Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Targeting solidity compiler v0.4.18 and updated to silence warnings #23

Merged
merged 22 commits into from
Nov 30, 2017
Merged
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
93638f5
odd issue with atom editor, removing and re-inserting multiple lines,…
AdamJLemmon Nov 20, 2017
8d16ad6
all if throw's converted to requires
AdamJLemmon Nov 20, 2017
b2d21ac
public modifiers explicitly added to all default public methods
AdamJLemmon Nov 20, 2017
4cef9b8
sha3 converted to keccak256
AdamJLemmon Nov 20, 2017
dab6ac9
public modifier added to OraclizeAddrResolverI getAddress method
AdamJLemmon Nov 20, 2017
6551cbc
var converted to uint256
AdamJLemmon Nov 20, 2017
b6c0fbd
added state mutability modifiers where applicable
AdamJLemmon Nov 20, 2017
5cb8617
explicit conversion of decimal to byte data type
AdamJLemmon Nov 20, 2017
430fdf2
remove unused networkID param from set network
AdamJLemmon Nov 20, 2017
82cabde
setNetwork unused param removed on method call and callback method ma…
AdamJLemmon Nov 20, 2017
0394647
added setNetwork method with input param in order to maintain backwar…
AdamJLemmon Nov 20, 2017
3d1b197
updated compiler version to 0.4.18
AdamJLemmon Nov 20, 2017
6a3f405
added placeholder __callback method to maintain backwards compatibility
AdamJLemmon Nov 20, 2017
ef27f51
moved updated api targeting 0.4.18 to a new 0.5 api version and rever…
AdamJLemmon Nov 24, 2017
db63f33
updated initial comment specifying the use of this api and to revert …
AdamJLemmon Nov 24, 2017
1ae72c5
updated oraclizeI visibility modifiers to match the connector
AdamJLemmon Nov 27, 2017
62bc14c
return added before variable use to silence warnings
AdamJLemmon Nov 27, 2017
d50ea57
removed methods from oraclizeI that are no longer present in the conn…
AdamJLemmon Nov 27, 2017
f5c4bba
check changed to bytes > 0 not != 0
AdamJLemmon Nov 27, 2017
d6a3c7e
assert used in place of require in order to burn all gas and not rewa…
AdamJLemmon Nov 27, 2017
023914a
set config and use coupon removed entirely from api as not longer sup…
AdamJLemmon Nov 27, 2017
0ada9bd
assert changed back to require in order to save the gas when exceptio…
AdamJLemmon Nov 29, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions oraclizeAPI_0.4.sol
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,19 @@ pragma solidity ^0.4.0;//please import oraclizeAPI_pre0.4.sol when solidity < 0.

contract OraclizeI {
address public cbAddress;
function query(uint _timestamp, string _datasource, string _arg) payable returns (bytes32 _id);
function query_withGasLimit(uint _timestamp, string _datasource, string _arg, uint _gaslimit) payable returns (bytes32 _id);
function query2(uint _timestamp, string _datasource, string _arg1, string _arg2) payable returns (bytes32 _id);
function query2_withGasLimit(uint _timestamp, string _datasource, string _arg1, string _arg2, uint _gaslimit) payable returns (bytes32 _id);
function queryN(uint _timestamp, string _datasource, bytes _argN) payable returns (bytes32 _id);
function queryN_withGasLimit(uint _timestamp, string _datasource, bytes _argN, uint _gaslimit) payable returns (bytes32 _id);
function getPrice(string _datasource) returns (uint _dsprice);
function getPrice(string _datasource, uint gaslimit) returns (uint _dsprice);
function useCoupon(string _coupon);
function setProofType(byte _proofType);
function setConfig(bytes32 _config);
function setCustomGasPrice(uint _gasPrice);
function randomDS_getSessionPubKeyHash() returns(bytes32);
function query(uint _timestamp, string _datasource, string _arg) public payable returns (bytes32 _id);
function query_withGasLimit(uint _timestamp, string _datasource, string _arg, uint _gaslimit) public payable returns (bytes32 _id);
function query2(uint _timestamp, string _datasource, string _arg1, string _arg2) public payable returns (bytes32 _id);
function query2_withGasLimit(uint _timestamp, string _datasource, string _arg1, string _arg2, uint _gaslimit) public payable returns (bytes32 _id);
function queryN(uint _timestamp, string _datasource, bytes _argN) public payable returns (bytes32 _id);
function queryN_withGasLimit(uint _timestamp, string _datasource, bytes _argN, uint _gaslimit) public payable returns (bytes32 _id);
function getPrice(string _datasource) public returns (uint _dsprice);
function getPrice(string _datasource, uint gaslimit) public returns (uint _dsprice);
function useCoupon(string _coupon) public;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bertani This (useCoupon) is no longer in the connector. Should these be removed, or kept for backwards compatibility. In case of the latter, appropriate comments should be added for each instance of it that it's a deprecated method.

Copy link
Contributor

@marcogiglio marcogiglio Nov 29, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no need for backward compatibility here, since only future deployed contracts are going to use this file anyway.. and those contracts will run on the current connector?

function setProofType(byte _proofType) public;
function setConfig(bytes32 _config) public;
function setCustomGasPrice(uint _gasPrice) public;
function randomDS_getSessionPubKeyHash() public returns(bytes32);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These visibility specifiers should ideally match with what they actually are in https://github.com/oraclize/ethereum-api/blob/master/connectors/oraclizeConnector.sol

Most are in fact external.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}
contract OraclizeAddrResolverI {
function getAddress() returns (address _addr);
Expand Down Expand Up @@ -119,10 +119,10 @@ contract usingOraclize {
return false;
}

function __callback(bytes32 myid, string result) {
function __callback(bytes32 myid, string result) public {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should the default methods implement check to ensure msg.sender is Oraclize cbAddress??? Or is it expected to fallback/be overriden.

Copy link
Contributor

@marcogiglio marcogiglio Nov 29, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That extra-check would slightly increase the gas usage on deployment for every contract, as most of them only deploy the _callback with proof. And I also believe it would be redundant, as most of them will have that check any way in the implemented callback. So I believe it is better to leave it as it is.

__callback(myid, result, new bytes(0));
}
function __callback(bytes32 myid, string result, bytes proof) {
function __callback(bytes32 myid, string result, bytes proof) public {
}

function oraclize_useCoupon(string code) oraclizeAPI internal {
Expand Down