Lesson 10: No contract deployed error #1044
-
|
Im trying to run deploy_aave.py on the mainnet-fork but for some reason im getting an error. error- brownie-config.yaml - dependencies:
- aave/[email protected]
compiler:
solc:
remappings:
- "@aave=aave/[email protected]"
dotenv: .env
networks:
kovan:
weth_token: "0xd0a1e359811322d97991e03f863a0c30c2cf029c"
lending_pool_addresses_provider: "0x88757f2f99175387ab4c6a4b3067c77a695b0349"
mainnet-fork:
weth_token: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"
lending_pool_addresses_provider: "0xB53C1a33016B2DC2fF3653530bfF1848a515c8c5"
wallets:
from_key: ${PRIVATE_KEY}
deploy_aave.py - from scripts.helpful_scripts import get_account
from scripts.get_weth import get_weth
from brownie import network, config, interface
amount = 100000000000000000
def main():
account = get_account()
erc20_address = config["networks"][network.show_active()]["weth_token"]
if network.show_active() in ["mainnet-fork"]:
get_weth()
lending_pool = get_lending_pool()
approve_erc20(amount, lending_pool.address, erc20_address, account)
def get_lending_pool():
lending_pool_addresses_provider = interface.ILendingPoolAddressesProvider(
config["networks"][network.show_active()]["lending_pool_addresses_provider"]
)
lending_pool_address = lending_pool_addresses_provider.getLendingPool()
lending_pool = interface.ILendingPool(lending_pool_address)
return lending_pool
def approve_erc20(amount, spender, erc20_address, account):
print("Approving ERC20 token...")
erc20 = interface.IERC20(erc20_address)
txn = erc20.approve(spender, amount, {"from": account})
txn.wait(1)
print("approved!")
return txnget_weth.py - from scripts.helpful_scripts import get_account
from brownie import interface, network, config, accounts
import sys
def get_weth(account=0):
account = (
account if account else 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_token"]
)
tx = weth.deposit({"from": account, "value": 0.1 * 1e18})
print("Received 0.1 WETH")
return tx
def main():
get_weth() |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
|
That's strange, could you please share your project folder Structure and also the IWeth file? Did you named differently and uses WethInterface instead right? |
Beta Was this translation helpful? Give feedback.
-
|
Just an idea: Can you check if the address of the contract is listed under If it is deployed there, the network ID should match the network you are running your code with |
Beta Was this translation helpful? Give feedback.

That's strange, could you please share your project folder Structure and also the IWeth file? Did you named differently and uses WethInterface instead right?