Skip to main content
8 events
when toggle format what by license comment
Feb 16, 2018 at 21:49 vote accept dkb
Feb 8, 2018 at 17:15 comment added natewelch_ You can read more about arithmetic overflow/underflow math.stackexchange.com/questions/534670/…
Feb 8, 2018 at 17:12 comment added dkb That's maybe a bit too much complicated information for me. Could you maybe provide some information on how I could get deeper into this like a link or some keywords I can google for? Thank you very much!
Feb 8, 2018 at 17:10 comment added natewelch_ it doesn't work because when you subtract 1 from a place where there is a 0, it borrows from the left, e.g. 100-1=99. When this happens in a computer, it does it all the way to the left until it can't borrow anymore, so it becomes all ones (which in hex is all f's).
Feb 8, 2018 at 16:21 comment added dkb Thanks for the information. So that means, if I have an uint256 of 0 and remove 1, that won't work because uint can't be negative and so it would instead add the highest number of uint256 possible?
Feb 7, 2018 at 18:51 comment added natewelch_ No, it actually was the subtraction. The owner had 0 tokens, then burned 1 token, making their balance 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff tokens, e.g. 2^256-1 tokens.
Feb 7, 2018 at 16:28 comment added dkb Thanks and great you found the contract! I forgot to add. The problem wasn't any negative value, instead, he just entered a too large number which resulted in giving back much tokens. The thing is here: etherscan.io/tx/… the value "fffffffffffffffffffffffffffffffffffffffffffffffffff8e502b672ffff" is: 115792089237316195423570985008687907853269984665640564039457582007913129639935 I did not understand yet why Solidity adds the amount instead of removing but all I know is that it is an "integer overflow".
Feb 6, 2018 at 15:59 history answered natewelch_ CC BY-SA 3.0