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

Refactor/2.1.0 #437

Merged
merged 39 commits into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
e97024e
refactor: Witnet.RadonDataRequestMethods -> Witnet.RadonRetrievalMethods
guidiaz Jul 30, 2024
0e5ab1b
refactor: Witnet.Radon*
guidiaz Jul 30, 2024
b59090f
refactor: merge WitnetV2.* into Witnet.*
guidiaz Jul 30, 2024
a57018a
refactor: IWitnet*Events
guidiaz Jul 31, 2024
3dccd8a
refactor: IWitnet*Appliance
guidiaz Jul 31, 2024
c718a22
refactor: *RequestBytecodes* -> *RadonRegistry*
guidiaz Jul 31, 2024
022945f
refactor: *WitnetRequest*
guidiaz Jul 31, 2024
2c26397
refactor: specs() calculation
guidiaz Aug 1, 2024
4613f73
refactor: *RequestBytecodes* -> *RadonRegistry* on scripts
guidiaz Aug 1, 2024
ee9c3d4
chore: revisit IWitnetFeeds* specs
guidiaz Aug 1, 2024
c6bfd3c
refactor: WitnetRadonRegistry and core artifacts interdependencies
guidiaz Aug 3, 2024
d9c628e
refactor: estimate*Fee
guidiaz Aug 3, 2024
948d044
refactor: Witnet.RadonSLA
guidiaz Aug 3, 2024
f2bbf8d
feat: IWitnetRandomness.randomize(Witnet.RadonSLA)
guidiaz Aug 3, 2024
f522574
chore: move contracts/mocks -> tests/mocks
guidiaz Aug 3, 2024
6b4b8c4
chore: move apps/Using|Consumer -> mocks/
guidiaz Aug 3, 2024
863a0c7
refactor: WitnetRandomnessV2 -> WitnetRandomnessV21
guidiaz Aug 3, 2024
7097cb2
chore: move .../WitnetPriceFeedsDefault -> apps/WitPriceFeedsV21
guidiaz Aug 3, 2024
3eebab5
chore: rearrange contracts/core layout
guidiaz Aug 3, 2024
b53cff8
refactor: apps/Witnet* -> apps/Wit*
guidiaz Aug 3, 2024
fd9f1fe
refactor: *Witnet* -> *Wit* | *WitOracle*
guidiaz Aug 4, 2024
3adc3b8
refactor: rename contracts/mocks -> contracts/mockups
guidiaz Aug 4, 2024
c00f00b
refactor: Witnet.Request|Response -> Witnet.Query*
guidiaz Aug 5, 2024
a5b3f79
refactor: WitnetQuery* -> WitOracle* events
guidiaz Aug 5, 2024
a029bc7
refactor: merge IFeed into IWitFeeds
guidiaz Aug 5, 2024
7cc31f8
refactor: IWitOracleAppliance.witnet() -> witOracle()
guidiaz Aug 5, 2024
ca0833d
refactor: Witnet.QueryRequest.witnet* -> radon*
guidiaz Aug 5, 2024
e6ff2e6
refactor: mockups/*
guidiaz Aug 5, 2024
54d9f7a
feat: IWitOracle.postRequestWithCallback(IWitOracleConsumer, ...)
guidiaz Aug 5, 2024
7a70235
fix: migrations and tests
guidiaz Aug 5, 2024
1c717fb
chore: bump package version to 2.1.0
guidiaz Aug 6, 2024
b680dc4
fix: Witnet.RadonSLA.equalOrGreater operator
guidiaz Aug 9, 2024
865993b
chore: revisit default query sla on mockups
guidiaz Aug 9, 2024
5c07d7b
feat: receive() external payable virtual on wit appliance mockups
guidiaz Aug 9, 2024
57676c8
refactor: UsingWitOracleRequestTemplate
guidiaz Aug 9, 2024
0a63ad0
refactor: WitOracleRequestTemplateConsumer
guidiaz Aug 9, 2024
2b35d0b
refactor: UsingWitOracleRandomness -> UsingWitOracle
guidiaz Aug 9, 2024
af252c3
refactor: WitRandomnessRequestConsumer -> WitOracleRandomnessConsumer
guidiaz Aug 9, 2024
380d3eb
feat: mockups/UsingWitPriceFeeds
guidiaz Aug 9, 2024
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
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Should any artifact require customized contract implementations:

When modifying the existing source code, or the contents of `settings/artifacts` or `settings/specs`, you may need to upgrade some of the artifacts on certain networks. Just add the `--artifacts` parameter and a comma-separated list of the artifacts you need to upgrade. For instance:

`$ pnpm run migrate <ecosystem>:<chain-name> WitnetErrorsLib,WitnetPriceFeeds`
`$ pnpm run migrate <ecosystem>:<chain-name> WitOracleResultErrorsLib,WitPriceFeeds`

When specifying deployable library artifacts, the depending contracts will be attempted to be upgraded as well.

Expand All @@ -56,13 +56,13 @@ Javacript methods and resources:
- WEB addresses at a given chain:
- `getAddresses(network)`
- WEB artifacts:
- `assets.WitnetOracle`
- `assets.WitnetPriceFeeds`
- `assets.WitOracle`
- `assets.WitPriceFeeds`
- `assets.WitnetPriceRouteSolver`
- `assets.WitnetRequest`
- `assets.WitnetRequestBytecodes`
- `assets.WitnetRequestFactory`
- `assets.WitnetRequestTemplate`
- `assets.WitOracleRequest`
- `assets.WitOracleRadonRegistry`
- `assets.WitOracleRequestFactory`
- `assets.WitOracleRequestTemplate`
- `assets.WitnetUpgrableBase`

### `require("witnet-solidity-bridge/utils")`
Expand Down
23 changes: 9 additions & 14 deletions contracts/WitnetFeeds.sol → contracts/WitFeeds.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,22 @@

pragma solidity >=0.7.0 <0.9.0;

import "./interfaces/IFeeds.sol";
import "./interfaces/IWitnetFeeds.sol";
import "./interfaces/IWitnetFeedsAdmin.sol";
import "./interfaces/IWitFeeds.sol";
import "./interfaces/IWitFeedsEvents.sol";
import "./interfaces/IWitOracleAppliance.sol";

import "ado-contracts/contracts/interfaces/IERC2362.sol";

abstract contract WitnetFeeds
abstract contract WitFeeds
is
IERC2362,
IFeeds,
IWitnetFeeds,
IWitnetFeedsAdmin,
IWitnetOracleEvents
IWitFeeds,
IWitFeedsEvents,
IWitOracleAppliance,
IWitOracleEvents
{
Witnet.RadonDataTypes immutable public override dataType;

function class() virtual external view returns (string memory);
function specs() virtual external view returns (bytes4);
function witnet() virtual external view returns (WitnetOracle);
bytes32 immutable internal __prefix;

constructor(
Witnet.RadonDataTypes _dataType,
Expand All @@ -31,8 +28,6 @@ abstract contract WitnetFeeds
__prefix = Witnet.toBytes32(bytes(_prefix));
}

bytes32 immutable internal __prefix;

function prefix() override public view returns (string memory) {
return Witnet.toString(__prefix);
}
Expand Down
19 changes: 19 additions & 0 deletions contracts/WitOracle.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// SPDX-License-Identifier: MIT

pragma solidity >=0.7.0 <0.9.0;

import "./WitOracleRadonRegistry.sol";
import "./WitOracleRequestFactory.sol";

import "./interfaces/IWitAppliance.sol";
import "./interfaces/IWitOracle.sol";
import "./interfaces/IWitOracleEvents.sol";

/// @title Witnet Request Board functionality base contract.
/// @author The Witnet Foundation.
abstract contract WitOracle
is
IWitAppliance,
IWitOracle,
IWitOracleEvents
{}
15 changes: 15 additions & 0 deletions contracts/WitOracleRadonRegistry.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// SPDX-License-Identifier: MIT

pragma solidity >=0.7.0 <0.9.0;
pragma experimental ABIEncoderV2;

import "./interfaces/IWitAppliance.sol";
import "./interfaces/IWitOracleRadonRegistry.sol";
import "./interfaces/IWitOracleRadonRegistryEvents.sol";

abstract contract WitOracleRadonRegistry
is
IWitAppliance,
IWitOracleRadonRegistry,
IWitOracleRadonRegistryEvents
{}
13 changes: 13 additions & 0 deletions contracts/WitOracleRequest.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// SPDX-License-Identifier: MIT

pragma solidity >=0.7.0 <0.9.0;
pragma experimental ABIEncoderV2;

import "./interfaces/IWitOracleAppliance.sol";
import "./interfaces/IWitOracleRequest.sol";

abstract contract WitOracleRequest
is
IWitOracleAppliance,
IWitOracleRequest
{}
17 changes: 17 additions & 0 deletions contracts/WitOracleRequestFactory.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// SPDX-License-Identifier: MIT

pragma solidity >=0.7.0 <0.9.0;
pragma experimental ABIEncoderV2;

import "./interfaces/IWitOracleAppliance.sol";
import "./interfaces/IWitOracleRadonRegistryEvents.sol";
import "./interfaces/IWitOracleRequestFactory.sol";
import "./interfaces/IWitOracleRequestFactoryEvents.sol";

abstract contract WitOracleRequestFactory
is
IWitOracleAppliance,
IWitOracleRadonRegistryEvents,
IWitOracleRequestFactory,
IWitOracleRequestFactoryEvents
{}
17 changes: 17 additions & 0 deletions contracts/WitOracleRequestTemplate.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// SPDX-License-Identifier: MIT

pragma solidity >=0.7.0 <0.9.0;
pragma experimental ABIEncoderV2;

import "./interfaces/IWitOracleAppliance.sol";
import "./interfaces/IWitOracleRadonRegistryEvents.sol";
import "./interfaces/IWitOracleRequestFactoryEvents.sol";
import "./interfaces/IWitOracleRequestTemplate.sol";

abstract contract WitOracleRequestTemplate
is
IWitOracleAppliance,
IWitOracleRadonRegistryEvents,
IWitOracleRequestFactoryEvents,
IWitOracleRequestTemplate
{}
21 changes: 21 additions & 0 deletions contracts/WitPriceFeeds.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// SPDX-License-Identifier: MIT

pragma solidity >=0.7.0 <0.9.0;

import "./WitFeeds.sol";
import "./interfaces/IWitPriceFeeds.sol";

/// @title WitPriceFeeds: Price Feeds live repository reliant on the Witnet Oracle blockchain.
/// @author The Witnet Foundation.
abstract contract WitPriceFeeds
is
WitFeeds,
IWitPriceFeeds
{
constructor()
WitFeeds(
Witnet.RadonDataTypes.Integer,
"Price-"
)
{}
}
16 changes: 16 additions & 0 deletions contracts/WitRandomness.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// SPDX-License-Identifier: MIT

pragma solidity >=0.8.0 <0.9.0;

import "./interfaces/IWitOracleAppliance.sol";
import "./interfaces/IWitOracleEvents.sol";
import "./interfaces/IWitRandomness.sol";
import "./interfaces/IWitRandomnessEvents.sol";

abstract contract WitRandomness
is
IWitOracleAppliance,
IWitOracleEvents,
IWitRandomness,
IWitRandomnessEvents
{}
24 changes: 0 additions & 24 deletions contracts/WitnetOracle.sol

This file was deleted.

22 changes: 0 additions & 22 deletions contracts/WitnetPriceFeeds.sol

This file was deleted.

17 changes: 0 additions & 17 deletions contracts/WitnetRandomness.sol

This file was deleted.

19 changes: 0 additions & 19 deletions contracts/WitnetRequest.sol

This file was deleted.

16 changes: 0 additions & 16 deletions contracts/WitnetRequestBytecodes.sol

This file was deleted.

18 changes: 0 additions & 18 deletions contracts/WitnetRequestFactory.sol

This file was deleted.

35 changes: 0 additions & 35 deletions contracts/WitnetRequestTemplate.sol

This file was deleted.

Loading