Approve
not compatible with Tether (USDT) implementation
#65
Labels
bug
Something isn't working
duplicate
This issue or pull request already exists
QA (Quality Assurance)
Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
Lines of code
https://github.com/code-423n4/2022-06-connext/blob/20f86d58444d7c8178735ada7e456a3112116e54/contracts/contracts/core/connext/libraries/AssetLogic.sol#L347
Vulnerability details
Impact
Approve
not compatible with Tether (USDT) implementation.Proof of Concept
Some tokens do not implement the ERC20 standard properly but are still accepted by most code that accepts ERC20 tokens. For example Tether (USDT or CVX)'s
approve()
function will revert if the current approval is not zero, to protect against front-running changes of approvals.The code as currently implemented does not handle these sorts of tokens properly, which would prevent USDT or CVX, from being used by this project.
Affected source code:
Recommended Mitigation Steps
Change from:
SafeERC20.safeApprove(IERC20(_assetIn), address(pool), _amountIn);
to:
SafeERC20.safeIncreaseAllowance(IERC20(_assetIn), address(pool), _amountIn);
The text was updated successfully, but these errors were encountered: