Skip to content
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

Insufficient funds error message after running get_weth.py #18

Open
efraser123 opened this issue Nov 17, 2021 · 9 comments
Open

Insufficient funds error message after running get_weth.py #18

efraser123 opened this issue Nov 17, 2021 · 9 comments

Comments

@efraser123
Copy link

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

@Zisan-uzum
Copy link

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

@danielschutz
Copy link

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.

@Zisan-uzum
Copy link

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

@danielschutz
Copy link

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?

@Adnaan1010
Copy link

I am expert

@MichiTheBlock
Copy link

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
Copy link

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!

@efraser123
Copy link
Author

efraser123 commented Feb 11, 2022 via email

@PP-AR-T
Copy link

PP-AR-T commented Feb 17, 2022

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants
@danielschutz @Zisan-uzum @PP-AR-T @Adnaan1010 @efraser123 @MichiTheBlock and others