Skip to content
Smart contracts Audit finding Beginner

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.

0xngndev Follow

Originally disclosed on Code4rena

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.

ritik99 (Sublime) confirmed:

We were using an older version of the contracts that had this definition, will be updated accordingly

The original report as published on Code4rena, by 0xngndev. Images and videos are our own copies; raw HTML is shown as text. View it on Code4rena.

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.

More from Sublime contest

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Smart contract vulnerabilities

The lesson behind this report.

Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.