0

Please I know this question might be a repetition of what was previously asked here but the answers didn't solve my problem.

In my case I actually used the brownie run scripts/deploy.py --network sepolia prompt to deploy my contract to the sepolia network.

This is my deploy.py file.

from brownie import accounts, config, SimpleStorage, network import os def deploy_simple_storage(): account = get_account() simple_storage = SimpleStorage.deploy({"from": account}) def get_account(): if network.show_active() == "development": return accounts[0] else: return accounts.add(config["wallets"]["from_key"]) def main(): deploy_simple_storage() 

I see the deployed contract in my .build/deployments folder. But when I try to interact with it in my read_value.py file, I get a IndexError: list index out of range error.

This is my read_value.py file.

'''Interacting with contracts deployed inside our brownie project''' from brownie import SimpleStorage, accounts, config, network from brownie.network.contract import ContractContainer def read_contract(): print(SimpleStorage[0]) def main(): read_contract() 

Please I'll need your help. Thanks.

2
  • Are you also passing --network sepolia flag while interacting with your read_value.py script? Commented Aug 22, 2024 at 9:19
  • 1
    Thanks @SYEDASADKAZM it worked! Commented Aug 23, 2024 at 13:22

1 Answer 1

0

Make sure that you pass --network sepolia flag while interacting with your read_value.py script too.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.