when I run brownie run scripts/deploy.py --network rinkeby I get this result:enter image description here

and this is my python code:

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

-now this python code should make a state change to a smart contract from 0 to 15 on a rinkbey testnet and there is no error in my python code or in my solidity code and I have created a .env file so brownie could see my private key and my project ID on infura. this is my .env file enter image description here

1 Answer 1


dev advocate at Chainstack here!

The first thing I want to mention is that Rinkeby was deprecated about a month ago, so you won't be able to interact with it.

Make sure that you use the Goerli or Sepolia testnet!

Checkout this article about the merge and testnets where you can see which testnets have been deprecated :)

Then here you can find a sample code to deploy and interact with a contract if you need it.

from brownie import accounts, SimpleStorage

def main():
    # fetch the account
    account = accounts[0]

    # deploy contract
    deploy_contract = SimpleStorage.deploy({"from":account})

    # print contract address
    print(f"contract deployed at {deploy_contract}")

    # store a number
    transaction_receipt = deploy_contract.storeNumber(15,{"from":account})

    # wait for transaction confirmation

    # retrieve the number
    retrieved_number = deploy_contract.readNumber()

    # print the retrieved number
    print(f"Number Retrieved : {retrieved_number}")

You can also check this article, where you can find an in depth tutorial about Brownie and how to deploy and test.

Chainstack provides reliable Goerli nodes if you need one:

Set up the endpoint URL

  1. Sign up with Chainstack.
  2. Deploy a node.
  3. View node access and credentials.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.