hemilabs / ui-monorepo

UI monorepo for Hemi Labs
https://app.hemi.xyz/
MIT License
2 stars 1 forks source link

Console errors when estimating deposit of ERC20 tokens #102

Open gndelia opened 8 months ago

gndelia commented 8 months ago

When trying to deposit ERC20 errors, many errors as this are logged

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: ERC20: transfer from the zero address", method="estimateGas", transaction={"to":"0xc94b1BEe63A3e101FE5F71C80F912b4F4b055925","data":"0x58a997f6000000000000000000000000ff34b3d4aee8ddcd6f9afffb6fe49bd371b8a357000000000000000000000000ec46e0efb2ea8152da0327a5eb3ff9a43956f13e00000000000000000000000000000000000000000000000001aa535d3d0c00000000000000000000000000000000000000000000000000000000000000030d4000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000000","accessList":null}, error={"code":-32603,"message":"execution reverted: ERC20: transfer from the zero address","data":{"originalError":{"code":3,"data":"0x08c379a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002545524332303a207472616e736665722066726f6d20746865207a65726f2061646472657373000000000000000000000000000000000000000000000000000000","message":"execution reverted: ERC20: transfer from the zero address"}}}, code=UNPREDICTABLE_GAS_LIMIT, version=providers/5.7.2)
    at Logger.makeError (index.js:242:23)
    at Logger.throwError (index.js:251:20)
    at checkError (json-rpc-provider.js:117:20)
    at Web3Provider.eval (json-rpc-provider.js:702:24)
    at Generator.throw (<anonymous>)
    at rejected (json-rpc-provider.js:34:40)
VM32753:1 MetaMask - RPC Error: execution reverted: ERC20: transfer from the zero address 

These errors appears when estimating, but the deposit operation seems to work ok

These ethers.js error docs may be relevant

These also happen both with viem and wagmi older and newer versions (though it's more frequent after migration)

gndelia commented 8 months ago

May also be related https://github.com/ethereum-optimism/optimism/issues/8952