You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 17, 2021. It is now read-only.
It seems to not consider the fact that transfer() and/or transferFrom() of some ERC20 token contracts could return false instead of throwing an exception in case of failure. Note that such a contract is still ERC20-compliant, as throwing an exception is recommended but not mandatory according to the ERC20 standard.
You may want to add the assertion on the return value, like (not sure about the exact syntax):
assert self.token.transfer(msg.sender, tokens)
The text was updated successfully, but these errors were encountered:
@daejunpark
Good point, thanks for the feedback. One potential issue is that many ERC20s are not fully ERC20 compliant (over 130 on EtherDelta) and do not return a bool at all, so this assertion might make those token transfers to fail. I'll write a test for it.
The only way I can think of that covers all cases is something like this:
It seems to not consider the fact that
transfer()
and/ortransferFrom()
of some ERC20 token contracts could returnfalse
instead of throwing an exception in case of failure. Note that such a contract is still ERC20-compliant, as throwing an exception is recommended but not mandatory according to the ERC20 standard.You may want to add the assertion on the return value, like (not sure about the exact syntax):
The text was updated successfully, but these errors were encountered: