GithubHelp home page GithubHelp logo

Comments (34)

jerrychan807 avatar jerrychan807 commented on May 19, 2024 7

The following setting in brownie-config.yaml worked for me:

settings:
  gas_limit: "2074044"

from aave-flashloan-mix.

harshanas avatar harshanas commented on May 19, 2024 4

I did three things and got it successfully working:

  1. Change the amount get_weth.py file to a lower amount:
tx = weth.deposit({"from": acct, "value": 10000000000000000})
  1. Change the amounts in the run_flash_loan_v2.py file
    Line 3:
MINIMUM_FLASHLOAN_WETH_BALANCE = 20000000000000

Line 19:

weth.transfer(flashloan, 20000000, {"from": acct})
  1. Change the hardcoded flash loan amount in FlashloanV2.sol
    Line 104:
uint256 amount = 20000000;

PS: I had around 0.1 Test Ether in my account when I was able to run this.

from aave-flashloan-mix.

omartin2010 avatar omartin2010 commented on May 19, 2024 2

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?

from aave-flashloan-mix.

berkaybulut avatar berkaybulut commented on May 19, 2024 1

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.

from aave-flashloan-mix.

MichiTheBlock avatar MichiTheBlock commented on May 19, 2024 1

MINIMUM_FLASHLOAN_WETH_BALANCE

I had the same problem. just head over to the file run_flash_loan_v2.py

change the code to
line3:
MINIMUM_FLASHLOAN_WETH_BALANCE = 100000000000000000

line18:
weth.transfer(flashloan, 1000000000000000000, {"from": acct})

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.

from aave-flashloan-mix.

ch1ch0gz avatar ch1ch0gz commented on May 19, 2024 1

You can add the gas in the transaction on run_flash_loan.py
tx = flashloan.flashloan(weth, {"from": acct, "gas_limit": 2074044})

from aave-flashloan-mix.

maghatashi avatar maghatashi commented on May 19, 2024 1

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:
tx = flashloan.flashloan(weth, {"from": acct, "gas_limit": 2074044, 'allow_revert': True})
That solved the VM issue and no more Gas Error either.

from aave-flashloan-mix.

wwignes88 avatar wwignes88 commented on May 19, 2024 1

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.

from aave-flashloan-mix.

fowardelcac avatar fowardelcac commented on May 19, 2024 1

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 TransactionReceipt.revert_msg on a reverted transaction requires the debug_traceTransaction RPC endpoint, but the node client does not support it or has not made it available. whats this?

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.

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.

from aave-flashloan-mix.

cryptololo avatar cryptololo commented on May 19, 2024

What would be the best program for a beginner to learn how to code flash loans? Start with HTML, Java and Python?

from aave-flashloan-mix.

spaceh3ad avatar spaceh3ad commented on May 19, 2024

Got same problem.

josh@pc ~/Code/Blockchain_Dev/Brownie/aave-flashloan-mix (master) $ brownie run scripts/run_flash_loan_v2.py --network kovan
Brownie v1.17.0 - 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: 0x7d08fa06666dc8a9149422caadd794e156328a8e3e53eb5e926450061cc7d198
  Gas price: 1.1 gwei   Gas limit: 56934   Nonce: 10
  WethInterface.transfer confirmed   Block: 27947784   Gas used: 46959 (82.48%)

