Skip to content

Instantly share code, notes, and snippets.

@voith
Last active January 13, 2022 19:27
Show Gist options
  • Save voith/69c9dce58885c5bcf39766715719f4f3 to your computer and use it in GitHub Desktop.
Save voith/69c9dce58885c5bcf39766715719f4f3 to your computer and use it in GitHub Desktop.
Sample solidity function
pragma solidity ^0.5.16;
contract DummyERC20 is ERC20 {
function withdraw() external {
uint256 amount = balances[msg.sender];
// demo reentracy
require(msg.sender.call.value(amount)());
balances[msg.sender] = 0;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment