daily pastebin goal
59%
SHARE
TWEET

Untitled

a guest Oct 20th, 2018 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. pragma solidity 0.4.24;
  2.  
  3. contract KoET {
  4.   // Highest bidder becomes the Leader.
  5.   // Vulnerable to DoS attack by an attacker contract which reverts all transactions to it.
  6.  
  7.     address public currentLeader;
  8.     uint public highestBid;
  9.  
  10.     function () public payable {
  11.         require(msg.value > highestBid && msg.value - highestBid < 1000, "Value have to be within 1000 wei above the highest bit" );
  12.         currentLeader.transfer(highestBid); // Refund the old leader, if it fails then revert
  13.         currentLeader = msg.sender;
  14.         highestBid = msg.value;
  15.     }
  16. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top