Aave.

Допис

Діліться своїми знаннями.

Aaveator.
Mar 07, 2023
Питання та відповіді експертів

Aave Error: cannot estimate gas; transaction may fail or may require manual gas limit

After multiple attempts I cannot get the withdrawETH function to work. Has someone actually been able to implement it?

Here's the verified contract if anyone wants to take a look.

This is the error I get with the withdrawETH() function:

Uncaught (in promise) Error: cannot estimate gas; transaction may fail or may require manual gas limit [ See: https://links.ethers.org/v5-errors-UNPREDICTABLE_GAS_LIMIT ] (reason="execution reverted:  ETH_TRANSFER_FAILED", method="estimateGas", transaction={"from":"0xb23Eb8665227f4f5165B943aB37f9D940fD4F7dD","to":"0xD56E34fA8Ac2067e6b9f9b0c0F192d8Aa84826e9","data":"0xa126d6010000000000000000000000000000000000000000000000000000000000000000","accessList":null}, error={"code":-32603,"message":"execution reverted: ETH_TRANSFER_FAILED","data":{"originalError":{"code":3,"data":"0x08c379a0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000134554485f5452414e534645525f4641494c454400000000000000000000000000","message":"execution reverted: ETH_TRANSFER_FAILED"}}}, code=UNPREDICTABLE_GAS_LIMIT, version=providers/5.7.1)
  • Aave Protocol
  • aTokens
0
1
Поділитися
Коментарі
.

Відповіді

1
Aaveator.
Mar 9 2023, 13:59

When you call a contract with no calldata (e.g. when you send ETH to it), your contract will try to match the (empty) calldata with the signature of one of your public functions (which won't work, since well, the calldata is empty). If it doesnt find any, it'll look for a fallback or receive function, and if it doesnt find any it will revert. Maybe read this.

Another option is to call withdrawETH, and withdrawETH will send the ETH to your contract (sending ETH to a contract = effectively calling the receive function). And when the gateway tries to call your contract back (by sending ETH to it) it fails because your contract can't receive ETH.

0
Коментарі
.

Ви знаєте відповідь?

Будь ласка, увійдіть та поділіться нею.

Ми використовуємо файли cookie, щоб гарантувати вам найкращий досвід на нашому сайті.
Детальніше