The problem is that totalSupply()
implementation is missing. Seems like autogenerated getters do not count. So you need to explicitly create the function.
contract StandardToken is Token {
uint256 _totalSupply;
function totalSupply() constant returns (uint256 totalSupply) {
totalSupply = _totalSupply;
}
}
The standard ABI doesn't support structs. You can return the members of a struct in a fixed-length normally deliminated interface. For example:
function getter(bytes32 key) public returns(byte32 name, uint amount, bool isValid) :
return(myStruct[key].name, myStruct[key].amount, myStruct[key].isValid);
The idea of returning the struct object is experimental, e.g.
return(myStruct[key]);
Also, your snippet doesn't include the whole thing, but I suspect the issuerIndex
is a list of keys, not the actual object. Your interface says it returns the object (the experimental feature) but possibly what you meant was returns(bytes32 key)
which would be okay.
Hope it helps.
UPDATE
Based on comment below, the issue is the return value is cast as type "Issuer" which would be the experimental struct object. It should be cast as type address.
To return the address of the Issuer from the mapping:
returns(address issuer) { ...
return issuersIndex[index];
Best Answer
Solidity v0.4-v0.7
Solidity v0.8 and above
As per the list of v0.8 breaking changes, the ABIEncoderV2 is not experimental anymore - it is actually enabled by default by the compiler.