Submitted by xiaoming90, also found by 0xNineDec, hyh, Ruhum, and slywaters
BridgeFacet.sol#L984
AssetLogic.sol#L347
Some tokens (like USDT) do not work when changing the allowance from an existing non-zero allowance value. For example Tether (USDT)s approve() function will revert if the current approval is not zero, to protect against front-running changes of approvals.
The following function must be approved by zero first, and then the SafeERC20.safeIncreaseAllowance function can be called. Otherwise, the _reconcileProcessPortal function will revert everytime it handles such kind of tokens. Understood from the comment that after the backUnbacked call there could be a remaining allowance.
BridgeFacet.sol#L984
The following fucntion must first be approved by zero, follow by the actual allowance to be approved. Otherwise, the _swapAssetOut function will revert everytime it handles such kind of tokens.
AssetLogic.sol#L347
Both the_reconcileProcessPortal and _swapAssetOut functions are called during repayment to Aave Portal if the fast-transfer was executed using portal liquidity. Thus, it is core part of the token transfer process within Connext, and failure of any of these functions would disrupt the AAVE repayment process.
Since both functions affect the AAVE repayment process, Im grouping them as one issue.
As Connext bridges/routers deal with all sort of tokens existed in various domains/chains, the protocol should try to implement measure to ensure that it is compatible with as much tokens as possible for future growth and availability of the protocol.
It is recommended to set the allowance to zero before increasing the allowance
It is recommended to set the allowance to zero before each approve call.
ecmendenhall (Connext) commented:
jakekidd (Connext) confirmed
LayneHaber (Connext) disagreed with severity and commented:
jakekidd (Connext) resolved:
0xleastwood (judge) commented:
