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
Cause of the error:
I had this line in my solution code require(token.transfer(msg.sender, tokenOutput), "ethToToken(): reverted swap.");
Since ERC20 transfer should return boolean and it worked before. But from current version ERC20.sol of openzeppelin
We have followed general OpenZeppelin Contracts guidelines: functions revert instead returning `false` on failure. This behavior is nonetheless conventional and does not conflict with the expectations of ERC20 applications.
transfer follows that, and then in my code token.transfer(msg.sender, tokenOutput) is not boolean when there is an error inside transfer and hence error notification is broken
So if I just change that line everything works fine.
So I removed openzeppelin v4 requirement from the code 6cbf937
Cause of the error: I had this line in my solution code require(token.transfer(msg.sender, tokenOutput), "ethToToken(): reverted swap.");
Since ERC20 transfer should return boolean and it worked before. But from current version ERC20.sol of openzeppelin
We have followed general OpenZeppelin Contracts guidelines: functions revert instead returning `false` on failure. This behavior is nonetheless conventional and does not conflict with the expectations of ERC20 applications.
transfer follows that, and then in my code token.transfer(msg.sender, tokenOutput) is not boolean when there is an error inside transfer and hence error notification is broken
So if I just change that line everything works fine.
So I removed openzeppelin v4 requirement from the code 6cbf937
And remove openzeppelin v4 dependency
context: #245 (comment)
The text was updated successfully, but these errors were encountered: