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
Using a try/catch statement we will be able to have the transaction revert in case the approve call fails silently. While a silent failure does not cause negative side effects to the protocol (the swap transaction would revert with error), we will be able to exclude that the approval target token is a not smart contract or does not implement the method as expected. As a result, we can remove the assertion of the target token being a smart contract, which will result in net gas efficiency (will cost just slightly more in general).
Summary
Refactor the safe approve internal method _safeApprove(...args) to avoid the use of low-level calls.
Motivation
A refactoring of the safe approve method has the scope of:
Specification
Rationale
Using a try/catch statement we will be able to have the transaction revert in case the approve call fails silently. While a silent failure does not cause negative side effects to the protocol (the swap transaction would revert with error), we will be able to exclude that the approval target token is a not smart contract or does not implement the method as expected. As a result, we can remove the assertion of the target token being a smart contract, which will result in net gas efficiency (will cost just slightly more in general).
Notes
The text was updated successfully, but these errors were encountered: