I am trying to run the script in the terminal but I get this error TypeError: argument of type 'NoneType' is not iterable.
Can anyone help me with this issue?
Thank you in advance.
Below is the entire code.
1.Get-weth.py
from scripts.helpful_scripts import get_account
from brownie import interface, config, network
def main():
get_weth()
def get_weth():
"""
Mints WETH by depositing ETH
"""
def get_account(index=None, id=None):
if index:
return accounts[index]
if network.show_active() in LOCAL_BLOCKCHAIN_ENVIRONMENTS:
return accounts[0]
if id:
return accounts.load(id)
if network.show_active() in config["networks"]:
return accounts.add(config["wallets"]["from_key"])
return None
I am trying to run the script in the terminal but I get this error TypeError: argument of type 'NoneType' is not iterable. Can anyone help me with this issue? Thank you in advance. Below is the entire code.
1.Get-weth.py
from scripts.helpful_scripts import get_account from brownie import interface, config, network
def main(): get_weth()
def get_weth(): """ Mints WETH by depositing ETH """
ABI&Address
2.Helpful-scripts.py from brownie import accounts, network, config
LOCAL_BLOCKCHAIN_ENVIRONMENTS = [ "development", "ganache", "hardhat", "local-ganache", "mainnet-fork", ]
def get_account(index=None, id=None): if index: return accounts[index] if network.show_active() in LOCAL_BLOCKCHAIN_ENVIRONMENTS: return accounts[0] if id: return accounts.load(id) if network.show_active() in config["networks"]: return accounts.add(config["wallets"]["from_key"]) return None
3.Brownie-config.yaml dependencies:
4.env export PRIVATE_KEY = "0x753aa243016b908fc6f7c21964201f11c1bf46cca2fe2ba2359cfeff9bbed00e" export WEB3_ALCHEMY_PROJECT_ID = "gP4XRpmUZxWsPV7gbb6X0EViwq9tnzCO" export ETHERSCAN_TOKEN = DPGZQ3V1B593F8FX4X1YETVU7WKY8PG9BV
interface IWeth { function allowance(address owner, address spender) external view returns (uint256 remaining); function approve(address spender, uint256 value) external returns (bool success); function balanceOf(address owner) external view returns (uint256 balance); function decimals() external view returns (uint8 decimalPlaces); function name() external view returns (string memory tokenName); function symbol() external view returns (string memory tokenSymbol); function totalSupply() external view returns (uint256 totalTokensIssued); function transfer(address to, uint256 value) external returns (bool success); function transferFrom(address from, address to, uint256 value) external returns (bool success); function deposit() external; function withdraw(uint wad) external; }