August 2019
Intermediate to advanced
486 pages
13h 52m
English
Once you have the contract definition ready and no compilation errors have been found, it can be deployed on the blockchain. You can use either the online Remix IDE, Truffle migration scripts, or the web3.js JavaScript API to deploy the contract on the blockchain. You can refer to Chapter 4, Learning MetaMask and Remix for more information.
When you deploy a contract from outside of the blockchain, it calls the constructor function, which is defined using the constructor keyword. The constructor is called only once, that is, at the time of deployment/creation. The constructor function is optional. You can also feed in some initial parameters to a contract via the constructor function by assigning arguments to it.
In the ...