diff --git a/contracts/WitPriceFeeds.sol b/contracts/WitPriceFeeds.sol index f8124f13..04e704e7 100644 --- a/contracts/WitPriceFeeds.sol +++ b/contracts/WitPriceFeeds.sol @@ -5,7 +5,7 @@ pragma solidity >=0.8.0 <0.9.0; import "./WitFeeds.sol"; import "./interfaces/IWitPriceFeeds.sol"; -/// @title WitPriceFeeds: Price Feeds live repository reliant on the Wit/oracle blockchain. +/// @title WitPriceFeeds: Price Feeds live repository reliant on the Wit/Oracle blockchain. /// @author The Witnet Foundation. abstract contract WitPriceFeeds is diff --git a/contracts/apps/WitPriceFeedsUpgradable.sol b/contracts/apps/WitPriceFeedsUpgradable.sol index 8b5bad6e..6d948f14 100644 --- a/contracts/apps/WitPriceFeedsUpgradable.sol +++ b/contracts/apps/WitPriceFeedsUpgradable.sol @@ -13,7 +13,7 @@ import "../interfaces/IWitOracleLegacy.sol"; import "../patterns/Ownable2Step.sol"; -/// @title WitPriceFeeds: Price Feeds live repository reliant on the Wit/oracle blockchain. +/// @title WitPriceFeeds: Price Feeds live repository reliant on the Wit/Oracle blockchain. /// @author Guillermo Díaz contract WitPriceFeedsUpgradable @@ -131,6 +131,12 @@ contract WitPriceFeedsUpgradable }); } } + // for (uint _ix = 0; _ix < __storage().ids.length; _ix ++) { + // bytes4 _feedId = __storage().ids[_ix]; + // WitPriceFeedsDataLib.Record storage __record = WitPriceFeedsDataLib.seekRecord(_feedId); + // __record.lastValidQueryId = Witnet.QueryId.wrap(0); + // __record.latestUpdateQueryId = Witnet.QueryId.wrap(0); + // } } @@ -165,8 +171,9 @@ contract WitPriceFeedsUpgradable public view returns (uint) { - return (IWitOracleLegacy(address(witOracle)).estimateBaseFee(_evmGasPrice, 32) - * (100 + __baseFeeOverheadPercentage) + return ( + witOracle.estimateBaseFee(_evmGasPrice) + * (100 + __baseFeeOverheadPercentage) ) / 100; } diff --git a/contracts/apps/WitRandomnessV21.sol b/contracts/apps/WitRandomnessV21.sol index 9215ff4d..fa2ac122 100644 --- a/contracts/apps/WitRandomnessV21.sol +++ b/contracts/apps/WitRandomnessV21.sol @@ -7,7 +7,7 @@ import "../interfaces/IWitRandomnessAdmin.sol"; import "../mockups/UsingWitOracle.sol"; import "../patterns/Ownable2Step.sol"; -/// @title WitRandomnessV21: Unmalleable and provably-fair randomness generation based on the Wit/oracle v2.*. +/// @title WitRandomnessV21: Unmalleable and provably-fair randomness generation based on the Wit/Oracle v2.*. /// @author The Witnet Foundation. contract WitRandomnessV21 is @@ -35,8 +35,8 @@ contract WitRandomnessV21 mapping (Witnet.BlockNumber => Randomize) randomize_; } - /// @notice Unique identifier of the RNG data request used on the Wit/oracle blockchain for solving randomness. - /// @dev Can be used to track all randomness requests solved so far on the Wit/oracle blockchain. + /// @notice Unique identifier of the RNG data request used on the Wit/Oracle blockchain for solving randomness. + /// @dev Can be used to track all randomness requests solved so far on the Wit/Oracle blockchain. bytes32 immutable public override witOracleQueryRadHash; constructor( @@ -112,7 +112,7 @@ contract WitRandomnessV21 } /// @notice Retrieves the result of keccak256-hashing the given block number with the randomness value - /// @notice generated by the Wit/oracle blockchain in response to the first non-errored randomize request solved + /// @notice generated by the Wit/Oracle blockchain in response to the first non-errored randomize request solved /// @notice after such block number. /// @dev Reverts if: /// @dev i. no `randomize()` was requested on neither the given block, nor afterwards. @@ -133,7 +133,7 @@ contract WitRandomnessV21 } /// @notice Retrieves the actual unique hash and timestamp of the witnessing commit/reveal act that took - /// @notice place in the Wit/oracle sidechain in response to the first non-errored randomize request + /// @notice place in the Wit/Oracle sidechain in response to the first non-errored randomize request /// @notice solved after the given block number. /// @dev Reverts if: /// @dev i. no `randomize()` was requested on neither the given block, nor afterwards. @@ -169,7 +169,7 @@ contract WitRandomnessV21 } /// @notice Retrieves metadata related to the randomize request that got posted to the - /// @notice Wit/oracle contract on the given block number. + /// @notice Wit/Oracle contract on the given block number. /// @dev Returns zero values if no randomize request was actually posted on the given block. /// @return _queryId Identifier of the underlying Witnet query created on the given block number. /// @return _prevRandomizeBlock Block number in which a randomize request got posted just before this one. 0 if none. @@ -343,7 +343,7 @@ contract WitRandomnessV21 } /// @notice Requests the Witnet oracle to generate an EVM-agnostic and trustless source of randomness. - /// @dev Only one randomness request per block will be actually posted to the Wit/oracle. + /// @dev Only one randomness request per block will be actually posted to the Wit/Oracle. /// @return Funds actually paid as randomize fee. function randomize() external payable @@ -354,7 +354,7 @@ contract WitRandomnessV21 } /// @notice Requests the Witnet oracle to generate an EVM-agnostic and trustless source of randomness. - /// @dev Only one randomness request per block will be actually posted to the Wit/oracle. + /// @dev Only one randomness request per block will be actually posted to the Wit/Oracle. /// @dev Reverts if given SLA security parameters are below witOracleDefaultQuerySLA(). /// @return Funds actually paid as randomize fee. function randomize(Witnet.QuerySLA calldata _querySLA) @@ -369,7 +369,7 @@ contract WitRandomnessV21 return __postRandomizeQuery(_querySLA); } - /// @notice Returns the SLA parameters required for the Wit/oracle blockchain to fulfill + /// @notice Returns the SLA parameters required for the Wit/Oracle blockchain to fulfill /// @notice when solving randomness requests: /// @notice - number of witnessing nodes contributing to randomness generation /// @notice - reward in $nanoWIT received by every contributing node in the Witnet blockchain diff --git a/contracts/core/base/WitOracleBase.sol b/contracts/core/base/WitOracleBase.sol index 083b15be..e19e6519 100644 --- a/contracts/core/base/WitOracleBase.sol +++ b/contracts/core/base/WitOracleBase.sol @@ -187,11 +187,11 @@ abstract contract WitOracleBase /// @notice Estimate the extra reward (i.e. over the base fee) to be paid when posting a new /// @notice data query in order to avoid getting provable "too low incentives" results from - /// @notice the Wit/oracle blockchain. + /// @notice the Wit/Oracle blockchain. /// @dev The extra fee gets calculated in proportion to: /// @param _evmGasPrice Tentative EVM gas price at the moment the query result is ready. - /// @param _evmWitPrice Tentative nanoWit price in Wei at the moment the query is solved on the Wit/oracle blockchain. - /// @param _querySLA The query SLA data security parameters as required for the Wit/oracle blockchain. + /// @param _evmWitPrice Tentative nanoWit price in Wei at the moment the query is solved on the Wit/Oracle blockchain. + /// @param _querySLA The query SLA data security parameters as required for the Wit/Oracle blockchain. function estimateExtraFee( uint256 _evmGasPrice, uint256 _evmWitPrice, @@ -400,7 +400,7 @@ abstract contract WitOracleBase ); } - /// @notice Enables data requesters to settle the actual validators in the Wit/oracle + /// @notice Enables data requesters to settle the actual validators in the Wit/Oracle /// @notice sidechain that will be entitled whatsover to solve /// @notice data requests, as presumed to be capable of supporting some given `Wit2.Capability`. function settleMyOwnCapableCommittee( diff --git a/contracts/core/base/WitOracleBaseTrustless.sol b/contracts/core/base/WitOracleBaseTrustless.sol index a64e623d..281b618f 100644 --- a/contracts/core/base/WitOracleBaseTrustless.sol +++ b/contracts/core/base/WitOracleBaseTrustless.sol @@ -270,7 +270,7 @@ abstract contract WitOracleBaseTrustless // ================================================================================================================ // --- Overrides IWitOracle (trustlessly) ------------------------------------------------------------------------- - /// @notice Verify the data report was actually produced by the Wit/oracle sidechain, + /// @notice Verify the data report was actually produced by the Wit/Oracle sidechain, /// @notice reverting if the verification fails, or returning the self-contained Witnet.Result value. function pushData( Witnet.DataPushReport calldata _report, diff --git a/contracts/core/trustable/WitOracleTrustableOvm2.sol b/contracts/core/trustable/WitOracleTrustableOvm2.sol index 872e123a..9b086302 100644 --- a/contracts/core/trustable/WitOracleTrustableOvm2.sol +++ b/contracts/core/trustable/WitOracleTrustableOvm2.sol @@ -87,11 +87,11 @@ contract WitOracleTrustableOvm2 /// @notice Estimate the extra reward (i.e. over the base fee) to be paid when posting a new /// @notice data query in order to avoid getting provable "too low incentives" results from - /// @notice the Wit/oracle blockchain. + /// @notice the Wit/Oracle blockchain. /// @dev The extra fee gets calculated in proportion to: /// @param _evmGasPrice Tentative EVM gas price at the moment the query result is ready. - /// @param _evmWitPrice Tentative nanoWit price in Wei at the moment the query is solved on the Wit/oracle blockchain. - /// @param _querySLA The query SLA data security parameters as required for the Wit/oracle blockchain. + /// @param _evmWitPrice Tentative nanoWit price in Wei at the moment the query is solved on the Wit/Oracle blockchain. + /// @param _querySLA The query SLA data security parameters as required for the Wit/Oracle blockchain. function estimateExtraFee( uint256 _evmGasPrice, uint256 _evmWitPrice, diff --git a/contracts/interfaces/IWitOracle.sol b/contracts/interfaces/IWitOracle.sol index 0b3160e1..5615b127 100644 --- a/contracts/interfaces/IWitOracle.sol +++ b/contracts/interfaces/IWitOracle.sol @@ -27,11 +27,11 @@ interface IWitOracle { /// @notice Estimate the extra reward (i.e. over the base fee) to be paid when posting a new /// @notice data query in order to avoid getting provable "too low incentives" results from - /// @notice the Wit/oracle blockchain. + /// @notice the Wit/Oracle blockchain. /// @dev The extra fee gets calculated in proportion to: /// @param evmGasPrice Tentative EVM gas price at the moment the query result is ready. - /// @param evmWitPrice Tentative nanoWit price in Wei at the moment the query is solved on the Wit/oracle blockchain. - /// @param querySLA The query SLA data security parameters as required for the Wit/oracle blockchain. + /// @param evmWitPrice Tentative nanoWit price in Wei at the moment the query is solved on the Wit/Oracle blockchain. + /// @param querySLA The query SLA data security parameters as required for the Wit/Oracle blockchain. function estimateExtraFee(uint256 evmGasPrice, uint256 evmWitPrice, Witnet.QuerySLA calldata querySLA) external view returns (uint256); /// @notice Returns next query id to be generated by the Witnet Request Board. @@ -60,21 +60,21 @@ interface IWitOracle { /// @notice Get current status of all given query ids. function getQueryStatusBatch(Witnet.QueryId[] calldata) external view returns (Witnet.QueryStatus[] memory); - /// @notice Request real world data from the Wit/oracle sidechain. + /// @notice Request real world data from the Wit/Oracle sidechain. /// @notice The paid fee is escrowed as a reward for the reporter that eventually relays back - /// @notice a valid query result from the Wit/oracle sidechain. + /// @notice a valid query result from the Wit/Oracle sidechain. /// @notice Query results are CBOR-encoded, and can contain either some data, or an error. /// @dev Reasons to revert: /// @dev - the data request's RAD hash was not previously verified into the WitOracleRadonRegistry contract; /// @dev - invalid query SLA parameters were provided; /// @dev - insufficient value is paid as reward. - /// @param drRadHash The RAD hash of the data request to be solved by Wit/oracle sidechain. + /// @param drRadHash The RAD hash of the data request to be solved by Wit/Oracle sidechain. function postQuery(bytes32 drRadHash, Witnet.QuerySLA calldata) external payable returns (Witnet.QueryId); - /// @notice Request real world data from the Wit/oracle sidechain. + /// @notice Request real world data from the Wit/Oracle sidechain. /// @notice The paid fee is escrowed as a reward for the reporter that eventually relays back - /// @notice a valid query result from the Wit/oracle sidechain. + /// @notice a valid query result from the Wit/Oracle sidechain. /// @notice The Witnet-provable result will be reported directly to the requesting contract. /// @notice Query results are CBOR-encoded, and can contain either some data, or an error. /// @dev Reasons to revert: @@ -82,13 +82,13 @@ interface IWitOracle { /// @dev - invalid query SLA parameters were provided; /// @dev - insufficient value is paid as reward. /// @dev - passed `consumer` is not a contract implementing the IWitOracleConsumer interface; - /// @param drRadHash The RAD hash of the data request to be solved by Wit/oracle sidechain. + /// @param drRadHash The RAD hash of the data request to be solved by Wit/Oracle sidechain. function postQuery(bytes32 drRadHash, Witnet.QuerySLA calldata, Witnet.QueryCallback calldata) external payable returns (Witnet.QueryId); - /// @notice Request real world data from the Wit/oracle sidechain. + /// @notice Request real world data from the Wit/Oracle sidechain. /// @notice The paid fee is escrowed as a reward for the reporter that eventually relays back - /// @notice a valid query result from the Wit/oracle sidechain. + /// @notice a valid query result from the Wit/Oracle sidechain. /// @notice The Witnet-provable result will be reported directly to the requesting contract. /// @notice Query results are CBOR-encoded, and can contain either some data, or an error. /// @dev Reasons to revert: @@ -105,7 +105,7 @@ interface IWitOracle { /// @notice calling postRequest(bytes32,..) methods. function registry() external view returns (WitOracleRadonRegistry); - /// @notice Enables data requesters to settle the actual validators in the Wit/oracle + /// @notice Enables data requesters to settle the actual validators in the Wit/Oracle /// @notice sidechain that will be entitled to solve data requests requiring to /// @notice support the specified `Wit2.Capability`. function settleMyOwnCapableCommittee(Witnet.QueryCapability, Witnet.QueryCapabilityMember[] calldata) external; diff --git a/contracts/interfaces/IWitOracleRadonRegistry.sol b/contracts/interfaces/IWitOracleRadonRegistry.sol index bcf0c054..d5487724 100644 --- a/contracts/interfaces/IWitOracleRadonRegistry.sol +++ b/contracts/interfaces/IWitOracleRadonRegistry.sol @@ -72,7 +72,7 @@ interface IWitOracleRadonRegistry { /// Verifies and registers the given sequence of dataset filters and reducing function to be /// potentially used as either Aggregate or Tally reducers within the resolution workflow - /// of Radon Requests in the Wit/oracle blockchain. Returns a unique hash that identifies the + /// of Radon Requests in the Wit/Oracle blockchain. Returns a unique hash that identifies the /// given Radon Reducer in the registry. Reverts if unsupported reducing or filtering methods /// are specified. function verifyRadonReducer(Witnet.RadonReducer calldata reducer) external returns (bytes32 hash); diff --git a/contracts/interfaces/IWitOracleTrustless.sol b/contracts/interfaces/IWitOracleTrustless.sol index b22cb611..c25f01f5 100644 --- a/contracts/interfaces/IWitOracleTrustless.sol +++ b/contracts/interfaces/IWitOracleTrustless.sol @@ -6,7 +6,7 @@ import "../libs/Witnet.sol"; interface IWitOracleTrustless { - /// @notice Verify the data report was actually produced by the Wit/oracle sidechain, + /// @notice Verify the data report was actually produced by the Wit/Oracle sidechain, /// @notice reverting if the verification fails, or returning the self-contained Witnet.Result value. function pushData( Witnet.DataPushReport calldata report, diff --git a/contracts/interfaces/IWitRandomness.sol b/contracts/interfaces/IWitRandomness.sol index 56c4e4df..ea15561c 100644 --- a/contracts/interfaces/IWitRandomness.sol +++ b/contracts/interfaces/IWitRandomness.sol @@ -13,7 +13,7 @@ interface IWitRandomness { function estimateRandomizeFee(uint256 evmGasPrice) external view returns (uint256); /// @notice Retrieves the result of keccak256-hashing the given block number with the randomness value - /// @notice generated by the Wit/oracle blockchain in response to the first non-failing randomize request solved + /// @notice generated by the Wit/Oracle blockchain in response to the first non-failing randomize request solved /// @notice after such block number. /// @dev Reverts if: /// @dev i. no `randomize()` was requested on neither the given block, nor afterwards. @@ -23,7 +23,7 @@ interface IWitRandomness { function fetchRandomnessAfter(Witnet.BlockNumber blockNumber) external view returns (bytes32); /// @notice Retrieves the actual random value, unique hash and timestamp of the witnessing commit/reveal act that took - /// @notice place in the Wit/oracle blockchain in response to the first non-failing randomize request + /// @notice place in the Wit/Oracle blockchain in response to the first non-failing randomize request /// @notice solved after the given block number. /// @dev Reverts if: /// @dev i. no `randomize()` was requested on neither the given block, nor afterwards. @@ -41,7 +41,7 @@ interface IWitRandomness { function getLastRandomizeBlock() external view returns (Witnet.BlockNumber); /// @notice Retrieves metadata related to the randomize request that got posted to the - /// @notice Wit/oracle contract on the given block number. + /// @notice Wit/Oracle contract on the given block number. /// @dev Returns zero values if no randomize request was actually posted on the given block. /// @return queryId Identifier of the underlying Witnet query created on the given block number. /// @return prevRandomizeBlock Block number in which a randomize request got posted just before this one. 0 if none. @@ -92,20 +92,20 @@ interface IWitRandomness { function random(uint32 range, uint256 nonce, Witnet.BlockNumber blockNumber) external view returns (uint32); /// @notice Requests the Witnet oracle to generate an EVM-agnostic and trustless source of randomness. - /// @dev Only one randomness request per block will be actually posted to the Wit/oracle. + /// @dev Only one randomness request per block will be actually posted to the Wit/Oracle. /// @dev Unused funds will be transferred back to the `msg.sender`. /// @return Funds actually paid as randomize fee. function randomize() external payable returns (uint256); /// @notice Requests the Witnet oracle to generate an EVM-agnostic and trustless source of randomness, /// @notice while fulfilling the given SLA data security parameters. - /// @dev Only one randomness request per block will be actually posted to the Wit/oracle. + /// @dev Only one randomness request per block will be actually posted to the Wit/Oracle. /// @dev Unused funds will be transferred back to the `msg.sender`. /// @dev Passed SLA security parameters must be equal or greater than `witOracleDefaultQuerySLA()`. /// @return Funds actually paid as randomize fee. function randomize(Witnet.QuerySLA calldata) external payable returns (uint256); - /// @notice Returns the SLA parameters required for the Wit/oracle blockchain to fulfill + /// @notice Returns the SLA parameters required for the Wit/Oracle blockchain to fulfill /// @notice when solving randomness requests: /// @notice - number of witnessing nodes contributing to randomness generation /// @notice - reward in $nanoWIT received per witnessing node in the Witnet blockchain diff --git a/contracts/libs/WitnetBN254.sol b/contracts/libs/WitnetBN254.sol deleted file mode 100644 index 8fde29e7..00000000 --- a/contracts/libs/WitnetBN254.sol +++ /dev/null @@ -1,110 +0,0 @@ -// SPDX-License-Identifier: MIT -// solium-disable security/no-assign-params - -pragma solidity >=0.8.0 <0.9.0; - -/// @title Elliptic curve operations on twist points on BN254-G2 -/// @dev Adaptation of https://github.com/musalbas/solidity-BN256G2 -library WitnetBN254 { - - using WitnetBN254 for Fq2; - using WitnetBN254 for Point; - - uint256 internal constant F_MODULUS = 0x30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd47; - - uint256 internal constant TWIST_BX = 0x2b149d40ceb8aaae81be18991be06ac3b5b4c5e559dbefa33267e6dc24a138e5; - uint256 internal constant TWIST_BY = 0x009713b03af0fed4cd2cafadeed8fdf4a74fa084e52d1852e4a2bd0685c315d2; - - // This is the generator negated, to use for pairing - uint256 public constant G2_NEG_X_RE = 0x198E9393920D483A7260BFB731FB5D25F1AA493335A9E71297E485B7AEF312C2; - uint256 public constant G2_NEG_X_IM = 0x1800DEEF121F1E76426A00665E5C4479674322D4F75EDADD46DEBD5CD992F6ED; - uint256 public constant G2_NEG_Y_RE = 0x275dc4a288d1afb3cbb1ac09187524c7db36395df7be3b99e673b13a075a65ec; - uint256 public constant G2_NEG_Y_IM = 0x1d9befcd05a5323e6da4d435f3b617cdb3af83285c2df711ef39c01571827f9d; - - struct Fq2 { - uint256 real; - uint256 imag; - } - - struct Point { - Fq2 x; - Fq2 y; - } - - function _addmod(uint256 a, uint256 b) private pure returns (uint256) { - return uint256(addmod(a, b, F_MODULUS)); - } - - function _invmod(uint256 a) private view returns (uint256 _result) { - bool _success; - assembly { - let _freemem := mload(0x40) - mstore(_freemem, 0x20) - mstore(add(_freemem,0x20), 0x20) - mstore(add(_freemem,0x40), 0x20) - mstore(add(_freemem,0x60), a) - mstore(add(_freemem,0x80), sub(F_MODULUS, 2)) - mstore(add(_freemem,0xA0), F_MODULUS) - _success := staticcall(sub(gas(), 2000), 5, _freemem, 0xC0, _freemem, 0x20) - _result := mload(_freemem) - } - assert(_success); - } - - function _mulmod(uint256 a, uint256 b) private pure returns (uint256) { - return uint256(mulmod(a, b, F_MODULUS)); - } - - function _submod(uint256 a, uint256 b) private pure returns (uint256) { - return uint256(addmod(a, F_MODULUS - b, F_MODULUS)); - } - - function add(Fq2 memory a, Fq2 memory b) internal pure returns (Fq2 memory) { - return Fq2( - _addmod(a.real, b.real), - _addmod(a.imag, b.imag) - ); - } - - function div(Fq2 memory d, Fq2 memory c) internal view returns (Fq2 memory) { - return mul(d, inv(c)); - } - - function equals(Fq2 memory a, Fq2 memory b) internal pure returns (bool) { - return ( - a.real == b.real - && a.imag == b.imag - ); - } - - function inv(Fq2 memory a) internal view returns (Fq2 memory) { - uint256 _inv = _invmod(_addmod(_mulmod(a.imag, a.imag), _mulmod(a.real, a.real))); - return Fq2( - _mulmod(a.real, _inv), - F_MODULUS - mulmod(a.imag, _inv, F_MODULUS) - ); - } - - function mul(Fq2 memory a, Fq2 memory b) internal pure returns (Fq2 memory) { - return Fq2( - _submod(_mulmod(a.real, b.real), _mulmod(a.imag, b.imag)), - _addmod(_mulmod(a.real, b.imag), _mulmod(a.imag, b.real)) - ); - } - - function mul(Fq2 memory a, uint256 k) internal pure returns (Fq2 memory) { - return Fq2( - _mulmod(a.real, k), - _mulmod(a.imag, k) - ); - } - - function sub(Fq2 memory a, Fq2 memory b) internal pure returns (Fq2 memory) { - return Fq2( - _submod(a.real, b.real), - _submod(a.imag, b.imag) - ); - } - - // WIP ... -} \ No newline at end of file diff --git a/contracts/mockups/UsingWitOracle.sol b/contracts/mockups/UsingWitOracle.sol index b208375d..000dfe29 100644 --- a/contracts/mockups/UsingWitOracle.sol +++ b/contracts/mockups/UsingWitOracle.sol @@ -23,7 +23,7 @@ abstract contract UsingWitOracle /// @dev the Witnet blockchain levels, respectivelly. uint16 internal __witOracleBaseFeeOverheadPercentage; - /// @notice Default SLA data security parameters to be fulfilled by the Wit/oracle blockchain + /// @notice Default SLA data security parameters to be fulfilled by the Wit/Oracle blockchain /// @notice when solving a data request. function witOracleDefaultQuerySLA() virtual public view returns (Witnet.QuerySLA memory) { return __witOracleDefaultQuerySLA; @@ -31,7 +31,7 @@ abstract contract UsingWitOracle Witnet.QuerySLA internal __witOracleDefaultQuerySLA; /// @dev Provides a convenient way for client contracts extending this to block the execution of the main logic of the - /// @dev contract until a particular request has been successfully solved and reported from the Wit/oracle blockchain, + /// @dev contract until a particular request has been successfully solved and reported from the Wit/Oracle blockchain, /// @dev either with an error or successfully. modifier witOracleQuerySolved(Witnet.QueryId _queryId) { Witnet.QueryStatus _queryStatus = _witOracleCheckQueryStatus(_queryId); @@ -62,7 +62,7 @@ abstract contract UsingWitOracle __witOracleBaseFeeOverheadPercentage = 33; // defaults to 33% } - /// @dev Check if given query was already reported back from the Wit/oracle blockchain. + /// @dev Check if given query was already reported back from the Wit/Oracle blockchain. /// @param _id The unique identifier of a previously posted data request. function _witOracleCheckQueryStatus(Witnet.QueryId _id) internal view diff --git a/contracts/mockups/UsingWitOracleRequest.sol b/contracts/mockups/UsingWitOracleRequest.sol index 5e94e7cb..d7a1cf3a 100644 --- a/contracts/mockups/UsingWitOracleRequest.sol +++ b/contracts/mockups/UsingWitOracleRequest.sol @@ -12,7 +12,7 @@ abstract contract UsingWitOracleRequest /// @notice update pulled from this contract. WitOracleRequest immutable public witOracleRequest; - /// @dev Immutable RAD hash of the underlying data request being solved on the Wit/oracle blockchain + /// @dev Immutable RAD hash of the underlying data request being solved on the Wit/Oracle blockchain /// @dev upon every fresh data update pulled from this contract. bytes32 immutable internal __witOracleRequestRadHash; @@ -33,7 +33,7 @@ abstract contract UsingWitOracleRequest __witOracleBaseFeeOverheadPercentage = _baseFeeOverheadPercentage; } - /// @dev Pulls a data update from the Wit/oracle blockchain based on the underlying `witOracleRequest`, + /// @dev Pulls a data update from the Wit/Oracle blockchain based on the underlying `witOracleRequest`, /// @dev and the default `__witOracleDefaultQuerySLA` data security parameters. /// @param _queryEvmReward The exact EVM reward passed to the WitOracle when pulling the data update. function __witOraclePostQuery( @@ -47,10 +47,10 @@ abstract contract UsingWitOracleRequest ); } - /// @dev Pulls a data update from the Wit/oracle blockchain based on the underlying `witOracleRequest`, + /// @dev Pulls a data update from the Wit/Oracle blockchain based on the underlying `witOracleRequest`, /// @dev and the given `_querySLA` data security parameters. /// @param _queryEvmReward The exact EVM reward passed to the WitOracle when pulling the data update. - /// @param _querySLA The required SLA data security params for the Wit/oracle blockchain to accomplish. + /// @param _querySLA The required SLA data security params for the Wit/Oracle blockchain to accomplish. function __witOraclePostQuery( uint256 _queryEvmReward, Witnet.QuerySLA memory _querySLA diff --git a/contracts/mockups/UsingWitOracleRequestTemplate.sol b/contracts/mockups/UsingWitOracleRequestTemplate.sol index da5ca8d6..d402f2ec 100644 --- a/contracts/mockups/UsingWitOracleRequestTemplate.sol +++ b/contracts/mockups/UsingWitOracleRequestTemplate.sol @@ -29,7 +29,7 @@ abstract contract UsingWitOracleRequestTemplate __witOracleBaseFeeOverheadPercentage = _baseFeeOverheadPercentage; } - /// @dev Verify and register into the witOracle() registry a Wit/oracle compliant data request based + /// @dev Verify and register into the witOracle() registry a Wit/Oracle compliant data request based /// @dev on the underlying `witOracleRequestTemplate`. Returns the RAD hash of the successfully verifed /// @dev data request. Reverts if the number of given parameters don't match as required by the underlying /// @dev template's parameterized data sources (i.e. Radon Retrievals). @@ -41,7 +41,7 @@ abstract contract UsingWitOracleRequestTemplate return witOracleRequestTemplate.verifyRadonRequest(_witOracleRequestArgs); } - /// @dev Pulls a fresh update from the Wit/oracle blockchain of some pre-verified Wit/oracle compliant + /// @dev Pulls a fresh update from the Wit/Oracle blockchain of some pre-verified Wit/Oracle compliant /// @dev data request, and the default `__witOracleDefaultQuerySLA` data security parameters. /// @dev Returns some unique query id. /// @param _queryEvmReward The exact EVM reward passed to the WitOracle bridge when pulling the data update. @@ -59,11 +59,11 @@ abstract contract UsingWitOracleRequestTemplate ); } - /// @dev Pulls a fresh update from the Wit/oracle blockchain of some pre-verified Wit/oracle compliant + /// @dev Pulls a fresh update from the Wit/Oracle blockchain of some pre-verified Wit/Oracle compliant /// @dev data request, and the given `_querSLA` data security parameters. Returns some unique query id. /// @param _queryEvmReward The exact EVM reward passed to the WitOracle bridge when pulling the data update. /// @param _queryRadHash RAD hash of some pre-verified data request in the witOracle()'s registry. - /// @param _querySLA The required SLA data security params for the Wit/oracle blockchain to accomplish. + /// @param _querySLA The required SLA data security params for the Wit/Oracle blockchain to accomplish. function __witOraclePostQuery( uint256 _queryEvmReward, bytes32 _queryRadHash, @@ -79,7 +79,7 @@ abstract contract UsingWitOracleRequestTemplate ); } - /// @dev Pulls a fresh update from the Wit/oracle blockchain based on some data request built out + /// @dev Pulls a fresh update from the Wit/Oracle blockchain based on some data request built out /// @dev of the underlying `witOracleRequestTemplate`, and the default `__witOracleDefaultQuerySLA` /// @dev data security parameters. Returns the unique RAD hash of the just-built data request, and some /// @dev unique query id. Reverts if the number of given parameters don't match as required by the @@ -99,13 +99,13 @@ abstract contract UsingWitOracleRequestTemplate ); } - /// @dev Pulls a fresh update from the Wit/oracle blockchain based on some data request built out + /// @dev Pulls a fresh update from the Wit/Oracle blockchain based on some data request built out /// @dev of the underlying `witOracleRequestTemplate`, and the given `_querSLA` data security parameters. /// @dev Returns the unique RAD hash of the just-built data request, and some unique query id. /// @dev Reverts if the number of given parameters don't match as required by the underlying template's /// @dev parameterized data sources (i.e. Radon Retrievals). /// @param _queryEvmReward The exact EVM reward passed to the WitOracle bridge when pulling the data update. - /// @param _querySLA The required SLA data security params for the Wit/oracle blockchain to accomplish. + /// @param _querySLA The required SLA data security params for the Wit/Oracle blockchain to accomplish. /// @param _witOracleRequestArgs Parameters passed to the `witOracleRequestTemplate` for building a new data request. function __witOraclePostQuery( string[][] memory _witOracleRequestArgs, diff --git a/contracts/mockups/WitOracleRandomnessConsumer.sol b/contracts/mockups/WitOracleRandomnessConsumer.sol index 2134feca..4796a969 100644 --- a/contracts/mockups/WitOracleRandomnessConsumer.sol +++ b/contracts/mockups/WitOracleRandomnessConsumer.sol @@ -73,12 +73,12 @@ abstract contract WitOracleRandomnessConsumer } /// @dev Helper function for decoding randomness seed embedded within a CBOR-encoded result - /// @dev as provided from the Wit/oracle blockchain. + /// @dev as provided from the Wit/Oracle blockchain. function _witOracleRandomizeSeedFromResultValue(WitnetCBOR.CBOR calldata cborValue) internal pure returns (bytes32) { return cborValue.readBytes().toBytes32(); } - /// @dev Trigger some randomness request to be solved by the Wit/oracle blockchain, by paying the + /// @dev Trigger some randomness request to be solved by the Wit/Oracle blockchain, by paying the /// @dev exact amount of `_queryEvmReward` of the underlying WitOracle bridge contract, and based /// @dev on the `__witOracleDefaultQuerySLA` data security parameters. function __witOracleRandomize( @@ -92,7 +92,7 @@ abstract contract WitOracleRandomnessConsumer ); } - /// @dev Trigger some randomness request to be solved by the Wit/oracle blockchain, by paying the + /// @dev Trigger some randomness request to be solved by the Wit/Oracle blockchain, by paying the /// @dev exact amount of `_queryEvmReward` of the underlying WitOracle bridge contract, and based /// @dev on the given `_querySLA` data security parameters. function __witOracleRandomize( diff --git a/contracts/mockups/WitOracleRequestConsumer.sol b/contracts/mockups/WitOracleRequestConsumer.sol index 62eb0d1f..7124e750 100644 --- a/contracts/mockups/WitOracleRequestConsumer.sol +++ b/contracts/mockups/WitOracleRequestConsumer.sol @@ -35,7 +35,7 @@ abstract contract WitOracleRequestConsumer return WitOracleConsumer._witOracleEstimateBaseFee(_evmGasPrice); } - /// @dev Pulls a data update from the Wit/oracle blockchain based on the underlying `witOracleRequest`, + /// @dev Pulls a data update from the Wit/Oracle blockchain based on the underlying `witOracleRequest`, /// @dev the default `__witOracleDefaultQuerySLA` data security parameters and the immutable value of /// @dev `__witOracleCalbackGasLimit`. /// @param _queryEvmReward The exact EVM reward passed to the WitOracle when pulling the data update. @@ -50,10 +50,10 @@ abstract contract WitOracleRequestConsumer ); } - /// @dev Pulls a data update from the Wit/oracle blockchain based on the underlying `witOracleRequest`, + /// @dev Pulls a data update from the Wit/Oracle blockchain based on the underlying `witOracleRequest`, /// @dev the given `_querySLA` data security parameters and the immutable value of `__witOracleCallbackGasLimit`. /// @param _queryEvmReward The exact EVM reward passed to the WitOracle when pulling the data update. - /// @param _querySLA The required SLA data security params for the Wit/oracle blockchain to accomplish. + /// @param _querySLA The required SLA data security params for the Wit/Oracle blockchain to accomplish. function __witOraclePostQuery( uint256 _queryEvmReward, Witnet.QuerySLA memory _querySLA diff --git a/contracts/mockups/WitOracleRequestTemplateConsumer.sol b/contracts/mockups/WitOracleRequestTemplateConsumer.sol index 280405fc..c8c29dff 100644 --- a/contracts/mockups/WitOracleRequestTemplateConsumer.sol +++ b/contracts/mockups/WitOracleRequestTemplateConsumer.sol @@ -35,7 +35,7 @@ abstract contract WitOracleRequestTemplateConsumer return WitOracleConsumer._witOracleEstimateBaseFee(_evmGasPrice); } - /// @dev Pulls a fresh update from the Wit/oracle blockchain based on some data request built out + /// @dev Pulls a fresh update from the Wit/Oracle blockchain based on some data request built out /// @dev of the underlying `witOracleRequestTemplate`, the default `__witOracleDefaultQuerySLA` data /// @dev security parameters and the immutable value of `__witOracleCallbackGasLimit`. /// @dev Returns the unique RAD hash of the just-built data request, and some unique query id. @@ -56,7 +56,7 @@ abstract contract WitOracleRequestTemplateConsumer ); } - /// @dev Pulls a fresh update from the Wit/oracle blockchain based on some data request built out + /// @dev Pulls a fresh update from the Wit/Oracle blockchain based on some data request built out /// @dev of the underlying `witOracleRequestTemplate`, and the given `_querSLA` data security parameters, /// @dev and the immutable value of `__witOracleCallbackGasLimit`. /// @dev Returns the unique RAD hash of the just-built data request, and some unique query id. @@ -64,7 +64,7 @@ abstract contract WitOracleRequestTemplateConsumer /// @dev parameterized data sources (i.e. Radon Retrievals). /// @param _witOracleRequestArgs Parameters passed to the `witOracleRequestTemplate` for building a new data request. /// @param _queryEvmReward The exact EVM reward passed to the WitOracle bridge when pulling the data update. - /// @param _querySLA The required SLA data security params for the Wit/oracle blockchain to accomplish. + /// @param _querySLA The required SLA data security params for the Wit/Oracle blockchain to accomplish. function __witOraclePostQuery( string[][] memory _witOracleRequestArgs, uint256 _queryEvmReward, diff --git a/migrations/scripts/3_framework.js b/migrations/scripts/3_framework.js index ed073638..37a02977 100644 --- a/migrations/scripts/3_framework.js +++ b/migrations/scripts/3_framework.js @@ -27,7 +27,7 @@ module.exports = async function (_, network, [, from, reporter, curator]) { apps: merge(Object.keys(networkArtifacts.apps), [],), } - // Settle WitOracle as first dependency on all Wit/oracle appliances + // Settle WitOracle as first dependency on all Wit/Oracle appliances framework.apps.forEach(appliance => { if (!networkSpecs[appliance]) networkSpecs[appliance] = {} networkSpecs[appliance].baseDeps = merge([], networkSpecs[appliance]?.baseDeps, ["WitOracle"]) diff --git a/package.json b/package.json index 2d76c083..d173b8fd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "witnet-solidity-bridge", - "version": "2.1.0", + "version": "2.1.0-beta.0", "description": "Witnet Solidity Bridge contracts for EVM-compatible chains", "author": "Witnet Foundation ", "license": "MIT",