Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to call an external function of another contract #4310

Closed
evgen-povt opened this issue Jun 18, 2018 · 5 comments
Closed

Failed to call an external function of another contract #4310

evgen-povt opened this issue Jun 18, 2018 · 5 comments

Comments

@evgen-povt
Copy link

Which version of Solidity you are using
0.4.21 vs 0.4.24

What was the source code

pragma solidity ^0.4.21;

contract Contract1 {
    uint256 private diff = 15;

    function getNumber(uint256 _seed) external view returns (uint256) {
        return _seed + diff;
    }
}

contract Contract2 {
    uint256 public value;
    Contract1 public contract1;

    function Contract2(address _contract1) public {
        contract1 = Contract1(_contract1);
    }

    function getContractValue(uint256 _seed) public {
        value = contract1.getNumber(_seed);
    }
}

Which platform are you running on
Remix IDE + geth 1.8.11-stable on Mac

How to reproduce the issue

  1. Deploy Contract1
  2. Deploy Contract2 with address of Contract1 as an argument of the constructor
  3. Make a call of Contract2.getContractValue(10)

What was the result of the issue
The steps above work if the contracts are compiled with compiler 0.4.21.
But they fail if the contracts are compiled with compiler 0.4.24
Also in both cases the compiler prints warning 'Gas requirement of function Contract2.getContractValue(uint256) high: infinite.'

What the expected behaviour is
The contracts should work when compiled with 0.4.24
There is no the warning message.

@erak
Copy link
Collaborator

erak commented Jun 18, 2018

@evgen-povt Could you please give some more information on your OS and web browser? Your issue seems to be related to #4162 which we're currently trying to track down.

@evgen-povt
Copy link
Author

@bit-shift
OS: macOS Sierra 10.12.6
Geth: Geth/v1.8.11-stable/darwin-amd64/go1.10.3
Browser: Google Chrome Version 67.0.3396.87 (Official Build) (64-bit)

The difference with the #4162 is that my case has a warning for 0.4.21 either.

And one major thing: Remix IDE is connected to the geth node, not Javascript VM.

@chriseth
Copy link
Contributor

I think the problem here is that you did not enable Byzantium mode in geth: ethereum/go-ethereum#16931

@axic
Copy link
Member

axic commented Jun 19, 2018

Should be solved by #4259.

@axic axic closed this as completed Jun 19, 2018
@axic
Copy link
Member

axic commented Jun 19, 2018

Please comment if using byzantium mode in geth didn't solve the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants