November 2018
Intermediate to advanced
528 pages
13h 21m
English
In our example, once the contract is loaded for the first time, we need to deposit the amount both parties agreed on. Hence, we need to execute the deposit function along with sending the contract value in ethers.
In web3j, all methods are defined identically to their equivalent Solidity methods and take the same parameters. To transact with a Cfutures function, we invoke the equivalent object's method using dot notation, as follows:
BigInteger Quantity = BigInteger.valueOf(120000);BigInteger Price = BigInteger.valueOf(300);TransactionReceipt DepositReceipt = CFutureInstance.deposit(Price.multiply(Quantity)).send();
As you can see, the argument passed to the deposit function is a BigInteger (price * quantity), ...
Read now
Unlock full access