/* * @source: https://github.com/sigp/solidity-security-blog * @author: - * @vulnerable_at_lines: 18,20 */ pragma solidity ^0.4.25; contract Roulette { uint public pastBlockTime; // Forces one bet per block constructor() public payable {} // initially fund contract // fallback function used to make a bet function () public payable { require(msg.value == 10 ether); // must send 10 ether to play // TIME_MANIPULATION require(now != pastBlockTime); // only 1 transaction per block // TIME_MANIPULATION pastBlockTime = now; if(now % 15 == 0) { // winner msg.sender.transfer(this.balance); } } }