Created
March 14, 2020 16:03
-
-
Save alexroan/c67f3e8cc9d073bcdcaa5c3267c8be4c to your computer and use it in GitHub Desktop.
Handover Ethereum Smart Contract Ponzi Scheme
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.5.0; | |
import "@openzeppelin/contracts/math/SafeMath.sol"; | |
contract Handover { | |
using SafeMath for uint; | |
address payable public owner; | |
address payable public user; | |
uint public price; | |
constructor() public { | |
owner = msg.sender; | |
user = msg.sender; | |
price = 1 finney; | |
} | |
function() external payable { | |
require(msg.value >= price, "Not enough ether"); | |
uint payout = msg.value.mul(9).div(100); | |
user.transfer(payout); | |
user = msg.sender; | |
price = price.mul(2); | |
owner.transfer(address(this).balance); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment