AaveYield: Misspelled external function name making functions fail
Three functions in the AaveYield contract call a misspelled external function name that does not exist on the WETH gateway contract, so the calls fail with a fallback error. As a result, the affected deposit, withdraw and liquidity-token functions could not work as intended.
Submitted by 0xngndev
Impact
In AaveYield.sol the functions:
liquidityToken_withdrawETH_depositETH
Make a conditional call to IWETHGateway(wethGateway).getAWETHAddress()
This function does not exist in the wethGateway contract, causing these function to fail with the error "Fallback not allowed".
The function they should be calling is getWethAddress() without the “A”.
Small yet dangerous typo.
Mitigation Steps
Simply modify:
IWETHGateway(wethGateway).getAWETHAddress()
to:
IWETHGateway(wethGateway).getWETHAddress()
In the functions mentioned above.
We were using an older version of the contracts that had this definition, will be updated accordingly
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
Likely a typo in the external function name, calling getAWETHAddress instead of the gateway's actual getWethAddress function.
Impact
The affected functions fail with a fallback error, so deposits, withdrawals and liquidity-token handling in this contract could not complete.
What the attacker needed
None
The fix
The external call should use the correctly spelled function name so it matches the gateway contract.
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.
A smart contract can call functions on another contract, but only if the name matches exactly. Here the code asked for a function with an extra letter in its name, so the other contract had nothing to run and the call failed. The fix is to correct the spelling so the right function is called.
What is Smart contracts?
Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.