Skip to content

Latest commit

 

History

History
37 lines (26 loc) · 1.3 KB

063.md

File metadata and controls

37 lines (26 loc) · 1.3 KB

Thankful Plum Pheasant

High

Approval operation will be reverted if usd token is USDT in Ethereum

Summary

USDT token in Ethereum is not compatible with the interface IERC20Upgradeable::approve(). This will cause all USDT's approval operation reverted.

Root Cause

In SolidlyV2AMO.sol, we will try to approve usd for router. However, some usds are not compatible with the interface IERC20Upgradeable. This will cause this transaction reverted.

IERC20Upgradeable(usd).approve(router, usdAmount);

Internal pre-conditions

In AMO, the usd is USDT, and the AMO is deployed in Ethereum. In readme.md, our sponsor mentions:

  1. The smart contracts can potentially be implemented on any full-EVM chain.
  2. In the the scope of this audit would be any USD-pegged token, beside fee-on-transfer ones. So USDT in Ethereum is in this audit scope.

External pre-conditions

None

Attack Path

If AMO is deployed on Ethereum and use USDT as the usd token, _addLiquidity function will always be reverted.

Impact

Some key functions will not work well, for example, _unfarmBuyBurn, _addLiquidity in SolidlyV2AMO and SolidlyV3AMO.

PoC

N/A

Mitigation

Suggest using safeApprove.