Executing Flashloan...
  File "brownie/_cli/run.py", line 50, 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 1260, in __call__
    return fn(*args)  # type: ignore
  File "brownie/network/contract.py", line 1622, in __call__
    return self.transact(*args)
  File "brownie/network/contract.py", line 1495, in transact
    return tx["from"].transfer(
  File "brownie/network/account.py", line 642, in transfer
    receipt, exc = self._make_transaction(
  File "brownie/network/account.py", line 725, in _make_transaction
    raise VirtualMachineError(e) from None
  File "brownie/exceptions.py", line 121, in __init__
    raise ValueError(str(exc)) from None
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.

from aave-flashloan-mix.

jasonbohne123 avatar jasonbohne123 commented on May 19, 2024

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.

from aave-flashloan-mix.

toddabraham avatar toddabraham commented on May 19, 2024

I'm getting the same error. Has anyone manage to resolve or?

from aave-flashloan-mix.

amazzuca avatar amazzuca commented on May 19, 2024

make sure you have weth in your account. Probably running the get_weth.py

from aave-flashloan-mix.

teryanarmen avatar teryanarmen commented on May 19, 2024

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/

from aave-flashloan-mix.

oguzpeker avatar oguzpeker commented on May 19, 2024

I have the same problem, and in my wallet I have enough ETH and WETH. I can't find a solution.

from aave-flashloan-mix.

amazzuca avatar amazzuca commented on May 19, 2024

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/

Where did you change the MINIMUM_FLASHLOAN_WETH_BALANCE setting?

from aave-flashloan-mix.

teryanarmen avatar teryanarmen commented on May 19, 2024

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/

Where did you change the MINIMUM_FLASHLOAN_WETH_BALANCE setting?

In /scripts/run_flash_loan_v2.py

from aave-flashloan-mix.

dhruvja avatar dhruvja commented on May 19, 2024

even i am getting this error
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.
Even though i have sufficient funds in both Eth and Weth.
Im able to deposit, but not able to borrow.

from aave-flashloan-mix.

topeklc avatar topeklc commented on May 19, 2024

Same here

from aave-flashloan-mix.

highfrog avatar highfrog commented on May 19, 2024

Same issue here. Have sufficient funds in both eth and weth yet still get gas estimation failed.

from aave-flashloan-mix.

A01138704 avatar A01138704 commented on May 19, 2024

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 ]
edit: No logic was implemented in the contract so I had to pay the loan premium fee by only getting the flash loan and giving back the loan.

this dosent solve anything but adjusting this parameters made me understand a little bit more where is the problem, in addition I ran the brownie test but didn't work.

from aave-flashloan-mix.

cftmonGIT avatar cftmonGIT commented on May 19, 2024

i had the same exact issue , i had enough eth/weth in my wallet , and weth in the Smart contract.
Changed all my variables to deposit 0.1 ETH instead. Not sure how to debug this

from aave-flashloan-mix.

berkaybulut avatar berkaybulut commented on May 19, 2024

I had this same issue. I had it resolved using an approval signature on my account. Try:
weth.approve(acct, '1 ether', {'from':acct})
You can replace 1 ether with any amount using integer values.

from aave-flashloan-mix.

basusus avatar basusus commented on May 19, 2024

Did you put : weth.approve(acct, '1 ether', {'from':acct})
in weth_get.py?

from aave-flashloan-mix.

cmedinasoriano avatar cmedinasoriano commented on May 19, 2024

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.

from aave-flashloan-mix.

ch1ch0gz avatar ch1ch0gz commented on May 19, 2024

The following setting in brownie-config.yaml worked for me:

settings:
  gas_limit: "2074044"

This worked for me...what is the reason for that specific gas limit?

from aave-flashloan-mix.

maghatashi avatar maghatashi commented on May 19, 2024

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.

from aave-flashloan-mix.

fowardelcac avatar fowardelcac commented on May 19, 2024

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 TransactionReceipt.revert_msg on a reverted transaction requires the debug_traceTransaction RPC endpoint, but the node client does not support it or has not made it available.
whats this?

from aave-flashloan-mix.

khaloosaman avatar khaloosaman commented on May 19, 2024

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 TransactionReceipt.revert_msg on a reverted transaction requires the debug_traceTransaction RPC endpoint, but the node client does not support it or has not made it available. whats this?

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.

from aave-flashloan-mix.

lucaregner avatar lucaregner commented on May 19, 2024

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 TransactionReceipt.revert_msg on a reverted transaction requires the debug_traceTransaction RPC endpoint, but the node client does not support it or has not made it available.
whats this?

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!

from aave-flashloan-mix.

Abdel364 avatar Abdel364 commented on May 19, 2024

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.
and i do have testnet eth and everything
can someone help me please

from aave-flashloan-mix.

Abdel364 avatar Abdel364 commented on May 19, 2024

please which video are you talking about

from aave-flashloan-mix.

wwignes88 avatar wwignes88 commented on May 19, 2024

please which video are you talking about

Patrick Collins video

Apologies I presumed that video was what brought people to this thread. I also updated my comment with a link to the video.

from aave-flashloan-mix.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.