Open code423n4 opened 1 year ago
In the previous implementation ,calls to safeApprove() to approve allowance in the AMO contract. But if there is a residual allowance this method will revert It is not possible to approve properly
safeApprove()
approve
https://github.com/code-423n4/2023-05-xeth/commit/793dade5217bd5751856f7cf0bccd4936286aeab Now Modify to use IERC20.approve(), this method does not have this limitation and will not revert Both addLiquidity() and addLiquidityOnlyStETH have been modified and are not used anywhere safeApprove() The mitigation resolved the original issue.
IERC20.approve()
addLiquidity()
addLiquidityOnlyStETH
kirk-baird marked the issue as satisfactory
Lines of code
Vulnerability details
In the previous implementation ,calls to
safeApprove()
to approve allowance in the AMO contract. But if there is a residual allowance this method will revert It is not possible toapprove
properlyMitigation
https://github.com/code-423n4/2023-05-xeth/commit/793dade5217bd5751856f7cf0bccd4936286aeab Now Modify to use
IERC20.approve()
, this method does not have this limitation and will not revert BothaddLiquidity()
andaddLiquidityOnlyStETH
have been modified and are not used anywheresafeApprove()
The mitigation resolved the original issue.