I have minimized the following solidity code generated in remix to demonstrate the issue. This code warns the test001.regester function requires infinite gas which obviously by the code cannot be.
Could some one determine what the issue really is?
I have tried several versions of calling sequence of the remote call, and all have the same issue. (Other versions are shown commented out in the function code below.)
pragma solidity ^0.4.17;
contract test002 {
address[] AddressList;
event ItemAdded(address, address);
function getItemCount() public view returns(uint) {return(AddressList.length);}
function getItem(uint index) public view returns(address) {return(AddressList[index]);}
function addItem(address inItem) public {
AddressList[AddressList.length] = inItem;
ItemAdded(this, inItem);
}
}
contract test001 {
address AA;
event Creation(address, address);
function test001() public {
AA = new test002();
Creation(address(this), AA);
}
function register() public {
// option 1
// test002(AA).addItem(address(this));
// option 2
// test002 A = test002(AA);
// A.addItem(this);
// option 3
test002 A = test002(AA);
A.addItem(address(this));
}
}