This repository contains some examples of vulnerabilities that can be found in Smart Contracts written in Solidity.
This code has been used for the talk "Cryptocurrencies and Smart Contracts: 100% secure?" at the 2021 C1b3rwall Academy.
More information on vulnerabilities can be found in the Smart Contracts directory.
- Node
v12.22.1
- Docker
You can install all the dependencies running npm install
.
You can run the following script by typing npm run-script <script>
.
remix-ide
: This command starts a Remix IDE instance but locally at http://localhost:8080/.remixd-local
: Remixd allows you to conect your localhost with Remix IDE online (https://remix.ethereum.org/).remixd-web
: Allows you to conect your localhost with Remix IDE local instance.start_ganache
: This command starts a local personal blockchain with Ganache on port 8545.stop_ganache
: This command stops Ganache.deploy
: This command deploys all the contracts developed in this project.
In order to test these vulnerabilities, perform the following steps.
- Install Docker and the project dependencies with
npm install
. - Build your own personal blockchain with
npm run-script start_ganache
. - Start your local Remix IDE with
npm run-script remix-ide
. - Link your localhost with Remix IDE with
npm run-script remixd-local
. - Deploy the Smart Contracts with
npm run-script deploy
. This will generate severaljson
files (addresses_<vulnerability>
) with the addresses of the different contracts. - Go to http://localhost:8080/, connect to your localhost and ganache, and then instantiate the Contracts at the addresses mentioned above. For more information about Remix IDE, please check this link.
- Play with this vulnerabilities and learn 😃.