Advertisement
Guest User

Untitled

a guest
Jan 24th, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. pragma solidity ^0.4.7;
  2.  
  3. import "./usingOraclize.sol";
  4.  
  5. contract TestOraclize is
  6.  
  7. usingOraclize
  8.  
  9. {
  10.  
  11. event LOG_Query(bytes32 _queryId, string _arg);
  12. event LOG_Callback(bytes32 _queryId, string _result);
  13.  
  14.  
  15. modifier onlyOraclize { if (msg.sender != oraclize_cbAddress()) throw; _; }
  16.  
  17. function TestOraclize () {
  18.  
  19. OAR = OraclizeAddrResolverI(0xd17e1233a03affb9092d5109179b43d6a8828607);
  20.  
  21. }
  22.  
  23. // discard this after testing.
  24. function OAR_getAddress() returns (address _addr) {
  25. _addr = OAR.getAddress();
  26. }
  27.  
  28. function test_oraclize(string _datasource, string _arg)
  29. returns (bytes32 _queryId) {
  30. _queryId = oraclize_query(_datasource, _arg);
  31. LOG_Query(_queryId, _arg);
  32. }
  33.  
  34. function __callback(bytes32 _queryId, string _result, bytes _proof) onlyOraclize {
  35.  
  36. LOG_Callback(_queryId, _result);
  37.  
  38. }
  39.  
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement