This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
contract BrokenToken { | |
mapping(address => uint) public balanceOf; | |
uint public totalSupply; | |
function deposit(uint amount) { | |
// intentionally vulnerable | |
balanceOf[msg.sender] += amount; | |
totalSupply += amount; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
contract TokenWithEStop { | |
mapping(address => uint) public balanceOf; | |
address public curator; | |
bool public stopped; | |
uint public totalSupply; | |
modifier stopInEmergency { if (!stopped) _ } | |
modifier onlyInEmergency { if (stopped) _ } | |
function TokenWithEStop(address _curator) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
contract CircuitBreaker { | |
struct Transfer { uint amount; address to; uint releaseBlock; bool released; bool stopped; } | |
Transfer[] public transfers; | |
address public curator; | |
address public authorizedSender; | |
uint public period; | |
uint public limit; | |
uint public currentPeriodEnd; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
contract CircuitBreaker { | |
struct Transfer { uint amount; address to; uint releaseBlock; bool released; bool stopped; } | |
Transfer[] public transfers; | |
address public curator; | |
address public authorizedSender; | |
uint public period; | |
uint public limit; | |
uint public currentPeriodEnd; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
contract TokenWithInvariants { | |
mapping(address => uint) public balanceOf; | |
uint public totalSupply; | |
modifier checkInvariants { | |
_ | |
if (this.balance < totalSupply) throw; | |
} | |
function deposit(uint amount) checkInvariants { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import "BrokenToken.sol"; | |
contract Bounty { | |
// This bounty will pay out if you can cause BrokenToken's balance | |
// to be lower than its totalSupply, which would mean that it doesn't | |
// have sufficient ether for everyone to withdraw. | |
uint public totalBounty; | |
bool public claimed; | |
mapping(address => address) public owners; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
contract EtherRouter { | |
function() { | |
// Look up the latest version of the contract, and then delegatecall. | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
contract EtherRouter { | |
function() { | |
// Look up the latest version of the code, and delegatecall | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
calldatacopy(mload(0x40), 0, calldatasize) | |
delegatecall(gas, destination, mload(0x40), calldatasize, mload(0x40), outsize) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
calldatacopy(mload(0x40), 0, calldatasize) | |
delegatecall(gas, destination, mload(0x40), calldatasize, mload(0x40), outsize) | |
return(mload(0x40), outsize) |
OlderNewer