Unsafe use of transfer() / transferFrom() with IERC20
The code calls transfer and transferFrom on tokens cast to IERC20 without checking return values, which can revert or silently fail for non-standard tokens like USDT. An attacker could potentially break accounting if such a token is used, though the judge notes lower likelihood on Arbitrum.
Submitted by IllIllI
Note: this finding was reported via the winning Automated Findings report. It was declared out of scope for the audit, but is being included here for completeness.
Some tokens do not implement the ERC20 standard properly but are still accepted by most code that accepts ERC20 tokens. For example Tether (USDT)‘s transfer() and transferFrom() functions on L1 do not return booleans as the specification requires, and instead have no return value. When these sorts of tokens are cast to IERC20, their function signatures do not match and therefore the calls made, revert (see this link for a test case). Use OpenZeppelinundefineds SafeERC20’s safeTransfer()/safeTransferFrom() instead
There are 6 instances of this issue:
File: contracts/amo/UniV3LiquidityAmo.sol
158 IERC20WithBurn(params._tokenA).transferFrom(
159 rdpxV2Core,
160 address(this),
161 params._amount0Desired
162: );
163 IERC20WithBurn(params._tokenB).transferFrom(
164 rdpxV2Core,
165 address(this),
166 params._amount1Desired
167: );
283 IERC20WithBurn(_tokenA).transferFrom(
284 rdpxV2Core,
285 address(this),
286 _amountAtoB
287: );
File: contracts/perp-vault/PerpetualAtlanticVaultLP.sol
128: collateral.transferFrom(msg.sender, address(this), assets);
170: collateral.transfer(receiver, assets);
File: contracts/reLP/ReLPContract.sol
243 IERC20WithBurn(addresses.pair).transferFrom(
244 addresses.amo,
245 address(this),
246 lpToRemove
247: );
GitHub: 243
Alex the Entreprenerd (Judge) commented
I believe this should be Classified as Medium as a no-op here can break accounting, even though on Arbitrum this is lower likelihood.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Impact
A no-op transfer could break accounting, though the judge considers this lower likelihood on Arbitrum.
What the attacker needed
Non-standard ERC20 token like USDT; token used in affected contracts
The fix
Use OpenZeppelin's SafeERC20 safeTransfer and safeTransferFrom instead of direct transfer calls.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
Some tokens, like USDT, don't follow the usual ERC20 rule of returning true or false when you send them. If a contract assumes they do, the transfer can fail or revert, which might mess up the contract's internal balance tracking.
What is Smart contracts?
Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.