2

I'm trying to test contract interaction using Remix with two basic contract:

  • contract Callee
  • contract Caller

Callee function/variable:

uint[] public values;

function storeValue(uint value) {
    values.push(value);
}

function getValues() view returns(uint) {
    return values.length;
}

Caller function:

function storeAction(address addr) returns(uint) {
    Callee c = Callee(addr);
    c.storeValue(100);
    return c.getValues();
}

If I try to execute function "storeAction" I see a different behavior between:

error "Gas estimation errored with the following message (see below). The transaction execution will likely fail. Do you want to force sending? gas required exceeds allowance or always failing transaction"

The deploy seems to works fine for both the environment.

I've already checked my private blockchain gas limit that is over 4700000.

Can someone explain this?

Thanks

  • Does the parameter "addr" contain the correct address? – Linmao Song Apr 24 '18 at 14:33
  • Yes, it contains the address of the deployed contract Callee. – gerry Apr 24 '18 at 14:38
  • UPDATE: The instruction that falls is "c.getValues()" but I still don't understand why. – gerry Apr 24 '18 at 22:47
0

I resolve the issue using version of solidity compiler earlier than ^0.4.21.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.