Skip to content

Instantly share code, notes, and snippets.

@alexroan
Created March 14, 2020 16:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexroan/c67f3e8cc9d073bcdcaa5c3267c8be4c to your computer and use it in GitHub Desktop.
Save alexroan/c67f3e8cc9d073bcdcaa5c3267c8be4c to your computer and use it in GitHub Desktop.
Handover Ethereum Smart Contract Ponzi Scheme
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