Skip to content

Commit

Permalink
Merge pull request #112 from provable-things/solidity-0.8.x
Browse files Browse the repository at this point in the history
feat(ethereum-api): <- adds version targeting solc 0.8.x
  • Loading branch information
gskapka authored Sep 6, 2022
2 parents c655c52 + 3dc1dc4 commit 94b49f1
Show file tree
Hide file tree
Showing 33 changed files with 12,682 additions and 144 deletions.
120 changes: 0 additions & 120 deletions .ci/drone.yml

This file was deleted.

26 changes: 26 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Node.js CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: ./package-lock.json
- run: npm run test
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
*.sw*
**/node_modules
**/cache
**/artifacts
33 changes: 24 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,34 @@ In Solidity it is as simple as inheriting the __`usingProvable`__ contract that

This will provide your contract with functions like __`provable_query(...)`__, which make it trivial for you to leverage our oracle technology straight away.

If you're using the __[Remix IDE](http://remix.ethereum.org)__ it's even easier still - simply import __Provable__ into your contract like so:
If you're using the __[Remix IDE](http://remix.ethereum.org)__ it's even easier still - simply import the latest version of __Provable__ into your contract like so:

```solidity
import "github.com/oraclize/ethereum-api/provableAPI.sol";
import "github.com/provable-things/ethereum-api/provableAPI.sol";
```

To learn more about the Provable technology, please refer to our __[documentation here](https://docs.oraclize.it)__.
Or if you need a specific version of the API, import that directly via:

```solidity
import "github.com/provable-things/ethereum-api/contracts/solc-v0.8.x/provableAPI.sol";
```


There are versions of the API targetting the following `solc` compilers:

```
solc-v0.4.25
solc-v0.5.x
solc-v0.6.x
solc-v0.8.x
```

To learn more about the Provable technology, please refer to our __[documentation here](https://docs.provable.xyz)__.

&nbsp;

Expand All @@ -26,9 +45,9 @@ To learn more about the Provable technology, please refer to our __[documentatio

### :computer: See It In Action!

For working examples of how to integrate the __Provable__ API into your own smart-contracts, head on over to the __[Provable Ethereum Examples](https://github.com/oraclize/ethereum-examples)__ repository. Here you'll find various examples that use __Provable__ to feed smart-contracts with data from a variety of external sources.
For working examples of how to integrate the __Provable__ API into your own smart-contracts, head on over to the __[Provable Ethereum Examples](https://github.com/provable-things/ethereum-examples)__ repository. Here you'll find various examples that use __Provable__ to feed smart-contracts with data from a variety of external sources.

There are even __[some examples here](https://github.com/oraclize/ethereum-examples/tree/master/solidity/truffle-examples)__ showing you how you can use __Provable__ in a local Truffle development environment!
There are even __[some examples here](https://github.com/provable-things/ethereum-examples/tree/master/solidity/truffle-examples)__ showing you how you can use __Provable__ in a local Truffle development environment!

&nbsp;

Expand Down Expand Up @@ -56,10 +75,6 @@ __❍__ Plus a __[Github](https://github.com/provable-things)__

&nbsp;

### :hourglass_flowing_sand: __Notice about Oraclize rebranding to Provable:__

Please use the __`provableAPI_0.X.sol`__ contracts going forward. We will continue supporting the oraclize-named versions for a limited time, but they should be considered deprecated and to be removed in the coming months.

### :radioactive: __A Note Regarding Serpent:__

:skull: __CAUTION__: It is highly recommended to avoid using Serpent, especially in production. The serpent version of the __Provable__ API herein remains for historical reasons but support for it is no longer maintained. Serpent is considered outdated and audits have shown it to be flawed. Use it at your own risk!
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -1333,4 +1333,4 @@ contract usingProvable {
}
}
}
// </provableAPI>
// </provableAPI>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// SPDX-License-Identifier: MIT
pragma solidity >= 0.8.0 < 0.9.0;

interface OracleAddrResolverI {
function getAddress() external returns (address _address);
}
59 changes: 59 additions & 0 deletions contracts/solc-v0.8.x/interfaces/provable-interface.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
// SPDX-License-Identifier: MIT
pragma solidity >= 0.8.0 < 0.9.0;

interface ProvableI {
function setProofType(bytes1 _proofType) external;
function setCustomGasPrice(uint _gasPrice) external;
function cbAddress() external returns (address _cbAddress);
function randomDS_getSessionPubKeyHash() external view returns (bytes32 _sessionKeyHash);

function getPrice(
string calldata _datasource
) external returns (uint _dsprice);

function getPrice(
string calldata _datasource,
uint _gasLimit
) external returns (uint _dsprice);

function queryN(
uint _timestamp,
string calldata _datasource,
bytes calldata _argN
) external payable returns (bytes32 _id);

function query(
uint _timestamp,
string calldata _datasource,
string calldata _arg
) external payable returns (bytes32 _id);

function query2(
uint _timestamp,
string calldata _datasource,
string calldata _arg1,
string calldata _arg2
) external payable returns (bytes32 _id);

function query_withGasLimit(
uint _timestamp,
string calldata _datasource,
string calldata _arg,
uint _gasLimit
) external payable returns (bytes32 _id);

function queryN_withGasLimit(
uint _timestamp,
string calldata _datasource,
bytes calldata _argN,
uint _gasLimit
) external payable returns (bytes32 _id);

function query2_withGasLimit(
uint _timestamp,
string calldata _datasource,
string calldata _arg1,
string calldata _arg2,
uint _gasLimit
) external payable returns (bytes32 _id);
}
Loading

0 comments on commit 94b49f1

Please sign in to comment.