Interacting w/ deployed contract
from brownie import SimpleStorage, accounts, config
#[-1] for most recent deployment, [0] for first deployment
def read_contract():
simple_storage = SimpleStorage[-1]
#read value
print(simple_storage.retrieve())
#update value
account = accounts.add(config["wallets"]["wallet1"])
simple_storage.store(5, {"from":account})
print(simple_storage.retrieve())
def main():
read_contract()
Last updated