Skip to content

djandrei/solidity-reentrancy-bug-example

Repository files navigation

Reentrancy attack on a smart contract

This is an (simplified) example of a reentrancy attack on a smart contract.

Update the pragma solidity directive to match your current compiler version.

Run the truffle compiler to make sure the current compiler does not have
any issues with the solidity syntax used for the smart contracts.

$ truffle compile

In terminal, start ganache-cli and run the tests

$ ./run-ganache-cli.sh
$ ./run-tests.sh

For any suggestions please contact me at andrei.dimitrief.jianu@gmail.com

DISCLAIMER

The information within this project is intended to be used only in an ethical manner. Do not use any information from the project if you do not have written permission from the owner of the smart contract. If you perform illegal actions, you are likely to be arrested and prosecuted to the full extent of the law. We do not take any responsibility if you misuse any of the information contained within the project. The information herein must only be used while testing smart contracts with proper written authorizations from appropriate persons responsible.

LICENSE

The MIT License (MIT)

Copyright (c) 2019 Andrei Dimitrief-Jianu

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.