-
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
How to withdraw from the smart contract to the wallet #25
Comments
Thank you @ch1ch0gz for your solution, at least this is a step forward. Even though, when I run it, I get an error. Here is the response after running "brownie run scripts/withdraw_function.py --network kovan": `Brownie v1.17.2 - Python development framework for Ethereum AaveFlashloanMixFunzionaYesmodificareCopyProject is the active project. Running 'scripts/withdraw_function.py::main'... Can you tell me what am I missing? |
I think you are right, I do not have that line in any file, and I expecially paid attention at contract.py, and I do not have that line. |
i think you are missing adding the import Withdrawable on FlashLoanReceiverBaseV2.sol
And the Withdrawable.sol looks like
|
@ch1ch0gz your advices here are outstanding. Me and probably all the people reading this thread owe you a big thank you. Now, I was messing around with the code, I did not solve this mystery, but I have some error logs I want you to take a look at.
---Code Begins--- from brownie import FlashloanV2, accounts, config, network, interface def main():
---Code Ends---
In my file I have the line "contract FlashloanV2 is FlashLoanReceiverBaseV2, Withdrawable" exactly as wrote by @PatrickAlphaC in https://github.com/brownie-mix/aave-flashloan-mix/blob/master/contracts/v2/FlashloanV2.sol If I run "brownie run scripts/withdraw_function.py --network kovan" having the line "contract FlashloanV2 is FlashLoanReceiverBaseV2, Withdrawable" in FlashloanV2.sol I get: ---Code Begins--- Brownie v1.17.2 - Python development framework for Ethereum Compiling contracts...
AaveFlashloanMixFunzionaYesmodificareCopyProject is the active project. Running 'scripts/withdraw_function.py::main'... ---Code Ends--- Now, if I run "brownie run scripts/withdraw_function.py --network kovan" having the line you suggested "contract FlashloanV2_aave is FlashLoanReceiverBaseV2, Withdrawable" in FlashloanV2.sol I get: ---Code Begins--- Brownie v1.17.2 - Python development framework for Ethereum Compiling contracts...
AaveFlashloanMixFunzionaYesmodificareCopyProject is the active project. ---Code Ends--- Said all that, still the withdrawal from the smart contract to the wallet does not get execute successfully. Suggestions? |
The response is get is : Brownie v1.17.2 - Python development framework for Ethereum Compiling contracts... OpenZeppelin/[email protected]/Context Running 'scripts/withdraw_function.py::main'... |
@ch1ch0gz thank you i solved it with your guide i want to send you an email to say thank you but i didn't find your email |
@ch1ch0gz Hello i just sent you a message on twitter, i just saw this and i'd need your assistance |
Hi Everyone,
I managed to deploy the smart contract and perform the flash loans. However, I don't know how to withdraw the funds from the smart contract.
Let's talk with the case on hand:
To do the flashloan, funds are transferred from wallet to the contract with transaction https://kovan.etherscan.io/tx/0x9c3d95bd9ddb14e7debfe9153724f7b3aaf0d981b4657d1a000e2d70860eff44 to cover the fees. Then I'm able to execute the flashloan correctly.
However, now the contract has a balance, that should be transferred back to my wallet. So my doubt is:
Thanks for who can clarify me this.
The text was updated successfully, but these errors were encountered: