This repository contains a series of smart contracts with vulnerabilities as well as smart contracts (written by me) that exploit the vulnerabilities of the previous contracts. Examples of vulnerabilities that were exploited include re-entrancy, self destruct, and integer overflow. This is the third homework assignment for CMPSC 190J: Blockchain Technologies and Security.
To run the program, download the Foundry toolset used to test Solidity applications. Then, use the following command:
forge test
The code for the smart contracts that need to be exploited are in the src/
folder with file name of the format ProblemX.sol
. These files contain implementations of various Ethereum applications such as games and auctions.
The smart contracts written by me that attack the above contracts are located in the test/
folder. For each problem number, the attacking contract's file name has format AttackerX.sol
.
Also in the test/
folder are testing files that test each attacking contract on their corresponding problem contract. The file names have the format ProblemX.t.sol
. There are nine tests in total.