Deployment to ganache
brownie automatically handles ganache initiation through ganache-cli
Last updated
brownie automatically handles ganache initiation through ganache-cli
Last updated
To proceed with deployment of the Smart Contract, we first need to import it into our script so we can interact with it.
Specify which account to deploy from. Brownie will build,sign and send the transaction.
simple_storage will store the return of the .deploy function -> it is a contract object.
The output, when printing simple_storage is the smart contract address:
Once a contract has been deployed, you can interact with it via via calls and transactions.
Transactions are broadcast to the network and recorded on the blockchain. They cost ether to run, and are able to alter the state to the blockchain.
Calls are used to execute code on the network without broadcasting a transaction. They are free to run, and cannot alter the state of the blockchain in any way. Calls are typically used to retrieve a storage value from a contract using a getter method.
deploy.py:
brownie does not automatically deploy all the contracts in our contracts folder.
we must specify what we want deployed through our python code.