-
Notifications
You must be signed in to change notification settings - Fork 274
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Quickstart Kovan] ValueError: Gas estimation failed: 'The execution failed due to an exception.' #15
Comments
What would be the best program for a beginner to learn how to code flash loans? Start with HTML, Java and Python? |
Got same problem.
|
I get the same error as well ValueError: Gas estimation failed: 'The execution failed due to an exception.'. This transaction will likely revert. If you wish to broadcast, you must set the gas limit manually. |
I'm getting the same error. Has anyone manage to resolve or? |
make sure you have weth in your account. Probably running the get_weth.py |
I had this same problem. For me it was due to a low balance of ETH/wETH. I changed the MINIMUM_FLASHLOAN_WETH_BALANCE to 0.1 instead of 1 and also the get_weth function i did .1 weth instead of .1eth. Got eth from here: https://faucet.paradigm.xyz/ |
I have the same problem, and in my wallet I have enough ETH and WETH. I can't find a solution. |
Where did you change the MINIMUM_FLASHLOAN_WETH_BALANCE setting? |
In /scripts/run_flash_loan_v2.py |
even i am getting this error |
Same here |
Same issue here. Have sufficient funds in both eth and weth yet still get gas estimation failed. |
no one ever got this resolved? I've got 2 eth and 1 weth in my test account and have funded 1 weth to the contract. No cigar. Anyone? |
i did manage to execute properly the contract with less than 2ETH on my kovan account and only had to extract one 0 of the lending amount leaving me with a 0.1 WETH loan... [https://kovan.etherscan.io/tx/0x58d527dc367e768bad912fd5a576ced1d8bc6ff88fb6463b0ec9d9acc35cb9bc ] this dosent solve anything but adjusting this parameters made me understand a little bit more where is the problem, in addition I ran the |
i had the same exact issue , i had enough eth/weth in my wallet , and weth in the Smart contract. |
I had this same issue. I had it resolved using an approval signature on my account. Try: |
Did you put : weth.approve(acct, '1 ether', {'from':acct}) |
I worked on brownie console line by line - but it should also work in that file. Just make sure that you have signed the contract. |
Is there a specific reason why it has to be approved? I honestly thought that by approving the Lending pool that was enough, I would have never guessed I had to approve myself to spend my own eth or am I misunderstanding how it works. |
I had the same problem. just head over to the file run_flash_loan_v2.py change the code to line18: then it should work. at least it did on my side. To be honest there are a few problems one can encounter with this example, which is quite good because you have to put more effort in this. on windows the source commands dont work, on my side the cahnge in the PRIVATE_KEY with 0x... did not work because of an non hex issue response->pasted the private_key in the brownie-config.yaml itself. but now it went through. Hope you guys can make it. |
The following setting in brownie-config.yaml worked for me:
|
This worked for me...what is the reason for that specific gas limit? |
In what line did you put the "settings"? Adding that line definitely did not work for me. Maybe it is just better to test the contract on Ropsten with V1 since it is easier to get a larger amount or eth there? I tried changing the wei and ether amounts in the contracts as well and could only get as far as the last (and most important) step which throws this same "ValueError." Any other suggestions would be appreciated. Thanks for the responses. If I find a proper solution I´ll post. |
You can add the gas in the transaction on run_flash_loan.py |
That sounds about right. Thanks so much. It helped but then I got a VM revert error, so I researched and had to add some more code to that. The result: |
Hi! i've a problem, i used this: tx = flashloan.flashloan(weth, {"from": acct, "gas_limit": 2074044, 'allow_revert': True}) but returns this: RPCRequestError: Accessing |
Hi, did you find any solution for this problem? it seems like the problem is from the node providers side but i dont know how to handle it, Iam not working on aave-flashloan but iam getting the same error in my tx, i think they might have the same solution. |
I ran into this error @ 9:45:43 in the video. Finally what resolved it was going back to 9:01:06 in the video where the get_weth.py script was ran directly. You should have 0.1 wETH after this step. Make sure you run it on kovan though (I suspect this might be the issue for some people). Once the dust settled - after much double checking every line - I think thats all I changed. Runs fine now - on Kovan anyway. Note however that it remains an issue for me on mainnet when forking throgh alchemy instead of infura for the node provider that I get the error "Able to launch RPC client, but unable to connect." When I fork through infura my code runs fine on mainnet and kovan. See the video @ 5:59:40 and 6:28:40 for how to configure a network which forks form a different node provider. |
Hi i didnt find a solution for this, im sure that im using right network and the contract has weth, but i'll check it again. |
Hello there, I am encountering the same error and cannot find a way to work around this error. Was anyone able to solve this problem and give a short explanation? Thank you in advance! |
I did three things and got it successfully working:
tx = weth.deposit({"from": acct, "value": 10000000000000000})
MINIMUM_FLASHLOAN_WETH_BALANCE = 20000000000000 Line 19: weth.transfer(flashloan, 20000000, {"from": acct})
uint256 amount = 20000000; PS: I had around 0.1 Test Ether in my account when I was able to run this. |
i have run the flashloan contract for the first time it went well but the second time it gives me this error Gas estimation failed: 'execution reverted'. This transaction will likely revert. If you wish to broadcast, you must set the gas limit manually. |
please which video are you talking about |
Apologies I presumed that video was what brought people to this thread. I also updated my comment with a link to the video. |
Hi, while following the steps to test the repo on the Kovan test network I ran into this issue : **. get_weth.py works well, I can see the ETH being replaced by WETH on Metamask, deployement_v2 works fine too (the contract is visible on etherscan). The issue resides in run_flash_loan_v2.py at line 20 : tx = flashloan.flashloan(weth, {"from": acct}). Could you help me out. Thx in advance
** : brownie run scripts/run_flash_loan_v2.py --network kovan
Brownie v1.15.2 - Python development framework for Ethereum
AaveFlashloanMixProject is the active project.
Running 'scripts/run_flash_loan_v2.py::main'...
Getting Flashloan contract...
Funding Flashloan contract with WETH...
Transaction sent: 0x1e9e940aacbbf711e8e406078c17b2bf7a6a787828ef85f596e6007dcd4a6241
Gas price: 1.1 gwei Gas limit: 56934 Nonce: 150
WethInterface.transfer confirmed - Block: 26576860 Gas used: 51759 (90.91%)
Executing Flashloan...
File "brownie/_cli/run.py", line 49, in main
return_value, frame = run(
File "brownie/project/scripts.py", line 103, in run
return_value = f_locals[method_name](*args, **kwargs)
File "./scripts/run_flash_loan_v2.py", line 20, in main
tx = flashloan.flashloan(weth, {"from": acct})
File "brownie/network/contract.py", line 1338, in call
return fn(*args) # type: ignore
File "brownie/network/contract.py", line 1691, in call
return self.transact(*args)
File "brownie/network/contract.py", line 1565, in transact
return tx["from"].transfer(
File "brownie/network/account.py", line 658, in transfer
gas_limit = Wei(gas_limit) or self._gas_limit(to, amount, gas_price, gas_buffer, data)
File "brownie/network/account.py", line 425, in _gas_limit
gas_limit = self.estimate_gas(to, amount, gas_price, data or "")
File "brownie/network/account.py", line 618, in estimate_gas
raise ValueError(
ValueError: Gas estimation failed: 'The execution failed due to an exception.'. This transaction will likely revert. If you wish to broadcast, you must set the gas limit manually.
The text was updated successfully, but these errors were encountered: