PatrickAlphaC / defi-stake-yield-brownie-freecode

52 stars 62 forks source link

MetaMask - RPC Error: The execution failed due to an exception #19

Closed DavidWilliamsQA closed 2 years ago

DavidWilliamsQA commented 2 years ago

Hi, Every time I try to stake tokens on my project I run into this issue right after the transaction seems to get approved so I never get the "Tokens Staked!" confirmation output in the console. Please can I get some guidance on why this is not working

PatrickAlphaC commented 2 years ago

Can you please add a step by step of what you did to get this error?

DavidWilliamsQA commented 2 years ago

Hi Patrick, I just followed the tutorial and when I got to the stage of the transaction getting approved it gave me that error. So I did not get the chance to approve the transaction hence tokens never got staked. Once I approved the first transaction the error below got printed out in the console

image

PatrickAlphaC commented 2 years ago

It's really hard for me to debug with "followed the whole tutorial".

What happens when you start from scratch to try to go step by step for me to reproduce?

derawl commented 2 years ago

I would like to share my experience as well. I received a similar error message when trying to stake FAU and WETH. However, staking the DAPP token works perfectly. I am still debugging the issue but I think you should try staking the DAPP token as well to see if it works.

DavidWilliamsQA commented 2 years ago

Hey guys, sorry about this I have just realized the issue. I must have forgotten to call the setAmount in the handleInputChange function on the StakeForm. So, the metamask was rejecting the transaction because it was zero.

Brar-Paul commented 2 years ago

I would like to share my experience as well. I received a similar error message when trying to stake FAU and WETH. However, staking the DAPP token works perfectly. I am still debugging the issue but I think you should try staking the DAPP token as well to see if it works.

Were you able to figure this out? I'm having the same issue where it works for DAPP but not FAU (approved but raises error while staking)