Now, we come to the primary methods of our app. We start with the createLC method, as follows:
- We start the app by storing the current app state in the app variable, as shown in the following code block. This will allow us to refer to the current app state during asynchronous calls:
createLC = () => { let app = this;
- The contract variable is used to instantiate an LCMaster object, which points to the LCMaster smart contract we deployed earlier to our blockchain. We do so by using the web3.eth.contract method. The input parameter to this method is the contract ABI, and the second parameter is the contract address. Since we had mapped these earlier to the LCMaster object, we simply fetch these values and pass ...