11// <ORACLIZE_API>
2+ // Release targetted at solc 0.4.25 to silence compiler warning/error messages, compatible down to 0.4.22
23/*
34Copyright (c) 2015-2016 Oraclize SRL
45Copyright (c) 2016 Oraclize LTD
6+
7+
8+
59Permission is hereby granted, free of charge, to any person obtaining a copy
610of this software and associated documentation files (the "Software"), to deal
711in the Software without restriction, including without limitation the rights
812to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
913copies of the Software, and to permit persons to whom the Software is
1014furnished to do so, subject to the following conditions:
15+
16+
17+
1118The above copyright notice and this permission notice shall be included in
1219all copies or substantial portions of the Software.
20+
21+
22+
1323THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1424IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1525FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -19,9 +29,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1929THE SOFTWARE.
2030*/
2131
22- // This api is currently targeted at 0.4.18 , please import oraclizeAPI_pre0.4.sol or oraclizeAPI_0.4 where necessary
32+ // This api is currently targeted at 0.4.22 to 0.4.25 (stable builds) , please import oraclizeAPI_pre0.4.sol or oraclizeAPI_0.4 where necessary
2333/* solium-disable */
24- pragma solidity >= 0.4.18 ;// Incompatible compiler version... please select one stated within pragma solidity or use different oraclizeAPI version
34+ pragma solidity >= 0.4.22 ;// Incompatible compiler version... please select one stated within pragma solidity or use different oraclizeAPI version
2535
2636contract OraclizeI {
2737 address public cbAddress;
@@ -44,17 +54,23 @@ contract OraclizeAddrResolverI {
4454
4555/*
4656Begin solidity-cborutils
57+
4758https://github.com/smartcontractkit/solidity-cborutils
59+
4860MIT License
61+
4962Copyright (c) 2018 SmartContract ChainLink, Ltd.
63+
5064Permission is hereby granted, free of charge, to any person obtaining a copy
5165of this software and associated documentation files (the "Software"), to deal
5266in the Software without restriction, including without limitation the rights
5367to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
5468copies of the Software, and to permit persons to whom the Software is
5569furnished to do so, subject to the following conditions:
70+
5671The above copyright notice and this permission notice shall be included in all
5772copies or substantial portions of the Software.
73+
5874THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
5975IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
6076FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -346,7 +362,11 @@ contract usingOraclize {
346362 }
347363 function __callback (bytes32 myid , string result , bytes proof ) public {
348364 return ;
365+ // Following should never be reached with a preceding return, however
366+ // this is just a placeholder function, ideally meant to be defined in
367+ // child contract when proofs are used
349368 myid; result; proof; // Silence compiler warnings
369+ oraclize = OraclizeI (0 ); // Additional compiler silence about making function pure/view.
350370 }
351371
352372 function oraclize_getPrice (string datasource ) oraclizeAPI internal returns (uint ){
@@ -744,7 +764,7 @@ contract usingOraclize {
744764 return oraclize.randomDS_getSessionPubKeyHash ();
745765 }
746766
747- function getCodeSize (address _addr ) constant internal returns (uint _size ) {
767+ function getCodeSize (address _addr ) view internal returns (uint _size ) {
748768 assembly {
749769 _size := extcodesize (_addr)
750770 }
@@ -963,7 +983,7 @@ contract usingOraclize {
963983
964984 }
965985
966- oraclize_randomDS_setCommitment (queryId, keccak256 (delay_bytes8_left, args[1 ], sha256 (args[0 ]), args[2 ]));
986+ oraclize_randomDS_setCommitment (queryId, keccak256 (abi.encodePacked ( delay_bytes8_left, args[1 ], sha256 (args[0 ]), args[2 ]) ));
967987 return queryId;
968988 }
969989
@@ -1075,7 +1095,7 @@ contract usingOraclize {
10751095 uint ledgerProofLength = 3+65 + (uint (proof[3+65+1 ])+ 2 )+ 32 ;
10761096 bytes memory keyhash = new bytes (32 );
10771097 copyBytes (proof, ledgerProofLength, 32 , keyhash, 0 );
1078- if (! (keccak256 (keyhash) == keccak256 (sha256 (context_name, queryId)))) return false ;
1098+ if (! (keccak256 (keyhash) == keccak256 (abi.encodePacked ( sha256 (abi.encodePacked ( context_name, queryId)) )))) return false ;
10791099
10801100 bytes memory sig1 = new bytes (uint (proof[ledgerProofLength+ (32+8+1+32 )+ 1 ])+ 2 );
10811101 copyBytes (proof, ledgerProofLength+ (32+8+1+32 ), sig1.length , sig1, 0 );
@@ -1093,7 +1113,7 @@ contract usingOraclize {
10931113 copyBytes (proof, sig2offset-64 , 64 , sessionPubkey, 0 );
10941114
10951115 bytes32 sessionPubkeyHash = sha256 (sessionPubkey);
1096- if (oraclize_randomDS_args[queryId] == keccak256 (commitmentSlice1, sessionPubkeyHash)){ //unonce, nbytes and sessionKeyHash match
1116+ if (oraclize_randomDS_args[queryId] == keccak256 (abi.encodePacked ( commitmentSlice1, sessionPubkeyHash) )){ //unonce, nbytes and sessionKeyHash match
10971117 delete oraclize_randomDS_args[queryId];
10981118 } else return false ;
10991119
@@ -1212,3 +1232,4 @@ contract usingOraclize {
12121232 }
12131233
12141234}
1235+ // </ORACLIZE_API>
0 commit comments