Last active
December 3, 2018 07:43
-
-
Save duytai/8cff2c3feeb8e3b5dc18882f3636a0d5 to your computer and use it in GitHub Desktop.
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
pragma solidity ^0.4.24; | |
contract Victim { | |
// gasless send error | |
function withdraw0(uint n, address addr) payable { | |
require(address(addr).send(n)); | |
} | |
// reentrancy | |
function withdraw1(uint n) payable { | |
msg.sender.call.value(n)(); | |
} | |
// delegate | |
function delegate(address addr) { | |
address(addr).delegatecall(msg.data); | |
} | |
// block.number | |
function number(uint n, address addr) { | |
if (block.number > 100) { | |
address(addr).call.value(n)(); | |
} | |
} | |
// block.now | |
function time(uint n, address addr) { | |
if (now < 100) { | |
address(addr).call.value(n)(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment