March 2018
Beginner to intermediate
656 pages
20h 9m
English
Once the web3 object is correctly created and simplecontractinstance is created, calls to the contract functions can be made easily as shown in the following example:
function callMatchertrue()
{
var txn = simplecontractinstance.Matcher.call(12);
{
};
console.log("return value: " + txn);
}
function callMatcherfalse()
{
var txn = simplecontractinstance.Matcher.call(1);{
};
console.log("return value: " + txn);
}
Calls can be made using simplecontractinstance.Matcher.call and then by passing the value for the argument. Recall the Matcher function in solidity code:
function Matcher (uint8 x) returns (bool)
It takes one argument x of type uint8 and returns a Boolean value, either true or false. Accordingly, the call is made ...