Skip to content

Commit

Permalink
updated with linting
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrickAlphaC committed Apr 27, 2021
1 parent 31afb68 commit c1a0d44
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion contracts/v2/FlashloanV2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,4 @@ contract FlashloanV2 is FlashLoanReceiverBaseV2, Withdrawable {

_flashloan(assets, amounts);
}
}
}
9 changes: 7 additions & 2 deletions scripts/deployment_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ def main():
Deploy a `FlashloanV2` contract from `accounts[0]`.
"""

acct = accounts.add(config["wallets"]["from_key"]) # add your keystore ID as an argument to this call
acct = accounts.add(
config["wallets"]["from_key"]
) # add your keystore ID as an argument to this call

flashloan = FlashloanV2.deploy(config['networks'][network.show_active()]['aave_lending_pool_v2'], {"from": acct})
flashloan = FlashloanV2.deploy(
config["networks"][network.show_active()]["aave_lending_pool_v2"],
{"from": acct},
)
return flashloan
7 changes: 5 additions & 2 deletions scripts/get_weth.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from brownie import accounts, config, network, interface


def main():
"""
Runs the get_weth function to get WETH
Expand All @@ -11,8 +12,10 @@ def get_weth():
"""
Mints WETH by depositing ETH.
"""
acct = accounts.add(config["wallets"]["from_key"]) # add your keystore ID as an argument to this call
weth = interface.WethInterface(config['networks'][network.show_active()]['weth'])
acct = accounts.add(
config["wallets"]["from_key"]
) # add your keystore ID as an argument to this call
weth = interface.WethInterface(config["networks"][network.show_active()]["weth"])
tx = weth.deposit({"from": acct, "value": 1000000000000000000})
print("Received 1 WETH")
return tx
5 changes: 3 additions & 2 deletions scripts/run_flash_loan_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
MINIMUM_FLASHLOAN_WETH_BALANCE = 500000000000000000
ETHERSCAN_TX_URL = "https://kovan.etherscan.io/tx/{}"


def main():
"""
Executes the funcitonality of the flash loan.
"""
acct = accounts.add(config["wallets"]["from_key"])
print("Getting Flashloan contract...")
flashloan = FlashloanV2[len(FlashloanV2) -1]
weth = interface.WethInterface(config['networks'][network.show_active()]['weth'])
flashloan = FlashloanV2[len(FlashloanV2) - 1]
weth = interface.WethInterface(config["networks"][network.show_active()]["weth"])
# We need to fund it if it doesn't have any token to fund!
if weth.balanceOf(flashloan) < MINIMUM_FLASHLOAN_WETH_BALANCE:
print("Funding Flashloan contract with WETH...")
Expand Down

0 comments on commit c1a0d44

Please sign in to comment.