Interacting w/ deployed contract
We previously deployed a contract onto rinkeby.
In the deployments folder, deployed contracts are organized into different folders based on their chainID.
Rinkeby -> chainID: 4 -> we will find our deployed contract's json file located here.
This serves as an interface for our python scripts to interact with the contract that resides on chain.
For example, we can read and write to the contract as follows:
We can run the above script with: brownie run scripts/read_value.py --network rinkeby
read current value of favNum -> returns 3 (call)
update favNum to 5
transaction hash provided
can look up on etherscan
read current value of favNum -> returns 5 (call)
this means you can knock out some python script to interact with your contract after running deploy.py
Last updated