External function call not working in 0.4.22, 0.4.23, 0.4.24, 0.25
Steps to reproduce in Quorum
- Clone https://github.com/jpmorganchase/quorum-examples/tree/master/examples/7nodes. 2../raft-init.sh 3../raft-start.sh
- Used truffle to deploy the contracts.. truffle version 4.1.11
2_deploy_contract.js
let InfoFeed = artifacts.require("./InfoFeed.sol");
let Consumer = artifacts.require("./Consumer.sol");
module.exports = function(deployer) {
deployer.deploy(InfoFeed)
.then(() => {
return deployer.deploy(Consumer, InfoFeed.address);
})
};
Expected: Consumer.getInfo must return 42. Observed: Consumer.getInfo returns 0.
However, if I used 0.4.21 this works.
\\InfoFeed.sol
pragma solidity 0.4.24;
contract InfoFeed {
function info()
public
pure
returns (uint8 ret)
{
return 42;
}
}
\\Consumer.sol
contract Consumer {
InfoFeed feed;
function Consumer(address addr) public { feed = InfoFeed(addr); }
function getInfo(uint8 _someInt) public view returns (uint8 _someInfo) { return feed.info(); }
}
Please give a bit more information. Which EVM version and environment are you running this against? Does getInfo really return 0 or does it revert?
How do I get the EVM version? I am using Ubuntu 16.04 LTS.
@aas312 this depends on a lot of factors. When you say "Deploy InfoFeed contract" - what exactly are you doing? Which blockchain are you using and how do you run it?
@chriseth I am using Parity v1.10.1. I setup my parity network using https://github.com/folsen/parity-poa-playground. When I say deploy I am clicking on the Deploy button in the Contract (Click Settings and check the Contract checkbox) tab in the Parity wallet. getInfo is returning 0.
Shouldn't you be changing your constructor definition to the new format? I'm surprised you're not getting errors during compilation.
i.e: function Consumer(address addr) public { feed = InfoFeed(addr); }
will be: constructor(address addr) public { feed = InfoFeed(addr); }
@jackneil yes i do get warnings for the constructor. This warning will become error in 0.4.25, but for now it works.
I think this should be covered by #4259.
Relevant issue in the quorum repository: https://github.com/jpmorganchase/quorum/issues/397