Consensys / Tokens

Ethereum Token Contracts
MIT License
2.06k stars 1.19k forks source link

fix verifyEIP20 function #121

Closed Wasram closed 6 years ago

maurelian commented 6 years ago

require(false) will REVERT, which is not the same thing as RETURN false.

https://ethereum.stackexchange.com/questions/15166/difference-between-require-and-assert-and-the-difference-between-revert-and-thro/24185#24185

Wasram commented 6 years ago

I initially thought that using require() for those purposes was the best idea simply because of a gas refund. Following up with your post, I see that REVERT also undoes any state changes caused in the function which isn't desired here. Thanks for the direction!

On Tue, Mar 20, 2018 at 10:15 AM Maurelian notifications@github.com wrote:

require(false) will REVERT, which is not the same thing as RETURN false.

https://ethereum.stackexchange.com/questions/15166/difference-between-require-and-assert-and-the-difference-between-revert-and-thro/24185#24185

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ConsenSys/Tokens/pull/121#issuecomment-374635643, or mute the thread https://github.com/notifications/unsubscribe-auth/Ad-I-tPgaukNCm3TN7QhxWh2gXkZ1tamks5tgR0SgaJpZM4SvB5K .