August 2018
Intermediate to advanced
404 pages
11h 19m
English
In order to read data from smart contracts, we will have to perform these steps:
// Create a contract objectvar MyContract = web3.eth.contract(<ABI>); // Create an instance with address var contractInstance = MyContract.at("<Address>");
For those who are using the upcoming version of web3js ( v1.x.x), use the following method to create an instance:
var contractInstance = new web3.eth.Contract( "<ABI>", "<Address>");
Read data from the smart contract using the call method. This executes the code in the Ethereum Virtual Machine (EVM) and returns the value. This method does not ...
Read now
Unlock full access