Created
January 24, 2017 20:43
-
-
Save christoph2806/6b7c3fe6b160f7935d7497dfbea519a1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.4.7; | |
import "./usingOraclize.sol"; | |
contract TestOraclize is | |
usingOraclize | |
{ | |
event LOG_Query(bytes32 _queryId, string _arg); | |
event LOG_Callback(bytes32 _queryId, string _result); | |
modifier onlyOraclize { if (msg.sender != oraclize_cbAddress()) throw; _; } | |
function TestOraclize () { | |
OAR = OraclizeAddrResolverI(0xd17e1233a03affb9092d5109179b43d6a8828607); | |
} | |
// discard this after testing. | |
function OAR_getAddress() returns (address _addr) { | |
_addr = OAR.getAddress(); | |
} | |
function test_oraclize(string _datasource, string _arg) | |
returns (bytes32 _queryId) { | |
_queryId = oraclize_query(_datasource, _arg); | |
LOG_Query(_queryId, _arg); | |
} | |
function __callback(bytes32 _queryId, string _result, bytes _proof) onlyOraclize { | |
LOG_Callback(_queryId, _result); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment