Boolean Return Assumption in transferFrom() Causes Token Compatibility Issues
The GatewaySend contract uses raw IERC20.transferFrom() calls wrapped in require(), expecting a boolean return value. Tokens like USDT that return void cause the require to fail even when the transfer succeeds, making the contract incompatible with such tokens.
0xc0ffEE Follow with 0xiehnnkta, 0xlucky and 44 others
Originally disclosed on Sherlock
Source: https://github.com/sherlock-audit/2025-05-dodo-cross-chain-dex-judging/issues/928
Found by
0xc0ffEE, 0xiehnnkta, 0xlucky, 0xpetern, 10ap17, Abhan1041, CoheeYang, Constant, Cybrid, Falendar, Goran, Greese, Kalyan-Singh, Oxsadeeq, Pianist, SafetyBytes, X0sauce, ZeroTrust, anirruth_, bube, cccz, dmdg321, eLSeR17, eightx, elolpuer, farismaulana, harry, holtzzx, iamandreiski, ifeco445, kazan, lls, mgf15, miracleworker0118, montecristo, n08ita, patitonar, radevweb3, rsam_eth, shushu, silver_eth, skipper, theweb3mechanic, wellbyt3, x0rc1ph3r, yoooo, zh1x1an1221
Summary
The GatewaySend contract incorrectly uses raw IERC20.transferFrom() calls wrapped in require() statements, expecting a boolean return value from all ERC20 tokens. However, tokens like USDT, which have a void return type, cause these calls to fail even when the transfer succeeds, as Solidity interprets the missing return as false. This makes the contract incompatible with major non-standard tokens, despite importing TransferHelper for safe transfers, which is not consistently applied.
Root Cause
Internal Pre-conditions
N/A
External Pre-conditions
N/A
Attack Path
A user, Charlie, tries to bridge 5,000 USDT from Ethereum to Polygon using depositAndCall(). After approving the GatewaySend contract to spend 5,000 USDT, Charlie initiates the transfer. The contract calls IERC20(USDT).transferFrom(charlie, contract, 5000), which successfully transfers the tokens, reducing Charlie’s balance and increasing the contract’s balance. However, since USDT’s transferFrom returns void instead of true, Solidity interprets this as false, triggering the require() failure with the error "INSUFFICIENT AMOUNT: ERC20 TRANSFER FROM FAILED." The transaction reverts, wasting Charlie’s gas fees and preventing the bridge operation.
Impact
Transaction Failures: Legitimate transfers revert, rendering the contract unusable for major tokens like USDT.
User Cost: Users lose gas fees due to failed transactions, degrading the bridging experience.
PoC
No response
Mitigation
safe transferrom shoyuld be used
Discussion
sherlock-admin2
The protocol team fixed this issue in the following PRs/commits: https://github.com/Skyewwww/omni-chain-contracts/pull/30
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
Root cause
The contract calls IERC20.transferFrom() directly and checks its boolean return value, but some ERC20 tokens (e.g., USDT) do not return a boolean, causing the require to fail.
Impact
Legitimate transfers revert, making the contract unusable for major tokens like USDT, and users lose gas fees due to failed transactions.
What the attacker needed
User holds USDT or similar non-standard token; User approves the contract to spend tokens; User calls depositAndCall()
The fix
The contract should use a safe transfer helper (e.g., TransferHelper.safeTransferFrom) that handles tokens with and without boolean return values.
How it was found
- Charlie approves the GatewaySend contract to spend 5,000 USDT.
- Charlie calls depositAndCall() to bridge the USDT.
- The contract calls IERC20(USDT).transferFrom(charlie, contract, 5000).
- The transfer succeeds, but USDT returns void, which Solidity treats as false.
- The require() fails with 'INSUFFICIENT AMOUNT: ERC20 TRANSFER FROM FAILED' and the transaction reverts.
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, do not return a true/false value when you ask them to transfer tokens. The contract assumes they always return true, so when they return nothing, the contract thinks the transfer failed and cancels the whole transaction, even though the tokens actually moved.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.