aave-flashloan-mix icon indicating copy to clipboard operation
aave-flashloan-mix copied to clipboard

Insufficient funds error message after running get_weth.py

Open efraser123 opened this issue 3 years ago • 9 comments

error: raise ValueError(exc["message"]) from None ValueError: Insufficient funds. The account you tried to send transaction from does not have enough funds. Required 1000049572000396576 and got: 0. Does this script fund the wallet or do I have to fund it seperately via Metamask. Please advise. Thanks EF

efraser123 avatar Nov 17 '21 22:11 efraser123

I'm having same issue even though I got testnet ether from faucet

Zisan-uzum avatar Nov 30 '21 17:11 Zisan-uzum

get_weth.py mints 1 WETH, which is likely more than you got from the faucet. You can reduce the value in line 19 to smaller value.

danielschutz avatar Dec 12 '21 03:12 danielschutz

Nope even though I change the value to 100 in line 19 it gives same error

Zisan-uzum avatar Dec 13 '21 12:12 Zisan-uzum

Does your error message say Required 100 and got: 0?

If it says got: 0, it means your wallet doesn't have ether.

Did you use a Kovan faucet? Can you see the funds on kovan.etherscan.io?

danielschutz avatar Dec 13 '21 17:12 danielschutz

I am expert

Adnaan1010 avatar Dec 16 '21 08:12 Adnaan1010

It needs the eth to transfer your eth to weth + some eth for the gas. I could recommend you to get a good amount of eth here: https://faucet.paradigm.xyz/

this worked for me... dont get why the send only 0.001 eth on kovan testnet and you can trigger it 3 times in 24h...

hope this helps

MichiTheBlock avatar Feb 10 '22 22:02 MichiTheBlock

Nope even though I change the value to 100 in line 19 it gives same error

you can easily change the amount, but you have to deploy that thing before running.

so change line 91 of FlashloanV2.sol to: uint256 amount = 1000000000000000; //borrow 0.001 eth

and adapt your run_flash_loan_v2.py line 18: weth.transfer(flashloan, 10000000000000000, {"from": acct})

so the funding of the flashloan and the Flashloan amount are fixed now.

now deploy it with: brownie run scripts/deployment_v2.py --network kovan

and you should now be able to run:

brownie run scripts/run_flash_loan_v2.py --network kovan

if it runs you can check the txid and should see we are lending 0.001 and pay them back with the fee Good luck!

MichiTheBlock avatar Feb 11 '22 08:02 MichiTheBlock

Thanks!

Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: MichiTheBlock @.> Sent: Friday, February 11, 2022 3:34:12 AM To: brownie-mix/aave-flashloan-mix @.> Cc: Evan Fraser @.>; Author @.> Subject: Re: [brownie-mix/aave-flashloan-mix] Insufficient funds error message after running get_weth.py (Issue #18)

Nope even though I change the value to 100 in line 19 it gives same error

you can easily change the amount, but you have to deploy that thing before running.

so change line 91 of FlashloanV2.sol to: uint256 amount = 1000000000000000; //borrow 0.001 eth

and adapt your run_flash_loan_v2.py line 18: weth.transfer(flashloan, 10000000000000000, {"from": acct})

so the funding of the flashloan and the Flashloan amount are fixed now.

now deploy it with: brownie run scripts/deployment_v2.py --network kovan

and you should now be able to run:

brownie run scripts/run_flash_loan_v2.py --network kovan

if it runs you can check the txid and should see we are lending 0.001 and pay them back with the fee Good luck!

— Reply to this email directly, view it on GitHubhttps://github.com/brownie-mix/aave-flashloan-mix/issues/18#issuecomment-1035978837, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AWP2VUQUKFQDPGWNJO3UW3LU2TCYJANCNFSM5IIDBRFA. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you authored the thread.Message ID: @.***>

efraser123 avatar Feb 11 '22 13:02 efraser123

This solution by MichiTheBlock worked for me, but don't understand, are you not allowed to loan theorically unlimited funds using a flashloan?? why you are limited by the funds deposited in the created flashloan contract?

PP-AR-T avatar Feb 17 '22 01:02 PP-AR-T