Here's my contract: contract test_contract { uint public last_a;
function double(uint a) public returns(uint) {
last_a = a;
return 2*a;
}
function getLastA() public constant returns(uint){
return last_a;
}
function getMethod() public constant returns(bytes4){
return bytes4(keccak256("getLastA())"));
}
}
Ok. So I get the method getLastA using the getMethod, pad it to 32, get the contract address on Ropsten...and now this is my call:
url post - json(https://ropsten.infura.io/).result
params - {"jsonrpc":"2.0","id":3,"method":"eth_call","params":[{"to":"0x76a83b371ab7232706eac16edf2b726f3a2dbe82","data":"4b9a1598000000000000000000000000000000000000000000000000000000000000000"], "latest"}
You can see my oraclize query here
Just wondering if I'm doing something wrong or if this is even possible. The value it should return is 17 if anyone else thinks they have an answer.

本文解决了在Ropsten测试网上通过Infura和Oraclize调用智能合约公共变量的问题。详细介绍了正确的JSON-RPC请求格式,并提供了一个有效的示例请求,成功返回了预期结果。
671







return this.getLastA.selector. – smarx 13 hours ago