I have followed this tutorial to create a cross-contract calling in ink. There are two contracts in the example accumulator
and delegator
. The accumulator contract has two functions and the delegator contract can access those functions. But if I do an operation using increasing a value using the accumulator contract, then the delegator contract cannot access that value. The delegator contract can access only those values that are created by its functions though and not the values of the Accumulator. How can the delegator contract access the values generated by the accumulator contract?
The contracts of the accumulator and delegator can be found here
get()
and increase it withinc()
methods. The contract's state is encapsulated and only the contract can change its state via external callsinc
function by 5. Hence the value is 5 if you useget
function in accumulator. When i access theget
function from delegator, it retruns zero and not 5. Is it possible to get the value set by accumulator contract in delegator contract?