Example of Signedness Bug in Smart Contracts

by zak100   Last Updated June 12, 2019 19:28 PM

I found an example of underflow bug at: Catching Vulnerable Smart Contracts Once and for All

contract UnderflowAttack {
 ...
 function withdraw (uint amount) public {
   require(balances[msg.sender] - amount > 0);
   msg.sender.transfer(amount);
   balances[msg.sender] -= amount; //Underflow
 }
 ...
}

I feel the above contract also exhibits signedness bug. Can somebody please provide me a more specific example of a signedness bug in smart contract?

Tags : vulnerability


Related Questions


Updated June 12, 2019 01:28 AM

Updated June 13, 2019 01:28 AM

Updated June 15, 2019 02:28 AM

Updated September 27, 2017 23:28 PM

Updated January 04, 2018 20:28 PM