omgnetwork / optimism

Monorepo implementing the Optimistic Ethereum protocol
https://optimism.io
MIT License
16 stars 6 forks source link

L1 staking - "Failed to approve amount" immediately without MM approval #543

Closed EpicChicken closed 3 years ago

EpicChicken commented 3 years ago

I'm trying to stake ETH on L1. As soon as I enter an amount and click the "Approve amount" button on the gateway, I immediately get a "Failed to approve amount" error - but I never receive an approval request in Metamask. I was able to bridge ETH and OMG to L2 and stake both successfully a few days ago, so this only seems to happen to me on L1.

More info: Metamask version 10.1.1 Tried with both Chrome and Brave browsers, both fully updated No hardware wallet associated with this MM wallet

Here's the error. I'm getting this regardless of the amount I try to stake. "Max amount" shows the correct amount of ETH in my wallet, and MM is currently on L1: image

Chrome console log when I try to stake: image

Console text dump: addTokenList main.bf8f9cb1.chunk.js:1 fetchNFTs main.bf8f9cb1.chunk.js:1 approveERC20_L1LP main.bf8f9cb1.chunk.js:1 WNM masterConfig mainnet main.bf8f9cb1.chunk.js:1 WNM networkLayer L1 main.bf8f9cb1.chunk.js:1 NS: approveERC20_L1LP error: Error: call revert exception (method="allowance(address,address)", errorArgs=null, errorName=null, errorSignature=null, reason=null, code=CALL_EXCEPTION, version=abi/5.4.0) at e.value (2.39ac1662.chunk.js:2) at e.value (2.39ac1662.chunk.js:2) at e.value (2.39ac1662.chunk.js:2) at 2.39ac1662.chunk.js:2 at c (2.39ac1662.chunk.js:2) at Generator._invoke (2.39ac1662.chunk.js:2) at Generator.next (2.39ac1662.chunk.js:2) at a (2.39ac1662.chunk.js:2) main.bf8f9cb1.chunk.js:1 WNM masterConfig mainnet main.bf8f9cb1.chunk.js:1 WNM networkLayer L1

deejayworm commented 3 years ago

Same issue here. Using brave browser with a ledger. Had no issues bridging to L2 or staking (OMG) on L2.

CAPtheorem commented 3 years ago

Thanks for the report - checking...

CAPtheorem commented 3 years ago

Yes, you are right. Bug was introduced when changing to new system for simplifying approval flow - fixed in pending https://github.com/omgnetwork/optimism/commit/fde3451ec3d4c975c83cf55dc784bf6a256494dd. Thanks again for helping and reporting issues!