-
Notifications
You must be signed in to change notification settings - Fork 429
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
feat: adds contract api compatible with sol 0.6 #98
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, @allemanfredi could you just have a fast look to my comments?
pragma solidity >= 0.5.0 < 0.7.0; // Incompatible compiler version - please select a compiler within the stated pragma range, or use a different version of the provableAPI! | ||
|
||
// Dummy contract only used to emit to end-user they are using wrong solc | ||
abstract contract solcChecker { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason why you used abstract
keyword here is to move to a more OO paradigm? Or was it forced? Just curious
/* INCOMPATIBLE SOLC: import the following instead: "github.com/oraclize/ethereum-api/oraclizeAPI_0.4.sol" */ function f(bytes calldata x) virtual external; | ||
} | ||
|
||
interface ProvableI { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The keyword interface
seems much more correct here, did you add it because it wasn’t compiling anymore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Solc 0.6 adds new requirements around explicitly declare interfaces as such. This change is necessary and expected since this is an interface after all (the interface keyword didn't exist when the provableAPI was first written)
I just did, we need to change the version check only. |
provableAPI_0.6.sol
Outdated
if (price > 1 ether + tx.gasprice * 200000) { | ||
return 0; // Unexpectedly high price | ||
} | ||
return provable.query.value(price)(0, _datasource, _arg); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.value(...) is deprecated as of 0.6.4. Might be nice to change this to {value: ...} instead. Same deprecated usage in 15 other places below.
As described in the title, This PR adds the contract api compatible with solidity 0.6.