safeApprove deprecated #167
Labels
1 (Low Risk)
Assets are not at risk. State handling, function incorrect as to spec, issues with comments
bug
Something isn't working
duplicate
This issue or pull request already exists
Handle
sirhashalot
Vulnerability details
Impact
The OpenZeppelin SafeERC20
safeApprove()
function has been deprecated, as seen in the comments of the OpenZeppelin code. Using this deprecated function can lead to unintended reverts and potentially the locking of funds. A deeper discussion on the deprecation of this function is in OZ issue #2219.Proof of Concept
The deprecated function is found in:
Recommended Mitigation Steps
As suggested by the OpenZeppelin comment, replace
safeApprove()
withsafeIncreaseAllowance()
orsafeDecreaseAllowance()
.TOKEN.safeIncreaseAllowance(address(UMA), _amount)
TOKEN.safeDecreaseAllowance(address(UMA), 0)
want.safeIncreaseAllowance(address(lp), type(uint256).max)
The text was updated successfully, but these errors were encountered: