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

feat: adds contract api compatible with sol 0.6 #98

Open
wants to merge 2 commits into
base: master
from

Conversation

@allemanfredi
Copy link

allemanfredi commented Mar 17, 2020

As described in the title, This PR adds the contract api compatible with solidity 0.6.

@allemanfredi allemanfredi requested a review from bertani Mar 17, 2020
@riccardopersiani riccardopersiani self-requested a review Mar 18, 2020
Copy link

riccardopersiani left a comment

Please, @allemanfredi could you just have a fast look to my comments?

provableAPI_0.6.sol Outdated Show resolved Hide resolved
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 {

This comment has been minimized.

Copy link
@riccardopersiani

riccardopersiani Mar 18, 2020

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 {

This comment has been minimized.

Copy link
@riccardopersiani

riccardopersiani Mar 18, 2020

The keyword interface seems much more correct here, did you add it because it wasn’t compiling anymore?

This comment has been minimized.

Copy link
@bertani

bertani Mar 18, 2020

Contributor

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)

@bertani

This comment has been minimized.

Copy link
Contributor

bertani commented Mar 18, 2020

Please, @allemanfredi could you just have a fast look to my comments?

I just did, we need to change the version check only.
Other checks are needed on safeMemoryCleaner as the new optimizer doesn't like the use of msize(), I will look into it

if (price > 1 ether + tx.gasprice * 200000) {
return 0; // Unexpectedly high price
}
return provable.query.value(price)(0, _datasource, _arg);

This comment has been minimized.

Copy link
@coffee-converter

coffee-converter Mar 19, 2020

.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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.