diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 773b33401..985c380a4 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: - node-version: [16.x] + node-version: [20.x] steps: - uses: actions/checkout@v1 @@ -20,15 +20,18 @@ jobs: uses: actions/setup-node@v1 with: node-version: ${{ matrix.node-version }} + - uses: pnpm/action-setup@v3 + with: + version: 8 - name: Install dependencies run: | - npm install + pnpm install - name: Check format run: | - npm run fmt + pnpm run fmt - name: Compile solidity contracts run: | - npm run compile + pnpm run compile - name: Run tests run: | - npm run test + pnpm run test diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml new file mode 100644 index 000000000..65ab18dd5 --- /dev/null +++ b/.github/workflows/npm-publish.yml @@ -0,0 +1,25 @@ +# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created +# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages + +name: Publish NPM package + +on: + release: + types: [created] + +jobs: + publish-npm: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 20 + registry-url: https://registry.npmjs.org/ + - uses: pnpm/action-setup@v3 + with: + version: 8 + - run: pnpm install + - run: pnpm publish + env: + NODE_AUTH_TOKEN: ${{SECRETS.NPM_TOKEN}} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 777d959ea..6d178d5ad 100644 --- a/.gitignore +++ b/.gitignore @@ -1,15 +1,13 @@ -node_modules/ + +artifacts/ build/ -coverage/ -coverage.json -flattened/** +cache/ +flattened/ +node_modules/ .env .idea .vscode -yarn.lock -yarn-error.log -package-lock.json - *.tmp +.old diff --git a/.solhint.json b/.solhint.json index 7e8130457..ab853d309 100644 --- a/.solhint.json +++ b/.solhint.json @@ -6,6 +6,8 @@ ">=0.6.0 <0.9.0" ], "constructor-syntax": "warn", + "custom-errors": "off", + "explicit-types": "off", "func-param-name-mixedcase": "warn", "func-visibility": [ "warn", @@ -13,9 +15,11 @@ "ignoreConstructors": true } ], + "immutable-vars-naming": "off", "modifier-name-mixedcase": "warn", "no-empty-blocks": "off", "no-inline-assembly": "off", + "no-global-import": "off", "var-name-mixedcase": "off", "reason-string": [ "warn", diff --git a/README.md b/README.md index e55c592f7..21ffe194e 100644 --- a/README.md +++ b/README.md @@ -1,322 +1,51 @@ # witnet-solidity-bridge -`witnet/witnet-solidity-bridge` is an open source implementation of an API that enables Solidity smart contract developers to harness the full power of the [**Witnet Decentralized Oracle Network**](https://docs.witnet.io/intro/about/). +Open repository containing the smart contracts composing the **Witnet Solidity Bridge** framework. This framework enables Solidity developers and smart contracts operating in a long range of EVM-compatible chains to interact with the [Witnet Oracle Blockchain](https://witnet.io) for retrieving and aggregating offchain public data, and randomness. -This repository provides several deployable contracts: +## Install the package -- `WitnetLib`, helper library useful for parsing Witnet-solved results to previously posted Witnet Data Requests. -- `WitnetProxy`, a delegate-proxy contract that routes Witnet Data Requests to a currently active `WitnetRequestBoard` implementation. -- Multiple implementations of the `WitnetRequestBoard` interface (WRB), which declares all required functionality to relay encapsulated [Witnet Data Requests](https://docs.witnet.io/intro/about/architecture#capabilities-of-data-requests/) from an EVM compatible chain to the Witnet mainnet, as well as to relay Witnet-solved results back to Ethereum. +`$ pnpm install` -The repository also provides: +## Deploy the whole WSB framework on a new chain -- `UsingWitnet`, an inheritable abstract contract that injects methods for conveniently interacting with the WRB. -- `WitnetRequest`, used as a means to encapsulate unmodifiable Witnet Data Requests. -- `WitnetRequestPrecompiled`, useful as a base contract to implement your own modifiable Witnet Data Requests. +### Pre-assessment +Should any artifact require customized contract implementations: -## **WitnetProxy** +- Please add source files accordingly to `contracts/core/customs`. -`WitnetProxy` is an upgradable delegate-proxy contract that routes Witnet Data Requests coming from a `UsingWitnet`-inheriting contract to a currently active `WitnetRequestBoard` implementation. +- Set up new artifact names, and eventual new construction parameters, if required, to `settings/artifacts` and `settings/specs`, respectively. -To find the entry-point address of the latest deployed version of the `WitnetRequestBoard` contract in every supported chain, please visit the [Witnet Data Feeds Explorer](https://feeds.witnet.io/). +- Run regression tests: `$ pnpm run test` -## **IWitnetRequest** -Used as a means to encapsulate Witnet Data Requests, that can eventually be posted to a `WitnetRequestBoard` implementation. The `bytecode()` of a `IWitnetRequest` must be constructed from the CBOR-encoded serialization of a [Witnet Data Request](https://docs.witnet.io/intro/about/architecture#capabilities-of-data-requests/). The `IWitnetRequest` interface defines two methods: +### Prepare the environment -- **`bytecode()`**: - - _Description_: - - Returns Witnet Data Request as a CBOR-encoded `bytes`. +- Add a new network configuration to `settings/networks`. The network name should follow the pattern `:`. -- **`hash()`**: - - _Description_: - - Returns SHA256 hash of Witnet Data Request as CBOR-encoded bytes. +- Make sure you run an ETH/RPC provider for the specified `host` and `port`, capable of intercepting `eth_sendTransaction` calls (e.g. [web3-ethrpc-gateway](https://github.io/witnet/web3-jsonrpc-gateway)). -## **WitnetRequestBoard** +### Run the script -From the point of view of a `UsingWitnet` contract, any given `WitnetRequestBoard` will always support the following interfaces: +`$ pnpm run migrate :` -- **`IWitnetRequestBoardEvents`** -- **`IWitnetRequestBoardRequestor`** -- **`IWitnetRequestBoardView`** +## Upgrade WSB components on an existing chain -### IWitnetRequestBoardEvents: +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: -- Event **`PostedRequest(uint256 queryId, address from)`**: - - _Description_: - - Emitted when a Witnet Data Request is posted to the WRB. - - _Arguments_: - - `queryId`: the query id assigned to this new posting. - - `from`: the address from which the Witnet Data Request was posted. +`$ pnpm run migrate : WitnetErrorsLib,WitnetPriceFeeds` -- Event **`PostedResult(uint256 queryId, address from)`**: - - _Description_: - - Emitted when a Witnet-solved result is reported to the WRB. - - _Arguments_: - - `queryId`: the id of the query the result refers to. - - `from`: the address from which the result was reported. +When specifying deployable library artifacts, the depending contracts will be attempted to be upgraded as well. -- Event **`DeletedQuery(uint256 queryId, address from)`**: - - _Description_: - - Emitted when all data related to given query is deleted from the WRB. - - _Arguments_: - - `queryId`: the id of the query that has been deleted. - - `from`: the address from which the result was reported. +With respect to deployable contracts, you shall be asked to confirm manually before actually performing a contract upgrade. You can automate all potentially involved upgrades by adding the parameter `--upgrade-all`. -### IWitnetRequestBoardRequestor: +Reasons for an upgrade to fail: +- You have no credentials. +- You're attempting to upgrade a contract with the same implementation logic as it currently has. +- The parameters passed to the upgrade call, as specified in `settings/specs` are not accepted for some reason (see actual revert message for further info). -- **`postRequest(IWitnetRequest _request)`**: - - _Description_: - - Posts a Witnet Data Request into the WRB in the expectation that it will be eventually relayed and resolved - by the Witnet decentralized oracle network, with `msg.value` as reward. - - _Inputs_: - - `_request`: the actual `IWitnetRequest` contract address which provided the Witnet Data Request bytecode. - - _Returns_: - - *_id*: the unique identifier of the data request. +## Exported assets -- **`upgradeReward(uint256 _id)`**: - - _Description_: increments the reward of a Witnet data request by - adding more value to it. The new data request reward will be increased by `msg.value`. - - _Inputs_: - - `_id`: the unique identifier of a previously posted Witnet data request. +- [Deployed addresses.]("./migrations/addresses.json") +- [Supported chains.]("./settings/networks/index.js") -- **`deleteQuery(uint256 _id)`**: - - _Description_: - - Retrieves copy of all Witnet-provided data related to a previously posted request, removing the whole query from the WRB storage. - - _Inputs_: - - `_id`: the unique identifier of a previously posted Witnet data request. - - _Returns_: - - The Witnet-solved result of the given data request, as CBOR-encoded `bytes`. - -### IWitnetRequestBoardView: - -- **`estimateReward(uint256 _gasPrice)`**: - - _Description_: - - Estimates the minimal amount of reward needed to post a Witnet data request into the WRB, for a given gas price. - - _Inputs_: - - `_gasPrice`: the gas price for which we need to calculate the rewards. - -- **`getNextQueryId()`**: - - _Description_: - - Returns next query id to be generated by the Witnet Request Board. - -- **`getQueryData(uint256 _queryId)`**: - - _Description_: - - Gets the whole `Witnet.Query` record related to a previously posted Witnet Data Request. - - _Inputs_: - - `_queryId`: the unique identifier of the query. - -- **`getQueryStatus(uint256 _queryId)`**: - - _Description_: - - Gets current status of the given query. - - _Inputs_: - - `_queryId`: the unique identifier of the query. - -- **`readRequest(uint256 _queryId)`**: - - _Description_: - - Retrieves the whole `Witnet.Request` record referred to a previously posted Witnet Data Request. - - _Inputs_: - - `_queryId`: the unique identifier of the query. - -- **`readRequestBytecode(uint256 _queryId)`**: - - _Description_: - - Retrieves the serialized bytecode of a previously posted Witnet Data Request. - - _Inputs_: - - `_queryId`: the unique identifier of the query. - - _Returns_: - - The Witnet Data Request bytecode, serialized as `bytes`. - -- **`readRequestGasPrice(uint256 _queryId)`**: - - _Description_: - - Retrieves the gas price that any assigned reporter will have to pay when reporting result to the referred query. - - _Inputs_: - - `_queryId`: the unique identifier of the query. - -- **`readRequestReward(uint256 _queryId)`**: - - _Description_: - - Retrieves the reward currently set for the referred query. - - _Inputs_: - - `_queryId`: the unique identifier of the query. - -- **`readResponse(uint256 _queryId)`**: - - _Description_: - - Retrieves the whole `Witnet.Response` record referred to a previously posted Witnet Data Request. Fails it the query has not been solved yet. - - _Inputs_: - - `_queryId`: the unique identifier of the query. - -- **`readResponseTimestamp(uint256 _queryId)`**: - - _Description_: - - Retrieves the timestamp in which the result to the referred query was solved by the Witnet DON. - - _Inputs_: - - `_queryId`: the unique identifier of a previously posted Witnet data request. - -- **`readResponseDrTxHash(uint256 _queryId)`**: - - _Description_: - - Retrieves the hash of the Witnet transaction hash that actually solved the referred query. - - _Inputs_: - - `_queryId`: the unique identifier of the query. - -- **`readResponseReporter(uint256 _queryId)`**: - - _Description_: - - Retrieves the address from which the result to the referred query was actually reported. - - _Inputs_: - - `_queryId`: the unique identifier of a previously posted Witnet data request. - -- **`readResponseResult(uint256 _queryId)`**: - - _Description_: - - Retrieves the Witnet-provided CBOR-bytes result to the referred query. Fails it the query has not been solved yet. - - _Inputs_: - - `_queryId`: the unique identifier of the query. - - _Returns_: - - The Witnet-provided result to the given query, as CBOR-encoded `bytes`. - -## **UsingWitnet base contract** - -The `UsingWitnet` contract injects the following _internal methods_ into the contracts inheriting from it: - -- **`_witnetEstimateReward()`**: - - _Description_: - - Estimates the reward amount, considering current transaction's gas price. - - _Returns_: - - The reward to be included when either posting a new request, or upgrading the reward of a previously posted one. - -- **`_witnetEstimateReward(uint256 _gasPrice)`**: - - _Description_: - - Estimates the reward amount, considering the given gas price is used when either posting or upgrading a request. - - _Inputs_: - - `_gasPrice`: the gas price for which we want to retrieve the estimation. - - _Returns_: - - The reward to be included when either posting a new request, or upgrading the reward of a previously posted one. - -- **`_witnetPostRequest(IWitnetRequest _request)`**: - - _Description_: - - Method to be called for posting Witnet data request into the WRB, with provided `msg.value` as reward. - - _Inputs_: - - `_request`: the Witnet request contract address that provides the Witnet Data Request encoded bytecode. - - _Returns_: - - The unique identifier of the Witnet data request just posted to the WRB. - -- **`_witnetUpgradeReward()`**: - - _Description_: - - Increments the reward of a previously posted Witnet data request by adding more value to it. The new request reward will be increased by `msg.value`. - - _Inputs_: - - `_id`: the unique identifier of a previously posted Witnet data request. - -- **`_witnetCheckResultAvailability()`**: - - _Description_: - - Checks if a Witnet data request has already been solved by Witnet network. - - _Inputs_: - - `_id`: the unique identifier of a previously posted Witnet data request. - - _Returns_: - - A boolean telling whether the Witnet data request has been already solved, or not. - -- **`_witnetReadResult(uint256 _id)`**: - - _Description_: - - Retrieves the Witnet-solved result of a previously posted Witnet data request. - - _Inputs_: - - `_id`: the unique identifier of a previously posted Witnet data request. - - _Returns_: - - The Witnet-solved result of the given data request, as CBOR-encoded `bytes`. - -- **`_witnetDeleteQuery(uint256 _id)`**: - - _Description_: - - Retrieves the Witnet-solved result (if already available) of a previously posted Witnet request, and removes it from the WRB storage. Works only if this `UsingWitnet` contract is the one that actually posted the given data request. - - _Inputs_: - - `_id`: the unique identifier of a previously posted Witnet data request. - - _Returns_: - - The Witnet-solved result of the given data request, as CBOR-encoded `bytes`. - -Besides, your contract will have access to the whole Witnet Request Board functionality by means of the immutable **`witnet`** address field. - -## **Usage: harness the power of the Witnet Decentralized Oracle Network** - -In order to integrate your own smart contracts with the **Witnet** fully-decentralized blockchain, you just need to inherit from the `UsingWitnet` abstract contract: - -```solidity -pragma solidity >=0.7.0 <0.9.0; - -import "./UsingWitnet.sol"; - -contract MyContract is UsingWitnet { - IWitnetRequest myRequest; - - constructor() UsingWitnet(/* here comes the entrypoint address provided by the Witnet Foundation */) { - // TODO - } - - function myOwnDrPost() public payable returns (uint256 _drTrackId) { - _drTrackId = witnetPostRequest{value: msg.value}(myRequest); - } -} -``` - -Please, have a look at the [`witnet/truffle-box`](https://github.com/witnet/truffle-box) repository to learn how to compose your own `IWitnetRequest` contracts. - -## **Gas cost benchmark** - -```bash -·------------------------------------------------------------------|---------------------------|-------------|----------------------------· -| Solc version: 0.8.17+commit.8df45f5f · Optimizer enabled: true · Runs: 200 · Block limit: 6718946 gas │ -···································································|···························|·············|····························· -| Methods │ -·······································|···························|·············|·············|·············|··············|·············· -| Contract · Method · Min · Max · Avg · # calls · usd (avg) │ -·······································|···························|·············|·············|·············|··············|·············· -| WitnetPriceRouter · transferOwnership · - · - · 31550 · 1 · - │ -·······································|···························|·············|·············|·············|··············|·············· -| WitnetProxy · upgradeTo · - · - · 129653 · 1 · - │ -·······································|···························|·············|·············|·············|··············|·············· -| WitnetRandomness · clone · - · - · 247765 · 7 · - │ -·······································|···························|·············|·············|·············|··············|·············· -| WitnetRandomness · upgradeRandomizeFee · - · - · 28446 · 1 · - │ -·······································|···························|·············|·············|·············|··············|·············· -| WitnetRequestBoardTrustableBoba · deleteQuery · - · - · 59706 · 3 · - │ -·······································|···························|·············|·············|·············|··············|·············· -| WitnetRequestBoardTrustableBoba · postRequest · 196513 · 213613 · 205840 · 11 · - │ -·······································|···························|·············|·············|·············|··············|·············· -| WitnetRequestBoardTrustableBoba · reportResult · 135354 · 135366 · 135361 · 5 · - │ -·······································|···························|·············|·············|·············|··············|·············· -| WitnetRequestBoardTrustableDefault · deleteQuery · - · - · 51200 · 6 · - │ -·······································|···························|·············|·············|·············|··············|·············· -| WitnetRequestBoardTrustableDefault · destruct · - · - · 28541 · 2 · - │ -·······································|···························|·············|·············|·············|··············|·············· -| WitnetRequestBoardTrustableDefault · initialize · - · - · 83767 · 36 · - │ -·······································|···························|·············|·············|·············|··············|·············· -| WitnetRequestBoardTrustableDefault · postRequest · 163063 · 180163 · 175626 · 49 · - │ -·······································|···························|·············|·············|·············|··············|·············· -| WitnetRequestBoardTrustableDefault · reportResult · - · - · 130017 · 17 · - │ -·······································|···························|·············|·············|·············|··············|·············· -| WitnetRequestBoardTrustableDefault · reportResultBatch · 53532 · 328625 · 188967 · 8 · - │ -·······································|···························|·············|·············|·············|··············|·············· -| WitnetRequestBoardTrustableDefault · upgradeReward · - · - · 38828 · 6 · - │ -·······································|···························|·············|·············|·············|··············|·············· -| WitnetRequestRandomness · clone · - · - · 245099 · 9 · - │ -·······································|···························|·············|·············|·············|··············|·············· -| WitnetRequestRandomness · renounceOwnership · - · - · 23554 · 2 · - │ -·······································|···························|·············|·············|·············|··············|·············· -| WitnetRequestRandomness · setWitnessingCollateral · 69708 · 72377 · 71043 · 10 · - │ -·······································|···························|·············|·············|·············|··············|·············· -| WitnetRequestRandomness · setWitnessingFees · 64370 · 73741 · 69481 · 11 · - │ -·······································|···························|·············|·············|·············|··············|·············· -| WitnetRequestRandomness · setWitnessingQuorum · 64228 · 67999 · 66114 · 12 · - │ -·······································|···························|·············|·············|·············|··············|·············· -| WitnetRequestRandomness · transferOwnership · - · - · 28881 · 3 · - │ -·······································|···························|·············|·············|·············|··············|·············· -| Deployments · · % of limit · │ -···································································|·············|·············|·············|··············|·············· -| WitnetLib · - · - · 3541780 · 52.7 % · - │ -···································································|·············|·············|·············|··············|·············· -| WitnetProxy · - · - · 571986 · 8.5 % · - │ -···································································|·············|·············|·············|··············|·············· -| WitnetRequestBoardTrustableDefault · - · - · 4265164 · 63.5 % · - │ -···································································|·············|·············|·············|··············|·············· -| WitnetRequestRandomness · - · - · 1643020 · 24.5 % · - │ -·------------------------------------------------------------------|-------------|-------------|-------------|--------------|-------------·``` - - -## **License** - -`witnet-solidity-bridge` is published under the [MIT license][license]. - -[license]: https://github.com/witnet/witnet-solidity-bridge/blob/master/LICENSE diff --git a/contracts/UsingWitnet.sol b/contracts/UsingWitnet.sol deleted file mode 100644 index de2ff6ceb..000000000 --- a/contracts/UsingWitnet.sol +++ /dev/null @@ -1,127 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity >=0.7.0 <0.9.0; -pragma experimental ABIEncoderV2; - -import "./WitnetRequestBoard.sol"; - -/// @title The UsingWitnet contract -/// @dev Witnet-aware contracts can inherit from this contract in order to interact with Witnet. -/// @author The Witnet Foundation. -abstract contract UsingWitnet { - - WitnetRequestBoard private immutable __witnet; - - /// @dev Include an address to specify the WitnetRequestBoard entry point address. - /// @param _wrb The WitnetRequestBoard entry point address. - constructor(WitnetRequestBoard _wrb) - { - require(address(_wrb) != address(0), "UsingWitnet: no WRB"); - __witnet = _wrb; - } - - /// @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 by Witnet, - /// @dev either with an error or successfully. - modifier witnetQuerySolved(uint256 _id) { - require(_witnetCheckResultAvailability(_id), "UsingWitnet: unsolved query"); - _; - } - - function witnet() virtual public view returns (WitnetRequestBoard) { - return __witnet; - } - - /// @notice Check if given query was already reported back from the Witnet oracle. - /// @param _id The unique identifier of a previously posted data request. - function _witnetCheckResultAvailability(uint256 _id) - internal view - returns (bool) - { - return __witnet.getQueryStatus(_id) == Witnet.QueryStatus.Reported; - } - - /// @notice Estimate the reward amount. - /// @param _gasPrice The gas price for which we want to retrieve the estimation. - /// @return The reward to be included when either posting a new request, or upgrading the reward of a previously posted one. - function _witnetEstimateReward(uint256 _gasPrice) - internal view - returns (uint256) - { - return __witnet.estimateReward(_gasPrice); - } - - /// @notice Estimates the reward amount, considering current transaction gas price. - /// @return The reward to be included when either posting a new request, or upgrading the reward of a previously posted one. - function _witnetEstimateReward() - internal view - returns (uint256) - { - return __witnet.estimateReward(tx.gasprice); - } - - /// @notice Post some data request to be eventually solved by the Witnet decentralized oracle network. - /// @notice The EVM -> Witnet bridge will read the Witnet Data Request bytecode from the WitnetBytecodes - /// @notice registry based on given `_radHash` and `_slaHash` values. - /// @dev Enough ETH needs to be provided as to cover for the implicit fee. - /// @param _radHash Unique hash of some pre-validated Witnet Radon Request. - /// @param _slaHash Unique hash of some pre-validated Witnet Radon Service-Level Agreement. - /// @return _id The unique identifier of the just posted data request. - /// @return _reward Current reward amount escrowed by the WRB until a result gets reported. - function _witnetPostRequest(bytes32 _radHash, bytes32 _slaHash) - virtual internal - returns (uint256 _id, uint256 _reward) - { - _reward = _witnetEstimateReward(); - require( - _reward <= msg.value, - "UsingWitnet: reward too low" - ); - _id = __witnet.postRequest{value: _reward}(_radHash, _slaHash); - } - - /// @notice Post some data request to be eventually solved by the Witnet decentralized oracle network. - /// @notice The EVM -> Witnet bridge will read the Witnet Data Request bytecode from the WitnetBytecodes - /// @notice registry based on given `_radHash` and `_slaHash` values. - /// @dev Enough ETH needs to be provided as to cover for the implicit fee. - /// @param _radHash Unique hash of some pre-validated Witnet Radon Request. - /// @param _slaParams The SLA params upon which this data request will be solved by Witnet. - /// @return _id The unique identifier of the just posted data request. - /// @return _reward Current reward amount escrowed by the WRB until a result gets reported. - function _witnetPostRequest(bytes32 _radHash, WitnetV2.RadonSLA memory _slaParams) - virtual internal - returns (uint256 _id, uint256 _reward) - { - return _witnetPostRequest(_radHash, __witnet.registry().verifyRadonSLA(_slaParams)); - } - - /// @notice Read the Witnet-provided result to a previously posted request. - /// @dev Reverts if the data request was not yet solved. - /// @param _id The unique identifier of some previously posted data request. - /// @return The result of the request as an instance of `Witnet.Result`. - function _witnetReadResult(uint256 _id) - internal view - virtual - returns (Witnet.Result memory) - { - return __witnet.readResponseResult(_id); - } - - /// @notice Upgrade the reward of some previously posted data request. - /// @dev Reverts if the data request was already solved. - /// @param _id The unique identifier of some previously posted data request. - /// @return Amount in which the reward has been increased. - function _witnetUpgradeReward(uint256 _id) - virtual internal - returns (uint256) - { - uint256 _currentReward = __witnet.readRequestReward(_id); - uint256 _newReward = _witnetEstimateReward(); - uint256 _fundsToAdd = 0; - if (_newReward > _currentReward) { - _fundsToAdd = (_newReward - _currentReward); - } - __witnet.upgradeReward{value: _fundsToAdd}(_id); - return _fundsToAdd; - } -} \ No newline at end of file diff --git a/contracts/WitnetBytecodes.sol b/contracts/WitnetBytecodes.sol deleted file mode 100644 index 3752d0dbe..000000000 --- a/contracts/WitnetBytecodes.sol +++ /dev/null @@ -1,15 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity >=0.7.0 <0.9.0; -pragma experimental ABIEncoderV2; - -import "./interfaces/V2/IWitnetBytecodes.sol"; -import "./interfaces/V2/IWitnetBytecodesErrors.sol"; -import "./interfaces/V2/IWitnetBytecodesEvents.sol"; - -abstract contract WitnetBytecodes - is - IWitnetBytecodes, - IWitnetBytecodesErrors, - IWitnetBytecodesEvents -{} \ No newline at end of file diff --git a/contracts/WitnetFeeds.sol b/contracts/WitnetFeeds.sol deleted file mode 100644 index 616b25489..000000000 --- a/contracts/WitnetFeeds.sol +++ /dev/null @@ -1,38 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity >=0.8.0 <0.9.0; - -import "./interfaces/V2/IFeeds.sol"; -import "./interfaces/V2/IWitnetFeeds.sol"; -import "./interfaces/V2/IWitnetFeedsAdmin.sol"; -import "./interfaces/V2/IWitnetFeedsEvents.sol"; - -abstract contract WitnetFeeds - is - IFeeds, - IWitnetFeeds, - IWitnetFeedsAdmin, - IWitnetFeedsEvents -{ - WitnetV2.RadonDataTypes immutable public override dataType; - WitnetBytecodes immutable public override registry; - WitnetRequestBoard immutable public override witnet; - - bytes32 immutable internal __prefix; - - constructor( - WitnetRequestBoard _wrb, - WitnetV2.RadonDataTypes _dataType, - string memory _prefix - ) - { - witnet = _wrb; - registry = witnet.registry(); - dataType = _dataType; - __prefix = Witnet.toBytes32(bytes(_prefix)); - } - - function prefix() override public view returns (string memory) { - return Witnet.toString(__prefix); - } -} \ No newline at end of file diff --git a/contracts/WitnetOracle.sol b/contracts/WitnetOracle.sol new file mode 100644 index 000000000..42d618970 --- /dev/null +++ b/contracts/WitnetOracle.sol @@ -0,0 +1,24 @@ +// SPDX-License-Identifier: MIT + +pragma solidity >=0.7.0 <0.9.0; + +import "./WitnetRequestBytecodes.sol"; +import "./WitnetRequestFactory.sol"; +import "./interfaces/IWitnetOracle.sol"; +import "./interfaces/IWitnetOracleEvents.sol"; + +/// @title Witnet Request Board functionality base contract. +/// @author The Witnet Foundation. +abstract contract WitnetOracle + is + IWitnetOracle, + IWitnetOracleEvents +{ + function class() virtual external view returns (string memory) { + return type(WitnetOracle).name; + } + function channel() virtual external view returns (bytes4); + function factory() virtual external view returns (WitnetRequestFactory); + function registry() virtual external view returns (WitnetRequestBytecodes); + function specs() virtual external view returns (bytes4); +} \ No newline at end of file diff --git a/contracts/WitnetPriceFeeds.sol b/contracts/WitnetPriceFeeds.sol index 60fda9612..709f29589 100644 --- a/contracts/WitnetPriceFeeds.sol +++ b/contracts/WitnetPriceFeeds.sol @@ -1,24 +1,22 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.8.0 <0.9.0; +pragma solidity >=0.7.0 <0.9.0; -import "ado-contracts/contracts/interfaces/IERC2362.sol"; -import "./interfaces/V2/IWitnetPriceFeeds.sol"; -import "./interfaces/V2/IWitnetPriceSolverDeployer.sol"; -import "./WitnetFeeds.sol"; +import "./apps/WitnetFeeds.sol"; +import "./interfaces/IWitnetPriceFeeds.sol"; +import "./interfaces/IWitnetPriceSolverDeployer.sol"; + +/// @title WitnetPriceFeeds: Price Feeds live repository reliant on the Witnet Oracle blockchain. +/// @author The Witnet Foundation. abstract contract WitnetPriceFeeds is - IERC2362, + WitnetFeeds, IWitnetPriceFeeds, - IWitnetPriceSolverDeployer, - WitnetFeeds -{ - constructor(WitnetRequestBoard _wrb) - WitnetFeeds( - _wrb, - WitnetV2.RadonDataTypes.Integer, - "Price-" - ) + IWitnetPriceSolverDeployer +{ + constructor() + WitnetFeeds(Witnet.RadonDataTypes.Integer, "Price-") {} -} \ No newline at end of file + +} diff --git a/contracts/WitnetRandomness.sol b/contracts/WitnetRandomness.sol deleted file mode 100644 index 98fc8384b..000000000 --- a/contracts/WitnetRandomness.sol +++ /dev/null @@ -1,25 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity >=0.7.0 <0.9.0; -pragma experimental ABIEncoderV2; - -import "./interfaces/IWitnetRandomness.sol"; -import "./interfaces/IWitnetRandomnessAdmin.sol"; - -abstract contract WitnetRandomness - is - IWitnetRandomness, - IWitnetRandomnessAdmin -{ - /// Deploys a minimal-proxy clone in which the `witnetRandomnessRequest` is owned by the cloner, - /// @dev This function should always provide a new address, no matter how many times - /// @dev is actually called from the same `msg.sender`. - function clone() virtual external returns (WitnetRandomness); - - /// Deploys a minimal-proxy clone in which the `witnetRandomnessRequest` is owned by the cloner, - /// and whose address will be determined by the provided salt. - /// @dev This function uses the CREATE2 opcode and a `_salt` to deterministically deploy - /// @dev the clone. Using the same `_salt` multiple time will revert, since - /// @dev no contract can be deployed more than once at the same address. - function cloneDeterministic(bytes32 salt) virtual external returns (WitnetRandomness); -} \ No newline at end of file diff --git a/contracts/requests/WitnetRequest.sol b/contracts/WitnetRequest.sol similarity index 100% rename from contracts/requests/WitnetRequest.sol rename to contracts/WitnetRequest.sol diff --git a/contracts/WitnetRequestBoard.sol b/contracts/WitnetRequestBoard.sol deleted file mode 100644 index 315d15c78..000000000 --- a/contracts/WitnetRequestBoard.sol +++ /dev/null @@ -1,35 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity >=0.7.0 <0.9.0; -pragma experimental ABIEncoderV2; - -import "./WitnetBytecodes.sol"; -import "./WitnetRequestFactory.sol"; - -import "./interfaces/IWitnetRequestBoardEvents.sol"; -import "./interfaces/IWitnetRequestBoardReporter.sol"; -import "./interfaces/IWitnetRequestBoardRequestor.sol"; -import "./interfaces/IWitnetRequestBoardView.sol"; - -import "./interfaces/IWitnetRequestBoardDeprecating.sol"; - -/// @title Witnet Request Board functionality base contract. -/// @author The Witnet Foundation. -abstract contract WitnetRequestBoard is - IWitnetRequestBoardDeprecating, - IWitnetRequestBoardEvents, - IWitnetRequestBoardReporter, - IWitnetRequestBoardRequestor, - IWitnetRequestBoardView -{ - WitnetRequestFactory immutable public factory; - WitnetBytecodes immutable public registry; - constructor (WitnetRequestFactory _factory) { - require( - _factory.class() == type(WitnetRequestFactory).interfaceId, - "WitnetRequestBoard: uncompliant factory" - ); - factory = _factory; - registry = _factory.registry(); - } -} \ No newline at end of file diff --git a/contracts/WitnetRequestBytecodes.sol b/contracts/WitnetRequestBytecodes.sol new file mode 100644 index 000000000..15b647159 --- /dev/null +++ b/contracts/WitnetRequestBytecodes.sol @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: MIT + +pragma solidity >=0.7.0 <0.9.0; +pragma experimental ABIEncoderV2; + +import "./interfaces/IWitnetRequestBytecodes.sol"; + +abstract contract WitnetRequestBytecodes + is + IWitnetRequestBytecodes +{ + function class() virtual external view returns (string memory) { + return type(WitnetRequestBytecodes).name; + } + function specs() virtual external view returns (bytes4); +} \ No newline at end of file diff --git a/contracts/WitnetRequestFactory.sol b/contracts/WitnetRequestFactory.sol index 221e74134..d222d7271 100644 --- a/contracts/WitnetRequestFactory.sol +++ b/contracts/WitnetRequestFactory.sol @@ -3,9 +3,16 @@ pragma solidity >=0.7.0 <0.9.0; pragma experimental ABIEncoderV2; -import "./interfaces/V2/IWitnetRequestFactory.sol"; +import "./WitnetRequestBytecodes.sol"; +import "./WitnetOracle.sol"; +import "./interfaces/IWitnetRequestFactory.sol"; abstract contract WitnetRequestFactory is IWitnetRequestFactory -{} \ No newline at end of file +{ + function class() virtual external view returns (string memory); + function registry() virtual external view returns (WitnetRequestBytecodes); + function specs() virtual external view returns (bytes4); + function witnet() virtual external view returns (WitnetOracle); +} \ No newline at end of file diff --git a/contracts/requests/WitnetRequestTemplate.sol b/contracts/WitnetRequestTemplate.sol similarity index 71% rename from contracts/requests/WitnetRequestTemplate.sol rename to contracts/WitnetRequestTemplate.sol index f180e5060..602fdd3b2 100644 --- a/contracts/requests/WitnetRequestTemplate.sol +++ b/contracts/WitnetRequestTemplate.sol @@ -3,28 +3,32 @@ pragma solidity >=0.7.0 <0.9.0; pragma experimental ABIEncoderV2; -import "../WitnetRequestFactory.sol"; +import "./WitnetRequestBytecodes.sol"; +import "./WitnetOracle.sol"; +import "./WitnetRequestFactory.sol"; abstract contract WitnetRequestTemplate { event WitnetRequestBuilt(address indexed request, bytes32 indexed radHash, string[][] args); - function class() virtual external view returns (bytes4); + function class() virtual external view returns (string memory); function factory() virtual external view returns (WitnetRequestFactory); - function registry() virtual external view returns (WitnetBytecodes); + function registry() virtual external view returns (WitnetRequestBytecodes); + function specs() virtual external view returns (bytes4); function version() virtual external view returns (string memory); + function witnet() virtual external view returns (WitnetOracle); function aggregator() virtual external view returns (bytes32); function parameterized() virtual external view returns (bool); function resultDataMaxSize() virtual external view returns (uint16); - function resultDataType() virtual external view returns (WitnetV2.RadonDataTypes); + function resultDataType() virtual external view returns (Witnet.RadonDataTypes); function retrievals() virtual external view returns (bytes32[] memory); function tally() virtual external view returns (bytes32); - function getRadonAggregator() virtual external view returns (WitnetV2.RadonReducer memory); - function getRadonRetrievalByIndex(uint256) virtual external view returns (WitnetV2.RadonRetrieval memory); + function getRadonAggregator() virtual external view returns (Witnet.RadonReducer memory); + function getRadonRetrievalByIndex(uint256) virtual external view returns (Witnet.RadonRetrieval memory); function getRadonRetrievalsCount() virtual external view returns (uint256); - function getRadonTally() virtual external view returns (WitnetV2.RadonReducer memory); + function getRadonTally() virtual external view returns (Witnet.RadonReducer memory); function buildRequest(string[][] calldata args) virtual external returns (address); function verifyRadonRequest(string[][] calldata args) virtual external returns (bytes32); diff --git a/contracts/apps/UsingWitnet.sol b/contracts/apps/UsingWitnet.sol new file mode 100644 index 000000000..c8c789b3b --- /dev/null +++ b/contracts/apps/UsingWitnet.sol @@ -0,0 +1,100 @@ +// SPDX-License-Identifier: MIT + +pragma solidity >=0.7.0 <0.9.0; +pragma experimental ABIEncoderV2; + +import "../WitnetOracle.sol"; + +/// @title The UsingWitnet contract +/// @dev Witnet-aware contracts can inherit from this contract in order to interact with Witnet. +/// @author The Witnet Foundation. +abstract contract UsingWitnet + is + IWitnetOracleEvents +{ + /// @dev Immutable reference to the Witnet Request Board contract. + WitnetOracle internal immutable __witnet; + + /// @dev Default Security-Level Agreement parameters to be fulfilled by the Witnet blockchain + /// @dev when solving a data request. + WitnetV2.RadonSLA internal __witnetDefaultSLA; + + /// @dev Percentage over base fee to pay on every data request, + /// @dev as to deal with volatility of evmGasPrice and evmWitPrice during the live time of + /// @dev a data request (since being posted until a result gets reported back), at both the EVM and + /// @dev the Witnet blockchain levels, respectivelly. + uint16 private __witnetBaseFeeOverheadPercentage; + + /// @param _wrb Address of the WitnetOracle contract. + constructor(WitnetOracle _wrb) { + require( + _wrb.specs() == type(IWitnetOracle).interfaceId, + "UsingWitnet: uncompliant WitnetOracle" + ); + __witnet = _wrb; + __witnetDefaultSLA = WitnetV2.RadonSLA({ + // Number of nodes in the Witnet blockchain that will take part in solving the data request: + committeeSize: 7, + // Fee in $nanoWIT paid to every node in the Witnet blockchain involved in solving the data request: + witnessingFee: 10 ** 9 + }); + + __witnetBaseFeeOverheadPercentage = 10; // defaults to 10% + } + + /// @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 by Witnet, + /// @dev either with an error or successfully. + modifier witnetQuerySolved(uint256 _witnetQueryId) { + require(_witnetCheckQueryResultAvailability(_witnetQueryId), "UsingWitnet: unsolved query"); + _; + } + + function witnet() virtual public view returns (WitnetOracle) { + return __witnet; + } + + /// @notice Check if given query was already reported back from the Witnet oracle. + /// @param _id The unique identifier of a previously posted data request. + function _witnetCheckQueryResultAvailability(uint256 _id) + internal view + returns (bool) + { + return __witnet.getQueryStatus(_id) == WitnetV2.QueryStatus.Reported; + } + + /// @notice Estimate the minimum reward required for posting a data request, using `tx.gasprice` as a reference. + /// @dev Underestimates if the size of returned data is greater than `_resultMaxSize`. + /// @param _resultMaxSize Maximum expected size of returned data (in bytes). + function _witnetEstimateEvmReward(uint16 _resultMaxSize) + virtual internal view + returns (uint256) + { + return ( + (100 + _witnetBaseFeeOverheadPercentage()) + * __witnet.estimateBaseFee(tx.gasprice, _resultMaxSize) + ) / 100; + } + + function _witnetCheckQueryResponseStatus(uint256 _witnetQueryId) + internal view + returns (WitnetV2.ResponseStatus) + { + return __witnet.getQueryResponseStatus(_witnetQueryId); + } + + function _witnetCheckQueryResultError(uint256 _witnetQueryId) + internal view + returns (Witnet.ResultError memory) + { + return __witnet.getQueryResultError(_witnetQueryId); + } + + function _witnetBaseFeeOverheadPercentage() virtual internal view returns (uint16) { + return __witnetBaseFeeOverheadPercentage; + } + + function __witnetSetBaseFeeOverheadPercentage(uint16 _baseFeeOverheadPercentage) virtual internal { + __witnetBaseFeeOverheadPercentage = _baseFeeOverheadPercentage; + } +} diff --git a/contracts/apps/UsingWitnetRandomness.sol b/contracts/apps/UsingWitnetRandomness.sol new file mode 100644 index 000000000..61e20d0b1 --- /dev/null +++ b/contracts/apps/UsingWitnetRandomness.sol @@ -0,0 +1,99 @@ +// SPDX-License-Identifier: MIT + +pragma solidity >=0.7.0 <0.9.0; +pragma experimental ABIEncoderV2; + +import "./WitnetConsumer.sol"; +import "../WitnetRequest.sol"; + +abstract contract UsingWitnetRandomness + is + WitnetConsumer +{ + using Witnet for bytes; + using WitnetCBOR for WitnetCBOR.CBOR; + using WitnetV2 for bytes32; + using WitnetV2 for WitnetV2.RadonSLA; + + bytes32 internal immutable __witnetRandomnessRadHash; + + /// @param _wrb Address of the WitnetOracle contract. + /// @param _baseFeeOverheadPercentage Percentage over base fee to pay as on every data request. + /// @param _callbackGasLimit Maximum gas to be spent by the IWitnetConsumer's callback methods. + constructor( + WitnetOracle _wrb, + uint16 _baseFeeOverheadPercentage, + uint24 _callbackGasLimit + ) + UsingWitnet(_wrb) + WitnetConsumer(_callbackGasLimit) + { + // On-chain building of the Witnet Randomness Request: + { + WitnetRequestFactory _factory = witnet().factory(); + WitnetRequestBytecodes _registry = witnet().registry(); + // Build own Witnet Randomness Request: + bytes32[] memory _retrievals = new bytes32[](1); + _retrievals[0] = _registry.verifyRadonRetrieval( + Witnet.RadonDataRequestMethods.Rng, + "", // no url + "", // no body + new string[2][](0), // no headers + hex"80" // no retrieval script + ); + Witnet.RadonFilter[] memory _filters; + bytes32 _aggregator = _registry.verifyRadonReducer(Witnet.RadonReducer({ + opcode: Witnet.RadonReducerOpcodes.Mode, + filters: _filters // no filters + })); + bytes32 _tally = _registry.verifyRadonReducer(Witnet.RadonReducer({ + opcode: Witnet.RadonReducerOpcodes.ConcatenateAndHash, + filters: _filters // no filters + })); + WitnetRequestTemplate _template = WitnetRequestTemplate(_factory.buildRequestTemplate( + _retrievals, + _aggregator, + _tally, + 32 // 256 bits of pure entropy ;-) + )); + __witnetRandomnessRadHash = WitnetRequest( + _template.buildRequest(new string[][](_retrievals.length)) + ).radHash(); + } + __witnetSetBaseFeeOverheadPercentage(_baseFeeOverheadPercentage); + } + + function _witnetEstimateEvmReward() virtual override internal view returns (uint256) { + return _witnetEstimateEvmReward(32); + } + + function _witnetRandomUniformUint32(uint32 _range, uint256 _nonce, bytes32 _seed) internal pure returns (uint32) { + uint256 _number = uint256( + keccak256( + abi.encode(_seed, _nonce) + ) + ) & uint256(2 ** 224 - 1); + return uint32((_number * _range) >> 224); + } + + function _witnetReadRandomizeFromResultValue(WitnetCBOR.CBOR calldata cborValue) internal pure returns (bytes32) { + return cborValue.readBytes().toBytes32(); + } + + function __witnetRandomize(uint256 _witnetEvmReward) virtual internal returns (uint256) { + return __witnetRandomize(_witnetEvmReward, __witnetDefaultSLA); + } + + function __witnetRandomize( + uint256 _witnetEvmReward, + WitnetV2.RadonSLA memory _witnetQuerySLA + ) + virtual internal + returns (uint256 _randomizeId) + { + return __witnet.postRequest{value: _witnetEvmReward}( + __witnetRandomnessRadHash, + _witnetQuerySLA + ); + } +} diff --git a/contracts/apps/UsingWitnetRequest.sol b/contracts/apps/UsingWitnetRequest.sol new file mode 100644 index 000000000..70a2c20ea --- /dev/null +++ b/contracts/apps/UsingWitnetRequest.sol @@ -0,0 +1,57 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import "./UsingWitnet.sol"; +import "../WitnetRequest.sol"; + +abstract contract UsingWitnetRequest + is UsingWitnet +{ + WitnetRequest immutable public dataRequest; + + bytes32 immutable internal __witnetRequestRadHash; + uint16 immutable internal __witnetQueryResultMaxSize; + + /// @param _witnetRequest Address of the WitnetRequest contract containing the actual data request. + /// @param _baseFeeOverheadPercentage Percentage over base fee to pay as on every data request. + constructor ( + WitnetRequest _witnetRequest, + uint16 _baseFeeOverheadPercentage + ) + UsingWitnet(_witnetRequest.witnet()) + { + require( + _witnetRequest.specs() == type(WitnetRequest).interfaceId, + "UsingWitnetRequest: uncompliant WitnetRequest" + ); + dataRequest = _witnetRequest; + __witnetQueryResultMaxSize = _witnetRequest.resultDataMaxSize(); + __witnetRequestRadHash = _witnetRequest.radHash(); + __witnetSetBaseFeeOverheadPercentage(_baseFeeOverheadPercentage); + } + + function _witnetEstimateEvmReward() + virtual internal view + returns (uint256) + { + return _witnetEstimateEvmReward(__witnetQueryResultMaxSize); + } + + function __witnetRequestData(uint256 _witnetEvmReward) + virtual internal returns (uint256) + { + return __witnetRequestData(_witnetEvmReward, __witnetDefaultSLA); + } + + function __witnetRequestData( + uint256 _witnetEvmReward, + WitnetV2.RadonSLA memory _witnetQuerySLA + ) + virtual internal returns (uint256) + { + return __witnet.postRequest{value: _witnetEvmReward}( + __witnetRequestRadHash, + _witnetQuerySLA + ); + } +} diff --git a/contracts/apps/UsingWitnetRequestTemplate.sol b/contracts/apps/UsingWitnetRequestTemplate.sol new file mode 100644 index 000000000..5785e8e30 --- /dev/null +++ b/contracts/apps/UsingWitnetRequestTemplate.sol @@ -0,0 +1,71 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import "./UsingWitnet.sol"; +import "../WitnetRequest.sol"; + +abstract contract UsingWitnetRequestTemplate + is UsingWitnet +{ + WitnetRequestTemplate immutable public dataRequestTemplate; + + uint16 immutable internal __witnetQueryResultMaxSize; + + /// @param _witnetRequestTemplate Address of the WitnetRequestTemplate from which actual data requests will get built. + /// @param _baseFeeOverheadPercentage Percentage over base fee to pay as on every data request. + constructor ( + WitnetRequestTemplate _witnetRequestTemplate, + uint16 _baseFeeOverheadPercentage + ) + UsingWitnet(_witnetRequestTemplate.witnet()) + { + require( + _witnetRequestTemplate.specs() == type(WitnetRequestTemplate).interfaceId, + "UsingWitnetRequestTemplate: uncompliant WitnetRequestTemplate" + ); + dataRequestTemplate = _witnetRequestTemplate; + __witnetQueryResultMaxSize = _witnetRequestTemplate.resultDataMaxSize(); + __witnetSetBaseFeeOverheadPercentage(_baseFeeOverheadPercentage); + } + + function _witnetBuildRadHash(string[][] memory _witnetRequestArgs) + internal returns (bytes32) + { + return dataRequestTemplate.verifyRadonRequest(_witnetRequestArgs); + } + + function _witnetBuildRequest(string[][] memory _witnetRequestArgs) + internal returns (WitnetRequest) + { + return WitnetRequest(dataRequestTemplate.buildRequest(_witnetRequestArgs)); + } + + function _witnetEstimateEvmReward() + virtual internal view + returns (uint256) + { + return _witnetEstimateEvmReward(__witnetQueryResultMaxSize); + } + + function __witnetRequestData( + uint256 _witnetEvmReward, + string[][] memory _witnetRequestArgs + ) + virtual internal returns (uint256) + { + return __witnetRequestData(_witnetEvmReward, _witnetRequestArgs, __witnetDefaultSLA); + } + + function __witnetRequestData( + uint256 _witnetEvmReward, + string[][] memory _witnetRequestArgs, + WitnetV2.RadonSLA memory _witnetQuerySLA + ) + virtual internal returns (uint256) + { + return __witnet.postRequest{value: _witnetEvmReward}( + _witnetBuildRadHash(_witnetRequestArgs), + _witnetQuerySLA + ); + } +} diff --git a/contracts/apps/WitnetConsumer.sol b/contracts/apps/WitnetConsumer.sol new file mode 100644 index 000000000..60c8b30c1 --- /dev/null +++ b/contracts/apps/WitnetConsumer.sol @@ -0,0 +1,77 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import "./UsingWitnet.sol"; +import "../interfaces/IWitnetConsumer.sol"; + +abstract contract WitnetConsumer + is + IWitnetConsumer, + UsingWitnet +{ + /// @dev Maximum gas to be spent by the IWitnetConsumer's callback methods. + uint24 private immutable __witnetCallbackGasLimit; + + modifier onlyFromWitnet { + require(msg.sender == address(__witnet), "WitnetConsumer: unauthorized"); + _; + } + + /// @param _callbackGasLimit Maximum gas to be spent by the IWitnetConsumer's callback methods. + constructor (uint24 _callbackGasLimit) { + __witnetCallbackGasLimit = _callbackGasLimit; + } + + + /// =============================================================================================================== + /// --- Base implementation of IWitnetConsumer -------------------------------------------------------------------- + + function reportableFrom(address _from) virtual override external view returns (bool) { + return _from == address(__witnet); + } + + + /// =============================================================================================================== + /// --- WitnetConsumer virtual methods ---------------------------------------------------------------------------- + + function _witnetCallbackGasLimit() + virtual internal view + returns (uint24) + { + return __witnetCallbackGasLimit; + } + + function _witnetEstimateEvmReward() virtual internal view returns (uint256) { + return ( + (100 + _witnetBaseFeeOverheadPercentage()) + * __witnet.estimateBaseFeeWithCallback( + tx.gasprice, + _witnetCallbackGasLimit() + ) + ) / 100; + } + + function _witnetEstimateEvmReward(uint16) + virtual override internal view + returns (uint256) + { + return _witnetEstimateEvmReward(); + } + + + /// @notice Estimate the minimum reward required for posting a data request, using `tx.gasprice` as a reference. + /// @dev Underestimates if the size of returned data is greater than `_resultMaxSize`. + /// @param _callbackGasLimit Maximum gas to be spent when reporting the data request result. + function _witnetEstimateEvmRewardWithCallback(uint24 _callbackGasLimit) + virtual internal view + returns (uint256) + { + return ( + (100 + _witnetBaseFeeOverheadPercentage()) + * __witnet.estimateBaseFeeWithCallback( + tx.gasprice, + _callbackGasLimit + ) + ) / 100; + } +} diff --git a/contracts/apps/WitnetFeeds.sol b/contracts/apps/WitnetFeeds.sol new file mode 100644 index 000000000..97462e644 --- /dev/null +++ b/contracts/apps/WitnetFeeds.sol @@ -0,0 +1,39 @@ +// SPDX-License-Identifier: MIT + +pragma solidity >=0.7.0 <0.9.0; + +import "../interfaces/IFeeds.sol"; +import "../interfaces/IWitnetFeeds.sol"; +import "../interfaces/IWitnetFeedsAdmin.sol"; + +import "ado-contracts/contracts/interfaces/IERC2362.sol"; + +abstract contract WitnetFeeds + is + IERC2362, + IFeeds, + IWitnetFeeds, + IWitnetFeedsAdmin, + IWitnetOracleEvents +{ + 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); + + constructor( + Witnet.RadonDataTypes _dataType, + string memory _prefix + ) + { + dataType = _dataType; + __prefix = Witnet.toBytes32(bytes(_prefix)); + } + + bytes32 immutable internal __prefix; + + function prefix() override public view returns (string memory) { + return Witnet.toString(__prefix); + } +} diff --git a/contracts/apps/WitnetPriceSolverBase.sol b/contracts/apps/WitnetPriceSolverBase.sol new file mode 100644 index 000000000..b79c48ed9 --- /dev/null +++ b/contracts/apps/WitnetPriceSolverBase.sol @@ -0,0 +1,62 @@ +// SPDX-License-Identifier: MIT + +pragma solidity >=0.8.0 <0.9.0; + +import "../data/WitnetPriceFeedsData.sol"; +import "../interfaces/IWitnetPriceFeeds.sol"; + +abstract contract WitnetPriceSolverBase + is + IWitnetPriceSolver, + WitnetPriceFeedsData +{ + address public immutable override delegator; + + modifier onlyDelegator { + require( + address(this) == delegator, + "WitnetPriceSolverBase: not the delegator" + ); + _; + } + + constructor() { + delegator = msg.sender; + } + + function specs() external pure returns (bytes4) { + return type(IWitnetPriceSolver).interfaceId; + } + + function validate(bytes4 feedId, string[] calldata deps) virtual override external { + bytes32 _depsFlag; + uint256 _innerDecimals; + require( + deps.length <= 8, + "WitnetPriceSolverBase: too many dependencies" + ); + for (uint _ix = 0; _ix < deps.length; _ix ++) { + bytes4 _depsId4 = bytes4(keccak256(bytes(deps[_ix]))); + Record storage __depsFeed = __records_(_depsId4); + require( + __depsFeed.index > 0, + string(abi.encodePacked( + "WitnetPriceSolverBase: unsupported ", + deps[_ix] + )) + ); + require( + _depsId4 != feedId, + string(abi.encodePacked( + "WitnetPriceSolverBase: loop on ", + deps[_ix] + )) + ); + _depsFlag |= (bytes32(_depsId4) >> (32 * _ix)); + _innerDecimals += __depsFeed.decimals; + } + Record storage __feed = __records_(feedId); + __feed.solverReductor = int(uint(__feed.decimals)) - int(_innerDecimals); + __feed.solverDepsFlag = _depsFlag; + } +} \ No newline at end of file diff --git a/contracts/apps/WitnetRequestConsumer.sol b/contracts/apps/WitnetRequestConsumer.sol new file mode 100644 index 000000000..629fee37a --- /dev/null +++ b/contracts/apps/WitnetRequestConsumer.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import "./UsingWitnetRequest.sol"; +import "./WitnetConsumer.sol"; + +abstract contract WitnetRequestConsumer + is + UsingWitnetRequest, + WitnetConsumer +{ + using WitnetCBOR for WitnetCBOR.CBOR; + using WitnetCBOR for WitnetCBOR.CBOR[]; + + /// @param _witnetRequest Address of the WitnetRequest contract containing the actual data request. + /// @param _baseFeeOverheadPercentage Percentage over base fee to pay as on every data request. + /// @param _callbackGasLimit Maximum gas to be spent by the IWitnetConsumer's callback methods. + constructor( + WitnetRequest _witnetRequest, + uint16 _baseFeeOverheadPercentage, + uint24 _callbackGasLimit + ) + UsingWitnetRequest(_witnetRequest, _baseFeeOverheadPercentage) + WitnetConsumer(_callbackGasLimit) + {} + + function _witnetEstimateEvmReward() + virtual override(UsingWitnetRequest, WitnetConsumer) + internal view + returns (uint256) + { + return WitnetConsumer._witnetEstimateEvmReward(); + } + + function _witnetEstimateEvmReward(uint16) + virtual override(UsingWitnet, WitnetConsumer) + internal view + returns (uint256) + { + return WitnetConsumer._witnetEstimateEvmReward(); + } + +} diff --git a/contracts/apps/WitnetRequestTemplateConsumer.sol b/contracts/apps/WitnetRequestTemplateConsumer.sol new file mode 100644 index 000000000..e728c4bbb --- /dev/null +++ b/contracts/apps/WitnetRequestTemplateConsumer.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import "./UsingWitnetRequestTemplate.sol"; +import "./WitnetConsumer.sol"; + +abstract contract WitnetRequestTemplateConsumer + is + UsingWitnetRequestTemplate, + WitnetConsumer +{ + using WitnetCBOR for WitnetCBOR.CBOR; + using WitnetCBOR for WitnetCBOR.CBOR[]; + + /// @param _witnetRequestTemplate Address of the WitnetRequestTemplate from which actual data requests will get built. + /// @param _baseFeeOverheadPercentage Percentage over base fee to pay as on every data request. + /// @param _callbackGasLimit Maximum gas to be spent by the IWitnetConsumer's callback methods. + constructor( + WitnetRequestTemplate _witnetRequestTemplate, + uint16 _baseFeeOverheadPercentage, + uint24 _callbackGasLimit + ) + UsingWitnetRequestTemplate(_witnetRequestTemplate, _baseFeeOverheadPercentage) + WitnetConsumer(_callbackGasLimit) + {} + + function _witnetEstimateEvmReward() + virtual override(UsingWitnetRequestTemplate, WitnetConsumer) + internal view + returns (uint256) + { + return WitnetConsumer._witnetEstimateEvmReward(__witnetQueryResultMaxSize); + } + + function _witnetEstimateEvmReward(uint16) + virtual override(UsingWitnet, WitnetConsumer) + internal view + returns (uint256) + { + return WitnetConsumer._witnetEstimateEvmReward(); + } + +} diff --git a/contracts/core/WitnetDeployer.sol b/contracts/core/WitnetDeployer.sol new file mode 100644 index 000000000..ddcda5a87 --- /dev/null +++ b/contracts/core/WitnetDeployer.sol @@ -0,0 +1,85 @@ +// SPDX-License-Identifier: MIT + +pragma solidity >=0.8.0 <0.9.0; + +import "./WitnetProxy.sol"; +import "../libs/Create3.sol"; + +/// @notice WitnetDeployer contract used both as CREATE2 (EIP-1014) factory for Witnet artifacts, +/// @notice and CREATE3 (EIP-3171) factory for Witnet proxies. +/// @author Guillermo Díaz + +contract WitnetDeployer { + + /// @notice Use given `_initCode` and `_salt` to deploy a contract into a deterministic address. + /// @dev The address of deployed address will be determined by both the `_initCode` and the `_salt`, but not the address + /// @dev nor the nonce of the caller (i.e. see EIP-1014). + /// @param _initCode Creation code, including construction logic and input parameters. + /// @param _salt Arbitrary value to modify resulting address. + /// @return _deployed Just deployed contract address. + function deploy(bytes memory _initCode, bytes32 _salt) + external + returns (address _deployed) + { + _deployed = determineAddr(_initCode, _salt); + if (_deployed.code.length == 0) { + assembly { + _deployed := create2(0, add(_initCode, 0x20), mload(_initCode), _salt) + } + require(_deployed != address(0), "WitnetDeployer: deployment failed"); + } + } + + /// @notice Determine counter-factual address of the contract that would be deployed by the given `_initCode` and a `_salt`. + /// @param _initCode Creation code, including construction logic and input parameters. + /// @param _salt Arbitrary value to modify resulting address. + /// @return Deterministic contract address. + function determineAddr(bytes memory _initCode, bytes32 _salt) + public view + returns (address) + { + return address( + uint160(uint(keccak256( + abi.encodePacked( + bytes1(0xff), + address(this), + _salt, + keccak256(_initCode) + ) + ))) + ); + } + + function determineProxyAddr(bytes32 _salt) + public view + returns (address) + { + return Create3.determineAddr(_salt); + } + + function proxify(bytes32 _proxySalt, address _firstImplementation, bytes memory _initData) + external + returns (WitnetProxy) + { + address _proxyAddr = determineProxyAddr(_proxySalt); + if (_proxyAddr.code.length == 0) { + // deploy the WitnetProxy + Create3.deploy(_proxySalt, type(WitnetProxy).creationCode); + // settle first implementation address, + WitnetProxy(payable(_proxyAddr)).upgradeTo( + _firstImplementation, + // and initialize it, providing + abi.encode( + // the owner (i.e. the caller of this function) + msg.sender, + // and some (optional) initialization data + _initData + ) + ); + return WitnetProxy(payable(_proxyAddr)); + } else { + revert("WitnetDeployer: already proxified"); + } + } + +} \ No newline at end of file diff --git a/contracts/impls/WitnetProxy.sol b/contracts/core/WitnetProxy.sol similarity index 87% rename from contracts/impls/WitnetProxy.sol rename to contracts/core/WitnetProxy.sol index d640592a8..fb5249e1d 100644 --- a/contracts/impls/WitnetProxy.sol +++ b/contracts/core/WitnetProxy.sol @@ -6,7 +6,7 @@ pragma experimental ABIEncoderV2; import "../patterns/Upgradeable.sol"; /// @title WitnetProxy: upgradable delegate-proxy contract. -/// @author The Witnet Foundation. +/// @author Guillermo Díaz contract WitnetProxy { /// Event emitted every time the implementation gets updated. @@ -75,7 +75,7 @@ contract WitnetProxy { msg.sender ) ); - require(_wasCalled, "WitnetProxy: not compliant"); + require(_wasCalled, "WitnetProxy: uncompliant implementation"); require(abi.decode(_result, (bool)), "WitnetProxy: not authorized"); require( Upgradeable(_oldImplementation).proxiableUUID() == Upgradeable(_newImplementation).proxiableUUID(), @@ -84,16 +84,26 @@ contract WitnetProxy { } // Initialize new implementation within proxy-context storage: - (bool _wasInitialized,) = _newImplementation.delegatecall( + (bool _wasInitialized, bytes memory _returnData) = _newImplementation.delegatecall( abi.encodeWithSignature( "initialize(bytes)", _initData ) ); - require(_wasInitialized, "WitnetProxy: unable to initialize"); + if (!_wasInitialized) { + if (_returnData.length < 68) { + revert("WitnetProxy: initialization failed"); + } else { + assembly { + _returnData := add(_returnData, 0x04) + } + revert(abi.decode(_returnData, (string))); + } + } // If all checks and initialization pass, update implementation address: __proxySlot().implementation = _newImplementation; + emit Upgraded(_newImplementation); // Asserts new implementation complies w/ minimal implementation of Upgradeable interface: @@ -101,7 +111,7 @@ contract WitnetProxy { return _isUpgradable; } catch { - revert ("WitnetProxy: not compliant"); + revert ("WitnetProxy: uncompliant implementation"); } } diff --git a/contracts/impls/WitnetUpgradableBase.sol b/contracts/core/WitnetUpgradableBase.sol similarity index 78% rename from contracts/impls/WitnetUpgradableBase.sol rename to contracts/core/WitnetUpgradableBase.sol index 5d6bc17a6..57b316272 100644 --- a/contracts/impls/WitnetUpgradableBase.sol +++ b/contracts/core/WitnetUpgradableBase.sol @@ -4,7 +4,6 @@ pragma solidity >=0.8.0 <0.9.0; -import "../patterns/ERC165.sol"; import "../patterns/Ownable2Step.sol"; import "../patterns/ReentrancyGuard.sol"; import "../patterns/Upgradeable.sol"; @@ -12,20 +11,16 @@ import "../patterns/Upgradeable.sol"; import "./WitnetProxy.sol"; /// @title Witnet Request Board base contract, with an Upgradeable (and Destructible) touch. -/// @author The Witnet Foundation. +/// @author Guillermo Díaz abstract contract WitnetUpgradableBase is - ERC165, Ownable2Step, Upgradeable, ReentrancyGuard { bytes32 internal immutable _WITNET_UPGRADABLE_VERSION; - error AlreadyUpgraded(address implementation); - error NotCompliant(bytes4 interfaceId); - error NotUpgradable(address self); - error OnlyOwner(address owner); + address public immutable deployer = msg.sender; constructor( bool _upgradable, @@ -43,22 +38,7 @@ abstract contract WitnetUpgradableBase revert("WitnetUpgradableBase: not implemented"); } - - // ================================================================================================================ - // --- Overrides IERC165 interface -------------------------------------------------------------------------------- - - /// @dev See {IERC165-supportsInterface}. - function supportsInterface(bytes4 _interfaceId) - public view - virtual override - returns (bool) - { - return _interfaceId == type(Ownable2Step).interfaceId - || _interfaceId == type(Upgradeable).interfaceId - || super.supportsInterface(_interfaceId); - } - - + // ================================================================================================================ // --- Overrides 'Proxiable' -------------------------------------------------------------------------------------- diff --git a/contracts/core/customs/WitnetRequestBoardTrustableObscuro.sol b/contracts/core/customs/WitnetRequestBoardTrustableObscuro.sol new file mode 100644 index 000000000..add5c2a0b --- /dev/null +++ b/contracts/core/customs/WitnetRequestBoardTrustableObscuro.sol @@ -0,0 +1,83 @@ +// SPDX-License-Identifier: MIT + +/* solhint-disable var-name-mixedcase */ + +pragma solidity >=0.7.0 <0.9.0; +pragma experimental ABIEncoderV2; + +import "../defaults/WitnetRequestBoardTrustableDefault.sol"; + +/// @title Witnet Request Board "trustable" implementation contract. +/// @notice Contract to bridge requests to Witnet Decentralized Oracle Network. +/// @dev This contract enables posting requests that Witnet bridges will insert into the Witnet network. +/// The result of the requests will be posted back to this contract by the bridge nodes too. +/// @author The Witnet Foundation +contract WitnetRequestBoardTrustableObscuro + is + WitnetRequestBoardTrustableDefault +{ + function class() virtual override external view returns (string memory) { + return type(WitnetRequestBoardTrustableObscuro).name; + } + + constructor( + WitnetRequestFactory _factory, + WitnetRequestBytecodes _registry, + bool _upgradable, + bytes32 _versionTag, + uint256 _reportResultGasBase, + uint256 _reportResultWithCallbackGasBase, + uint256 _reportResultWithCallbackRevertGasBase, + uint256 _sstoreFromZeroGas + ) + WitnetRequestBoardTrustableDefault( + _factory, + _registry, + _upgradable, + _versionTag, + _reportResultGasBase, + _reportResultWithCallbackGasBase, + _reportResultWithCallbackRevertGasBase, + _sstoreFromZeroGas + ) + {} + + + // ================================================================================================================ + // --- Overrides implementation of 'IWitnetOracleView' ------------------------------------------------------ + + /// @notice Gets the whole Query data contents, if any, no matter its current status. + /// @dev Fails if or if `msg.sender` is not the actual requester. + function getQuery(uint256 _queryId) + public view + virtual override + onlyRequester(_queryId) + returns (WitnetV2.Query memory) + { + return WitnetRequestBoardTrustableBase.getQuery(_queryId); + } + + /// @notice Retrieves the whole `Witnet.Response` record referred to a previously posted Witnet Data Request. + /// @dev Fails if the `_queryId` is not in 'Reported' status, or if `msg.sender` is not the actual requester. + /// @param _queryId The unique query identifier + function getQueryResponse(uint256 _queryId) + public view + virtual override + onlyRequester(_queryId) + returns (WitnetV2.Response memory _response) + { + return WitnetRequestBoardTrustableBase.getQueryResponse(_queryId); + } + + /// @notice Gets error code identifying some possible failure on the resolution of the given query. + /// @param _queryId The unique query identifier. + function getQueryResultError(uint256 _queryId) + public view + virtual override + onlyRequester(_queryId) + returns (Witnet.ResultError memory) + { + return WitnetRequestBoardTrustableBase.getQueryResultError(_queryId); + } + +} diff --git a/contracts/core/customs/WitnetRequestBoardTrustableOvm2.sol b/contracts/core/customs/WitnetRequestBoardTrustableOvm2.sol new file mode 100644 index 000000000..b050875a8 --- /dev/null +++ b/contracts/core/customs/WitnetRequestBoardTrustableOvm2.sol @@ -0,0 +1,91 @@ +// SPDX-License-Identifier: MIT + +/* solhint-disable var-name-mixedcase */ + +pragma solidity >=0.7.0 <0.9.0; +pragma experimental ABIEncoderV2; + +import "../defaults/WitnetRequestBoardTrustableDefault.sol"; + +// solhint-disable-next-line +interface OVM_GasPriceOracle { + function getL1Fee(bytes calldata _data) external view returns (uint256); +} + +/// @title Witnet Request Board "trustable" implementation contract. +/// @notice Contract to bridge requests to Witnet Decentralized Oracle Network. +/// @dev This contract enables posting requests that Witnet bridges will insert into the Witnet network. +/// The result of the requests will be posted back to this contract by the bridge nodes too. +/// @author The Witnet Foundation +contract WitnetRequestBoardTrustableOvm2 + is + WitnetRequestBoardTrustableDefault +{ + OVM_GasPriceOracle immutable public gasPriceOracleL1; + + function class() virtual override external view returns (string memory) { + return type(WitnetRequestBoardTrustableOvm2).name; + } + + constructor( + WitnetRequestFactory _factory, + WitnetRequestBytecodes _registry, + bool _upgradable, + bytes32 _versionTag, + uint256 _reportResultGasBase, + uint256 _reportResultWithCallbackGasBase, + uint256 _reportResultWithCallbackRevertGasBase, + uint256 _sstoreFromZeroGas + ) + WitnetRequestBoardTrustableDefault( + _factory, + _registry, + _upgradable, + _versionTag, + _reportResultGasBase, + _reportResultWithCallbackGasBase, + _reportResultWithCallbackRevertGasBase, + _sstoreFromZeroGas + ) + { + gasPriceOracleL1 = OVM_GasPriceOracle(0x420000000000000000000000000000000000000F); + } + + + // ================================================================================================================ + // --- Overrides 'IWitnetOracle' ---------------------------------------------------------------------------- + + /// @notice Estimate the minimum reward required for posting a data request. + /// @dev Underestimates if the size of returned data is greater than `_resultMaxSize`. + /// @param _gasPrice Expected gas price to pay upon posting the data request. + /// @param _resultMaxSize Maximum expected size of returned data (in bytes). + function estimateBaseFee(uint256 _gasPrice, uint16 _resultMaxSize) + public view + virtual override + returns (uint256) + { + return WitnetRequestBoardTrustableDefault.estimateBaseFee(_gasPrice, _resultMaxSize) + ( + _gasPrice * gasPriceOracleL1.getL1Fee( + hex"c8f5cdd500000000000000000000000000000000000000000000000000000000ffffffff00000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000225820ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" + ) + ); + } + + /// @notice Estimate the minimum reward required for posting a data request with a callback. + /// @param _gasPrice Expected gas price to pay upon posting the data request. + /// @param _callbackGasLimit Maximum gas to be spent when reporting the data request result. + function estimateBaseFeeWithCallback(uint256 _gasPrice, uint24 _callbackGasLimit) + public view + virtual override + returns (uint256) + { + return WitnetRequestBoardTrustableDefault.estimateBaseFeeWithCallback( + _gasPrice, + _callbackGasLimit + ) + ( + _gasPrice * gasPriceOracleL1.getL1Fee( + hex"c8f5cdd500000000000000000000000000000000000000000000000000000000ffffffff00000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000225820ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" + ) + ); + } +} diff --git a/contracts/core/customs/WitnetRequestBoardTrustableReef.sol b/contracts/core/customs/WitnetRequestBoardTrustableReef.sol new file mode 100644 index 000000000..88f8e1795 --- /dev/null +++ b/contracts/core/customs/WitnetRequestBoardTrustableReef.sol @@ -0,0 +1,82 @@ +// SPDX-License-Identifier: MIT + +/* solhint-disable var-name-mixedcase */ + +pragma solidity >=0.7.0 <0.9.0; +pragma experimental ABIEncoderV2; + +// Inherits from: +import "../defaults/WitnetRequestBoardTrustableDefault.sol"; + +/// @title Witnet Request Board OVM-compatible (Optimism) "trustable" implementation. +/// @notice Contract to bridge requests to Witnet Decentralized Oracle Network. +/// @dev This contract enables posting requests that Witnet bridges will insert into the Witnet network. +/// The result of the requests will be posted back to this contract by the bridge nodes too. +/// @author The Witnet Foundation +contract WitnetOracleTrustableReef + is + WitnetRequestBoardTrustableDefault +{ + function class() virtual override external view returns (string memory) { + return type(WitnetOracleTrustableReef).name; + } + + constructor( + WitnetRequestFactory _factory, + WitnetRequestBytecodes _registry, + bool _upgradable, + bytes32 _versionTag, + uint256 _reportResultGasBase, + uint256 _reportResultWithCallbackGasBase, + uint256 _reportResultWithCallbackRevertGasBase, + uint256 _sstoreFromZeroGas + ) + WitnetRequestBoardTrustableDefault( + _factory, + _registry, + _upgradable, + _versionTag, + _reportResultGasBase, + _reportResultWithCallbackGasBase, + _reportResultWithCallbackRevertGasBase, + _sstoreFromZeroGas + ) + {} + + // ================================================================================================================ + // --- Overrides 'IWitnetOracle' ---------------------------------------------------------------------------- + + /// @notice Estimate the minimum reward required for posting a data request. + /// @dev Underestimates if the size of returned data is greater than `_resultMaxSize`. + /// @param _resultMaxSize Maximum expected size of returned data (in bytes). + function estimateBaseFee(uint256, uint16 _resultMaxSize) + public view + virtual override + returns (uint256) + { + return WitnetRequestBoardTrustableDefault.estimateBaseFee(1, _resultMaxSize); + } + + /// @notice Estimate the minimum reward required for posting a data request with a callback. + /// @param _callbackGasLimit Maximum gas to be spent when reporting the data request result. + function estimateBaseFeeWithCallback(uint256, uint24 _callbackGasLimit) + public view + virtual override + returns (uint256) + { + return WitnetRequestBoardTrustableDefault.estimateBaseFeeWithCallback(1, _callbackGasLimit); + } + + + // ================================================================================================================ + // --- Overrides 'Payable' ---------------------------------------------------------------------------------------- + + /// Gets current transaction price. + function _getGasPrice() + internal pure + virtual override + returns (uint256) + { + return 1; + } +} diff --git a/contracts/core/customs/WitnetRequestBytecodesNoSha256.sol b/contracts/core/customs/WitnetRequestBytecodesNoSha256.sol new file mode 100644 index 000000000..dc0c02f0c --- /dev/null +++ b/contracts/core/customs/WitnetRequestBytecodesNoSha256.sol @@ -0,0 +1,23 @@ +// SPDX-License-Identifier: MIT + +pragma solidity >=0.7.0 <0.9.0; +pragma experimental ABIEncoderV2; + +import "../defaults/WitnetRequestBytecodesDefault.sol"; + +contract WitnetRequestBytecodesNoSha256 + is + WitnetRequestBytecodesDefault +{ + function class() virtual override external view returns (string memory) { + return type(WitnetRequestBytecodesNoSha256).name; + } + + constructor(bool _upgradable, bytes32 _versionTag) + WitnetRequestBytecodesDefault(_upgradable, _versionTag) + {} + + function _witnetHash(bytes memory chunk) virtual override internal pure returns (bytes32) { + return keccak256(chunk); + } +} \ No newline at end of file diff --git a/contracts/impls/core/customs/WitnetRequestFactoryCfxCore.sol b/contracts/core/customs/WitnetRequestFactoryCfxCore.sol similarity index 55% rename from contracts/impls/core/customs/WitnetRequestFactoryCfxCore.sol rename to contracts/core/customs/WitnetRequestFactoryCfxCore.sol index 87090fb62..2a820cbd5 100644 --- a/contracts/impls/core/customs/WitnetRequestFactoryCfxCore.sol +++ b/contracts/core/customs/WitnetRequestFactoryCfxCore.sol @@ -3,15 +3,23 @@ pragma solidity >=0.7.0 <0.9.0; pragma experimental ABIEncoderV2; -import "../WitnetRequestFactoryDefault.sol"; +import "../defaults/WitnetRequestFactoryDefault.sol"; + +contract WitnetRequestFactoryCfxCore + is + WitnetRequestFactoryDefault +{ + function class() virtual override external view returns (string memory) { + return type(WitnetRequestFactoryCfxCore).name; + } -contract WitnetRequestFactoryCfxCore is WitnetRequestFactoryDefault { constructor( - WitnetBytecodes _registry, + WitnetOracle _witnet, + WitnetRequestBytecodes _registry, bool _upgradable, bytes32 _versionTag ) - WitnetRequestFactoryDefault(_registry, _upgradable, _versionTag) + WitnetRequestFactoryDefault(_witnet, _registry, _upgradable, _versionTag) {} function _cloneDeterministic(bytes32 _salt) diff --git a/contracts/impls/apps/WitnetPriceFeedsUpgradable.sol b/contracts/core/defaults/WitnetPriceFeedsDefault.sol similarity index 65% rename from contracts/impls/apps/WitnetPriceFeedsUpgradable.sol rename to contracts/core/defaults/WitnetPriceFeedsDefault.sol index 515a640c9..901a160ce 100644 --- a/contracts/impls/apps/WitnetPriceFeedsUpgradable.sol +++ b/contracts/core/defaults/WitnetPriceFeedsDefault.sol @@ -3,36 +3,53 @@ pragma solidity >=0.7.0 <0.9.0; pragma experimental ABIEncoderV2; +import "../WitnetUpgradableBase.sol"; + import "../../WitnetPriceFeeds.sol"; -import "../../data/WitnetPriceFeedsData.sol"; -import "../../impls/WitnetUpgradableBase.sol"; -import "../../interfaces/V2/IWitnetPriceSolver.sol"; +import "../../data/WitnetPriceFeedsData.sol"; import "../../libs/WitnetPriceFeedsLib.sol"; +import "../../patterns/Ownable2Step.sol"; -/// @title WitnetPriceFeedsUpgradable: ... -/// @author Witnet Foundation. -contract WitnetPriceFeedsUpgradable +/// @title WitnetPriceFeeds: Price Feeds live repository reliant on the Witnet Oracle blockchain. +/// @author Guillermo Díaz + +contract WitnetPriceFeedsDefault is + Ownable2Step, WitnetPriceFeeds, WitnetPriceFeedsData, WitnetUpgradableBase + { + using Witnet for bytes; using Witnet for Witnet.Result; + using WitnetV2 for WitnetV2.Response; using WitnetV2 for WitnetV2.RadonSLA; + + function class() virtual override external view returns (string memory) { + return type(WitnetPriceFeedsDefault).name; + } + + bytes4 immutable public override specs = type(IWitnetPriceFeeds).interfaceId; + WitnetOracle immutable public override witnet; + + WitnetV2.RadonSLA private __defaultRadonSLA; constructor( - WitnetRequestBoard _wrb, + WitnetOracle _wrb, bool _upgradable, - bytes32 _version + bytes32 _versionTag ) - WitnetPriceFeeds(_wrb) + Ownable(address(msg.sender)) WitnetUpgradableBase( _upgradable, - _version, - "io.witnet.proxiable.router" + _versionTag, + "io.witnet.proxiable.feeds.price" ) - {} + { + witnet = _wrb; + } // solhint-disable-next-line payable-fallback fallback() override external { @@ -43,7 +60,7 @@ contract WitnetPriceFeedsUpgradable address _solver = __records_(bytes4(bytes8(msg.data) << 32)).solver; require( _solver != address(0), - "WitnetPriceFeedsUpgradable: unsettled solver" + "WitnetPriceFeeds: unsettled solver" ); assembly { let ptr := mload(0x40) @@ -56,60 +73,64 @@ contract WitnetPriceFeedsUpgradable default { return(ptr, size) } } } else { - revert("WitnetPriceFeedsUpgradable: not implemented"); + revert("WitnetPriceFeeds: not implemented"); } } // ================================================================================================================ - // --- Overrides 'Upgradeable' ------------------------------------------------------------------------------------- + // --- Overrides 'Upgradeable' ------------------------------------------------------------------------------------ /// @notice Re-initialize contract's storage context upon a new upgrade from a proxy. /// @dev Must fail when trying to upgrade to same logic contract more than once. - function initialize(bytes memory) - public override - onlyDelegateCalls // => we don't want the logic base contract to be ever initialized + function initialize(bytes memory _initData) + public + override { - if ( - __proxiable().proxy == address(0) - && __proxiable().implementation == address(0) - ) { - // a proxy is being initialized for the first time... - __proxiable().proxy = address(this); - _transferOwnership(msg.sender); + address _owner = owner(); + if (_owner == address(0)) { + // set owner as specified by first argument in _initData + _owner = abi.decode(_initData, (address)); + _transferOwnership(_owner); + // settle default Radon SLA upon first initialization + __defaultRadonSLA = WitnetV2.RadonSLA({ + committeeSize: 10, + witnessingFee: 2 ** 8 // 0.2 $WIT + }); } else { // only the owner can initialize: - if (msg.sender != owner()) { - revert("WitnetPriceFeedsUpgradable: not the owner"); - } + require( + msg.sender == _owner, + "WitnetPriceFeeds: not the owner" + ); } + + if ( + __proxiable().codehash != bytes32(0) + && __proxiable().codehash == codehash() + ) { + revert("WitnetPriceFeeds: already upgraded"); + } + __proxiable().codehash = codehash(); + require( - __proxiable().implementation != base(), - "WitnetPriceFeedsUpgradable: already initialized" + address(witnet).code.length > 0, + "WitnetPriceFeeds: inexistent oracle" ); - if (__storage().defaultSlaHash == 0) { - settleDefaultRadonSLA(WitnetV2.RadonSLA({ - numWitnesses: 5, - witnessCollateral: 15 * 10 ** 9, - witnessReward: 15 * 10 ** 7, - minerCommitRevealFee: 10 ** 7, - minConsensusPercentage: 51 - })); - } - __proxiable().implementation = base(); - emit Upgraded(msg.sender, base(), codehash(), version()); + require( + witnet.specs() == type(IWitnetOracle).interfaceId, + "WitnetPriceFeeds: uncompliant oracle" + ); + emit Upgraded(_owner, base(), codehash(), version()); } /// Tells whether provided address could eventually upgrade the contract. - function isUpgradableFrom(address _from) - override - external view - returns (bool) - { + function isUpgradableFrom(address _from) external view override returns (bool) { + address _owner = owner(); return ( - // false if the contract is set as not upgradable, or `_from` is not the owner + // false if the WRB is intrinsically not upgradable, or `_from` is no owner isUpgradable() - && _from == owner() + && _owner == _from ); } @@ -172,43 +193,27 @@ contract WitnetPriceFeedsUpgradable function defaultRadonSLA() override public view - returns (WitnetV2.RadonSLA memory) - { - return registry.lookupRadonSLA(__storage().defaultSlaHash); - } - - function estimateUpdateBaseFee(bytes4, uint256 _evmGasPrice, uint256) - virtual override - public view - returns (uint) + returns (Witnet.RadonSLA memory) { - // TODO: refactor when WRB.estimateBaseFee(bytes32,bytes32,uint256,uint256) is implemented. - return witnet.estimateReward(_evmGasPrice); + return __defaultRadonSLA.toV1(); } - function estimateUpdateBaseFee(bytes4, uint256 _evmGasPrice, uint256, bytes32) + function estimateUpdateBaseFee(uint256 _evmGasPrice) virtual override public view returns (uint) { - // TODO: refactor when WRB.estimateBaseFee(bytes32,bytes32,uint256,uint256) is implemented. - return witnet.estimateReward(_evmGasPrice); + return witnet.estimateBaseFee(_evmGasPrice, 32); } - function latestResponse(bytes4 feedId) + function lastValidResponse(bytes4 feedId) override public view - returns (Witnet.Response memory) + returns (WitnetV2.Response memory) { - return witnet.readResponse(_latestValidQueryId(feedId)); - } - - function latestResult(bytes4 feedId) - override external view - returns (Witnet.Result memory) - { - return witnet.readResponseResult(_latestValidQueryId(feedId)); + return witnet.getQueryResponse(_lastValidQueryId(feedId)); } + function latestUpdateQueryId(bytes4 feedId) override public view returns (uint256) @@ -218,149 +223,120 @@ contract WitnetPriceFeedsUpgradable function latestUpdateRequest(bytes4 feedId) override external view - returns (Witnet.Request memory) + returns (WitnetV2.Request memory) { - return witnet.readRequest(latestUpdateQueryId(feedId)); + return witnet.getQueryRequest(latestUpdateQueryId(feedId)); } function latestUpdateResponse(bytes4 feedId) override external view - returns (Witnet.Response memory) + returns (WitnetV2.Response memory) { - return witnet.readResponse(latestUpdateQueryId(feedId)); + return witnet.getQueryResponse(latestUpdateQueryId(feedId)); } function latestUpdateResultError(bytes4 feedId) override external view returns (Witnet.ResultError memory) { - return witnet.checkResultError(latestUpdateQueryId(feedId)); + return witnet.getQueryResultError(latestUpdateQueryId(feedId)); } - function latestUpdateResultStatus(bytes4 feedId) + function latestUpdateResponseStatus(bytes4 feedId) override public view - returns (Witnet.ResultStatus) + returns (WitnetV2.ResponseStatus) { - return _checkQueryResultStatus(latestUpdateQueryId(feedId)); + return _checkQueryResponseStatus(latestUpdateQueryId(feedId)); } - function lookupBytecode(bytes4 feedId) + function lookupWitnetBytecode(bytes4 feedId) override external view returns (bytes memory) { Record storage __record = __records_(feedId); require( __record.radHash != 0, - "WitnetPriceFeedsUpgradable: no RAD hash" - ); - return registry.bytecodeOf( - __record.radHash, - __storage().defaultSlaHash + "WitnetPriceFeeds: no RAD hash" ); + return registry().bytecodeOf(__record.radHash); } - function lookupRadHash(bytes4 feedId) + function lookupWitnetRadHash(bytes4 feedId) override public view returns (bytes32) { return __records_(feedId).radHash; } - function lookupRetrievals(bytes4 feedId) + function lookupWitnetRetrievals(bytes4 feedId) override external view - returns (WitnetV2.RadonRetrieval[] memory _retrievals) + returns (Witnet.RadonRetrieval[] memory _retrievals) { - bytes32[] memory _hashes = registry.lookupRadonRequestSources(lookupRadHash(feedId)); - _retrievals = new WitnetV2.RadonRetrieval[](_hashes.length); + bytes32[] memory _hashes = registry().lookupRadonRequestSources(lookupWitnetRadHash(feedId)); + _retrievals = new Witnet.RadonRetrieval[](_hashes.length); for (uint _ix = 0; _ix < _retrievals.length; _ix ++) { - _retrievals[_ix] = registry.lookupRadonRetrieval(_hashes[_ix]); + _retrievals[_ix] = registry().lookupRadonRetrieval(_hashes[_ix]); } } + function registry() public view virtual override returns (WitnetRequestBytecodes) { + return WitnetOracle(address(witnet)).registry(); + } + function requestUpdate(bytes4 feedId) external payable virtual override returns (uint256) { - return _requestUpdate(feedId, __storage().defaultSlaHash); + return __requestUpdate(feedId, __defaultRadonSLA); } - function requestUpdate(bytes4 feedId, bytes32 _slaHash) + function requestUpdate(bytes4 feedId, WitnetV2.RadonSLA calldata updateSLA) public payable virtual override returns (uint256 _usedFunds) { require( - registry.lookupRadonSLA(_slaHash).equalOrGreaterThan(defaultRadonSLA()), - "WitnetPriceFeedsUpgradable: unsecure update" + updateSLA.equalOrGreaterThan(__defaultRadonSLA), + "WitnetPriceFeeds: unsecure update" ); - return _requestUpdate(feedId, _slaHash); + return __requestUpdate(feedId, updateSLA); } - function _requestUpdate(bytes4[] memory _deps, bytes32 slaHash) - virtual internal - returns (uint256 _usedFunds) + + // ================================================================================================================ + // --- Implements 'IWitnetFeedsAdmin' ----------------------------------------------------------------------------- + + function owner() + virtual override (IWitnetFeedsAdmin, Ownable) + public view + returns (address) { - uint _partial = msg.value / _deps.length; - for (uint _ix = 0; _ix < _deps.length; _ix ++) { - _usedFunds += this.requestUpdate{value: _partial}(_deps[_ix], slaHash); - } + return Ownable.owner(); } - - function _requestUpdate(bytes4 feedId, bytes32 _slaHash) - virtual internal - returns (uint256 _usedFunds) + + function acceptOwnership() + virtual override (IWitnetFeedsAdmin, Ownable2Step) + public { - Record storage __feed = __records_(feedId); - if (__feed.radHash != 0) { - _usedFunds = estimateUpdateBaseFee(feedId, tx.gasprice, 0, _slaHash); - require(msg.value>= _usedFunds, "WitnetPriceFeedsUpgradable: reward too low"); - uint _latestId = __feed.latestUpdateQueryId; - Witnet.ResultStatus _latestStatus = _checkQueryResultStatus(_latestId); - if (_latestStatus == Witnet.ResultStatus.Awaiting) { - // latest update is still pending, so just increase the reward - // accordingly to current tx gasprice: - int _deltaReward = int(witnet.readRequestReward(_latestId)) - int(_usedFunds); - if (_deltaReward > 0) { - _usedFunds = uint(_deltaReward); - witnet.upgradeReward{value: _usedFunds}(_latestId); - emit UpdatingFeedReward(msg.sender, feedId, _usedFunds); - } else { - _usedFunds = 0; - } - } else { - // Check if latest update ended successfully: - if (_latestStatus == Witnet.ResultStatus.Ready) { - // If so, remove previous last valid query from the WRB: - if (__feed.latestValidQueryId > 0) { - witnet.deleteQuery(__feed.latestValidQueryId); - } - __feed.latestValidQueryId = _latestId; - } else { - // Otherwise, try to delete latest query, as it was faulty - // and we are about to post a new update request: - try witnet.deleteQuery(_latestId) {} catch {} - } - // Post update request to the WRB: - _latestId = witnet.postRequest{value: _usedFunds}(__feed.radHash, _slaHash); - // Update latest query id: - __feed.latestUpdateQueryId = _latestId; - emit UpdatingFeed(msg.sender, feedId, _slaHash, _usedFunds); - } - } else if (__feed.solver != address(0)) { - _usedFunds = _requestUpdate(_depsOf(feedId), _slaHash); - } else { - revert("WitnetPriceFeedsUpgradable: unknown feed"); - } - if (_usedFunds < msg.value) { - // transfer back unused funds: - payable(msg.sender).transfer(msg.value - _usedFunds); - } + Ownable2Step.acceptOwnership(); } - - // ================================================================================================================ - // --- Implements 'IWitnetFeedsAdmin' ----------------------------------------------------------------------- + function pendingOwner() + virtual override (IWitnetFeedsAdmin, Ownable2Step) + public view + returns (address) + { + return Ownable2Step.pendingOwner(); + } + + function transferOwnership(address _newOwner) + virtual override (IWitnetFeedsAdmin, Ownable2Step) + public + onlyOwner + { + Ownable.transferOwnership(_newOwner); + } function deleteFeed(string calldata caption) virtual override @@ -371,7 +347,7 @@ contract WitnetPriceFeedsUpgradable bytes4[] storage __ids = __storage().ids; Record storage __record = __records_(feedId); uint _index = __record.index; - require(_index != 0, "WitnetPriceFeedsUpgradable: unknown feed"); + require(_index != 0, "WitnetPriceFeeds: unknown feed"); { bytes4 _lastFeedId = __ids[__ids.length - 1]; __ids[_index - 1] = _lastFeedId; @@ -381,11 +357,12 @@ contract WitnetPriceFeedsUpgradable emit DeletedFeed(msg.sender, feedId, caption); } - function settleDefaultRadonSLA(WitnetV2.RadonSLA memory sla) + function settleDefaultRadonSLA(WitnetV2.RadonSLA calldata defaultSLA) override public onlyOwner { - __storage().defaultSlaHash = registry.verifyRadonSLA(sla); + require(defaultSLA.isValid(), "WitnetPriceFeeds: invalid SLA"); + __defaultRadonSLA = defaultSLA; } function settleFeedRequest(string calldata caption, bytes32 radHash) @@ -393,8 +370,8 @@ contract WitnetPriceFeedsUpgradable onlyOwner { require( - registry.lookupRadonRequestResultDataType(radHash) == dataType, - "WitnetPriceFeedsUpgradable: bad result data type" + registry().lookupRadonRequestResultDataType(radHash) == dataType, + "WitnetPriceFeeds: bad result data type" ); bytes4 feedId = hash(caption); Record storage __record = __records_(feedId); @@ -441,7 +418,7 @@ contract WitnetPriceFeedsUpgradable { require( solver != address(0), - "WitnetPriceFeedsUpgradable: no solver address" + "WitnetPriceFeeds: no solver address" ); bytes4 feedId = hash(caption); Record storage __record = __records_(feedId); @@ -487,7 +464,7 @@ contract WitnetPriceFeedsUpgradable _reason := add(_reason, 4) } revert(string(abi.encodePacked( - "WitnetPriceFeedsUpgradable: smoke-test failed: ", + "WitnetPriceFeeds: smoke-test failed: ", string(abi.decode(_reason,(string))) ))); } @@ -525,15 +502,15 @@ contract WitnetPriceFeedsUpgradable public view returns (IWitnetPriceSolver.Price memory) { - uint _queryId = _latestValidQueryId(feedId); + uint _queryId = _lastValidQueryId(feedId); if (_queryId > 0) { - Witnet.Response memory _latestResponse = latestResponse(feedId); - Witnet.Result memory _latestResult = Witnet.resultFromCborBytes(_latestResponse.cborBytes); + WitnetV2.Response memory _lastValidResponse = lastValidResponse(feedId); + Witnet.Result memory _latestResult = _lastValidResponse.resultCborBytes.toWitnetResult(); return IWitnetPriceSolver.Price({ value: _latestResult.asUint(), - timestamp: _latestResponse.timestamp, - drTxHash: _latestResponse.drTxHash, - status: latestUpdateResultStatus(feedId) + timestamp: _lastValidResponse.resultTimestamp, + tallyHash: _lastValidResponse.resultTallyHash, + status: latestUpdateResponseStatus(feedId) }); } else { address _solver = __records_(feedId).solver; @@ -548,7 +525,7 @@ contract WitnetPriceFeedsUpgradable _result := add(_result, 4) } revert(string(abi.encodePacked( - "WitnetPriceFeedsUpgradable: ", + "WitnetPriceFeeds: ", string(abi.decode(_result, (string))) ))); } else { @@ -558,8 +535,8 @@ contract WitnetPriceFeedsUpgradable return IWitnetPriceSolver.Price({ value: 0, timestamp: 0, - drTxHash: 0, - status: latestUpdateResultStatus(feedId) + tallyHash: 0, + status: latestUpdateResponseStatus(feedId) }); } } @@ -616,11 +593,13 @@ contract WitnetPriceFeedsUpgradable return ( int(_latestPrice.value), _latestPrice.timestamp, - _latestPrice.status == Witnet.ResultStatus.Ready + _latestPrice.status == WitnetV2.ResponseStatus.Ready ? 200 - : _latestPrice.status == Witnet.ResultStatus.Awaiting - ? 404 - : 400 + : ( + _latestPrice.status == WitnetV2.ResponseStatus.Awaiting + || _latestPrice.status == WitnetV2.ResponseStatus.AwaitingReady + || _latestPrice.status == WitnetV2.ResponseStatus.AwaitingError + ) ? 404 : 400 ); } @@ -628,29 +607,29 @@ contract WitnetPriceFeedsUpgradable // ================================================================================================================ // --- Internal methods ------------------------------------------------------------------------------------------- - function _checkQueryResultStatus(uint _queryId) + function _checkQueryResponseStatus(uint _queryId) internal view - returns (Witnet.ResultStatus) + returns (WitnetV2.ResponseStatus) { if (_queryId > 0) { - return witnet.checkResultStatus(_queryId); + return witnet.getQueryResponseStatus(_queryId); } else { - return Witnet.ResultStatus.Ready; + return WitnetV2.ResponseStatus.Ready; } } - function _latestValidQueryId(bytes4 feedId) + function _lastValidQueryId(bytes4 feedId) virtual internal view returns (uint256) { uint _latestUpdateQueryId = latestUpdateQueryId(feedId); if ( _latestUpdateQueryId > 0 - && witnet.checkResultStatus(_latestUpdateQueryId) == Witnet.ResultStatus.Ready + && witnet.getQueryResponseStatus(_latestUpdateQueryId) == WitnetV2.ResponseStatus.Ready ) { return _latestUpdateQueryId; } else { - return __records_(feedId).latestValidQueryId; + return __records_(feedId).lastValidQueryId; } } @@ -661,9 +640,93 @@ contract WitnetPriceFeedsUpgradable return _decimals; } catch Error(string memory reason) { revert(string(abi.encodePacked( - "WitnetPriceFeedsUpgradable: ", + "WitnetPriceFeeds: ", reason ))); } } + + function __requestUpdate(bytes4[] memory _deps, WitnetV2.RadonSLA memory sla) + virtual internal + returns (uint256 _usedFunds) + { + uint _partial = msg.value / _deps.length; + for (uint _ix = 0; _ix < _deps.length; _ix ++) { + _usedFunds += this.requestUpdate{value: _partial}(_deps[_ix], sla); + } + } + + function __requestUpdate(bytes4 feedId, WitnetV2.RadonSLA memory querySLA) + virtual internal + returns (uint256 _usedFunds) + { + Record storage __feed = __records_(feedId); + if (__feed.radHash != 0) { + _usedFunds = estimateUpdateBaseFee(tx.gasprice); + require( + msg.value >= _usedFunds, + "WitnetPriceFeeds: insufficient reward" + ); + uint _latestId = __feed.latestUpdateQueryId; + WitnetV2.ResponseStatus _latestStatus = _checkQueryResponseStatus(_latestId); + if (_latestStatus == WitnetV2.ResponseStatus.Awaiting) { + // latest update is still pending, so just increase the reward + // accordingly to current tx gasprice: + int _deltaReward = int(witnet.getQueryEvmReward(_latestId)) - int(_usedFunds); + if (_deltaReward > 0) { + _usedFunds = uint(_deltaReward); + witnet.upgradeQueryEvmReward{value: _usedFunds}(_latestId); + // solhint-disable avoid-tx-origin + emit UpdateRequestReward( + tx.origin, + feedId, + _latestId, + _usedFunds + ); + } else { + _usedFunds = 0; + } + } else { + // Check if latest update ended successfully: + if (_latestStatus == WitnetV2.ResponseStatus.Ready) { + // If so, remove previous last valid query from the WRB: + if (__feed.lastValidQueryId > 0) { + witnet.fetchQueryResponse(__feed.lastValidQueryId); + } + __feed.lastValidQueryId = _latestId; + } else { + // Otherwise, try to delete latest query, as it was faulty + // and we are about to post a new update request: + try witnet.fetchQueryResponse(_latestId) {} catch {} + } + // Post update request to the WRB: + _latestId = witnet.postRequest{value: _usedFunds}( + __feed.radHash, + querySLA + ); + // Update latest query id: + __feed.latestUpdateQueryId = _latestId; + // solhint-disable avoid-tx-origin: + emit UpdateRequest( + tx.origin, + feedId, + _latestId, + _usedFunds, + querySLA + ); + } + } else if (__feed.solver != address(0)) { + _usedFunds = __requestUpdate( + _depsOf(feedId), + querySLA + ); + } else { + revert("WitnetPriceFeeds: unknown feed"); + } + if (_usedFunds < msg.value) { + // transfer back unused funds: + payable(msg.sender).transfer(msg.value - _usedFunds); + } + } + } diff --git a/contracts/core/defaults/WitnetRequestBoardTrustableBase.sol b/contracts/core/defaults/WitnetRequestBoardTrustableBase.sol new file mode 100644 index 000000000..209a5f1a2 --- /dev/null +++ b/contracts/core/defaults/WitnetRequestBoardTrustableBase.sol @@ -0,0 +1,980 @@ +// SPDX-License-Identifier: MIT + +pragma solidity >=0.7.0 <0.9.0; +pragma experimental ABIEncoderV2; + +import "../WitnetUpgradableBase.sol"; +import "../../WitnetOracle.sol"; +import "../../WitnetRequestFactory.sol"; + +import "../../data/WitnetRequestBoardDataACLs.sol"; +import "../../interfaces/IWitnetRequestBoardAdminACLs.sol"; +import "../../interfaces/IWitnetRequestBoardReporter.sol"; +import "../../interfaces/IWitnetConsumer.sol"; +import "../../libs/WitnetErrorsLib.sol"; +import "../../patterns/Payable.sol"; + +/// @title Witnet Request Board "trustable" base implementation contract. +/// @notice Contract to bridge requests to Witnet Decentralized Oracle Network. +/// @dev This contract enables posting requests that Witnet bridges will insert into the Witnet network. +/// The result of the requests will be posted back to this contract by the bridge nodes too. +/// @author The Witnet Foundation +abstract contract WitnetRequestBoardTrustableBase + is + WitnetUpgradableBase, + WitnetOracle, + WitnetRequestBoardDataACLs, + IWitnetRequestBoardReporter, + IWitnetRequestBoardAdminACLs, + Payable +{ + using Witnet for bytes; + using Witnet for Witnet.Result; + using WitnetCBOR for WitnetCBOR.CBOR; + using WitnetV2 for WitnetV2.RadonSLA; + using WitnetV2 for WitnetV2.Request; + using WitnetV2 for WitnetV2.Response; + + bytes4 public immutable override specs = type(IWitnetOracle).interfaceId; + WitnetRequestBytecodes immutable public override registry; + + WitnetRequestFactory immutable private __factory; + + modifier checkCallbackRecipient(address _addr, uint24 _callbackGasLimit) { + require( + _addr.code.length > 0 && IWitnetConsumer(_addr).reportableFrom(address(this)) && _callbackGasLimit > 0, + "WitnetOracle: invalid callback" + ); _; + } + + modifier checkReward(uint256 _baseFee) { + require( + _getMsgValue() >= _baseFee, + "WitnetOracle: insufficient reward" + ); _; + } + + modifier checkSLA(WitnetV2.RadonSLA calldata sla) { + require( + WitnetV2.isValid(sla), + "WitnetOracle: invalid SLA" + ); _; + } + + constructor( + WitnetRequestFactory _factory, + WitnetRequestBytecodes _registry, + bool _upgradable, + bytes32 _versionTag, + address _currency + ) + Ownable(address(msg.sender)) + Payable(_currency) + WitnetUpgradableBase( + _upgradable, + _versionTag, + "io.witnet.proxiable.board" + ) + { + __factory = _factory; + registry = _registry; + } + + receive() external payable { + revert("WitnetOracle: no transfers accepted"); + } + + /// @dev Provide backwards compatibility for dapps bound to versions <= 0.6.1 + /// @dev (i.e. calling methods in IWitnetOracle) + /// @dev (Until 'function ... abi(...)' modifier is allegedly supported in solc versions >= 0.9.1) + /* solhint-disable payable-fallback */ + /* solhint-disable no-complex-fallback */ + fallback() override external { + revert(string(abi.encodePacked( + "WitnetOracle: not implemented: 0x", + Witnet.toHexString(uint8(bytes1(msg.sig))), + Witnet.toHexString(uint8(bytes1(msg.sig << 8))), + Witnet.toHexString(uint8(bytes1(msg.sig << 16))), + Witnet.toHexString(uint8(bytes1(msg.sig << 24))) + ))); + } + + function channel() virtual override public view returns (bytes4) { + return bytes4(keccak256(abi.encode(address(this), block.chainid))); + } + + function factory() virtual override public view returns (WitnetRequestFactory) { + return __factory; + } + + + // ================================================================================================================ + // --- Yet to be implemented virtual methods ---------------------------------------------------------------------- + + /// @notice Estimate the minimum reward required for posting a data request. + /// @dev Underestimates if the size of returned data is greater than `_resultMaxSize`. + /// @param _gasPrice Expected gas price to pay upon posting the data request. + /// @param _resultMaxSize Maximum expected size of returned data (in bytes). + function estimateBaseFee(uint256 _gasPrice, uint16 _resultMaxSize) virtual public view returns (uint256); + + /// @notice Estimate the minimum reward required for posting a data request with a callback. + /// @param _gasPrice Expected gas price to pay upon posting the data request. + /// @param _callbackGasLimit Maximum gas to be spent when reporting the data request result. + function estimateBaseFeeWithCallback(uint256 _gasPrice, uint24 _callbackGasLimit) virtual public view returns (uint256); + + + // ================================================================================================================ + // --- Overrides 'Upgradeable' ------------------------------------------------------------------------------------ + + /// @notice Re-initialize contract's storage context upon a new upgrade from a proxy. + /// @dev Must fail when trying to upgrade to same logic contract more than once. + function initialize(bytes memory _initData) + public + override + { + address _owner = __storage().owner; + address[] memory _reporters; + + if (_owner == address(0)) { + // get owner (and reporters) from _initData + bytes memory _reportersRaw; + (_owner, _reportersRaw) = abi.decode(_initData, (address, bytes)); + __storage().owner = _owner; + _reporters = abi.decode(_reportersRaw, (address[])); + } else { + // only owner can initialize: + require( + msg.sender == _owner, + "WitnetOracle: not the owner" + ); + // get reporters from _initData + _reporters = abi.decode(_initData, (address[])); + } + + if (__storage().base != address(0)) { + // current implementation cannot be initialized more than once: + require( + __storage().base != base(), + "WitnetOracle: already upgraded" + ); + } + __storage().base = base(); + + require( + address(__factory).code.length > 0, + "WitnetOracle: inexistent factory" + ); + require( + __factory.specs() == type(IWitnetRequestFactory).interfaceId, + "WitnetOracle: uncompliant factory" + ); + require( + address(__factory.witnet()) == address(this) + && address(__factory.registry()) == address(registry), + "WitnetOracle: discordant factory" + ); + + // Set reporters + __setReporters(_reporters); + + emit Upgraded(_owner, base(), codehash(), version()); + } + + /// Tells whether provided address could eventually upgrade the contract. + function isUpgradableFrom(address _from) external view override returns (bool) { + address _owner = __storage().owner; + return ( + // false if the WRB is intrinsically not upgradable, or `_from` is no owner + isUpgradable() + && _owner == _from + ); + } + + + // ================================================================================================================ + // --- Partial implementation of IWitnetOracle -------------------------------------------------------------- + + /// @notice Estimate the minimum reward required for posting a data request. + /// @dev Underestimates if the size of returned data is greater than `resultMaxSize`. + /// @param gasPrice Expected gas price to pay upon posting the data request. + /// @param radHash The hash of some Witnet Data Request previously posted in the WitnetRequestBytecodes registry. + function estimateBaseFee(uint256 gasPrice, bytes32 radHash) + override + public view + returns (uint256) + { + uint16 _resultMaxSize = registry.lookupRadonRequestResultMaxSize(radHash); + require( + _resultMaxSize > 0, + "WitnetRequestBoardTrustableDefault: invalid RAD" + ); + return estimateBaseFee( + gasPrice, + _resultMaxSize + ); + } + + /// Retrieves copy of all response data related to a previously posted request, removing the whole query from storage. + /// @dev Fails if the `_witnetQueryId` is not in 'Reported' status, or called from an address different to + /// @dev the one that actually posted the given request. + /// @param _witnetQueryId The unique query identifier. + function fetchQueryResponse(uint256 _witnetQueryId) + virtual override + external + inStatus(_witnetQueryId, WitnetV2.QueryStatus.Reported) + onlyRequester(_witnetQueryId) + returns (WitnetV2.Response memory _response) + { + _response = __seekQuery(_witnetQueryId).response; + delete __storage().queries[_witnetQueryId]; + } + + /// Gets the whole Query data contents, if any, no matter its current status. + function getQuery(uint256 _witnetQueryId) + public view + virtual override + returns (WitnetV2.Query memory) + { + return __storage().queries[_witnetQueryId]; + } + + /// Retrieves the reward currently set for the given query. + /// @dev Fails if the `_witnetQueryId` is not valid or, if it has already been + /// @dev reported, or deleted. + /// @param _witnetQueryId The unique query identifier + function getQueryEvmReward(uint256 _witnetQueryId) + override + external view + inStatus(_witnetQueryId, WitnetV2.QueryStatus.Posted) + returns (uint256) + { + return __seekQueryRequest(_witnetQueryId).evmReward; + } + + + /// @notice Retrieves the RAD hash and SLA parameters of the given query. + /// @param _witnetQueryId The unique query identifier. + function getQueryRequest(uint256 _witnetQueryId) + external view + override + returns (WitnetV2.Request memory) + { + return __seekQueryRequest(_witnetQueryId); + } + + /// Retrieves the Witnet-provable result, and metadata, to a previously posted request. + /// @dev Fails if the `_witnetQueryId` is not in 'Reported' status. + /// @param _witnetQueryId The unique query identifier + function getQueryResponse(uint256 _witnetQueryId) + public view + virtual override + returns (WitnetV2.Response memory _response) + { + return __seekQueryResponse(_witnetQueryId); + } + + /// @notice Returns query's result current status from a requester's point of view: + /// @notice - 0 => Void: the query is either non-existent or deleted; + /// @notice - 1 => Awaiting: the query has not yet been reported; + /// @notice - 2 => Ready: the query has been succesfully solved; + /// @notice - 3 => Error: the query couldn't get solved due to some issue. + /// @param _witnetQueryId The unique query identifier. + function getQueryResponseStatus(uint256 _witnetQueryId) + virtual public view + returns (WitnetV2.ResponseStatus) + { + WitnetV2.QueryStatus _queryStatus = _statusOf(_witnetQueryId); + if ( + _queryStatus == WitnetV2.QueryStatus.Finalized + || _queryStatus == WitnetV2.QueryStatus.Reported + ) { + bytes storage __cborValues = __seekQueryResponse(_witnetQueryId).resultCborBytes; + // determine whether reported result is an error by peeking the first byte + return (__cborValues[0] == bytes1(0xd8) + ? (_queryStatus == WitnetV2.QueryStatus.Finalized + ? WitnetV2.ResponseStatus.Error + : WitnetV2.ResponseStatus.AwaitingError + ) : (_queryStatus == WitnetV2.QueryStatus.Finalized + ? WitnetV2.ResponseStatus.Ready + : WitnetV2.ResponseStatus.AwaitingReady + ) + ); + } else if ( + _queryStatus == WitnetV2.QueryStatus.Posted + || _queryStatus == WitnetV2.QueryStatus.Undeliverable + ) { + return WitnetV2.ResponseStatus.Awaiting; + } else { + return WitnetV2.ResponseStatus.Void; + } + } + + /// @notice Gets error code identifying some possible failure on the resolution of the given query. + /// @param _witnetQueryId The unique query identifier. + function getQueryResultError(uint256 _witnetQueryId) + virtual override + public view + returns (Witnet.ResultError memory) + { + WitnetV2.ResponseStatus _status = getQueryResponseStatus(_witnetQueryId); + try WitnetErrorsLib.asResultError(_status, __seekQueryResponse(_witnetQueryId).resultCborBytes) + returns (Witnet.ResultError memory _resultError) + { + return _resultError; + } + catch Error(string memory _reason) { + return Witnet.ResultError({ + code: Witnet.ResultErrorCodes.Unknown, + reason: string(abi.encodePacked("WitnetErrorsLib: ", _reason)) + }); + } + catch (bytes memory) { + return Witnet.ResultError({ + code: Witnet.ResultErrorCodes.Unknown, + reason: "WitnetErrorsLib: assertion failed" + }); + } + } + + /// Gets current status of given query. + function getQueryStatus(uint256 _witnetQueryId) + external view + override + returns (WitnetV2.QueryStatus) + { + return _statusOf(_witnetQueryId); + } + + /// @notice Retrieves the Witnet Data Request bytecode of a previously posted query. + /// @dev Fails if the query does not exist. + /// @param _witnetQueryId The unique query identifier. + function getQueryWitnetBytecode(uint256 _witnetQueryId) + external view + virtual override + returns (bytes memory) + { + require( + _statusOf(_witnetQueryId) != WitnetV2.QueryStatus.Unknown, + "WitnetOracle: unknown query" + ); + WitnetV2.Request storage __request = __seekQueryRequest(_witnetQueryId); + if (__request.witnetRAD != bytes32(0)) { + return registry.bytecodeOf(__request.witnetRAD); + } else { + return __request.witnetBytecode; + } + } + + /// @notice Returns next query id to be generated by the Witnet Request Board. + function getNextQueryId() + external view + override + returns (uint256) + { + return __storage().nonce; + } + + + /// @notice Requests the execution of the given Witnet Data Request, in expectation that it will be relayed and + /// @notice solved by the Witnet blockchain. A reward amount is escrowed by the Witnet Request Board that will be + /// @notice transferred to the reporter who relays back the Witnet-provable result to this request. + /// @dev Reasons to fail: + /// @dev - the RAD hash was not previously verified by the WitnetRequestBytecodes registry; + /// @dev - invalid SLA parameters were provided; + /// @dev - insufficient value is paid as reward. + /// @param _queryRAD The RAD hash of the data request to be solved by Witnet. + /// @param _querySLA The data query SLA to be fulfilled on the Witnet blockchain. + /// @return _witnetQueryId Unique query identifier. + function postRequest( + bytes32 _queryRAD, + WitnetV2.RadonSLA calldata _querySLA + ) + virtual override + external payable + checkReward(estimateBaseFee(_getGasPrice(), _queryRAD)) + checkSLA(_querySLA) + returns (uint256 _witnetQueryId) + { + _witnetQueryId = __postRequest(_queryRAD, _querySLA, 0); + // Let Web3 observers know that a new request has been posted + emit WitnetQuery( + _witnetQueryId, + _getMsgValue(), + _querySLA.witTotalFee() + ); + } + + /// @notice Requests the execution of the given Witnet Data Request, in expectation that it will be relayed and solved by + /// @notice the Witnet blockchain. A reward amount is escrowed by the Witnet Request Board that will be transferred to the + /// @notice reporter who relays back the Witnet-provable result to this request. The Witnet-provable result will be reported + /// @notice directly to the requesting contract. If the report callback fails for any reason, an `WitnetResponseDeliveryFailed` + /// @notice will be triggered, and the Witnet audit trail will be saved in storage, but not so the actual CBOR-encoded result. + /// @dev Reasons to fail: + /// @dev - the caller is not a contract implementing the IWitnetConsumer interface; + /// @dev - the RAD hash was not previously verified by the WitnetRequestBytecodes registry; + /// @dev - invalid SLA parameters were provided; + /// @dev - zero callback gas limit is provided; + /// @dev - insufficient value is paid as reward. + /// @param _queryRAD The RAD hash of the data request to be solved by Witnet. + /// @param _querySLA The data query SLA to be fulfilled on the Witnet blockchain. + /// @param _queryCallbackGasLimit Maximum gas to be spent when reporting the data request result. + /// @return _witnetQueryId Unique query identifier. + function postRequestWithCallback( + bytes32 _queryRAD, + WitnetV2.RadonSLA calldata _querySLA, + uint24 _queryCallbackGasLimit + ) + virtual override + external payable + checkCallbackRecipient(msg.sender, _queryCallbackGasLimit) + checkReward(estimateBaseFeeWithCallback(_getGasPrice(), _queryCallbackGasLimit)) + checkSLA(_querySLA) + returns (uint256 _witnetQueryId) + { + _witnetQueryId = __postRequest( + _queryRAD, + _querySLA, + _queryCallbackGasLimit + ); + emit WitnetQuery( + _witnetQueryId, + _getMsgValue(), + _querySLA.witTotalFee() + ); + } + + /// @notice Requests the execution of the given Witnet Data Request, in expectation that it will be relayed and solved by + /// @notice the Witnet blockchain. A reward amount is escrowed by the Witnet Request Board that will be transferred to the + /// @notice reporter who relays back the Witnet-provable result to this request. The Witnet-provable result will be reported + /// @notice directly to the requesting contract. If the report callback fails for any reason, a `WitnetResponseDeliveryFailed` + /// @notice event will be triggered, and the Witnet audit trail will be saved in storage, but not so the CBOR-encoded result. + /// @dev Reasons to fail: + /// @dev - the caller is not a contract implementing the IWitnetConsumer interface; + /// @dev - the provided bytecode is empty; + /// @dev - invalid SLA parameters were provided; + /// @dev - zero callback gas limit is provided; + /// @dev - insufficient value is paid as reward. + /// @param _queryUnverifiedBytecode The (unverified) bytecode containing the actual data request to be solved by the Witnet blockchain. + /// @param _querySLA The data query SLA to be fulfilled on the Witnet blockchain. + /// @param _queryCallbackGasLimit Maximum gas to be spent when reporting the data request result. + /// @return _witnetQueryId Unique query identifier. + function postRequestWithCallback( + bytes calldata _queryUnverifiedBytecode, + WitnetV2.RadonSLA calldata _querySLA, + uint24 _queryCallbackGasLimit + ) + virtual override + external payable + checkCallbackRecipient(msg.sender, _queryCallbackGasLimit) + checkReward(estimateBaseFeeWithCallback(_getGasPrice(), _queryCallbackGasLimit)) + checkSLA(_querySLA) + returns (uint256 _witnetQueryId) + { + _witnetQueryId = __postRequest( + bytes32(0), + _querySLA, + _queryCallbackGasLimit + ); + __seekQueryRequest(_witnetQueryId).witnetBytecode = _queryUnverifiedBytecode; + emit WitnetQuery( + _witnetQueryId, + _getMsgValue(), + _querySLA.witTotalFee() + ); + } + + /// Increments the reward of a previously posted request by adding the transaction value to it. + /// @dev Fails if the `_witnetQueryId` is not in 'Posted' status. + /// @param _witnetQueryId The unique query identifier. + function upgradeQueryEvmReward(uint256 _witnetQueryId) + external payable + virtual override + inStatus(_witnetQueryId, WitnetV2.QueryStatus.Posted) + { + WitnetV2.Request storage __request = __seekQueryRequest(_witnetQueryId); + __request.evmReward += uint72(_getMsgValue()); + emit WitnetQueryRewardUpgraded(_witnetQueryId, __request.evmReward); + } + + + // ================================================================================================================ + // --- Full implementation of IWitnetRequestBoardReporter --------------------------------------------------------- + + /// @notice Estimates the actual earnings (or loss), in WEI, that a reporter would get by reporting result to given query, + /// @notice based on the gas price of the calling transaction. Data requesters should consider upgrading the reward on + /// @notice queries providing no actual earnings. + /// @dev Fails if the query does not exist, or if deleted. + function estimateQueryEarnings(uint256[] calldata _witnetQueryIds, uint256 _gasPrice) + virtual override + external view + returns (int256 _earnings) + { + uint256 _expenses; uint256 _revenues; + for (uint _ix = 0; _ix < _witnetQueryIds.length; _ix ++) { + if (_statusOf(_witnetQueryIds[_ix]) == WitnetV2.QueryStatus.Posted) { + WitnetV2.Request storage __request = __seekQueryRequest(_witnetQueryIds[_ix]); + _revenues += __request.evmReward; + _expenses += _gasPrice * __request.gasCallback; + } + } + return int256(_revenues) - int256(_expenses); + } + + /// Reports the Witnet-provable result to a previously posted request. + /// @dev Will assume `block.timestamp` as the timestamp at which the request was solved. + /// @dev Fails if: + /// @dev - the `_witnetQueryId` is not in 'Posted' status. + /// @dev - provided `_witnetQueryResultTallyHash` is zero; + /// @dev - length of provided `_result` is zero. + /// @param _witnetQueryId The unique identifier of the data request. + /// @param _witnetQueryResultTallyHash Hash of the commit/reveal witnessing act that took place in the Witnet blockahin. + /// @param _witnetQueryResultCborBytes The result itself as bytes. + function reportResult( + uint256 _witnetQueryId, + bytes32 _witnetQueryResultTallyHash, + bytes calldata _witnetQueryResultCborBytes + ) + external + override + onlyReporters + inStatus(_witnetQueryId, WitnetV2.QueryStatus.Posted) + returns (uint256) + { + require( + _witnetQueryResultTallyHash != 0, + "WitnetRequestBoardTrustableDefault: tally has cannot be zero" + ); + // Ensures the result bytes do not have zero length + // This would not be a valid encoding with CBOR and could trigger a reentrancy attack + require( + _witnetQueryResultCborBytes.length != 0, + "WitnetRequestBoardTrustableDefault: result cannot be empty" + ); + // Do actual report: + // solhint-disable not-rely-on-time + return __reportResultAndReward( + _witnetQueryId, + uint32(block.timestamp), + _witnetQueryResultTallyHash, + _witnetQueryResultCborBytes + ); + } + + /// Reports the Witnet-provable result to a previously posted request. + /// @dev Fails if: + /// @dev - called from unauthorized address; + /// @dev - the `_witnetQueryId` is not in 'Posted' status. + /// @dev - provided `_witnetQueryResultTallyHash` is zero; + /// @dev - length of provided `_witnetQueryResultCborBytes` is zero. + /// @param _witnetQueryId The unique query identifier + /// @param _witnetQueryResultTimestamp Timestamp at which the reported value was captured by the Witnet blockchain. + /// @param _witnetQueryResultTallyHash Hash of the commit/reveal witnessing act that took place in the Witnet blockahin. + /// @param _witnetQueryResultCborBytes The result itself as bytes. + function reportResult( + uint256 _witnetQueryId, + uint32 _witnetQueryResultTimestamp, + bytes32 _witnetQueryResultTallyHash, + bytes calldata _witnetQueryResultCborBytes + ) + external + override + onlyReporters + inStatus(_witnetQueryId, WitnetV2.QueryStatus.Posted) + returns (uint256) + { + require( + _witnetQueryResultTimestamp <= block.timestamp, + "WitnetRequestBoardTrustableDefault: bad timestamp" + ); + require( + _witnetQueryResultTallyHash != 0, + "WitnetRequestBoardTrustableDefault: Witnet tallyHash cannot be zero" + ); + // Ensures the result bytes do not have zero length (this would not be a valid CBOR encoding + // and could trigger a reentrancy attack) + require( + _witnetQueryResultCborBytes.length != 0, + "WitnetRequestBoardTrustableDefault: result cannot be empty" + ); + // Do actual report and return reward transfered to the reproter: + return __reportResultAndReward( + _witnetQueryId, + _witnetQueryResultTimestamp, + _witnetQueryResultTallyHash, + _witnetQueryResultCborBytes + ); + } + + /// Reports Witnet-provable results to multiple requests within a single EVM tx. + /// @dev Fails if called from unauthorized address. + /// @dev Emits a PostedResult event for every succesfully reported result, if any. + /// @param _batchResults Array of BatchedResult structs, every one containing: + /// - unique query identifier; + /// - timestamp of the solving tally txs in Witnet. If zero is provided, EVM-timestamp will be used instead; + /// - hash of the corresponding data request tx at the Witnet side-chain level; + /// - data request result in raw bytes. + /// @param _verbose If true, emits a BatchReportError event for every failing report, if any. + function reportResultBatch( + IWitnetRequestBoardReporter.BatchResult[] calldata _batchResults, + bool _verbose + ) + external + override + onlyReporters + returns (uint256 _batchReward) + { + for ( uint _i = 0; _i < _batchResults.length; _i ++) { + if (_statusOf(_batchResults[_i].queryId) != WitnetV2.QueryStatus.Posted) { + if (_verbose) { + emit BatchReportError( + _batchResults[_i].queryId, + "WitnetOracle: bad queryId" + ); + } + } else if (_batchResults[_i].queryResultTallyHash == 0) { + if (_verbose) { + emit BatchReportError( + _batchResults[_i].queryId, + "WitnetOracle: bad tallyHash" + ); + } + } else if (_batchResults[_i].queryResultCborBytes.length == 0) { + if (_verbose) { + emit BatchReportError( + _batchResults[_i].queryId, + "WitnetOracle: bad cborBytes" + ); + } + } else if ( + _batchResults[_i].queryResultTimestamp > 0 + && uint256(_batchResults[_i].queryResultTimestamp) > block.timestamp + ) { + if (_verbose) { + emit BatchReportError( + _batchResults[_i].queryId, + "WitnetOracle: bad timestamp" + ); + } + } else { + _batchReward += __reportResult( + _batchResults[_i].queryId, + _batchResults[_i].queryResultTimestamp == uint32(0) + ? uint32(block.timestamp) + : _batchResults[_i].queryResultTimestamp + , + _batchResults[_i].queryResultTallyHash, + _batchResults[_i].queryResultCborBytes + ); + } + } + // Transfer rewards to all reported results in one single transfer to the reporter: + if (_batchReward > 0) { + __safeTransferTo( + payable(msg.sender), + _batchReward + ); + } + } + + + // ================================================================================================================ + // --- Full implementation of 'IWitnetRequestBoardAdmin' ---------------------------------------------------------- + + /// Gets admin/owner address. + function owner() + public view + override + returns (address) + { + return __storage().owner; + } + + /// Transfers ownership. + function transferOwnership(address _newOwner) + public + virtual override + onlyOwner + { + address _owner = __storage().owner; + if (_newOwner != _owner) { + __storage().owner = _newOwner; + emit OwnershipTransferred(_owner, _newOwner); + } + } + + + // ================================================================================================================ + // --- Full implementation of 'IWitnetRequestBoardAdminACLs' ------------------------------------------------------ + + /// Tells whether given address is included in the active reporters control list. + /// @param _reporter The address to be checked. + function isReporter(address _reporter) public view override returns (bool) { + return __acls().isReporter_[_reporter]; + } + + /// Adds given addresses to the active reporters control list. + /// @dev Can only be called from the owner address. + /// @dev Emits the `ReportersSet` event. + /// @param _reporters List of addresses to be added to the active reporters control list. + function setReporters(address[] memory _reporters) + public + override + onlyOwner + { + __setReporters(_reporters); + } + + /// Removes given addresses from the active reporters control list. + /// @dev Can only be called from the owner address. + /// @dev Emits the `ReportersUnset` event. + /// @param _exReporters List of addresses to be added to the active reporters control list. + function unsetReporters(address[] memory _exReporters) + public + override + onlyOwner + { + for (uint ix = 0; ix < _exReporters.length; ix ++) { + address _reporter = _exReporters[ix]; + __acls().isReporter_[_reporter] = false; + } + emit ReportersUnset(_exReporters); + } + + + // ================================================================================================================ + // --- Internal functions ----------------------------------------------------------------------------------------- + + function __newQueryId(bytes32 _queryRAD, bytes32 _querySLA) + virtual internal view + returns (uint256) + { + return uint(keccak256(abi.encode( + channel(), + block.number, + msg.sender, + _queryRAD, + _querySLA + ))); + } + + function __postRequest(bytes32 _radHash, WitnetV2.RadonSLA calldata _sla, uint24 _callbackGasLimit) + virtual internal + returns (uint256 _witnetQueryId) + { + _witnetQueryId = ++ __storage().nonce; //__newQueryId(_radHash, _packedSLA); + WitnetV2.Request storage __request = __seekQueryRequest(_witnetQueryId); + require(__request.requester != address(0), "WitnetOracle: already posted"); + { + __request.requester = msg.sender; + __request.gasCallback = _callbackGasLimit; + __request.evmReward = uint72(_getMsgValue()); + __request.witnetRAD = _radHash; + __request.witnetSLA = _sla; + } + } + + function __reportResult( + uint256 _witnetQueryId, + uint32 _witnetQueryResultTimestamp, + bytes32 _witnetQueryResultTallyHash, + bytes calldata _witnetQueryResultCborBytes + ) + virtual internal + returns (uint256 _evmReward) + { + // read requester address and whether a callback was requested: + WitnetV2.Request storage __request = __seekQueryRequest(_witnetQueryId); + + // read query EVM reward: + _evmReward = __request.evmReward; + + // set EVM reward right now as to avoid re-entrancy attacks: + __request.evmReward = 0; + + // determine whether a callback is required + if (__request.gasCallback > 0) { + ( + uint256 _evmCallbackActualGas, + bool _evmCallbackSuccess, + string memory _evmCallbackRevertMessage + ) = __reportResultCallback( + _witnetQueryId, + _witnetQueryResultTimestamp, + _witnetQueryResultTallyHash, + _witnetQueryResultCborBytes, + __request.requester, + __request.gasCallback + ); + if (_evmCallbackSuccess) { + // => the callback run successfully + emit WitnetResponseDelivered( + _witnetQueryId, + _getGasPrice(), + _evmCallbackActualGas + ); + // upon successfull delivery, the audit trail is saved into storage, but not the actual result + // as it was already passed over to the requester: + __writeQueryResponse( + _witnetQueryId, + _witnetQueryResultTimestamp, + _witnetQueryResultTallyHash, + hex"" + ); + } else { + // => the callback reverted + emit WitnetResponseDeliveryFailed( + _witnetQueryId, + _witnetQueryResultCborBytes, + _getGasPrice(), + _evmCallbackActualGas, + bytes(_evmCallbackRevertMessage).length > 0 + ? _evmCallbackRevertMessage + : "WitnetOracle: callback exceeded gas limit" + ); + // upon failing delivery, only the witnet result tally hash is saved into storage, + // as to distinguish Reported vs Undelivered status. The query result is not saved + // into storage as to avoid buffer-overflow attacks (on reporters): + __writeQueryResponse( + _witnetQueryId, + 0, + _witnetQueryResultTallyHash, + hex"" + ); + } + } else { + // => no callback is involved + emit WitnetQueryReported( + _witnetQueryId, + _getGasPrice() + ); + // write query result and audit trail data into storage + __writeQueryResponse( + _witnetQueryId, + _witnetQueryResultTimestamp, + _witnetQueryResultTallyHash, + _witnetQueryResultCborBytes + ); + } + } + + function __reportResultAndReward( + uint256 _witnetQueryId, + uint32 _witnetQueryResultTimestamp, + bytes32 _witnetQueryResultTallyHash, + bytes calldata _witnetQueryResultCborBytes + ) + virtual internal + returns (uint256 _evmReward) + { + _evmReward = __reportResult( + _witnetQueryId, + _witnetQueryResultTimestamp, + _witnetQueryResultTallyHash, + _witnetQueryResultCborBytes + ); + // transfer reward to reporter + __safeTransferTo( + payable(msg.sender), + _evmReward + ); + } + + function __reportResultCallback( + uint256 _witnetQueryId, + uint64 _witnetQueryResultTimestamp, + bytes32 _witnetQueryResultTallyHash, + bytes calldata _witnetQueryResultCborBytes, + address _evmRequester, + uint256 _evmCallbackGasLimit + ) + virtual internal + returns ( + uint256 _evmCallbackActualGas, + bool _evmCallbackSuccess, + string memory _evmCallbackRevertMessage + ) + { + _evmCallbackActualGas = gasleft(); + if (_witnetQueryResultCborBytes[0] == bytes1(0xd8)) { + WitnetCBOR.CBOR[] memory _errors = WitnetCBOR.fromBytes(_witnetQueryResultCborBytes).readArray(); + if (_errors.length < 2) { + // try to report result with unknown error: + try IWitnetConsumer(_evmRequester).reportWitnetQueryError{gas: _evmCallbackGasLimit}( + _witnetQueryId, + _witnetQueryResultTimestamp, + _witnetQueryResultTallyHash, + block.number, + Witnet.ResultErrorCodes.Unknown, + WitnetCBOR.CBOR({ + buffer: WitnetBuffer.Buffer({ data: hex"", cursor: 0}), + initialByte: 0, + majorType: 0, + additionalInformation: 0, + len: 0, + tag: 0 + }) + ) { + _evmCallbackSuccess = true; + } catch Error(string memory err) { + _evmCallbackRevertMessage = err; + } + } else { + // try to report result with parsable error: + try IWitnetConsumer(_evmRequester).reportWitnetQueryError{gas: _evmCallbackGasLimit}( + _witnetQueryId, + _witnetQueryResultTimestamp, + _witnetQueryResultTallyHash, + block.number, + Witnet.ResultErrorCodes(_errors[0].readUint()), + _errors[0] + ) { + _evmCallbackSuccess = true; + } catch Error(string memory err) { + _evmCallbackRevertMessage = err; + } + } + } else { + // try to report result result with no error : + try IWitnetConsumer(_evmRequester).reportWitnetQueryResult{gas: _evmCallbackGasLimit}( + _witnetQueryId, + _witnetQueryResultTimestamp, + _witnetQueryResultTallyHash, + block.number, + WitnetCBOR.fromBytes(_witnetQueryResultCborBytes) + ) { + _evmCallbackSuccess = true; + } catch Error(string memory err) { + _evmCallbackRevertMessage = err; + } catch (bytes memory) {} + } + _evmCallbackActualGas -= gasleft(); + } + + function __setReporters(address[] memory _reporters) + virtual internal + { + for (uint ix = 0; ix < _reporters.length; ix ++) { + address _reporter = _reporters[ix]; + __acls().isReporter_[_reporter] = true; + } + emit ReportersSet(_reporters); + } + + function __writeQueryResponse( + uint256 _witnetQueryId, + uint32 _witnetQueryResultTimestamp, + bytes32 _witnetQueryResultTallyHash, + bytes memory _witnetQueryResultCborBytes + ) + virtual internal + { + __seekQuery(_witnetQueryId).response = WitnetV2.Response({ + reporter: msg.sender, + finality: uint64(block.number), + resultTimestamp: _witnetQueryResultTimestamp, + resultTallyHash: _witnetQueryResultTallyHash, + resultCborBytes: _witnetQueryResultCborBytes + }); + } + +} \ No newline at end of file diff --git a/contracts/core/defaults/WitnetRequestBoardTrustableDefault.sol b/contracts/core/defaults/WitnetRequestBoardTrustableDefault.sol new file mode 100644 index 000000000..27c709d92 --- /dev/null +++ b/contracts/core/defaults/WitnetRequestBoardTrustableDefault.sol @@ -0,0 +1,135 @@ +// SPDX-License-Identifier: MIT + +/* solhint-disable var-name-mixedcase */ + +pragma solidity >=0.7.0 <0.9.0; +pragma experimental ABIEncoderV2; + +import "./WitnetRequestBoardTrustableBase.sol"; + +/// @title Witnet Request Board "trustable" implementation contract. +/// @notice Contract to bridge requests to Witnet Decentralized Oracle Network. +/// @dev This contract enables posting requests that Witnet bridges will insert into the Witnet network. +/// The result of the requests will be posted back to this contract by the bridge nodes too. +/// @author The Witnet Foundation +contract WitnetRequestBoardTrustableDefault + is + WitnetRequestBoardTrustableBase +{ + function class() virtual override external view returns (string memory) { + return type(WitnetRequestBoardTrustableDefault).name; + } + + uint256 internal immutable __reportResultGasBase; + uint256 internal immutable __reportResultWithCallbackGasBase; + uint256 internal immutable __reportResultWithCallbackRevertGasBase; + uint256 internal immutable __sstoreFromZeroGas; + + constructor( + WitnetRequestFactory _factory, + WitnetRequestBytecodes _registry, + bool _upgradable, + bytes32 _versionTag, + uint256 _reportResultGasBase, + uint256 _reportResultWithCallbackGasBase, + uint256 _reportResultWithCallbackRevertGasBase, + uint256 _sstoreFromZeroGas + ) + WitnetRequestBoardTrustableBase( + _factory, + _registry, + _upgradable, + _versionTag, + address(0) + ) + { + __reportResultGasBase = _reportResultGasBase; + __reportResultWithCallbackGasBase = _reportResultWithCallbackGasBase; + __reportResultWithCallbackRevertGasBase = _reportResultWithCallbackRevertGasBase; + __sstoreFromZeroGas = _sstoreFromZeroGas; + } + + + // ================================================================================================================ + // --- Overrides 'IWitnetOracle' ---------------------------------------------------------------------------- + + /// @notice Estimate the minimum reward required for posting a data request. + /// @dev Underestimates if the size of returned data is greater than `_resultMaxSize`. + /// @param _gasPrice Expected gas price to pay upon posting the data request. + /// @param _resultMaxSize Maximum expected size of returned data (in bytes). + function estimateBaseFee(uint256 _gasPrice, uint16 _resultMaxSize) + public view + virtual override + returns (uint256) + { + return _gasPrice * ( + __reportResultGasBase + + __sstoreFromZeroGas * ( + 5 + (_resultMaxSize == 0 ? 0 : _resultMaxSize - 1) / 32 + ) + ); + } + + /// @notice Estimate the minimum reward required for posting a data request with a callback. + /// @param _gasPrice Expected gas price to pay upon posting the data request. + /// @param _callbackGasLimit Maximum gas to be spent when reporting the data request result. + function estimateBaseFeeWithCallback(uint256 _gasPrice, uint24 _callbackGasLimit) + public view + virtual override + returns (uint256) + { + uint _reportResultWithCallbackGasThreshold = ( + __reportResultWithCallbackRevertGasBase + + 3 * __sstoreFromZeroGas + ); + if ( + _callbackGasLimit < _reportResultWithCallbackGasThreshold + || __reportResultWithCallbackGasBase + _callbackGasLimit < _reportResultWithCallbackGasThreshold + ) { + return ( + _gasPrice + * _reportResultWithCallbackGasThreshold + ); + } else { + return ( + _gasPrice + * ( + __reportResultWithCallbackGasBase + + _callbackGasLimit + ) + ); + } + } + + + // ================================================================================================================ + // --- Overrides 'Payable' ---------------------------------------------------------------------------------------- + + /// Gets current transaction price. + function _getGasPrice() + internal view + virtual override + returns (uint256) + { + return tx.gasprice; + } + + /// Gets current payment value. + function _getMsgValue() + internal view + virtual override + returns (uint256) + { + return msg.value; + } + + /// Transfers ETHs to given address. + /// @param _to Recipient address. + /// @param _amount Amount of ETHs to transfer. + function __safeTransferTo(address payable _to, uint256 _amount) + internal + virtual override + { + payable(_to).transfer(_amount); + } +} diff --git a/contracts/impls/core/WitnetBytecodesDefault.sol b/contracts/core/defaults/WitnetRequestBytecodesDefault.sol similarity index 56% rename from contracts/impls/core/WitnetBytecodesDefault.sol rename to contracts/core/defaults/WitnetRequestBytecodesDefault.sol index d4a2c93f9..091c25a41 100644 --- a/contracts/impls/core/WitnetBytecodesDefault.sol +++ b/contracts/core/defaults/WitnetRequestBytecodesDefault.sol @@ -2,12 +2,9 @@ pragma solidity >=0.8.4 <0.9.0; -import "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol"; - import "../WitnetUpgradableBase.sol"; -import "../../WitnetBytecodes.sol"; -import "../../data/WitnetBytecodesData.sol"; - +import "../../WitnetRequestBytecodes.sol"; +import "../../data/WitnetRequestBytecodesData.sol"; import "../../libs/WitnetEncodingLib.sol"; /// @title Witnet Request Board EVM-default implementation contract. @@ -15,28 +12,30 @@ import "../../libs/WitnetEncodingLib.sol"; /// @dev This contract enables posting requests that Witnet bridges will insert into the Witnet network. /// The result of the requests will be posted back to this contract by the bridge nodes too. /// @author The Witnet Foundation -contract WitnetBytecodesDefault +contract WitnetRequestBytecodesDefault is - WitnetBytecodes, - WitnetBytecodesData, + WitnetRequestBytecodes, + WitnetRequestBytecodesData, WitnetUpgradableBase -{ - using ERC165Checker for address; - +{ using Witnet for bytes; using Witnet for string; - using WitnetEncodingLib for WitnetV2.DataRequestMethods; - using WitnetEncodingLib for WitnetV2.RadonRetrieval; - using WitnetEncodingLib for WitnetV2.RadonRetrieval[]; - using WitnetEncodingLib for WitnetV2.RadonReducer; - using WitnetEncodingLib for WitnetV2.RadonSLA; - using WitnetEncodingLib for WitnetV2.RadonDataTypes; + using WitnetEncodingLib for Witnet.RadonDataRequestMethods; + using WitnetEncodingLib for Witnet.RadonRetrieval; + using WitnetEncodingLib for Witnet.RadonRetrieval[]; + using WitnetEncodingLib for Witnet.RadonReducer; + using WitnetEncodingLib for Witnet.RadonSLA; + using WitnetEncodingLib for Witnet.RadonDataTypes; + + function class() virtual override external view returns (string memory) { + return type(WitnetRequestBytecodesDefault).name; + } + + bytes4 public immutable override specs = type(IWitnetRequestBytecodes).interfaceId; - constructor( - bool _upgradable, - bytes32 _versionTag - ) + constructor(bool _upgradable, bytes32 _versionTag) + Ownable(address(msg.sender)) WitnetUpgradableBase( _upgradable, _versionTag, @@ -45,21 +44,7 @@ contract WitnetBytecodesDefault {} receive() external payable { - revert("WitnetBytecodesDefault: no transfers"); - } - - - // ================================================================================================================ - // --- Overrides IERC165 interface -------------------------------------------------------------------------------- - - /// @dev See {IERC165-supportsInterface}. - function supportsInterface(bytes4 _interfaceId) - public view - virtual override - returns (bool) - { - return _interfaceId == type(WitnetBytecodes).interfaceId - || super.supportsInterface(_interfaceId); + revert("WitnetRequestBytecodes: no transfers"); } @@ -115,32 +100,32 @@ contract WitnetBytecodesDefault /// @notice Re-initialize contract's storage context upon a new upgrade from a proxy. /// @dev Must fail when trying to upgrade to same logic contract more than once. - function initialize(bytes memory) + function initialize(bytes memory _initData) public override { address _owner = __bytecodes().owner; if (_owner == address(0)) { - // set owner if none set yet - _owner = msg.sender; + // set owner from the one specified in _initData + _owner = abi.decode(_initData, (address)); __bytecodes().owner = _owner; } else { // only owner can initialize: if (msg.sender != _owner) { - revert WitnetUpgradableBase.OnlyOwner(_owner); + revert("WitnetRequestBytecodes: not the owner"); } } if (__bytecodes().base != address(0)) { // current implementation cannot be initialized more than once: if(__bytecodes().base == base()) { - revert WitnetUpgradableBase.AlreadyUpgraded(base()); + revert("WitnetRequestBytecodes: already initialized"); } } __bytecodes().base = base(); emit Upgraded( - msg.sender, + _owner, base(), codehash(), version() @@ -159,7 +144,7 @@ contract WitnetBytecodesDefault // ================================================================================================================ - // --- Implementation of 'IWitnetBytecodes' ----------------------------------------------------------------------- + // --- Implementation of 'IWitnetRequestBytecodes' ----------------------------------------------------------------------- function bytecodeOf(bytes32 _radHash) public view @@ -169,76 +154,9 @@ contract WitnetBytecodesDefault return __database().radsBytecode[_radHash]; } - function bytecodeOf(bytes32 _radHash, bytes32 _slaHash) - external view - returns (bytes memory) - { - WitnetV2.RadonSLA storage __sla = __database().slas[_slaHash]; - if (__sla.numWitnesses == 0) { - revert IWitnetBytecodesErrors.UnknownRadonSLA(_slaHash); - } - bytes memory _radBytecode = bytecodeOf(_radHash); - return abi.encodePacked( - WitnetEncodingLib.encode(uint64(_radBytecode.length), 0x0a), - _radBytecode, - __database().slasBytecode[_slaHash] - ); - } - - function hashOf( - bytes32[] calldata _retrievalsIds, - bytes32 _aggregatorId, - bytes32 _tallyId, - uint16 _resultMaxSize, - string[][] calldata _args - ) - external pure - virtual override - returns (bytes32) - { - return keccak256(abi.encode( - _retrievalsIds, - _aggregatorId, - _tallyId, - _resultMaxSize, - _args - )); - } - - function hashOf(bytes32 _radHash, bytes32 _slaHash) - public pure - virtual override - returns (bytes32) - { - return sha256(abi.encode( - _radHash, - _slaHash - )); - } - - function hashWeightWitsOf( - bytes32 _radHash, - bytes32 _slaHash - ) - external view - virtual override - returns (bytes32, uint32, uint256) - { - WitnetV2.RadonSLA storage __sla = __database().slas[_slaHash]; - { - uint _numWitnesses = __sla.numWitnesses; - uint _weight = __database().radsBytecode[_radHash].length; - uint _witnessWits = __sla.witnessReward + 2 * __sla.minerCommitRevealFee; - return ( - hashOf(_radHash, _slaHash), - uint32(_weight - + _numWitnesses * 636 - // + (8 + 2 + 8 + 4 + 8) - + 100 - ), - _numWitnesses * _witnessWits - ); - } + function hashOf(bytes calldata _radBytecode) external pure override returns (bytes32) { + // todo: validate correctness of _radBytecode + return _witnetHash(_radBytecode); } function lookupDataProvider(uint256 _index) @@ -268,7 +186,7 @@ contract WitnetBytecodesDefault external view returns (bytes32[] memory _endpoints) { - WitnetV2.DataProvider storage __provider = __database().providers[_index]; + DataProvider storage __provider = __database().providers[_index]; uint _totalEndpoints = __provider.totalEndpoints; if (_offset < _totalEndpoints){ if (_offset + _length > _totalEndpoints) { @@ -284,11 +202,11 @@ contract WitnetBytecodesDefault function lookupRadonRetrieval(bytes32 _hash) external view override - returns (WitnetV2.RadonRetrieval memory _source) + returns (Witnet.RadonRetrieval memory _source) { _source = __database().retrievals[_hash]; - if (_source.method == WitnetV2.DataRequestMethods.Unknown) { - revert IWitnetBytecodesErrors.UnknownRadonRetrieval(_hash); + if (_source.method == Witnet.RadonDataRequestMethods.Unknown) { + revert UnknownRadonRetrieval(_hash); } } @@ -297,8 +215,8 @@ contract WitnetBytecodesDefault override returns (uint8) { - if (__database().retrievals[_hash].method == WitnetV2.DataRequestMethods.Unknown) { - revert IWitnetBytecodesErrors.UnknownRadonRetrieval(_hash); + if (__database().retrievals[_hash].method == Witnet.RadonDataRequestMethods.Unknown) { + revert UnknownRadonRetrieval(_hash); } return __database().retrievals[_hash].argsCount; } @@ -306,10 +224,10 @@ contract WitnetBytecodesDefault function lookupRadonRetrievalResultDataType(bytes32 _hash) external view override - returns (WitnetV2.RadonDataTypes) + returns (Witnet.RadonDataTypes) { - if (__database().retrievals[_hash].method == WitnetV2.DataRequestMethods.Unknown) { - revert IWitnetBytecodesErrors.UnknownRadonRetrieval(_hash); + if (__database().retrievals[_hash].method == Witnet.RadonDataRequestMethods.Unknown) { + revert UnknownRadonRetrieval(_hash); } return __database().retrievals[_hash].resultDataType; } @@ -317,18 +235,18 @@ contract WitnetBytecodesDefault function lookupRadonReducer(bytes32 _hash) external view override - returns (WitnetV2.RadonReducer memory _reducer) + returns (Witnet.RadonReducer memory _reducer) { _reducer = __database().reducers[_hash]; if (uint8(_reducer.opcode) == 0) { - revert IWitnetBytecodesErrors.UnknownRadonReducer(_hash); + revert UnknownRadonReducer(_hash); } } function lookupRadonRequestAggregator(bytes32 _radHash) external view override - returns (WitnetV2.RadonReducer memory) + returns (Witnet.RadonReducer memory) { return __database().reducers[ __requests(_radHash).aggregator @@ -338,7 +256,7 @@ contract WitnetBytecodesDefault function lookupRadonRequestResultDataType(bytes32 _radHash) external view override - returns (WitnetV2.RadonDataTypes) + returns (Witnet.RadonDataTypes) { return __requests(_radHash).resultDataType; } @@ -346,9 +264,9 @@ contract WitnetBytecodesDefault function lookupRadonRequestResultMaxSize(bytes32 _radHash) external view override - returns (uint256) + returns (uint16) { - return __requests(_radHash).resultMaxSize; + return uint16(__requests(_radHash).resultMaxSize); } function lookupRadonRequestSources(bytes32 _radHash) @@ -370,35 +288,15 @@ contract WitnetBytecodesDefault function lookupRadonRequestTally(bytes32 _radHash) external view override - returns (WitnetV2.RadonReducer memory) + returns (Witnet.RadonReducer memory) { return __database().reducers[ __requests(_radHash).tally ]; } - function lookupRadonSLA(bytes32 _slaHash) - external view - override - returns (WitnetV2.RadonSLA memory sla) - { - sla = __database().slas[_slaHash]; - if (sla.numWitnesses == 0) { - revert IWitnetBytecodesErrors.UnknownRadonSLA(_slaHash); - } - } - - function lookupRadonSLAReward(bytes32 _slaHash) - public view - override - returns (uint) - { - WitnetV2.RadonSLA storage __sla = __database().slas[_slaHash]; - return __sla.numWitnesses * __sla.witnessReward; - } - function verifyRadonRetrieval( - WitnetV2.DataRequestMethods _requestMethod, + Witnet.RadonDataRequestMethods _requestMethod, string calldata _requestURL, string calldata _requestBody, string[2][] memory _requestHeaders, @@ -407,85 +305,25 @@ contract WitnetBytecodesDefault public virtual override returns (bytes32 hash) - { - // validate data source params - hash = _requestMethod.validate(_requestURL, _requestBody, _requestHeaders, _requestRadonScript); - - // should it be a new data source: - if ( - __database().retrievals[hash].method == WitnetV2.DataRequestMethods.Unknown - ) { - // compose data source and save it in storage: - __database().retrievals[hash] = WitnetV2.RadonRetrieval({ - argsCount: - WitnetBuffer.argsCountOf( - abi.encode( - _requestURL, bytes(" "), - _requestBody, bytes(" "), - _requestHeaders, bytes(" "), - _requestRadonScript - ) - ), - - method: - _requestMethod, - - resultDataType: - WitnetEncodingLib.verifyRadonScriptResultDataType(_requestRadonScript), - - url: - _requestURL, - - body: - _requestBody, - - headers: - _requestHeaders, - - script: - _requestRadonScript - }); - emit NewRadonRetrievalHash(hash); - } - } - - function verifyRadonRetrieval( - WitnetV2.DataRequestMethods _requestMethod, - string memory _requestSchema, - string memory _requestAuthority, - string memory _requestPath, - string memory _requestQuery, - string memory _requestBody, - string[2][] memory _requestHeaders, - bytes calldata _requestRadonScript - ) - external - virtual override - returns (bytes32 hash) { // validate data source params hash = _requestMethod.validate( - _requestSchema, - _requestAuthority, - _requestPath, - _requestQuery, - _requestBody, - _requestHeaders, + _requestURL, + _requestBody, + _requestHeaders, _requestRadonScript ); // should it be a new data source: if ( - __database().retrievals[hash].method == WitnetV2.DataRequestMethods.Unknown + __database().retrievals[hash].method == Witnet.RadonDataRequestMethods.Unknown ) { // compose data source and save it in storage: - __database().retrievals[hash] = WitnetV2.RadonRetrieval({ + __database().retrievals[hash] = Witnet.RadonRetrieval({ argsCount: WitnetBuffer.argsCountOf( abi.encode( - _requestAuthority, bytes(" "), - _requestPath, bytes(" "), - _requestQuery, bytes(" "), + _requestURL, bytes(" "), _requestBody, bytes(" "), _requestHeaders, bytes(" "), _requestRadonScript @@ -499,16 +337,7 @@ contract WitnetBytecodesDefault WitnetEncodingLib.verifyRadonScriptResultDataType(_requestRadonScript), url: - string(abi.encodePacked( - _requestSchema, - _requestAuthority, - bytes(_requestPath).length > 0 - ? abi.encodePacked(bytes("/"), _requestPath) - : bytes(""), - bytes(_requestQuery).length > 0 - ? abi.encodePacked("?", _requestQuery) - : bytes("") - )), + _requestURL, body: _requestBody, @@ -519,16 +348,15 @@ contract WitnetBytecodesDefault script: _requestRadonScript }); - __pushDataProviderSource(_requestAuthority, hash); emit NewRadonRetrievalHash(hash); } } - function verifyRadonReducer(WitnetV2.RadonReducer memory _reducer) + function verifyRadonReducer(Witnet.RadonReducer memory _reducer) external returns (bytes32 hash) { hash = keccak256(abi.encode(_reducer)); - WitnetV2.RadonReducer storage __reducer = __database().reducers[hash]; + Witnet.RadonReducer storage __reducer = __database().reducers[hash]; if ( uint8(__reducer.opcode) == 0 && __reducer.filters.length == 0 @@ -565,46 +393,32 @@ contract WitnetBytecodesDefault // Check that at least one source is provided; if (_retrievalsIds.length == 0) { - revert WitnetV2.RadonRequestNoSources(); + revert("WitnetRequestBytecodes: no retrievals"); } // Check that number of args arrays matches the number of sources: if ( _retrievalsIds.length != _args.length) { - revert WitnetV2.RadonRequestSourcesArgsMismatch( - _retrievalsIds.length, - _args.length - ); + revert("WitnetRequestBytecodes: args mismatch"); } // Check sources and tally reducers: - WitnetV2.RadonReducer memory _aggregator = __database().reducers[_aggregatorId]; - WitnetV2.RadonReducer memory _tally = __database().reducers[_tallyId]; - if (_tally.script.length > 0) { - revert WitnetV2.UnsupportedRadonTallyScript(_tallyId); - } + Witnet.RadonReducer memory _aggregator = __database().reducers[_aggregatorId]; + Witnet.RadonReducer memory _tally = __database().reducers[_tallyId]; // Check result type consistency among all sources: - WitnetV2.RadonDataTypes _resultDataType; - WitnetV2.RadonRetrieval[] memory _retrievals = new WitnetV2.RadonRetrieval[](_retrievalsIds.length); + Witnet.RadonDataTypes _resultDataType; + Witnet.RadonRetrieval[] memory _retrievals = new Witnet.RadonRetrieval[](_retrievalsIds.length); for (uint _ix = 0; _ix < _retrievals.length; _ix ++) { _retrievals[_ix] = __database().retrievals[_retrievalsIds[_ix]]; // Check all sources return same Radon data type: if (_ix == 0) { _resultDataType = _retrievals[0].resultDataType; } else if (_retrievals[_ix].resultDataType != _resultDataType) { - revert WitnetV2.RadonRequestResultsMismatch( - _ix, - uint8(_retrievals[_ix].resultDataType), - uint8(_resultDataType) - ); + revert("WitnetRequestBytecodes: mismatching retrievals"); } // check enough args are provided for each source if (_args[_ix].length < uint(_retrievals[_ix].argsCount)) { - revert WitnetV2.RadonRequestMissingArgs( - _ix, - _retrievals[_ix].argsCount, - _args[_ix].length - ); + revert("WitnetRequestBytecodes: missing args"); } } @@ -619,14 +433,14 @@ contract WitnetBytecodesDefault _resultMaxSize ); if (_bytecode.length > 65535) { - revert WitnetV2.RadonRequestTooHeavy(_bytecode, _bytecode.length); + revert("WitnetRequestBytecodes: too heavy request"); } // Calculate radhash and add request metadata and rad bytecode to storage: _radHash = _witnetHash(_bytecode); __database().rads[hash] = _radHash; __database().radsBytecode[_radHash] = _bytecode; - __database().requests[_radHash] = RadonRequest({ + __database().requests[_radHash] = DataRequest({ aggregator: _aggregatorId, args: _args, radHash: _radHash, @@ -639,26 +453,6 @@ contract WitnetBytecodesDefault } } - function verifyRadonSLA(WitnetV2.RadonSLA calldata _sla) - external - virtual override - returns (bytes32 _slaHash) - { - // Validate SLA params: - _sla.validate(); - - // Build RadonSLA bytecode: - bytes memory _bytecode = _sla.encode(); - - // Calculate hash and add to storage if new: - _slaHash = _witnetHash(_bytecode); - if (__database().slas[_slaHash].numWitnesses == 0) { - __database().slas[_slaHash] = _sla; - __database().slasBytecode[_slaHash] = _bytecode; - emit NewSlaHash(_slaHash); - } - } - function totalDataProviders() external view override @@ -697,8 +491,8 @@ contract WitnetBytecodesDefault } function __pushRadonReducerFilters( - WitnetV2.RadonReducer storage __reducer, - WitnetV2.RadonFilter[] memory _filters + Witnet.RadonReducer storage __reducer, + Witnet.RadonFilter[] memory _filters ) internal virtual diff --git a/contracts/impls/core/WitnetRequestFactoryDefault.sol b/contracts/core/defaults/WitnetRequestFactoryDefault.sol similarity index 87% rename from contracts/impls/core/WitnetRequestFactoryDefault.sol rename to contracts/core/defaults/WitnetRequestFactoryDefault.sol index c13eb0294..e6f48d033 100644 --- a/contracts/impls/core/WitnetRequestFactoryDefault.sol +++ b/contracts/core/defaults/WitnetRequestFactoryDefault.sol @@ -3,14 +3,11 @@ pragma solidity >=0.7.0 <0.9.0; pragma experimental ABIEncoderV2; -import "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol"; - -import "../../WitnetBytecodes.sol"; +import "../WitnetUpgradableBase.sol"; +import "../../WitnetRequestBytecodes.sol"; import "../../WitnetRequestFactory.sol"; import "../../data/WitnetRequestFactoryData.sol"; -import "../../impls/WitnetUpgradableBase.sol"; import "../../patterns/Clonable.sol"; -import "../../requests/WitnetRequest.sol"; contract WitnetRequestFactoryDefault is @@ -20,15 +17,16 @@ contract WitnetRequestFactoryDefault WitnetRequestFactoryData, WitnetUpgradableBase { - using ERC165Checker for address; + /// @notice Reference to Witnet Data Requests Bytecode Registry. + WitnetRequestBytecodes immutable public override(WitnetRequestFactory, WitnetRequestTemplate) registry; - /// @notice Reference to Witnet Data Requests Bytecode Registry - WitnetBytecodes immutable public override(IWitnetRequestFactory, WitnetRequestTemplate) registry; + /// @notice Reference to the Witnet Request Board that all templates built out from this factory will refer to. + WitnetOracle immutable public override(WitnetRequestFactory, WitnetRequestTemplate) witnet; modifier onlyDelegateCalls override(Clonable, Upgradeable) { require( address(this) != _BASE, - "WitnetRequestFactoryDefault: not a delegate call" + "WitnetRequestFactory: not a delegate call" ); _; } @@ -37,7 +35,7 @@ contract WitnetRequestFactoryDefault require( address(this) == __proxy() || address(this) == base(), - "WitnetRequestFactoryDefault: not the factory" + "WitnetRequestFactory: not the factory" ); _; } @@ -45,26 +43,25 @@ contract WitnetRequestFactoryDefault modifier onlyOnTemplates { require( __witnetRequestTemplate().tally != bytes32(0), - "WitnetRequestFactoryDefault: not a WitnetRequestTemplate" + "WitnetRequestFactory: not a WitnetRequestTemplate" ); _; } constructor( - WitnetBytecodes _registry, + WitnetOracle _witnet, + WitnetRequestBytecodes _registry, bool _upgradable, bytes32 _versionTag ) + Ownable(address(msg.sender)) WitnetUpgradableBase( _upgradable, _versionTag, "io.witnet.requests.factory" ) { - require( - address(_registry).supportsInterface(type(WitnetBytecodes).interfaceId), - "WitnetRequestFactoryDefault: uncompliant registry" - ); + witnet = _witnet; registry = _registry; // let logic contract be used as a factory, while avoiding further initializations: __proxiable().proxy = address(this); @@ -83,7 +80,7 @@ contract WitnetRequestFactoryDefault returns (WitnetRequestTemplate) { // check that at least one retrieval is provided - WitnetV2.RadonDataTypes _resultDataType; + Witnet.RadonDataTypes _resultDataType; require( _retrievalsIds.length > 0, "WitnetRequestTemplate: no retrievals?" @@ -92,23 +89,26 @@ contract WitnetRequestFactoryDefault // and they all return the same data type bool _parameterized; for (uint _ix = 0; _ix < _retrievalsIds.length; _ix ++) { + bytes32 _retrievalHash = _retrievalsIds[_ix]; if (_ix == 0) { - _resultDataType = registry.lookupRadonRetrievalResultDataType(_retrievalsIds[_ix]); + _resultDataType = registry.lookupRadonRetrievalResultDataType(_retrievalHash); } else { require( - _resultDataType == registry.lookupRadonRetrievalResultDataType(_retrievalsIds[_ix]), + _resultDataType == registry.lookupRadonRetrievalResultDataType(_retrievalHash), "WitnetRequestTemplate: mismatching retrievals" ); } if (!_parameterized) { // check whether at least one of the retrievals is parameterized - _parameterized = registry.lookupRadonRetrievalArgsCount(_retrievalsIds[_ix]) > 0; + _parameterized = registry.lookupRadonRetrievalArgsCount(_retrievalHash) > 0; } } - // check that the aggregator and tally reducers actually exist in the registry - registry.lookupRadonReducer(_aggregatorId); - registry.lookupRadonReducer(_tallyId); { + // check that the aggregator and tally reducers actually exist in the registry + registry.lookupRadonReducer(_aggregatorId); + registry.lookupRadonReducer(_tallyId); + + // write data into storage: WitnetRequestTemplateSlot storage __data = __witnetRequestTemplate(); __data.aggregator = _aggregatorId; __data.factory = WitnetRequestFactory(msg.sender); @@ -187,48 +187,37 @@ contract WitnetRequestFactoryDefault ); } - function class() - virtual override(IWitnetRequestFactory, WitnetRequestTemplate) + function class() + virtual override(WitnetRequestFactory, WitnetRequestTemplate) external view - returns (bytes4) + returns (string memory) { if ( address(this) == _SELF || address(this) == __proxy() ) { - return type(WitnetRequestFactory).interfaceId; + return type(WitnetRequestFactory).name; } else if (__witnetRequest().radHash != bytes32(0)) { - return type(WitnetRequest).interfaceId; + return type(WitnetRequest).name; } else { - return type(WitnetRequestTemplate).interfaceId; + return type(WitnetRequestTemplate).name; } } - - // ================================================================================================================ - // ---Overrides 'IERC165' ----------------------------------------------------------------------------------------- - - /// @dev See {IERC165-supportsInterface}. - function supportsInterface(bytes4 _interfaceId) - public view - virtual override - returns (bool) - { - if (__witnetRequest().radHash != bytes32(0)) { - return ( - _interfaceId == type(IWitnetRequest).interfaceId - || _interfaceId == type(WitnetRequest).interfaceId - || _interfaceId == type(WitnetRequestTemplate).interfaceId - ); - } - else if (__witnetRequestTemplate().retrievals.length > 0) { - return (_interfaceId == type(WitnetRequestTemplate).interfaceId); - } - else { - return ( - _interfaceId == type(WitnetRequestFactory).interfaceId - || super.supportsInterface(_interfaceId) - ); + function specs() + virtual override(WitnetRequestFactory, WitnetRequestTemplate) + external view + returns (bytes4) + { + if ( + address(this) == _SELF + || address(this) == __proxy() + ) { + return type(IWitnetRequestFactory).interfaceId; + } else if (__witnetRequest().radHash != bytes32(0)) { + return type(WitnetRequest).interfaceId; + } else { + return type(WitnetRequestTemplate).interfaceId; } } @@ -285,7 +274,7 @@ contract WitnetRequestFactoryDefault /// @notice Re-initialize contract's storage context upon a new upgrade from a proxy. /// @dev Must fail when trying to upgrade to same logic contract more than once. - function initialize(bytes memory) + function initialize(bytes memory _initData) virtual override public onlyDelegateCalls @@ -295,13 +284,13 @@ contract WitnetRequestFactoryDefault address _owner = __witnetRequestFactory().owner; if (_owner == address(0)) { - // set owner if none set yet - _owner = msg.sender; + // set owner from the one specified in _initData + _owner = abi.decode(_initData, (address)); __witnetRequestFactory().owner = _owner; } else { // only owner can initialize the proxy if (msg.sender != _owner) { - revert WitnetUpgradableBase.OnlyOwner(_owner); + revert("WitnetRequestFactory: not the owner"); } } @@ -313,11 +302,14 @@ contract WitnetRequestFactoryDefault if (__proxiable().implementation != address(0)) { // same implementation cannot be initialized more than once: if(__proxiable().implementation == base()) { - revert WitnetUpgradableBase.AlreadyUpgraded(base()); + revert("WitnetRequestFactory: already initialized"); } } __proxiable().implementation = base(); + require(address(registry).code.length > 0, "WitnetRequestFactory: inexistent requests registry"); + require(registry.specs() == type(IWitnetRequestBytecodes).interfaceId, "WitnetRequestFactory: uncompliant requests registry"); + emit Upgraded(msg.sender, base(), codehash(), version()); } @@ -471,7 +463,7 @@ contract WitnetRequestFactoryDefault override external view onlyDelegateCalls - returns (WitnetV2.RadonDataTypes) + returns (Witnet.RadonDataTypes) { WitnetRequestTemplate _template = __witnetRequest().template; if (address(_template) != address(0)) { @@ -514,7 +506,7 @@ contract WitnetRequestFactoryDefault override external view onlyDelegateCalls - returns (WitnetV2.RadonReducer memory) + returns (Witnet.RadonReducer memory) { WitnetRequestTemplate _template = __witnetRequest().template; if (address(_template) != address(0)) { @@ -530,7 +522,7 @@ contract WitnetRequestFactoryDefault override external view onlyDelegateCalls - returns (WitnetV2.RadonRetrieval memory) + returns (Witnet.RadonRetrieval memory) { WitnetRequestTemplate _template = __witnetRequest().template; if (address(_template) != address(0)) { @@ -564,7 +556,7 @@ contract WitnetRequestFactoryDefault override external view onlyDelegateCalls - returns (WitnetV2.RadonReducer memory) + returns (Witnet.RadonReducer memory) { WitnetRequestTemplate _template = __witnetRequest().template; if (address(_template) != address(0)) { diff --git a/contracts/data/WitnetBoardData.sol b/contracts/data/WitnetBoardData.sol deleted file mode 100644 index c24664377..000000000 --- a/contracts/data/WitnetBoardData.sol +++ /dev/null @@ -1,122 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity >=0.7.0 <0.9.0; - -import "../libs/Witnet.sol"; - -/// @title Witnet Request Board base data model. -/// @author The Witnet Foundation. -abstract contract WitnetBoardData { - - bytes32 internal constant _WITNET_BOARD_DATA_SLOTHASH = - /* keccak256("io.witnet.boards.data") */ - 0xf595240b351bc8f951c2f53b26f4e78c32cb62122cf76c19b7fdda7d4968e183; - - struct WitnetBoardState { - address base; - address owner; - uint256 numQueries; - mapping (uint => Witnet.Query) queries; - } - - constructor() { - __storage().owner = msg.sender; - } - - /// Asserts the given query is currently in the given status. - modifier inStatus(uint256 _queryId, Witnet.QueryStatus _status) { - require( - _statusOf(_queryId) == _status, - _statusOfRevertMessage(_status) - ); - _; - } - - /// Asserts the given query was previously posted and that it was not yet deleted. - modifier notDeleted(uint256 _queryId) { - require(_queryId > 0 && _queryId <= __storage().numQueries, "WitnetRequestBoard: not yet posted"); - require(__query(_queryId).from != address(0), "WitnetRequestBoard: deleted"); - _; - } - - /// Asserts the give query was actually posted before calling this method. - modifier wasPosted(uint256 _queryId) { - require(_queryId > 0 && _queryId <= __storage().numQueries, "WitnetRequestBoard: not yet posted"); - _; - } - - // ================================================================================================================ - // --- Internal functions ----------------------------------------------------------------------------------------- - - /// Gets query storage by query id. - function __query(uint256 _queryId) internal view returns (Witnet.Query storage) { - return __storage().queries[_queryId]; - } - - /// Gets the Witnet.Request part of a given query. - function __request(uint256 _queryId) - internal view - returns (Witnet.Request storage) - { - return __storage().queries[_queryId].request; - } - - /// Gets the Witnet.Result part of a given query. - function __response(uint256 _queryId) - internal view - returns (Witnet.Response storage) - { - return __storage().queries[_queryId].response; - } - - /// Returns storage pointer to contents of 'WitnetBoardState' struct. - function __storage() - internal pure - returns (WitnetBoardState storage _ptr) - { - assembly { - _ptr.slot := _WITNET_BOARD_DATA_SLOTHASH - } - } - - /// Gets current status of given query. - function _statusOf(uint256 _queryId) - internal view - returns (Witnet.QueryStatus) - { - Witnet.Query storage _query = __storage().queries[_queryId]; - if (_query.response.drTxHash != 0) { - // Query is in "Reported" status as soon as the hash of the - // Witnet transaction that solved the query is reported - // back from a Witnet bridge: - return Witnet.QueryStatus.Reported; - } - else if (_query.from != address(0)) { - // Otherwise, while address from which the query was posted - // is kept in storage, the query remains in "Posted" status: - return Witnet.QueryStatus.Posted; - } - else if (_queryId > __storage().numQueries) { - // Requester's address is removed from storage only if - // the query gets "Deleted" by its requester. - return Witnet.QueryStatus.Deleted; - } else { - return Witnet.QueryStatus.Unknown; - } - } - - function _statusOfRevertMessage(Witnet.QueryStatus _status) - internal pure - returns (string memory) - { - if (_status == Witnet.QueryStatus.Posted) { - return "WitnetRequestBoard: not in Posted status"; - } else if (_status == Witnet.QueryStatus.Reported) { - return "WitnetRequestBoard: not in Reported status"; - } else if (_status == Witnet.QueryStatus.Deleted) { - return "WitnetRequestBoard: not in Deleted status"; - } else { - return "WitnetRequestBoard: bad mood"; - } - } -} diff --git a/contracts/data/WitnetPriceFeedsData.sol b/contracts/data/WitnetPriceFeedsData.sol index 94e486d97..b7b419512 100644 --- a/contracts/data/WitnetPriceFeedsData.sol +++ b/contracts/data/WitnetPriceFeedsData.sol @@ -11,7 +11,7 @@ abstract contract WitnetPriceFeedsData { 0xe36ea87c48340f2c23c9e1c9f72f5c5165184e75683a4d2a19148e5964c1d1ff; struct Storage { - bytes32 defaultSlaHash; + bytes32 packedDefaultSLA; bytes4[] ids; mapping (bytes4 => Record) records; } @@ -20,7 +20,7 @@ abstract contract WitnetPriceFeedsData { string caption; uint8 decimals; uint256 index; - uint256 latestValidQueryId; + uint256 lastValidQueryId; uint256 latestUpdateQueryId; bytes32 radHash; address solver; // logic contract address for reducing values on routed feeds. diff --git a/contracts/data/WitnetRequestBoardData.sol b/contracts/data/WitnetRequestBoardData.sol new file mode 100644 index 000000000..26591d217 --- /dev/null +++ b/contracts/data/WitnetRequestBoardData.sol @@ -0,0 +1,118 @@ +// SPDX-License-Identifier: MIT + +pragma solidity >=0.7.0 <0.9.0; + +import "../libs/WitnetV2.sol"; + +/// @title Witnet Request Board base data model. +/// @author The Witnet Foundation. +abstract contract WitnetRequestBoardData { + + using WitnetV2 for WitnetV2.Request; + + bytes32 internal constant _WITNET_REQUEST_BOARD_DATA_SLOTHASH = + /* keccak256("io.witnet.boards.data") */ + 0xf595240b351bc8f951c2f53b26f4e78c32cb62122cf76c19b7fdda7d4968e183; + + struct WitnetBoardState { + address base; + address owner; + uint256 nonce; + mapping (uint => WitnetV2.Query) queries; + } + + constructor() { + __storage().owner = msg.sender; + } + + /// Asserts the given query is currently in the given status. + modifier inStatus(uint256 _queryId, WitnetV2.QueryStatus _status) { + require( + _statusOf(_queryId) == _status, + _statusOfRevertMessage(_status) + ); _; + } + + /// Asserts the caller actually posted the referred query. + modifier onlyRequester(uint256 _queryId) { + require( + msg.sender == __seekQueryRequest(_queryId).requester, + "WitnetRequestBoardBase: not the requester" + ); _; + } + + + // ================================================================================================================ + // --- Internal functions ----------------------------------------------------------------------------------------- + + /// Gets query storage by query id. + function __seekQuery(uint256 _queryId) internal view returns (WitnetV2.Query storage) { + return __storage().queries[_queryId]; + } + + /// Gets the Witnet.Request part of a given query. + function __seekQueryRequest(uint256 _queryId) + internal view + returns (WitnetV2.Request storage) + { + return __storage().queries[_queryId].request; + } + + /// Gets the Witnet.Result part of a given query. + function __seekQueryResponse(uint256 _queryId) + internal view + returns (WitnetV2.Response storage) + { + return __storage().queries[_queryId].response; + } + + /// Returns storage pointer to contents of 'WitnetBoardState' struct. + function __storage() + internal pure + returns (WitnetBoardState storage _ptr) + { + assembly { + _ptr.slot := _WITNET_REQUEST_BOARD_DATA_SLOTHASH + } + } + + /// Gets current status of given query. + function _statusOf(uint256 _queryId) + internal view + returns (WitnetV2.QueryStatus) + { + WitnetV2.Query storage __query = __storage().queries[_queryId]; + if (__query.response.resultTallyHash != bytes32(0)) { + if (__query.response.resultTimestamp != 0) { + if (block.number >= __query.response.finality) { + return WitnetV2.QueryStatus.Finalized; + } else { + return WitnetV2.QueryStatus.Reported; + } + } else { + return WitnetV2.QueryStatus.Undeliverable; + } + } else if (__query.request.requester != address(0)) { + return WitnetV2.QueryStatus.Posted; + } else { + return WitnetV2.QueryStatus.Unknown; + } + } + + function _statusOfRevertMessage(WitnetV2.QueryStatus _status) + internal pure + returns (string memory) + { + if (_status == WitnetV2.QueryStatus.Posted) { + return "WitnetOracle: query not in Posted status"; + } else if (_status == WitnetV2.QueryStatus.Reported) { + return "WitnetOracle: query not in Reported status"; + } else if (_status == WitnetV2.QueryStatus.Finalized) { + return "WitnetOracle: query not in Finalized status"; + } else if (_status == WitnetV2.QueryStatus.Undeliverable) { + return "WitnetOracle: query not in Undeliverable status"; + } else { + return "WitnetOracle: bad mood"; + } + } +} diff --git a/contracts/data/WitnetBoardDataACLs.sol b/contracts/data/WitnetRequestBoardDataACLs.sol similarity index 72% rename from contracts/data/WitnetBoardDataACLs.sol rename to contracts/data/WitnetRequestBoardDataACLs.sol index 989f79068..77946d06d 100644 --- a/contracts/data/WitnetBoardDataACLs.sol +++ b/contracts/data/WitnetRequestBoardDataACLs.sol @@ -2,13 +2,13 @@ pragma solidity >=0.7.0 <0.9.0; -import "./WitnetBoardData.sol"; +import "./WitnetRequestBoardData.sol"; /// @title Witnet Access Control Lists storage layout, for Witnet-trusted request boards. /// @author The Witnet Foundation. -abstract contract WitnetBoardDataACLs +abstract contract WitnetRequestBoardDataACLs is - WitnetBoardData + WitnetRequestBoardData { bytes32 internal constant _WITNET_BOARD_ACLS_SLOTHASH = /* keccak256("io.witnet.boards.data.acls") */ @@ -19,13 +19,13 @@ abstract contract WitnetBoardDataACLs } constructor() { - _acls().isReporter_[msg.sender] = true; + __acls().isReporter_[msg.sender] = true; } modifier onlyReporters { require( - _acls().isReporter_[msg.sender], - "WitnetRequestBoard: unauthorized reporter" + __acls().isReporter_[msg.sender], + "WitnetOracle: unauthorized reporter" ); _; } @@ -33,7 +33,7 @@ abstract contract WitnetBoardDataACLs // ================================================================================================================ // --- Internal functions ----------------------------------------------------------------------------------------- - function _acls() internal pure returns (WitnetBoardACLs storage _struct) { + function __acls() internal pure returns (WitnetBoardACLs storage _struct) { assembly { _struct.slot := _WITNET_BOARD_ACLS_SLOTHASH } diff --git a/contracts/data/WitnetBytecodesData.sol b/contracts/data/WitnetRequestBytecodesData.sol similarity index 72% rename from contracts/data/WitnetBytecodesData.sol rename to contracts/data/WitnetRequestBytecodesData.sol index adb92052f..0fa8d36f4 100644 --- a/contracts/data/WitnetBytecodesData.sol +++ b/contracts/data/WitnetRequestBytecodesData.sol @@ -6,7 +6,7 @@ import "../libs/WitnetV2.sol"; /// @title Witnet Request Board base data model. /// @author The Witnet Foundation. -abstract contract WitnetBytecodesData { +abstract contract WitnetRequestBytecodesData { bytes32 private constant _WITNET_BYTECODES_DATA_SLOTHASH = /* keccak256("io.witnet.bytecodes.data") */ @@ -22,29 +22,32 @@ abstract contract WitnetBytecodesData { // ... } - struct RadonRequest { + struct DataProvider { + string authority; + uint256 totalEndpoints; + mapping (uint256 => bytes32) endpoints; + } + + struct DataRequest { string[][] args; bytes32 aggregator; bytes32 radHash; - WitnetV2.RadonDataTypes resultDataType; + Witnet.RadonDataTypes resultDataType; uint16 resultMaxSize; bytes32[] retrievals; bytes32 tally; } struct Database { - mapping (uint256 => WitnetV2.DataProvider) providers; + mapping (uint256 => DataProvider) providers; mapping (bytes32 => uint256) providersIndex; - mapping (bytes32 => WitnetV2.RadonReducer) reducers; - mapping (bytes32 => WitnetV2.RadonRetrieval) retrievals; - mapping (bytes32 => WitnetV2.RadonSLA) slas; - - mapping (bytes32 => RadonRequest) requests; + mapping (bytes32 => Witnet.RadonReducer) reducers; + mapping (bytes32 => Witnet.RadonRetrieval) retrievals; + mapping (bytes32 => DataRequest) requests; mapping (bytes32 => bytes32) rads; - mapping (bytes32 => bytes) radsBytecode; - mapping (bytes32 => bytes) slasBytecode; + mapping (bytes32 => bytes) _slasBytecode; } constructor() { @@ -74,10 +77,10 @@ abstract contract WitnetBytecodesData { return __bytecodes().db; } - function __requests(bytes32 _drRetrievalHash) + function __requests(bytes32 _radHash) internal view - returns (RadonRequest storage _ptr) + returns (DataRequest storage _ptr) { - return __database().requests[_drRetrievalHash]; + return __database().requests[_radHash]; } } \ No newline at end of file diff --git a/contracts/data/WitnetRequestFactoryData.sol b/contracts/data/WitnetRequestFactoryData.sol index b7e04459c..6679dfd64 100644 --- a/contracts/data/WitnetRequestFactoryData.sol +++ b/contracts/data/WitnetRequestFactoryData.sol @@ -3,7 +3,7 @@ pragma solidity >=0.7.0 <0.9.0; pragma experimental ABIEncoderV2; -import "../requests/WitnetRequest.sol"; +import "../WitnetRequest.sol"; contract WitnetRequestFactoryData { @@ -45,7 +45,7 @@ contract WitnetRequestFactoryData { /// @notice Array of retrievals hashes passed upon construction. bytes32[] retrievals; /// @notice Result data type. - WitnetV2.RadonDataTypes resultDataType; + Witnet.RadonDataTypes resultDataType; /// @notice Result max size or rank (if variable type). uint16 resultDataMaxSize; } diff --git a/contracts/impls/apps/WitnetPriceRouter.sol b/contracts/impls/apps/WitnetPriceRouter.sol deleted file mode 100644 index 48fd600df..000000000 --- a/contracts/impls/apps/WitnetPriceRouter.sol +++ /dev/null @@ -1,266 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >=0.7.0 <0.9.0; -pragma experimental ABIEncoderV2; - -import "@openzeppelin/contracts/utils/Strings.sol"; -import "../../interfaces/IWitnetPriceFeed.sol"; - -import "../../impls/WitnetUpgradableBase.sol"; -import "../../interfaces/IWitnetPriceRouter.sol"; - -contract WitnetPriceRouter - is - WitnetUpgradableBase, - IWitnetPriceRouter -{ - using Strings for uint256; - - struct Pair { - IERC165 pricefeed; - uint256 decimals; - string base; - string quote; - } - - struct Storage { - mapping (bytes4 => Pair) pairs; - mapping (address => bytes32) pricefeedId_; - bytes32[] supportedCurrencyPairs; - } - - constructor( - bool _upgradable, - bytes32 _versionTag - ) - WitnetUpgradableBase( - _upgradable, - _versionTag, - "io.witnet.proxiable.router" - ) - {} - - // ================================================================================================================ - // --- Overrides 'Upgradeable' ------------------------------------------------------------------------------------- - - /// @notice Re-initialize contract's storage context upon a new upgrade from a proxy. - /// @dev Must fail when trying to upgrade to same logic contract more than once. - function initialize(bytes memory) - public - override - { - address _owner = owner(); - if (_owner == address(0)) { - // set owner if none set yet - _owner = msg.sender; - _transferOwnership(_owner); - } else { - // only owner can initialize: - if (msg.sender != _owner) { - revert WitnetUpgradableBase.OnlyOwner(_owner); - } - } - - if (__proxiable().implementation != address(0)) { - // current implementation cannot be initialized more than once: - if(__proxiable().implementation == base()) { - revert WitnetUpgradableBase.AlreadyUpgraded(base()); - } - } - __proxiable().implementation = base(); - - emit Upgraded( - msg.sender, - base(), - codehash(), - version() - ); - } - - /// Tells whether provided address could eventually upgrade the contract. - function isUpgradableFrom(address _from) external view override returns (bool) { - address _owner = owner(); - return ( - // false if the WRB is intrinsically not upgradable, or `_from` is no owner - isUpgradable() - && _owner == _from - ); - } - - // ======================================================================== - // --- Implementation of 'IERC2362' --------------------------------------- - - /// Returns last valid price value and timestamp, as well as status of - /// the latest update request that got posted to the Witnet Request Board. - /// @dev Fails if the given currency pair is not currently supported. - /// @param _erc2362id Price pair identifier as specified in https://github.com/adoracles/ADOIPs/blob/main/adoip-0010.md - /// @return _lastPrice Last valid price reported back from the Witnet oracle. - /// @return _lastTimestamp EVM-timestamp of the last valid price. - /// @return _latestUpdateStatus Status code of latest update request that got posted to the Witnet Request Board: - /// - 200: latest update request was succesfully solved with no errors - /// - 400: latest update request was solved with errors - /// - 404: latest update request is still pending to be solved - function valueFor(bytes32 _erc2362id) - external view - virtual override - returns ( - int256 _lastPrice, - uint256 _lastTimestamp, - uint256 _latestUpdateStatus - ) - { - IWitnetPriceFeed _pricefeed = IWitnetPriceFeed(address(getPriceFeed(_erc2362id))); - require(address(_pricefeed) != address(0), "WitnetPriceRouter: unsupported currency pair"); - (_lastPrice, _lastTimestamp,, _latestUpdateStatus) = _pricefeed.lastValue(); - } - - - // ======================================================================== - // --- Implementation of 'IWitnetPriceRouter' --------------------------- - - /// Helper pure function: returns hash of the provided ERC2362-compliant currency pair caption (aka ID). - function currencyPairId(string memory _caption) - public pure - virtual override - returns (bytes32) - { - return keccak256(bytes(_caption)); - } - - /// Returns the ERC-165-compliant price feed contract currently serving - /// updates on the given currency pair. - function getPriceFeed(bytes32 _erc2362id) - public view - virtual override - returns (IERC165) - { - return __storage().pairs[bytes4(_erc2362id)].pricefeed; - } - - /// Returns human-readable ERC2362-based caption of the currency pair being - /// served by the given price feed contract address. - /// @dev Fails if the given price feed contract address is not currently - /// @dev registered in the router. - function getPriceFeedCaption(IERC165 _pricefeed) - public view - virtual override - returns (string memory) - { - require(supportsPriceFeed(_pricefeed), "WitnetPriceRouter: unknown"); - return lookupERC2362ID(__storage().pricefeedId_[address(_pricefeed)]); - } - - /// Returns human-readable caption of the ERC2362-based currency pair identifier, if known. - function lookupERC2362ID(bytes32 _erc2362id) - public view - virtual override - returns (string memory _caption) - { - Pair storage _pair = __storage().pairs[bytes4(_erc2362id)]; - if ( - bytes(_pair.base).length > 0 - && bytes(_pair.quote).length > 0 - ) { - _caption = string(abi.encodePacked( - "Price-", - _pair.base, - "/", - _pair.quote, - "-", - _pair.decimals.toString() - )); - } - } - - /// Register a price feed contract that will serve updates for the given currency pair. - /// @dev Setting zero address to a currency pair implies that it will not be served any longer. - /// @dev Otherwise, fails if the price feed contract does not support the `IWitnetPriceFeed` interface, - /// @dev or if given price feed is already serving another currency pair (within this WitnetPriceRouter instance). - function setPriceFeed( - IERC165 _pricefeed, - uint256 _decimals, - string calldata _base, - string calldata _quote - ) - public - virtual override - onlyOwner - { - if (address(_pricefeed) != address(0)) { - require( - _pricefeed.supportsInterface(type(IWitnetPriceFeed).interfaceId), - "WitnetPriceRouter: feed contract is not compliant with IWitnetPriceFeed" - ); - require( - __storage().pricefeedId_[address(_pricefeed)] == bytes32(0), - "WitnetPriceRouter: already serving a currency pair" - ); - } - bytes memory _caption = abi.encodePacked( - "Price-", - bytes(_base), - "/", - bytes(_quote), - "-", - _decimals.toString() - ); - bytes32 _erc2362id = keccak256(_caption); - - Pair storage _record = __storage().pairs[bytes4(_erc2362id)]; - address _currentPriceFeed = address(_record.pricefeed); - if (bytes(_record.base).length == 0) { - _record.base = _base; - _record.quote = _quote; - _record.decimals = _decimals; - __storage().supportedCurrencyPairs.push(_erc2362id); - } - else if (_currentPriceFeed != address(0)) { - __storage().pricefeedId_[_currentPriceFeed] = bytes32(0); - } - if (address(_pricefeed) != _currentPriceFeed) { - __storage().pricefeedId_[address(_pricefeed)] = _erc2362id; - } - _record.pricefeed = _pricefeed; - emit CurrencyPairSet(_erc2362id, _pricefeed); - } - - /// Returns list of known currency pairs IDs. - function supportedCurrencyPairs() - external view - virtual override - returns (bytes32[] memory) - { - return __storage().supportedCurrencyPairs; - } - - /// Returns `true` if given pair is currently being served by a compliant price feed contract. - function supportsCurrencyPair(bytes32 _erc2362id) - public view - virtual override - returns (bool) - { - return address(__storage().pairs[bytes4(_erc2362id)].pricefeed) != address(0); - } - - /// Returns `true` if given price feed contract is currently serving updates to any known currency pair. - function supportsPriceFeed(IERC165 _pricefeed) - public view - virtual override - returns (bool) - { - return __storage().pairs[bytes4(__storage().pricefeedId_[address(_pricefeed)])].pricefeed == _pricefeed; - } - - - /// ======================================================================= - /// --- Internal methods -------------------------------------------------- - - bytes32 internal constant _WITNET_PRICE_ROUTER_SLOTHASH = - /* keccak256("io.witnet.router.data") */ - 0x1ab0a3400242e9b47752f01347893fa91d77046d73895ccd575be9dd5025abd9; - - function __storage() internal pure returns (Storage storage ptr) { - assembly { - ptr.slot := _WITNET_PRICE_ROUTER_SLOTHASH - } - } -} diff --git a/contracts/impls/apps/WitnetRandomnessProxiable.sol b/contracts/impls/apps/WitnetRandomnessProxiable.sol deleted file mode 100644 index 678c3dd8c..000000000 --- a/contracts/impls/apps/WitnetRandomnessProxiable.sol +++ /dev/null @@ -1,539 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity >=0.7.0 <0.9.0; -pragma experimental ABIEncoderV2; - -import "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol"; - -import "../../UsingWitnet.sol"; -import "../../WitnetRandomness.sol"; -import "../../impls/WitnetUpgradableBase.sol"; -import "../../patterns/Clonable.sol"; - -import "../../requests/WitnetRequest.sol"; - -/// @title WitnetRandomnessProxiable: A trustless randomness generator and registry, using the Witnet oracle. -/// @author Witnet Foundation. -contract WitnetRandomnessProxiable - is - Clonable, - UsingWitnet, - WitnetRandomness, - WitnetUpgradableBase -{ - using ERC165Checker for address; - using Witnet for Witnet.Result; - - uint256 public override latestRandomizeBlock; - WitnetRequest public immutable override witnetRandomnessRequest; - - bytes32 internal immutable __witnetRandomnessRadHash; - bytes32 internal __witnetRandomnessSlaHash; - - mapping (uint256 => RandomizeData) internal __randomize_; - struct RandomizeData { - address from; - uint256 prevBlock; - uint256 nextBlock; - uint256 witnetQueryId; - } - - modifier onlyDelegateCalls override(Clonable, Upgradeable) { - require(address(this) != base(), "WitnetRandomnessProxiable: not a delegate call"); - _; - } - - function witnet() - virtual override (IWitnetRandomness, UsingWitnet) - public view returns (WitnetRequestBoard) - { - return UsingWitnet.witnet(); - } - - /// Include an address to specify the immutable WitnetRequestBoard entrypoint address. - /// @param _wrb The WitnetRequestBoard immutable entrypoint address. - constructor( - WitnetRequestBoard _wrb, - bytes32 _version - ) - UsingWitnet(_wrb) - WitnetUpgradableBase( - false, - _version, - "io.witnet.proxiable.randomness" - ) - { - require( - address(_wrb) == address(0) - || address(_wrb).supportsInterface(type(WitnetRequestBoard).interfaceId), - "WitnetRandomnessProxiable: uncompliant request board" - ); - WitnetBytecodes _registry = witnet().registry(); - WitnetRequestFactory _factory = witnet().factory(); - { - // Build own Witnet Randomness Request: - bytes32[] memory _retrievals = new bytes32[](1); - _retrievals[0] = _registry.verifyRadonRetrieval( - WitnetV2.DataRequestMethods.Rng, - "", // no schema - "", // no authority - "", // no path - "", // no query - "", // no body - new string[2][](0), // no headers - hex"80" // no retrieval script - ); - WitnetV2.RadonFilter[] memory _filters; - bytes32 _aggregator = _registry.verifyRadonReducer(WitnetV2.RadonReducer({ - opcode: WitnetV2.RadonReducerOpcodes.Mode, - filters: _filters, // no filters - script: hex"" // no aggregation script - })); - bytes32 _tally = _registry.verifyRadonReducer(WitnetV2.RadonReducer({ - opcode: WitnetV2.RadonReducerOpcodes.ConcatenateAndHash, - filters: _filters, // no filters - script: hex"" // no aggregation script - })); - WitnetRequestTemplate _template = WitnetRequestTemplate(_factory.buildRequestTemplate( - _retrievals, - _aggregator, - _tally, - 0 - )); - witnetRandomnessRequest = WitnetRequest(_template.buildRequest(new string[][](_retrievals.length))); - __witnetRandomnessRadHash = witnetRandomnessRequest.radHash(); - } - __initializeWitnetRandomnessSlaHash(); - } - - /// @notice Initializes a cloned instance. - /// @dev Every cloned instance can only get initialized once. - function initializeClone(bytes memory _initData) - virtual external - initializer // => ensure a cloned instance can only be initialized once - onlyDelegateCalls // => this method can only be called upon cloned instances - { - _initialize(_initData); - } - - - /// =============================================================================================================== - /// --- 'WitnetRandomnessAdmin' implementation ------------------------------------------------------------------------- - - function owner() - virtual override (IWitnetRandomnessAdmin, Ownable) - public view - returns (address) - { - return Ownable.owner(); - } - - function acceptOwnership() - virtual override (IWitnetRandomnessAdmin, Ownable2Step) - public - { - Ownable2Step.acceptOwnership(); - } - - function pendingOwner() - virtual override (IWitnetRandomnessAdmin, Ownable2Step) - public view - returns (address) - { - return Ownable2Step.pendingOwner(); - } - - function transferOwnership(address _newOwner) - virtual override (IWitnetRandomnessAdmin, Ownable2Step) - public - onlyOwner - { - Ownable.transferOwnership(_newOwner); - } - - function settleWitnetRandomnessSLA(WitnetV2.RadonSLA memory _radonSLA) - virtual override - public - onlyOwner - returns (bytes32 _radonSlaHash) - { - _radonSlaHash = witnet().registry().verifyRadonSLA(_radonSLA); - __witnetRandomnessSlaHash = _radonSlaHash; - } - - /// =============================================================================================================== - /// --- 'WitnetRandomness' implementation ------------------------------------------------------------------------- - - /// Deploys and returns the address of a minimal proxy clone that replicates contract - /// behaviour while using its own EVM storage. - /// @dev This function should always provide a new address, no matter how many times - /// @dev is actually called from the same `msg.sender`. - function clone() - virtual override - public - wasInitialized - returns (WitnetRandomness) - { - return _afterClone(_clone()); - } - - /// Deploys and returns the address of a minimal proxy clone that replicates contract - /// behaviour while using its own EVM storage. - /// @dev This function uses the CREATE2 opcode and a `_salt` to deterministically deploy - /// @dev the clone. Using the same `_salt` multiple time will revert, since - /// @dev no contract can be deployed more than once at the same address. - function cloneDeterministic(bytes32 _salt) - virtual override - public - wasInitialized - returns (WitnetRandomness) - { - return _afterClone(_cloneDeterministic(_salt)); - } - - /// Returns amount of wei required to be paid as a fee when requesting randomization with a - /// transaction gas price as the one given. - function estimateRandomizeFee(uint256 _gasPrice) - public view - virtual override - returns (uint256) - { - return witnet().estimateReward(_gasPrice); - } - - /// Retrieves data of a randomization request that got successfully posted to the WRB within a given block. - /// @dev Returns zero values if no randomness request was actually posted within a given block. - /// @param _block Block number whose randomness request is being queried for. - /// @return _from Address from which the latest randomness request was posted. - /// @return _id Unique request identifier as provided by the WRB. - /// @return _prevBlock Block number in which a randomness request got posted just before this one. 0 if none. - /// @return _nextBlock Block number in which a randomness request got posted just after this one, 0 if none. - function getRandomizeData(uint256 _block) - external view - virtual override - returns ( - address _from, - uint256 _id, - uint256 _prevBlock, - uint256 _nextBlock - ) - { - RandomizeData storage _data = __randomize_[_block]; - _id = _data.witnetQueryId; - _from = _data.from; - _prevBlock = _data.prevBlock; - _nextBlock = _data.nextBlock; - } - - /// Retrieves the randomness generated upon solving a request that was posted within a given block, - /// if any, or to the _first_ request posted after that block, otherwise. Should the intended - /// request happen to be finalized with errors on the Witnet oracle network side, this function - /// will recursively try to return randomness from the next non-faulty randomization request found - /// in storage, if any. - /// @dev Fails if: - /// @dev i. no `randomize()` was not called in either the given block, or afterwards. - /// @dev ii. a request posted in/after given block does exist, but no result has been provided yet. - /// @dev iii. all requests in/after the given block were solved with errors. - /// @param _block Block number from which the search will start. - function getRandomnessAfter(uint256 _block) - public view - virtual override - returns (bytes32) - { - if (__randomize_[_block].from == address(0)) { - _block = getRandomnessNextBlock(_block); - } - uint256 _queryId = __randomize_[_block].witnetQueryId; - require(_queryId != 0, "WitnetRandomnessProxiable: not randomized"); - Witnet.ResultStatus _resultStatus = witnet().checkResultStatus(_queryId); - if (_resultStatus == Witnet.ResultStatus.Ready) { - return witnet().readResponseResult(_queryId).asBytes32(); - } else if (_resultStatus == Witnet.ResultStatus.Error) { - uint256 _nextRandomizeBlock = __randomize_[_block].nextBlock; - require(_nextRandomizeBlock != 0, "WitnetRandomnessProxiable: faulty randomize"); - return getRandomnessAfter(_nextRandomizeBlock); - } else { - revert("WitnetRandomnessProxiable: pending randomize"); - } - } - - /// Tells what is the number of the next block in which a randomization request was posted after the given one. - /// @param _block Block number from which the search will start. - /// @return Number of the first block found after the given one, or `0` otherwise. - function getRandomnessNextBlock(uint256 _block) - public view - virtual override - returns (uint256) - { - return ((__randomize_[_block].from != address(0)) - ? __randomize_[_block].nextBlock - // start search from the latest block - : _searchNextBlock(_block, latestRandomizeBlock) - ); - } - - /// Gets previous block in which a randomness request was posted before the given one. - /// @param _block Block number from which the search will start. Cannot be zero. - /// @return First block found before the given one, or `0` otherwise. - function getRandomnessPrevBlock(uint256 _block) - public view - virtual override - returns (uint256) - { - assert(_block > 0); - uint256 _latest = latestRandomizeBlock; - return ((_block > _latest) - ? _latest - // start search from the latest block - : _searchPrevBlock(_block, __randomize_[_latest].prevBlock) - ); - } - - /// Returns `true` only when the randomness request that got posted within given block was already - /// reported back from the Witnet oracle, either successfully or with an error of any kind. - function isRandomized(uint256 _block) - public view - virtual override - returns (bool) - { - RandomizeData storage _data = __randomize_[_block]; - return ( - _data.witnetQueryId != 0 - && witnet().getQueryStatus(_data.witnetQueryId) == Witnet.QueryStatus.Reported - ); - } - - /// Generates a pseudo-random number uniformly distributed within the range [0 .. _range), by using - /// the given `_nonce` value and the randomness returned by `getRandomnessAfter(_block)`. - /// @dev Fails under same conditions as `getRandomnessAfter(uint256)` may do. - /// @param _range Range within which the uniformly-distributed random number will be generated. - /// @param _nonce Nonce value enabling multiple random numbers from the same randomness value. - /// @param _block Block number from which the search will start. - function random(uint32 _range, uint256 _nonce, uint256 _block) - external view - virtual override - returns (uint32) - { - return random( - _range, - _nonce, - keccak256( - abi.encode( - msg.sender, - getRandomnessAfter(_block) - ) - ) - ); - } - - /// Generates a pseudo-random number uniformly distributed within the range [0 .. _range), by using - /// the given `_nonce` value and the given `_seed` as a source of entropy. - /// @param _range Range within which the uniformly-distributed random number will be generated. - /// @param _nonce Nonce value enabling multiple random numbers from the same randomness value. - /// @param _seed Seed value used as entropy source. - function random(uint32 _range, uint256 _nonce, bytes32 _seed) - public pure - virtual override - returns (uint32) - { - uint8 _flagBits = uint8(255 - _msbDeBruijn32(_range)); - uint256 _number = uint256( - keccak256( - abi.encode(_seed, _nonce) - ) - ) & uint256(2 ** _flagBits - 1); - return uint32((_number * _range) >> _flagBits); - } - - /// Requests the Witnet oracle to generate an EVM-agnostic and trustless source of randomness. - /// Only one randomness request per block will be actually posted to the WRB. Should there - /// already be a posted request within current block, it will try to upgrade Witnet fee of current's - /// block randomness request according to current gas price. In both cases, all unused funds shall - /// be transfered back to the tx sender. - /// @return _usedFunds Amount of funds actually used from those provided by the tx sender. - function randomize() - external payable - virtual override - returns (uint256 _usedFunds) - { - if (latestRandomizeBlock < block.number) { - // Post the Witnet Randomness request: - uint _queryId; - (_queryId, _usedFunds) = _witnetPostRequest( - __witnetRandomnessRadHash, - __witnetRandomnessSlaHash - ); - // Keep Randomize data in storage: - RandomizeData storage _data = __randomize_[block.number]; - _data.witnetQueryId = _queryId; - _data.from = msg.sender; - // Update block links: - uint256 _prevBlock = latestRandomizeBlock; - _data.prevBlock = _prevBlock; - __randomize_[_prevBlock].nextBlock = block.number; - latestRandomizeBlock = block.number; - // Throw event: - emit Randomized( - msg.sender, - _prevBlock, - _queryId, - __witnetRandomnessRadHash - ); - // Transfer back unused tx value: - if (_usedFunds < msg.value) { - payable(msg.sender).transfer(msg.value - _usedFunds); - } - } else { - return upgradeRandomizeFee(block.number); - } - } - - /// Increases Witnet fee related to a pending-to-be-solved randomness request, as much as it - /// may be required in proportion to how much bigger the current tx gas price is with respect the - /// highest gas price that was paid in either previous fee upgrades, or when the given randomness - /// request was posted. All unused funds shall be transferred back to the tx sender. - /// @return _usedFunds Amount of dunds actually used from those provided by the tx sender. - function upgradeRandomizeFee(uint256 _block) - public payable - virtual override - returns (uint256 _usedFunds) - { - RandomizeData storage _data = __randomize_[_block]; - if (_data.witnetQueryId != 0) { - _usedFunds = _witnetUpgradeReward(_data.witnetQueryId); - } - if (_usedFunds < msg.value) { - payable(msg.sender).transfer(msg.value - _usedFunds); - } - } - - /// @notice Returns SLA parameters that are being used every time there's a new randomness request. - function witnetRandomnessSLA() - virtual override - external view - returns (WitnetV2.RadonSLA memory) - { - return witnet().registry().lookupRadonSLA(__witnetRandomnessSlaHash); - } - - - // ================================================================================================================ - // --- 'Upgradeable' extension ------------------------------------------------------------------------------------ - - /// Initialize storage-context when invoked as delegatecall. - /// @dev Must fail when trying to initialize same instance more than once. - function initialize(bytes memory) - public - virtual override - onlyDelegateCalls // => we don't want the logic base contract to be ever initialized - { - if ( - __proxiable().proxy == address(0) - && __proxiable().implementation == address(0) - ) { - // a proxy is being initilized for the first time ... - __proxiable().proxy = address(this); - _transferOwnership(msg.sender); - __initializeWitnetRandomnessSlaHash(); - } - else if (__proxiable().implementation == base()) { - revert("WitnetRandomnessProxiable: not upgradeable"); - } - __proxiable().implementation = base(); - } - - /// Tells whether provided address could eventually upgrade the contract. - function isUpgradableFrom(address) external pure override returns (bool) { - return false; - } - - - // ================================================================================================================ - // --- 'Clonable' extension --------------------------------------------------------------------------------------- - - /// @notice Tells whether this instance has been initialized. - function initialized() - override - public view - returns (bool) - { - return address(witnetRandomnessRequest) != address(0); - } - - - // ================================================================================================================ - // --- INTERNAL FUNCTIONS ----------------------------------------------------------------------------------------- - - /// @dev Common steps for both deterministic and non-deterministic cloning. - function _afterClone(address _instance) - virtual internal - returns (WitnetRandomness) - { - WitnetRandomnessProxiable(_instance).initializeClone(hex""); - return WitnetRandomness(_instance); - } - - /// @notice Re-initialize contract's storage context upon a new upgrade from a proxy. - /// @dev Must fail when trying to upgrade to same logic contract more than once. - function _initialize(bytes memory) - virtual internal - { - // settle ownership: - _transferOwnership(msg.sender); - // initialize default Witnet SLA parameters used for every randomness request; - __initializeWitnetRandomnessSlaHash(); - // make sure that this clone cannot ever get initialized as a proxy: - __proxiable().implementation = base(); - } - - function __initializeWitnetRandomnessSlaHash() virtual internal { - settleWitnetRandomnessSLA(WitnetV2.RadonSLA({ - numWitnesses: 5, - minConsensusPercentage: 51, - witnessReward: 10 ** 8, - witnessCollateral: 10 ** 9, - minerCommitRevealFee: 10 ** 7 - })); - } - - /// @dev Returns index of the Most Significant Bit of the given number, applying De Bruijn O(1) algorithm. - function _msbDeBruijn32(uint32 _v) - internal pure - returns (uint8) - { - uint8[32] memory _bitPosition = [ - 0, 9, 1, 10, 13, 21, 2, 29, - 11, 14, 16, 18, 22, 25, 3, 30, - 8, 12, 20, 28, 15, 17, 24, 7, - 19, 27, 23, 6, 26, 5, 4, 31 - ]; - _v |= _v >> 1; - _v |= _v >> 2; - _v |= _v >> 4; - _v |= _v >> 8; - _v |= _v >> 16; - return _bitPosition[ - uint32(_v * uint256(0x07c4acdd)) >> 27 - ]; - } - - /// @dev Recursively searches for the number of the first block after the given one in which a Witnet randomization request was posted. - /// @dev Returns 0 if none found. - function _searchNextBlock(uint256 _target, uint256 _latest) internal view returns (uint256) { - return ((_target >= _latest) - ? __randomize_[_latest].nextBlock - : _searchNextBlock(_target, __randomize_[_latest].prevBlock) - ); - } - - /// @dev Recursively searches for the number of the first block before the given one in which a Witnet randomization request was posted. - /// @dev Returns 0 if none found. - - function _searchPrevBlock(uint256 _target, uint256 _latest) internal view returns (uint256) { - return ((_target > _latest) - ? _latest - : _searchPrevBlock(_target, __randomize_[_latest].prevBlock) - ); - } - -} diff --git a/contracts/impls/core/WitnetRequestBoardTrustableDefault.sol b/contracts/impls/core/WitnetRequestBoardTrustableDefault.sol deleted file mode 100644 index bde65694f..000000000 --- a/contracts/impls/core/WitnetRequestBoardTrustableDefault.sol +++ /dev/null @@ -1,93 +0,0 @@ -// SPDX-License-Identifier: MIT - -/* solhint-disable var-name-mixedcase */ - -pragma solidity >=0.7.0 <0.9.0; -pragma experimental ABIEncoderV2; - -import "./customs/WitnetRequestBoardTrustableBase.sol"; -import "../../patterns/Destructible.sol"; - -/// @title Witnet Request Board "trustable" implementation contract. -/// @notice Contract to bridge requests to Witnet Decentralized Oracle Network. -/// @dev This contract enables posting requests that Witnet bridges will insert into the Witnet network. -/// The result of the requests will be posted back to this contract by the bridge nodes too. -/// @author The Witnet Foundation -contract WitnetRequestBoardTrustableDefault - is - Destructible, - WitnetRequestBoardTrustableBase -{ - uint256 internal immutable _ESTIMATED_REPORT_RESULT_GAS; - - constructor( - WitnetRequestFactory _factory, - bool _upgradable, - bytes32 _versionTag, - uint256 _reportResultGasLimit - ) - WitnetRequestBoardTrustableBase( - _factory, - _upgradable, - _versionTag, - address(0) - ) - { - _ESTIMATED_REPORT_RESULT_GAS = _reportResultGasLimit; - } - - - // ================================================================================================================ - // --- Overrides implementation of 'IWitnetRequestBoardView' ------------------------------------------------------ - - /// Estimates the amount of reward we need to insert for a given gas price. - /// @param _gasPrice The gas price for which we need to calculate the rewards. - function estimateReward(uint256 _gasPrice) - public view - virtual override - returns (uint256) - { - return _gasPrice * _ESTIMATED_REPORT_RESULT_GAS; - } - - - // ================================================================================================================ - // --- Overrides 'Destructible' ----------------------------------------------------------------------------------- - - /// Destroys current instance. Only callable by the owner. - function destruct() external override onlyOwner { - selfdestruct(payable(msg.sender)); - } - - - // ================================================================================================================ - // --- Overrides 'Payable' ---------------------------------------------------------------------------------------- - - /// Gets current transaction price. - function _getGasPrice() - internal view - virtual override - returns (uint256) - { - return tx.gasprice; - } - - /// Gets current payment value. - function _getMsgValue() - internal view - virtual override - returns (uint256) - { - return msg.value; - } - - /// Transfers ETHs to given address. - /// @param _to Recipient address. - /// @param _amount Amount of ETHs to transfer. - function _safeTransferTo(address payable _to, uint256 _amount) - internal - virtual override - { - payable(_to).transfer(_amount); - } -} diff --git a/contracts/impls/core/customs/WitnetBytecodesNoSha256.sol b/contracts/impls/core/customs/WitnetBytecodesNoSha256.sol deleted file mode 100644 index 0d50f2621..000000000 --- a/contracts/impls/core/customs/WitnetBytecodesNoSha256.sol +++ /dev/null @@ -1,20 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity >=0.7.0 <0.9.0; -pragma experimental ABIEncoderV2; - -import "../WitnetBytecodesDefault.sol"; - -contract WitnetBytecodesNoSha256 is WitnetBytecodesDefault { - - constructor( - bool _upgradable, - bytes32 _versionTag - ) - WitnetBytecodesDefault(_upgradable, _versionTag) - {} - - function _witnetHash(bytes memory chunk) virtual override internal pure returns (bytes32) { - return keccak256(chunk); - } -} \ No newline at end of file diff --git a/contracts/impls/core/customs/WitnetRequestBoardTrustableBase.sol b/contracts/impls/core/customs/WitnetRequestBoardTrustableBase.sol deleted file mode 100644 index 4a992376f..000000000 --- a/contracts/impls/core/customs/WitnetRequestBoardTrustableBase.sol +++ /dev/null @@ -1,837 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity >=0.7.0 <0.9.0; -pragma experimental ABIEncoderV2; - -import "../../WitnetUpgradableBase.sol"; -import "../../../WitnetRequestBoard.sol"; -import "../../../data/WitnetBoardDataACLs.sol"; -import "../../../interfaces/IWitnetRequestBoardAdminACLs.sol"; -import "../../../patterns/Payable.sol"; - -import "../../../libs/WitnetErrorsLib.sol"; - -/// @title Witnet Request Board "trustable" base implementation contract. -/// @notice Contract to bridge requests to Witnet Decentralized Oracle Network. -/// @dev This contract enables posting requests that Witnet bridges will insert into the Witnet network. -/// The result of the requests will be posted back to this contract by the bridge nodes too. -/// @author The Witnet Foundation -abstract contract WitnetRequestBoardTrustableBase - is - WitnetUpgradableBase, - WitnetRequestBoard, - WitnetBoardDataACLs, - IWitnetRequestBoardAdminACLs, - Payable -{ - using Witnet for bytes; - using Witnet for Witnet.Result; - - constructor( - WitnetRequestFactory _factory, - bool _upgradable, - bytes32 _versionTag, - address _currency - ) - Payable(_currency) - WitnetUpgradableBase( - _upgradable, - _versionTag, - "io.witnet.proxiable.board" - ) - WitnetRequestBoard(_factory) - {} - - receive() external payable { - revert("WitnetRequestBoardTrustableBase: no transfers accepted"); - } - - /// @dev Provide backwards compatibility for dapps bound to versions <= 0.6.1 - /// @dev (i.e. calling methods in IWitnetRequestBoardDeprecating) - /// @dev (Until 'function ... abi(...)' modifier is allegedly supported in solc versions >= 0.9.1) - // solhint-disable-next-line payable-fallback - fallback() override external { /* solhint-disable no-complex-fallback */ - bytes4 _newSig = msg.sig; - if (msg.sig == 0xA8604C1A) { - // IWitnetRequestParser.isOk({bool,CBOR}) --> IWitnetRequestBoardDeprecating.isOk({bool,WitnetCBOR.CBOR}) - _newSig = IWitnetRequestBoardDeprecating.isOk.selector; - } else if (msg.sig == 0xCF62D115) { - // IWitnetRequestParser.asBytes32({bool,CBOR}) --> IWitnetRequestBoardDeprecating.asBytes32({bool,WitnetCBOR.CBOR}) - _newSig = IWitnetRequestBoardDeprecating.asBytes32.selector; - } else if (msg.sig == 0xBC7E25FF) { - // IWitnetRequestParser.asUint64({bool,CBOR}) --> IWitnetRequestBoardDeprecating.asUint64({bool,WitnetCBOR.CBOR}) - _newSig = IWitnetRequestBoardDeprecating.asUint64.selector; - } else if (msg.sig == 0xD74803BE) { - // IWitnetRequestParser.asErrorMessage({bool,CBOR}) --> IWitnetRequestBoardDeprecating.asErrorMessage({bool,WitnetCBOR.CBOR}) - _newSig = IWitnetRequestBoardDeprecating.asErrorMessage.selector; - } - if (_newSig != msg.sig) { - address _self = address(this); - assembly { - let ptr := mload(0x40) - calldatacopy(ptr, 0, calldatasize()) - mstore(ptr, or(and(mload(ptr), 0x00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff), _newSig)) - let result := delegatecall(gas(), _self, ptr, calldatasize(), 0, 0) - let size := returndatasize() - returndatacopy(ptr, 0, size) - switch result - case 0 { revert(ptr, size) } - default { return(ptr, size) } - } - } else { - revert(string(abi.encodePacked( - "WitnetRequestBoardTrustableBase: not implemented: 0x", - Witnet.toHexString(uint8(bytes1(msg.sig))), - Witnet.toHexString(uint8(bytes1(msg.sig << 8))), - Witnet.toHexString(uint8(bytes1(msg.sig << 16))), - Witnet.toHexString(uint8(bytes1(msg.sig << 24))) - ))); - } - } - - - // ================================================================================================================ - // --- Overrides IERC165 interface -------------------------------------------------------------------------------- - - /// @dev See {IERC165-supportsInterface}. - function supportsInterface(bytes4 _interfaceId) - public view - virtual override - returns (bool) - { - return _interfaceId == type(WitnetRequestBoard).interfaceId - || _interfaceId == type(IWitnetRequestBoardAdminACLs).interfaceId - || super.supportsInterface(_interfaceId); - } - - - // ================================================================================================================ - // --- Overrides 'Upgradeable' ------------------------------------------------------------------------------------- - - /// @notice Re-initialize contract's storage context upon a new upgrade from a proxy. - /// @dev Must fail when trying to upgrade to same logic contract more than once. - function initialize(bytes memory _initData) - public - override - { - address _owner = __storage().owner; - if (_owner == address(0)) { - // set owner if none set yet - _owner = msg.sender; - __storage().owner = _owner; - } else { - // only owner can initialize: - require( - msg.sender == _owner, - "WitnetRequestBoardTrustableBase: only owner" - ); - } - - if (__storage().base != address(0)) { - // current implementation cannot be initialized more than once: - require( - __storage().base != base(), - "WitnetRequestBoardTrustableBase: already upgraded" - ); - } - __storage().base = base(); - - emit Upgraded(msg.sender, base(), codehash(), version()); - - // Do actual base initialization: - setReporters(abi.decode(_initData, (address[]))); - } - - /// Tells whether provided address could eventually upgrade the contract. - function isUpgradableFrom(address _from) external view override returns (bool) { - address _owner = __storage().owner; - return ( - // false if the WRB is intrinsically not upgradable, or `_from` is no owner - isUpgradable() - && _owner == _from - ); - } - - - // ================================================================================================================ - // --- Full implementation of 'IWitnetRequestBoardAdmin' ---------------------------------------------------------- - - /// Gets admin/owner address. - function owner() - public view - override - returns (address) - { - return __storage().owner; - } - - /// Transfers ownership. - function transferOwnership(address _newOwner) - public - virtual override - onlyOwner - { - address _owner = __storage().owner; - if (_newOwner != _owner) { - __storage().owner = _newOwner; - emit OwnershipTransferred(_owner, _newOwner); - } - } - - - // ================================================================================================================ - // --- Full implementation of 'IWitnetRequestBoardAdminACLs' ------------------------------------------------------ - - /// Tells whether given address is included in the active reporters control list. - /// @param _reporter The address to be checked. - function isReporter(address _reporter) public view override returns (bool) { - return _acls().isReporter_[_reporter]; - } - - /// Adds given addresses to the active reporters control list. - /// @dev Can only be called from the owner address. - /// @dev Emits the `ReportersSet` event. - /// @param _reporters List of addresses to be added to the active reporters control list. - function setReporters(address[] memory _reporters) - public - override - onlyOwner - { - for (uint ix = 0; ix < _reporters.length; ix ++) { - address _reporter = _reporters[ix]; - _acls().isReporter_[_reporter] = true; - } - emit ReportersSet(_reporters); - } - - /// Removes given addresses from the active reporters control list. - /// @dev Can only be called from the owner address. - /// @dev Emits the `ReportersUnset` event. - /// @param _exReporters List of addresses to be added to the active reporters control list. - function unsetReporters(address[] memory _exReporters) - public - override - onlyOwner - { - for (uint ix = 0; ix < _exReporters.length; ix ++) { - address _reporter = _exReporters[ix]; - _acls().isReporter_[_reporter] = false; - } - emit ReportersUnset(_exReporters); - } - - - // ================================================================================================================ - // --- Full implementation of 'IWitnetRequestBoardReporter' ------------------------------------------------------- - - /// Reports the Witnet-provided result to a previously posted request. - /// @dev Will assume `block.timestamp` as the timestamp at which the request was solved. - /// @dev Fails if: - /// @dev - the `_queryId` is not in 'Posted' status. - /// @dev - provided `_drTxHash` is zero; - /// @dev - length of provided `_result` is zero. - /// @param _queryId The unique identifier of the data request. - /// @param _drTxHash The hash of the solving tally transaction in Witnet. - /// @param _cborBytes The result itself as bytes. - function reportResult( - uint256 _queryId, - bytes32 _drTxHash, - bytes calldata _cborBytes - ) - external - override - onlyReporters - inStatus(_queryId, Witnet.QueryStatus.Posted) - { - require(_drTxHash != 0, "WitnetRequestBoardTrustableDefault: Witnet drTxHash cannot be zero"); - // Ensures the result bytes do not have zero length - // This would not be a valid encoding with CBOR and could trigger a reentrancy attack - require(_cborBytes.length != 0, "WitnetRequestBoardTrustableDefault: result cannot be empty"); - // solhint-disable not-rely-on-time - _safeTransferTo( - payable(msg.sender), - __reportResult( - _queryId, - block.timestamp, - _drTxHash, - _cborBytes - ) - ); - emit PostedResult(_queryId, msg.sender); - } - - /// Reports the Witnet-provided result to a previously posted request. - /// @dev Fails if: - /// @dev - called from unauthorized address; - /// @dev - the `_queryId` is not in 'Posted' status. - /// @dev - provided `_drTxHash` is zero; - /// @dev - length of provided `_result` is zero. - /// @param _queryId The unique query identifier - /// @param _timestamp The timestamp of the solving tally transaction in Witnet. - /// @param _drTxHash The hash of the solving tally transaction in Witnet. - /// @param _cborBytes The result itself as bytes. - function reportResult( - uint256 _queryId, - uint256 _timestamp, - bytes32 _drTxHash, - bytes calldata _cborBytes - ) - external - override - onlyReporters - inStatus(_queryId, Witnet.QueryStatus.Posted) - { - require(_timestamp <= block.timestamp, "WitnetRequestBoardTrustableDefault: bad timestamp"); - require(_drTxHash != 0, "WitnetRequestBoardTrustableDefault: Witnet drTxHash cannot be zero"); - // Ensures the result bytes do not have zero length - // This would not be a valid encoding with CBOR and could trigger a reentrancy attack - require(_cborBytes.length != 0, "WitnetRequestBoardTrustableDefault: result cannot be empty"); - _safeTransferTo( - payable(msg.sender), - __reportResult( - _queryId, - _timestamp, - _drTxHash, - _cborBytes - ) - ); - emit PostedResult(_queryId, msg.sender); - } - - /// Reports Witnet-provided results to multiple requests within a single EVM tx. - /// @dev Fails if called from unauthorized address. - /// @dev Emits a PostedResult event for every succesfully reported result, if any. - /// @param _batchResults Array of BatchedResult structs, every one containing: - /// - unique query identifier; - /// - timestamp of the solving tally txs in Witnet. If zero is provided, EVM-timestamp will be used instead; - /// - hash of the corresponding data request tx at the Witnet side-chain level; - /// - data request result in raw bytes. - /// @param _verbose If true, emits a BatchReportError event for every failing report, if any. - function reportResultBatch( - IWitnetRequestBoardReporter.BatchResult[] memory _batchResults, - bool _verbose - ) - external - override - onlyReporters - { - uint _batchReward; - uint _batchSize = _batchResults.length; - for ( uint _i = 0; _i < _batchSize; _i ++) { - BatchResult memory _result = _batchResults[_i]; - if (_statusOf(_result.queryId) != Witnet.QueryStatus.Posted) { - if (_verbose) { - emit BatchReportError( - _result.queryId, - "WitnetRequestBoardTrustableBase: bad queryId" - ); - } - } else if (_result.drTxHash == 0) { - if (_verbose) { - emit BatchReportError( - _result.queryId, - "WitnetRequestBoardTrustableBase: bad drTxHash" - ); - } - } else if (_result.cborBytes.length == 0) { - if (_verbose) { - emit BatchReportError( - _result.queryId, - "WitnetRequestBoardTrustableBase: bad cborBytes" - ); - } - } else if (_result.timestamp > 0 && _result.timestamp > block.timestamp) { - if (_verbose) { - emit BatchReportError( - _result.queryId, - "WitnetRequestBoardTrustableBase: bad timestamp" - ); - } - } else { - _batchReward += __reportResult( - _result.queryId, - _result.timestamp == 0 ? block.timestamp : _result.timestamp, - _result.drTxHash, - _result.cborBytes - ); - emit PostedResult( - _result.queryId, - msg.sender - ); - } - } - // Transfer all successful rewards in one single shot to the authorized reporter, if any: - if (_batchReward > 0) { - _safeTransferTo( - payable(msg.sender), - _batchReward - ); - } - } - - - // ================================================================================================================ - // --- Full implementation of 'IWitnetRequestBoardRequestor' ------------------------------------------------------ - - /// @notice Returns query's result current status from a requester's point of view: - /// @notice - 0 => Void: the query is either non-existent or deleted; - /// @notice - 1 => Awaiting: the query has not yet been reported; - /// @notice - 2 => Ready: the query has been succesfully solved; - /// @notice - 3 => Error: the query couldn't get solved due to some issue. - /// @param _queryId The unique query identifier. - function checkResultStatus(uint256 _queryId) - virtual public view - returns (Witnet.ResultStatus) - { - Witnet.QueryStatus _queryStatus = _statusOf(_queryId); - if (_queryStatus == Witnet.QueryStatus.Reported) { - bytes storage __cborValues = __response(_queryId).cborBytes; - // determine whether reported result is an error by peeking the first byte - return (__cborValues[0] == bytes1(0xd8) - ? Witnet.ResultStatus.Error - : Witnet.ResultStatus.Ready - ); - } else if (_queryStatus == Witnet.QueryStatus.Posted) { - return Witnet.ResultStatus.Awaiting; - } else { - return Witnet.ResultStatus.Void; - } - } - - /// @notice Gets error code identifying some possible failure on the resolution of the given query. - /// @param _queryId The unique query identifier. - function checkResultError(uint256 _queryId) - override external view - returns (Witnet.ResultError memory) - { - Witnet.ResultStatus _status = checkResultStatus(_queryId); - if (_status == Witnet.ResultStatus.Awaiting) { - return Witnet.ResultError({ - code: Witnet.ResultErrorCodes.Unknown, - reason: "WitnetRequestBoardTrustableBase: not yet solved" - }); - } else if (_status == Witnet.ResultStatus.Void) { - return Witnet.ResultError({ - code: Witnet.ResultErrorCodes.Unknown, - reason: "WitnetRequestBoardTrustableBase: unknown query" - }); - } else { - try WitnetErrorsLib.resultErrorFromCborBytes(__response(_queryId).cborBytes) - returns (Witnet.ResultError memory _error) - { - return _error; - } - catch Error(string memory _reason) { - return Witnet.ResultError({ - code: Witnet.ResultErrorCodes.Unknown, - reason: string(abi.encodePacked("WitnetErrorsLib: ", _reason)) - }); - } - catch (bytes memory) { - return Witnet.ResultError({ - code: Witnet.ResultErrorCodes.Unknown, - reason: "WitnetErrorsLib: assertion failed" - }); - } - } - } - - /// Retrieves copy of all response data related to a previously posted request, removing the whole query from storage. - /// @dev Fails if the `_queryId` is not in 'Reported' status, or called from an address different to - /// @dev the one that actually posted the given request. - /// @param _queryId The unique query identifier. - function deleteQuery(uint256 _queryId) - public - virtual override - inStatus(_queryId, Witnet.QueryStatus.Reported) - returns (Witnet.Response memory _response) - { - Witnet.Query storage __query = __storage().queries[_queryId]; - require( - msg.sender == __query.from, - "WitnetRequestBoardTrustableBase: only requester" - ); - _response = __query.response; - delete __storage().queries[_queryId]; - emit DeletedQuery(_queryId, msg.sender); - } - - /// Requests the execution of the given Witnet Data Request in expectation that it will be relayed and solved by the Witnet DON. - /// A reward amount is escrowed by the Witnet Request Board that will be transferred to the reporter who relays back the Witnet-provided - /// result to this request. - /// @dev Fails if: - /// @dev - provided reward is too low. - /// @dev - provided address is zero. - /// @param _requestInterface The address of a IWitnetRequest contract, containing the actual Data Request seralized bytecode. - /// @return _queryId An unique query identifier. - function postRequest(IWitnetRequest _requestInterface) - virtual override - public payable - returns (uint256 _queryId) - { - uint256 _value = _getMsgValue(); - uint256 _gasPrice = _getGasPrice(); - - // check base reward - uint256 _baseReward = estimateReward(_gasPrice); - require(_value >= _baseReward, "WitnetRequestBoardTrustableBase: reward too low"); - - // Validates provided script: - require(_requestInterface.hash() != bytes32(0), "WitnetRequestBoardTrustableBase: no precompiled request"); - - _queryId = ++ __storage().numQueries; - __storage().queries[_queryId].from = msg.sender; - - Witnet.Request storage _request = __request(_queryId); - _request.addr = address(_requestInterface); - _request.gasprice = _gasPrice; - _request.reward = _value; - - // Let observers know that a new request has been posted - emit PostedRequest(_queryId, msg.sender); - } - - /// Requests the execution of the given Witnet Data Request in expectation that it will be relayed and solved by the Witnet DON. - /// A reward amount is escrowed by the Witnet Request Board that will be transferred to the reporter who relays back the Witnet-provided - /// result to this request. - /// @dev Fails if: - /// @dev - provided reward is too low. - /// @param _radHash The radHash of the Witnet Data Request. - /// @param _slaHash The slaHash of the Witnet Data Request. - function postRequest(bytes32 _radHash, bytes32 _slaHash) - virtual override - public payable - returns (uint256 _queryId) - { - uint256 _value = _getMsgValue(); - uint256 _gasPrice = _getGasPrice(); - - // check base reward - uint256 _baseReward = estimateReward(_gasPrice); - require( - _value >= _baseReward, - "WitnetRequestBoardTrustableBase: reward too low" - ); - - _queryId = ++ __storage().numQueries; - __storage().queries[_queryId].from = msg.sender; - - Witnet.Request storage _request = __request(_queryId); - _request.radHash = _radHash; - _request.slaHash = _slaHash; - _request.gasprice = _gasPrice; - _request.reward = _value; - - // Let observers know that a new request has been posted - emit PostedRequest(_queryId, msg.sender); - } - - /// Requests the execution of the given Witnet Data Request in expectation that it will be relayed and solved by the Witnet DON. - /// A reward amount is escrowed by the Witnet Request Board that will be transferred to the reporter who relays back the Witnet-provided - /// result to this request. - /// @dev Fails if: - /// @dev - provided reward is too low. - /// @param _radHash The RAD hash of the data tequest to be solved by Witnet. - /// @param _slaParams The SLA param of the data request to be solved by Witnet. - function postRequest(bytes32 _radHash, WitnetV2.RadonSLA calldata _slaParams) - virtual override - public payable - returns (uint256 _queryId) - { - return postRequest( - _radHash, - registry.verifyRadonSLA(_slaParams) - ); - } - - - /// Increments the reward of a previously posted request by adding the transaction value to it. - /// @dev Updates request `gasPrice` in case this method is called with a higher - /// @dev gas price value than the one used in previous calls to `postRequest` or - /// @dev `upgradeReward`. - /// @dev Fails if the `_queryId` is not in 'Posted' status. - /// @dev Fails also in case the request `gasPrice` is increased, and the new - /// @dev reward value gets below new recalculated threshold. - /// @param _queryId The unique query identifier. - function upgradeReward(uint256 _queryId) - public payable - virtual override - inStatus(_queryId, Witnet.QueryStatus.Posted) - { - Witnet.Request storage _request = __request(_queryId); - - uint256 _newReward = _request.reward + _getMsgValue(); - uint256 _newGasPrice = _getGasPrice(); - - // If gas price is increased, then check if new rewards cover gas costs - if (_newGasPrice > _request.gasprice) { - // Checks the reward is covering gas cost - uint256 _minResultReward = estimateReward(_newGasPrice); - require( - _newReward >= _minResultReward, - "WitnetRequestBoardTrustableBase: reward too low" - ); - _request.gasprice = _newGasPrice; - } - _request.reward = _newReward; - } - - - // ================================================================================================================ - // --- Full implementation of 'IWitnetRequestBoardView' ----------------------------------------------------------- - - /// Estimates the amount of reward we need to insert for a given gas price. - /// @param _gasPrice The gas price for which we need to calculate the rewards. - function estimateReward(uint256 _gasPrice) - public view - virtual override - returns (uint256); - - /// Returns next request id to be generated by the Witnet Request Board. - function getNextQueryId() - external view - override - returns (uint256) - { - return __storage().numQueries + 1; - } - - /// Gets the whole Query data contents, if any, no matter its current status. - function getQueryData(uint256 _queryId) - external view - override - returns (Witnet.Query memory) - { - return __storage().queries[_queryId]; - } - - /// Gets current status of given query. - function getQueryStatus(uint256 _queryId) - external view - override - returns (Witnet.QueryStatus) - { - return _statusOf(_queryId); - - } - - /// Retrieves the whole Request record posted to the Witnet Request Board. - /// @dev Fails if the `_queryId` is not valid or, if it has already been reported - /// @dev or deleted. - /// @param _queryId The unique identifier of a previously posted query. - function readRequest(uint256 _queryId) - external view - override - inStatus(_queryId, Witnet.QueryStatus.Posted) - returns (Witnet.Request memory _request) - { - return __request(_queryId); - } - - /// Retrieves the serialized bytecode of a previously posted Witnet Data Request. - /// @dev Fails if the `_queryId` is not valid, or if the related script bytecode - /// @dev got changed after being posted. Returns empty array once it gets reported, - /// @dev or deleted. - /// @param _queryId The unique query identifier. - function readRequestBytecode(uint256 _queryId) - external view - virtual override - returns (bytes memory _bytecode) - { - require( - _statusOf(_queryId) != Witnet.QueryStatus.Unknown, - "WitnetRequestBoardTrustableBase: not yet posted" - ); - Witnet.Request storage _request = __request(_queryId); - if (_request.addr != address(0)) { - _bytecode = IWitnetRequest(_request.addr).bytecode(); - } else if (_request.radHash != bytes32(0)) { - _bytecode = registry.bytecodeOf( - _request.radHash, - _request.slaHash - ); - } - } - - /// Retrieves the gas price that any assigned reporter will have to pay when reporting - /// result to a previously posted Witnet data request. - /// @dev Fails if the `_queryId` is not valid or, if it has already been - /// @dev reported, or deleted. - /// @param _queryId The unique query identifier - function readRequestGasPrice(uint256 _queryId) - external view - override - inStatus(_queryId, Witnet.QueryStatus.Posted) - returns (uint256) - { - return __storage().queries[_queryId].request.gasprice; - } - - /// Retrieves the reward currently set for a previously posted request. - /// @dev Fails if the `_queryId` is not valid or, if it has already been - /// @dev reported, or deleted. - /// @param _queryId The unique query identifier - function readRequestReward(uint256 _queryId) - external view - override - inStatus(_queryId, Witnet.QueryStatus.Posted) - returns (uint256) - { - return __storage().queries[_queryId].request.reward; - } - - /// Retrieves the Witnet-provided result, and metadata, to a previously posted request. - /// @dev Fails if the `_queryId` is not in 'Reported' status. - /// @param _queryId The unique query identifier - function readResponse(uint256 _queryId) - external view - override - inStatus(_queryId, Witnet.QueryStatus.Reported) - returns (Witnet.Response memory _response) - { - return __response(_queryId); - } - - /// Retrieves the hash of the Witnet transaction that actually solved the referred query. - /// @dev Fails if the `_queryId` is not in 'Reported' status. - /// @param _queryId The unique query identifier. - function readResponseDrTxHash(uint256 _queryId) - external view - override - inStatus(_queryId, Witnet.QueryStatus.Reported) - returns (bytes32) - { - return __response(_queryId).drTxHash; - } - - /// Retrieves the address that reported the result to a previously-posted request. - /// @dev Fails if the `_queryId` is not in 'Reported' status. - /// @param _queryId The unique query identifier - function readResponseReporter(uint256 _queryId) - external view - override - inStatus(_queryId, Witnet.QueryStatus.Reported) - returns (address) - { - return __response(_queryId).reporter; - } - - /// Retrieves the Witnet-provided CBOR-bytes result of a previously posted request. - /// @dev Fails if the `_queryId` is not in 'Reported' status. - /// @param _queryId The unique query identifier - function readResponseResult(uint256 _queryId) - external view - override - inStatus(_queryId, Witnet.QueryStatus.Reported) - returns (Witnet.Result memory) - { - Witnet.Response storage _response = __response(_queryId); - return _response.cborBytes.resultFromCborBytes(); - } - - /// Retrieves the timestamp in which the result to the referred query was solved by the Witnet DON. - /// @dev Fails if the `_queryId` is not in 'Reported' status. - /// @param _queryId The unique query identifier. - function readResponseTimestamp(uint256 _queryId) - external view - override - inStatus(_queryId, Witnet.QueryStatus.Reported) - returns (uint256) - { - return __response(_queryId).timestamp; - } - - - // ================================================================================================================ - // --- Full implementation of 'IWitnetRequestBoardDeprecating' interface ------------------------------------------ - - /// Tell if a Witnet.Result is successful. - /// @param _result An instance of Witnet.Result. - /// @return `true` if successful, `false` if errored. - function isOk(Witnet.Result memory _result) - external pure - override - returns (bool) - { - return _result.success; - } - - /// Decode a bytes value from a Witnet.Result as a `bytes32` value. - /// @param _result An instance of Witnet.Result. - /// @return The `bytes32` decoded from the Witnet.Result. - function asBytes32(Witnet.Result memory _result) - external pure - override - returns (bytes32) - { - return _result.asBytes32(); - } - - /// Generate a suitable error message for a member of `Witnet.ResultErrorCodes` and its corresponding arguments. - /// @dev WARN: Note that client contracts should wrap this function into a try-catch foreseing potential errors generated in this function - /// @param _result An instance of `Witnet.Result`. - /// @return A tuple containing the `CBORValue.Error memory` decoded from the `Witnet.Result`, plus a loggable error message. - function asErrorMessage(Witnet.Result memory _result) - external pure - override - returns (Witnet.ResultErrorCodes, string memory) - { - Witnet.ResultError memory _resultError = WitnetErrorsLib.asError(_result); - return ( - _resultError.code, - _resultError.reason - ); - } - - /// Decode a natural numeric value from a Witnet.Result as a `uint` value. - /// @param _result An instance of Witnet.Result. - /// @return The `uint` decoded from the Witnet.Result. - function asUint64(Witnet.Result memory _result) - external pure - override - returns (uint64) - { - return uint64(_result.asUint()); - } - - /// Decode raw CBOR bytes into a Witnet.Result instance. - /// @param _cborBytes Raw bytes representing a CBOR-encoded value. - /// @return A `Witnet.Result` instance. - function resultFromCborBytes(bytes memory _cborBytes) - external pure - override - returns (Witnet.Result memory) - { - return Witnet.resultFromCborBytes(_cborBytes); - } - - - // ================================================================================================================ - // --- Internal functions ----------------------------------------------------------------------------------------- - - function __reportResult( - uint256 _queryId, - uint256 _timestamp, - bytes32 _drTxHash, - bytes memory _cborBytes - ) - internal - returns (uint256 _reward) - { - Witnet.Query storage _query = __query(_queryId); - Witnet.Request storage _request = _query.request; - Witnet.Response storage _response = _query.response; - - // solhint-disable not-rely-on-time - _response.timestamp = _timestamp; - _response.drTxHash = _drTxHash; - _response.reporter = msg.sender; - _response.cborBytes = _cborBytes; - - // return request latest reward - _reward = _request.reward; - - // Request data won't be needed anymore, so it can just get deleted right now: - delete _query.request; - } -} diff --git a/contracts/impls/core/customs/WitnetRequestBoardTrustableBoba.sol b/contracts/impls/core/customs/WitnetRequestBoardTrustableBoba.sol deleted file mode 100644 index e6c3a33f4..000000000 --- a/contracts/impls/core/customs/WitnetRequestBoardTrustableBoba.sol +++ /dev/null @@ -1,132 +0,0 @@ -// SPDX-License-Identifier: MIT - -/* solhint-disable var-name-mixedcase */ - -pragma solidity >=0.7.0 <0.9.0; -pragma experimental ABIEncoderV2; - -// Inherits from: -import "./WitnetRequestBoardTrustableBase.sol"; - -// Uses: -import "../../../interfaces/IERC20.sol"; - -/// @title Witnet Request Board OVM-compatible (Optimism) "trustable" implementation. -/// @notice Contract to bridge requests to Witnet Decentralized Oracle Network. -/// @dev This contract enables posting requests that Witnet bridges will insert into the Witnet network. -/// The result of the requests will be posted back to this contract by the bridge nodes too. -/// @author The Witnet Foundation -contract WitnetRequestBoardTrustableBoba - is - Payable, - WitnetRequestBoardTrustableBase -{ - uint256 internal lastBalance; - uint256 internal immutable _OVM_GAS_PRICE; - uint256 internal immutable _OVM_ESTIMATED_REPORT_RESULT_GAS; - - modifier ovmPayable virtual { - _; - // all calls to payable methods, - // MUST update internal 'lastBalance' value at the very end. - lastBalance = _balanceOf(address(this)); - } - - constructor( - WitnetRequestFactory _factory, - bool _upgradable, - bytes32 _versionTag, - uint256 _layer2ReportResultGasLimit, - uint256 _layer2GasPrice, - address _oETH - ) - WitnetRequestBoardTrustableBase(_factory, _upgradable, _versionTag, _oETH) - { - require(address(_oETH) != address(0), "WitnetRequestBoardTrustableBoba: null currency"); - _OVM_GAS_PRICE = _layer2GasPrice; - _OVM_ESTIMATED_REPORT_RESULT_GAS = _layer2ReportResultGasLimit; - } - - /// Gets lastBalance of given address. - function _balanceOf(address _from) - internal view - returns (uint256) - { - return currency.balanceOf(_from); - } - - - // ================================================================================================================ - // --- Overrides 'Payable' ---------------------------------------------------------------------------------------- - - /// Gets current transaction price. - function _getGasPrice() - internal view - override - returns (uint256) - { - return _OVM_GAS_PRICE; - } - - /// Calculates `msg.value` equivalent OVM_ETH value. - /// @dev Based on `lastBalance` value. - function _getMsgValue() - internal view - override - returns (uint256) - { - uint256 _newBalance = _balanceOf(address(this)); - assert(_newBalance >= lastBalance); - return _newBalance - lastBalance; - } - - /// Transfers oETHs to given address. - /// @dev Updates `lastBalance` value. - /// @param _to OVM_ETH recipient account. - /// @param _amount Amount of oETHs to transfer. - function _safeTransferTo(address payable _to, uint256 _amount) - internal - override - { - uint256 _lastBalance = _balanceOf(address(this)); - require(_amount <= _lastBalance, "WitnetRequestBoardTrustableBoba: insufficient funds"); - lastBalance = _lastBalance - _amount; - currency.transfer(_to, _amount); - } - - - // ================================================================================================================ - // --- Overrides implementation of 'IWitnetRequestBoardView' ------------------------------------------------------ - - /// @dev Estimate the minimal amount of reward we need to insert for a given gas price. - /// @return The minimal reward to be included for the given gas price. - function estimateReward(uint256) - public view - virtual override - returns (uint256) - { - return _OVM_GAS_PRICE * _OVM_ESTIMATED_REPORT_RESULT_GAS; - } - - - // ================================================================================================================ - // --- Overrides implementation of 'IWitnetRequestBoardRequestor' ------------------------------------------------- - - function postRequest(IWitnetRequest _request) - public payable - virtual override - ovmPayable - returns (uint256) - { - return WitnetRequestBoardTrustableBase.postRequest(_request); - } - - function upgradeReward(uint256 _queryId) - public payable - virtual override - ovmPayable - inStatus(_queryId, Witnet.QueryStatus.Posted) - { - WitnetRequestBoardTrustableBase.upgradeReward(_queryId); - } -} diff --git a/contracts/impls/core/customs/WitnetRequestBoardTrustableOvm2.sol b/contracts/impls/core/customs/WitnetRequestBoardTrustableOvm2.sol deleted file mode 100644 index 369bd398b..000000000 --- a/contracts/impls/core/customs/WitnetRequestBoardTrustableOvm2.sol +++ /dev/null @@ -1,58 +0,0 @@ -// SPDX-License-Identifier: MIT - -/* solhint-disable var-name-mixedcase */ - -pragma solidity >=0.7.0 <0.9.0; -pragma experimental ABIEncoderV2; - -import "../WitnetRequestBoardTrustableDefault.sol"; - -// solhint-disable-next-line -interface OVM_GasPriceOracle { - function getL1Fee(bytes calldata _data) external view returns (uint256); -} - -/// @title Witnet Request Board "trustable" implementation contract. -/// @notice Contract to bridge requests to Witnet Decentralized Oracle Network. -/// @dev This contract enables posting requests that Witnet bridges will insert into the Witnet network. -/// The result of the requests will be posted back to this contract by the bridge nodes too. -/// @author The Witnet Foundation -contract WitnetRequestBoardTrustableOvm2 - is - Destructible, - WitnetRequestBoardTrustableDefault -{ - OVM_GasPriceOracle immutable public gasPriceOracleL1; - - constructor( - WitnetRequestFactory _factory, - bool _upgradable, - bytes32 _versionTag, - uint256 _reportResultGasLimit - ) - WitnetRequestBoardTrustableDefault( - _factory, - _upgradable, - _versionTag, - _reportResultGasLimit - ) - { - gasPriceOracleL1 = OVM_GasPriceOracle(0x420000000000000000000000000000000000000F); - } - - - // ================================================================================================================ - // --- Overrides implementation of 'IWitnetRequestBoardView' ------------------------------------------------------ - - /// Estimates the amount of reward we need to insert for a given gas price. - /// @param _gasPrice The gas price for which we need to calculate the rewards. - function estimateReward(uint256 _gasPrice) - public view - virtual override - returns (uint256) - { - return _gasPrice * _ESTIMATED_REPORT_RESULT_GAS + gasPriceOracleL1.getL1Fee( - hex"c8f5cdd500000000000000000000000000000000000000000000000000000000ffffffff00000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000225820ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" - ); - } -} diff --git a/contracts/impls/core/customs/WitnetRequestBoardTrustableReef.sol b/contracts/impls/core/customs/WitnetRequestBoardTrustableReef.sol deleted file mode 100644 index f99ec4628..000000000 --- a/contracts/impls/core/customs/WitnetRequestBoardTrustableReef.sol +++ /dev/null @@ -1,58 +0,0 @@ -// SPDX-License-Identifier: MIT - -/* solhint-disable var-name-mixedcase */ - -pragma solidity >=0.7.0 <0.9.0; -pragma experimental ABIEncoderV2; - -// Inherits from: -import "../WitnetRequestBoardTrustableDefault.sol"; - -/// @title Witnet Request Board OVM-compatible (Optimism) "trustable" implementation. -/// @notice Contract to bridge requests to Witnet Decentralized Oracle Network. -/// @dev This contract enables posting requests that Witnet bridges will insert into the Witnet network. -/// The result of the requests will be posted back to this contract by the bridge nodes too. -/// @author The Witnet Foundation -contract WitnetRequestBoardTrustableReef - is - WitnetRequestBoardTrustableDefault -{ - constructor( - WitnetRequestFactory _factory, - bool _upgradable, - bytes32 _versionTag, - uint256 _reportResultGasLimit - ) - WitnetRequestBoardTrustableDefault( - _factory, - _upgradable, - _versionTag, - _reportResultGasLimit - ) - {} - - // ================================================================================================================ - // --- Overrides implementation of 'IWitnetRequestBoardView' ------------------------------------------------------ - - /// @dev Estimate the minimal amount of reward we need to insert for a given gas price. - /// @return The minimal reward to be included for the given gas price. - function estimateReward(uint256) - public view - virtual override - returns (uint256) - { - return _ESTIMATED_REPORT_RESULT_GAS; - } - - // ================================================================================================================ - // --- Overrides 'Payable' ---------------------------------------------------------------------------------------- - - /// Gets current transaction price. - function _getGasPrice() - internal pure - virtual override - returns (uint256) - { - return 1; - } -} diff --git a/contracts/impls/mocks/WitnetRandomnessMock.sol b/contracts/impls/mocks/WitnetRandomnessMock.sol deleted file mode 100644 index 3a5232eb9..000000000 --- a/contracts/impls/mocks/WitnetRandomnessMock.sol +++ /dev/null @@ -1,163 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity >=0.7.0 <0.9.0; -pragma experimental ABIEncoderV2; - -import "../apps/WitnetRandomnessProxiable.sol"; - -/// @title WitnetRandomness mock contract implementation. -/// @dev TO BE USED ONLY ON DEVELOPMENT ENVIRONMENTS. -/// @dev ON SUPPORTED TESTNETS, PLEASE USE THE `WitnetRandomness` -/// @dev CONTRACT ADDRESS PROVIDED BY THE WITNET FOUNDATION. -/// @dev SEE: https://docs.witnet.io/smart-contracts/witnet-randomness-oracle/contract-addresses -/// @author Witnet Foundation. -contract WitnetRandomnessMock - is - WitnetRandomnessProxiable -{ - uint8 internal __mockRandomizeLatencyBlocks; - uint256 internal __mockRandomizeFee; - uint256 internal __mockRandomizeLatestId; - - /// Constructor: new WitnetRandomnessMock contract - /// @param _mockRandomizeLatencyBlocks Mocked number of blocks in which a new randomness will be provided after `randomize()` - /// @param _mockRandomizeFee Mocked randomize fee (will be constant no matter what tx gas price is provided). - constructor ( - WitnetRequestBoard _wrb, - uint8 _mockRandomizeLatencyBlocks, - uint256 _mockRandomizeFee - ) - WitnetRandomnessProxiable( - _wrb, - bytes32("mocked") - ) - { - __mockRandomizeLatencyBlocks = _mockRandomizeLatencyBlocks; - __mockRandomizeFee = _mockRandomizeFee; - } - - /// Returns mocked amount of wei required to be paid as a fee when requesting new randomization. - function estimateRandomizeFee(uint256) - public view - virtual override - returns (uint256) - { - return __mockRandomizeFee; - } - - /// Retrieves data of a randomization request that got successfully posted to the WRB within a given block. - /// @dev Returns zero values if no randomness request was actually posted within a given block. - /// @param _block Block number whose randomness request is being queried for. - /// @return _from Address from which the latest randomness request was posted. - /// @return _id Unique request identifier as provided by the WRB. - /// @return _prevBlock Block number in which a randomness request got posted just before this one. 0 if none. - /// @return _nextBlock Block number in which a randomness request got posted just after this one, 0 if none. - function getRandomizeData(uint256 _block) - external view - virtual override - returns ( - address _from, - uint256 _id, - uint256 _prevBlock, - uint256 _nextBlock - ) - { - RandomizeData storage _data = __randomize_[_block]; - _id = _data.witnetQueryId; - _from = _data.from; - _prevBlock = _data.prevBlock; - _nextBlock = _data.nextBlock; - } - - /// Mocks randomness generated upon solving a request that was posted within a given block, - /// if more than `__mockRandomizeLatencyBlocks` have elapsed since rquest, or to the _first_ request - /// posted after that block, otherwise. - /// @dev Please, note that 256 blocks after a `randomize()` request, randomness will be possibly returned - /// @dev as `bytes32(0)` (depending on actual EVM implementation). - /// @dev Fails if: - /// @dev i. no `randomize()` was not called in either the given block, or afterwards. - /// @dev ii. a request posted in/after given block does exist, but lest than `__mockRandomizeLatencyBlocks` have elapsed. - /// @param _block Block number from which the search will start. - function getRandomnessAfter(uint256 _block) - public view - virtual override - returns (bytes32) - { - if (__randomize_[_block].from == address(0)) { - _block = getRandomnessNextBlock(_block); - } - uint256 _queryId = __randomize_[_block].witnetQueryId; - require(_queryId != 0, "WitnetRandomnessMock: not randomized"); - require(block.number >= _block + __mockRandomizeLatencyBlocks, "WitnetRandomnessMock: pending randomize"); - return blockhash(_block); - } - - /// Mocks `true` only when a randomness request got actually posted within given block, - /// and at least `__mockRandomizeLatencyBlocks` have elapsed since then. - function isRandomized(uint256 _block) - public view - virtual override - returns (bool) - { - RandomizeData storage _data = __randomize_[_block]; - return ( - _data.witnetQueryId != 0 - && block.number >= _block + __mockRandomizeLatencyBlocks - ); - } - - /// Mocks request to generate randomness, using underlying EVM as entropy source. - /// Only one randomness request per block will be actually posted. Unused funds shall - /// be transfered back to the tx sender. - /// @dev FOR UNITARY TESTING ONLY. DO NOT USE IN PRODUCTION, AS PROVIDED RANDOMNESS - /// @dev WILL NEITHER BE EVM-AGNOSTIC, NOR SECURE. - /// @return _usedFunds Amount of funds actually used from those provided by the tx sender. - function randomize() - external payable - virtual override - returns (uint256 _usedFunds) - { - if (latestRandomizeBlock < block.number) { - _usedFunds = __mockRandomizeFee; - require( - msg.value >= _usedFunds, - "WitnetRandomnessMock: reward too low" - ); - // Post the Witnet Randomness request: - uint _queryId = ++ __mockRandomizeLatestId; - RandomizeData storage _data = __randomize_[block.number]; - _data.from = msg.sender; - _data.witnetQueryId = _queryId; - // Update block links: - uint256 _prevBlock = latestRandomizeBlock; - _data.prevBlock = _prevBlock; - __randomize_[_prevBlock].nextBlock = block.number; - latestRandomizeBlock = block.number; - // Throw event: - emit Randomized( - msg.sender, - _prevBlock, - _queryId, - __witnetRandomnessRadHash - ); - } - // Transfer back unused tx value: - if (_usedFunds < msg.value) { - payable(msg.sender).transfer(msg.value - _usedFunds); - } - } - - /// Mocks by ignoring any fee increase on a pending-to-be-solved randomness request. - /// @dev The whole `msg.value` shall be transferred back to the tx sender. - /// @return _usedFunds Amount of funds actually used from those provided by the tx sender. - function upgradeRandomizeFee(uint256) - public payable - virtual override - returns (uint256) - { - if (msg.value > 0) { - payable(msg.sender).transfer(msg.value); - } - return 0; - } -} diff --git a/contracts/interfaces/IERC165.sol b/contracts/interfaces/IERC165.sol deleted file mode 100644 index 27d6b9ff4..000000000 --- a/contracts/interfaces/IERC165.sol +++ /dev/null @@ -1,3 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >=0.7.0 <0.9.0; -import "@openzeppelin/contracts/utils/introspection/IERC165.sol"; diff --git a/contracts/interfaces/IERC20.sol b/contracts/interfaces/IERC20.sol deleted file mode 100644 index 35ce7b279..000000000 --- a/contracts/interfaces/IERC20.sol +++ /dev/null @@ -1,3 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >=0.7.0 <0.9.0; -import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; diff --git a/contracts/interfaces/V2/IFeeds.sol b/contracts/interfaces/IFeeds.sol similarity index 100% rename from contracts/interfaces/V2/IFeeds.sol rename to contracts/interfaces/IFeeds.sol diff --git a/contracts/interfaces/IWitnetConsumer.sol b/contracts/interfaces/IWitnetConsumer.sol new file mode 100644 index 000000000..3f84c13c0 --- /dev/null +++ b/contracts/interfaces/IWitnetConsumer.sol @@ -0,0 +1,48 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import "../libs/Witnet.sol"; + +interface IWitnetConsumer { + + /// @notice Method to be called from the WitnetOracle contract as soon as the given Witnet `queryId` + /// @notice gets reported, if reported with no errors. + /// @dev It should revert if called from any other address different to the WitnetOracle being used + /// @dev by the WitnetConsumer contract. + /// @param witnetQueryId The unique identifier of the Witnet query being reported. + /// @param witnetResultTallyHash Hash of the commit/reveal witnessing act that took place in the Witnet blockahin. + /// @param witnetResultTimestamp Timestamp at which the reported value was captured by the Witnet blockchain. + /// @param witnetEvmFinalityBlock EVM block at which the provided data can be considered to be final. + /// @param witnetResultCborValue The CBOR-encoded resulting value of the Witnet query being reported. + function reportWitnetQueryResult( + uint256 witnetQueryId, + uint64 witnetResultTimestamp, + bytes32 witnetResultTallyHash, + uint256 witnetEvmFinalityBlock, + WitnetCBOR.CBOR calldata witnetResultCborValue + ) external; + + /// @notice Method to be called from the WitnetOracle contract as soon as the given Witnet `queryId` + /// @notice gets reported, if reported WITH errors. + /// @dev It should revert if called from any other address different to the WitnetOracle being used + /// @dev by the WitnetConsumer contract. + /// @param witnetQueryId The unique identifier of the Witnet query being reported. + /// @param witnetResultTallyHash Hash of the commit/reveal witnessing act that took place in the Witnet blockahin. + /// @param witnetResultTimestamp Timestamp at which the reported value was captured by the Witnet blockchain. + /// @param witnetEvmFinalityBlock EVM block at which the provided data can be considered to be final. + /// @param errorCode The error code enum identifying the error produced during resolution on the Witnet blockchain. + /// @param errorArgs Error arguments, if any. An empty buffer is to be passed if no error arguments apply. + function reportWitnetQueryError( + uint256 witnetQueryId, + uint64 witnetResultTimestamp, + bytes32 witnetResultTallyHash, + uint256 witnetEvmFinalityBlock, + Witnet.ResultErrorCodes errorCode, + WitnetCBOR.CBOR calldata errorArgs + ) external; + + /// @notice Determines if Witnet queries can be reported from given address. + /// @dev In practice, must only be true on the WitnetOracle address that's being used by + /// @dev the WitnetConsumer to post queries. + function reportableFrom(address) external view returns (bool); +} \ No newline at end of file diff --git a/contracts/interfaces/IWitnetFeeds.sol b/contracts/interfaces/IWitnetFeeds.sol new file mode 100644 index 000000000..2e4487642 --- /dev/null +++ b/contracts/interfaces/IWitnetFeeds.sol @@ -0,0 +1,52 @@ +// SPDX-License-Identifier: MIT + +pragma solidity >=0.8.0 <0.9.0; + +import "../WitnetOracle.sol"; +import "../WitnetRequestBytecodes.sol"; + +interface IWitnetFeeds { + + event DeletedFeed (address indexed from, bytes4 indexed feedId, string caption); + event SettledFeed (address indexed from, bytes4 indexed feedId, string caption, bytes32 radHash); + event SettledFeedSolver (address indexed from, bytes4 indexed feedId, string caption, address solver); + event SettledRadonSLA (address indexed from, WitnetV2.RadonSLA sla); + + event UpdateRequest( + address indexed origin, + bytes4 indexed feedId, + uint256 witnetQueryId, + uint256 witnetQueryEvmReward, + WitnetV2.RadonSLA witnetQuerySLA + ); + + event UpdateRequestReward( + address indexed origin, + bytes4 indexed feedId, + uint256 witnetQueryId, + uint256 witnetQueryReward + ); + + function dataType() external view returns (Witnet.RadonDataTypes); + function prefix() external view returns (string memory); + function registry() external view returns (WitnetRequestBytecodes); + function witnet() external view returns (WitnetOracle); + + function defaultRadonSLA() external view returns (Witnet.RadonSLA memory); + function estimateUpdateBaseFee(uint256 evmGasPrice) external view returns (uint); + + function lastValidResponse(bytes4 feedId) external view returns (WitnetV2.Response memory); + + function latestUpdateQueryId(bytes4 feedId) external view returns (uint256); + function latestUpdateRequest(bytes4 feedId) external view returns (WitnetV2.Request memory); + function latestUpdateResponse(bytes4 feedId) external view returns (WitnetV2.Response memory); + function latestUpdateResponseStatus(bytes4 feedId) external view returns (WitnetV2.ResponseStatus); + function latestUpdateResultError(bytes4 feedId) external view returns (Witnet.ResultError memory); + + function lookupWitnetBytecode(bytes4 feedId) external view returns (bytes memory); + function lookupWitnetRadHash(bytes4 feedId) external view returns (bytes32); + function lookupWitnetRetrievals(bytes4 feedId) external view returns (Witnet.RadonRetrieval[] memory); + + function requestUpdate(bytes4 feedId) external payable returns (uint256 usedFunds); + function requestUpdate(bytes4 feedId, WitnetV2.RadonSLA calldata updateSLA) external payable returns (uint256 usedFunds); +} \ No newline at end of file diff --git a/contracts/interfaces/V2/IWitnetFeedsAdmin.sol b/contracts/interfaces/IWitnetFeedsAdmin.sol similarity index 70% rename from contracts/interfaces/V2/IWitnetFeedsAdmin.sol rename to contracts/interfaces/IWitnetFeedsAdmin.sol index 92f4694fe..87190fb3c 100644 --- a/contracts/interfaces/V2/IWitnetFeedsAdmin.sol +++ b/contracts/interfaces/IWitnetFeedsAdmin.sol @@ -2,14 +2,18 @@ pragma solidity >=0.8.0 <0.9.0; -import "../../libs/WitnetV2.sol"; -import "../../requests/WitnetRequest.sol"; +import "../libs/WitnetV2.sol"; +import "../WitnetRequest.sol"; interface IWitnetFeedsAdmin { + function acceptOwnership() external; function deleteFeed(string calldata caption) external; + function owner() external view returns (address); + function pendingOwner() external returns (address); function settleDefaultRadonSLA(WitnetV2.RadonSLA calldata) external; function settleFeedRequest(string calldata caption, bytes32 radHash) external; function settleFeedRequest(string calldata caption, WitnetRequest request) external; function settleFeedRequest(string calldata caption, WitnetRequestTemplate template, string[][] calldata) external; function settleFeedSolver(string calldata caption, address solver, string[] calldata deps) external; + function transferOwnership(address) external; } \ No newline at end of file diff --git a/contracts/interfaces/IWitnetOracle.sol b/contracts/interfaces/IWitnetOracle.sol new file mode 100644 index 000000000..f749e7ae3 --- /dev/null +++ b/contracts/interfaces/IWitnetOracle.sol @@ -0,0 +1,130 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.7.0 <0.9.0; + +import "../libs/WitnetV2.sol"; + +interface IWitnetOracle { + + /// @notice Estimate the minimum reward required for posting a data request. + /// @dev Underestimates if the size of returned data is greater than `resultMaxSize`. + /// @param gasPrice Expected gas price to pay upon posting the data request. + /// @param resultMaxSize Maximum expected size of returned data (in bytes). + function estimateBaseFee(uint256 gasPrice, uint16 resultMaxSize) external view returns (uint256); + + /// @notice Estimate the minimum reward required for posting a data request. + /// @dev Fails if the RAD hash was not previously verified on the WitnetRequestBytecodes registry. + /// @param gasPrice Expected gas price to pay upon posting the data request. + /// @param radHash The RAD hash of the data request to be solved by Witnet. + function estimateBaseFee(uint256 gasPrice, bytes32 radHash) external view returns (uint256); + + /// @notice Estimate the minimum reward required for posting a data request with a callback. + /// @param gasPrice Expected gas price to pay upon posting the data request. + /// @param callbackGasLimit Maximum gas to be spent when reporting the data request result. + function estimateBaseFeeWithCallback(uint256 gasPrice, uint24 callbackGasLimit) external view returns (uint256); + + /// @notice Retrieves a copy of all Witnet-provable data related to a previously posted request, + /// removing the whole query from the WRB storage. + /// @dev Fails if the query was not in 'Reported' status, or called from an address different to + /// @dev the one that actually posted the given request. + /// @param queryId The unique query identifier. + function fetchQueryResponse(uint256 queryId) external returns (WitnetV2.Response memory); + + /// @notice Gets the whole Query data contents, if any, no matter its current status. + function getQuery(uint256 queryId) external view returns (WitnetV2.Query memory); + + /// @notice Retrieves the reward currently set for the given query. + /// @dev Fails if the `queryId` is not valid or, if it has already been reported, delivered, or deleted. + /// @param queryId The unique query identifier. + function getQueryEvmReward(uint256 queryId) external view returns (uint256); + + /// @notice Retrieves the RAD hash and SLA parameters of the given query. + /// @param queryId The unique query identifier. + function getQueryRequest(uint256 queryId) external view returns (WitnetV2.Request memory); + + /// @notice Retrieves the whole `Witnet.Response` record referred to a previously posted Witnet Data Request. + /// @param queryId The unique query identifier. + function getQueryResponse(uint256 queryId) external view returns (WitnetV2.Response memory); + + /// @notice Returns query's result current status from a requester's point of view: + /// @notice - 0 => Void: the query is either non-existent or deleted; + /// @notice - 1 => Awaiting: the query has not yet been reported; + /// @notice - 2 => Ready: the query response was finalized, and contains a result with no erros. + /// @notice - 3 => Error: the query response was finalized, and contains a result with errors. + /// @param queryId The unique query identifier. + function getQueryResponseStatus(uint256 queryId) external view returns (WitnetV2.ResponseStatus); + + /// @notice Gets error code identifying some possible failure on the resolution of the given query. + /// @param queryId The unique query identifier. + function getQueryResultError(uint256 queryId) external view returns (Witnet.ResultError memory); + + /// @notice Gets current status of given query. + function getQueryStatus(uint256 queryId) external view returns (WitnetV2.QueryStatus); + + /// @notice Retrieves the Witnet Data Request bytecode of a previously posted query. + /// @dev Fails if the query does not exist. + /// @param queryId The unique query identifier. + function getQueryWitnetBytecode(uint256 queryId) external view returns (bytes memory); + + /// @notice Returns next query id to be generated by the Witnet Request Board. + function getNextQueryId() external view returns (uint256); + + /// @notice Requests the execution of the given Witnet Data Request, in expectation that it will be relayed and + /// @notice solved by the Witnet blockchain. A reward amount is escrowed by the Witnet Request Board that will be + /// @notice transferred to the reporter who relays back the Witnet-provable result to this request. + /// @dev Reasons to fail: + /// @dev - the RAD hash was not previously verified by the WitnetRequestBytecodes registry; + /// @dev - invalid SLA parameters were provided; + /// @dev - insufficient value is paid as reward. + /// @param queryRAD The RAD hash of the data request to be solved by Witnet. + /// @param querySLA The data query SLA to be fulfilled on the Witnet blockchain. + /// @return queryId Unique query identifier. + function postRequest( + bytes32 queryRAD, + WitnetV2.RadonSLA calldata querySLA + ) external payable returns (uint256 queryId); + + /// @notice Requests the execution of the given Witnet Data Request, in expectation that it will be relayed and solved by + /// @notice the Witnet blockchain. A reward amount is escrowed by the Witnet Request Board that will be transferred to the + /// @notice reporter who relays back the Witnet-provable result to this request. The Witnet-provable result will be reported + /// @notice directly to the requesting contract. If the report callback fails for any reason, an `WitnetResponseDeliveryFailed` + /// @notice will be triggered, and the Witnet audit trail will be saved in storage, but not so the actual CBOR-encoded result. + /// @dev Reasons to fail: + /// @dev - the caller is not a contract implementing the IWitnetConsumer interface; + /// @dev - the RAD hash was not previously verified by the WitnetRequestBytecodes registry; + /// @dev - invalid SLA parameters were provided; + /// @dev - insufficient value is paid as reward. + /// @param queryRAD The RAD hash of the data request to be solved by Witnet. + /// @param querySLA The data query SLA to be fulfilled on the Witnet blockchain. + /// @param queryCallbackGasLimit Maximum gas to be spent when reporting the data request result. + /// @return queryId Unique query identifier. + function postRequestWithCallback( + bytes32 queryRAD, + WitnetV2.RadonSLA calldata querySLA, + uint24 queryCallbackGasLimit + ) external payable returns (uint256 queryId); + + /// @notice Requests the execution of the given Witnet Data Request, in expectation that it will be relayed and solved by + /// @notice the Witnet blockchain. A reward amount is escrowed by the Witnet Request Board that will be transferred to the + /// @notice reporter who relays back the Witnet-provable result to this request. The Witnet-provable result will be reported + /// @notice directly to the requesting contract. If the report callback fails for any reason, a `WitnetResponseDeliveryFailed` + /// @notice event will be triggered, and the Witnet audit trail will be saved in storage, but not so the CBOR-encoded result. + /// @dev Reasons to fail: + /// @dev - the caller is not a contract implementing the IWitnetConsumer interface; + /// @dev - the provided bytecode is empty; + /// @dev - invalid SLA parameters were provided; + /// @dev - insufficient value is paid as reward. + /// @param queryUnverifiedBytecode The (unverified) bytecode containing the actual data request to be solved by the Witnet blockchain. + /// @param querySLA The data query SLA to be fulfilled on the Witnet blockchain. + /// @param queryCallbackGasLimit Maximum gas to be spent when reporting the data request result. + /// @return queryId Unique query identifier. + function postRequestWithCallback( + bytes calldata queryUnverifiedBytecode, + WitnetV2.RadonSLA calldata querySLA, + uint24 queryCallbackGasLimit + ) external payable returns (uint256 queryId); + + /// @notice Increments the reward of a previously posted request by adding the transaction value to it. + /// @param queryId The unique query identifier. + function upgradeQueryEvmReward(uint256 queryId) external payable; + +} diff --git a/contracts/interfaces/IWitnetOracleEvents.sol b/contracts/interfaces/IWitnetOracleEvents.sol new file mode 100644 index 000000000..44ca0475a --- /dev/null +++ b/contracts/interfaces/IWitnetOracleEvents.sol @@ -0,0 +1,28 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.7.0 <0.9.0; + +import "../libs/WitnetV2.sol"; + +interface IWitnetOracleEvents { + + /// Emitted every time a new query containing some verified data request is posted to the WRB. + event WitnetQuery(uint256 indexed id, uint256 evmReward, uint64 witTotalFee); + + /// Emitted when a query with no callback gets reported into the WRB. + event WitnetQueryReported(uint256 indexed id, uint256 evmGasPrice); + + /// Emitted when the reward of some not-yet reported query is upgraded. + event WitnetQueryRewardUpgraded(uint256 indexed id, uint256 evmReward); + + /// Emitted when a query with a callback gets successfully reported into the WRB. + event WitnetResponseDelivered(uint256 indexed id, uint256 evmGasPrice, uint256 evmCallbackGas); + + /// Emitted when a query with a callback cannot get reported into the WRB. + event WitnetResponseDeliveryFailed( + uint256 indexed id, + bytes resultCborBytes, + uint256 evmGasPrice, + uint256 evmCallbackGas, + string evmCallbackRevertReason + ); +} diff --git a/contracts/interfaces/IWitnetPriceFeed.sol b/contracts/interfaces/IWitnetPriceFeed.sol deleted file mode 100644 index d5865f3da..000000000 --- a/contracts/interfaces/IWitnetPriceFeed.sol +++ /dev/null @@ -1,72 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >=0.7.0 <0.9.0; -pragma experimental ABIEncoderV2; - -/// @title The Witnet Price Feed basic interface. -/// @dev Guides implementation of active price feed polling contracts. -/// @author The Witnet Foundation. - -interface IWitnetPriceFeed { - - /// Signals that a new price update request is being posted to the Witnet Request Board - event PriceFeeding(address indexed from, uint256 queryId, uint256 extraFee); - - /// @notice Estimates minimum fee amount in native currency to be paid when - /// @notice requesting a new price update. - /// @dev Actual fee depends on the gas price of the `requestUpdate()` transaction. - /// @param _gasPrice Gas price expected to be paid when calling `requestUpdate()` - function estimateUpdateFee(uint256 _gasPrice) external view returns (uint256); - - /// @notice Returns result of the last valid price update request successfully solved by the Witnet oracle. - function lastPrice() external view returns (int256); - - /// @notice Returns the EVM-timestamp when last valid price was reported back from the Witnet oracle. - function lastTimestamp() external view returns (uint256); - - /// @notice Returns tuple containing last valid price and timestamp, as well as status code of latest update - /// @notice request that got posted to the Witnet Request Board. - /// @return _lastPrice Last valid price reported back from the Witnet oracle. - /// @return _lastTimestamp EVM-timestamp of the last valid price. - /// @return _lastDrTxHash Hash of the Witnet Data Request that solved the last valid price. - /// @return _latestUpdateStatus Status code of the latest update request. - function lastValue() external view returns ( - int _lastPrice, - uint _lastTimestamp, - bytes32 _lastDrTxHash, - uint _latestUpdateStatus - ); - - /// @notice Returns identifier of the latest update request posted to the Witnet Request Board. - function latestQueryId() external view returns (uint256); - - /// @notice Returns hash of the Witnet Data Request that solved the latest update request. - /// @dev Returning 0 while the latest update request remains unsolved. - function latestUpdateDrTxHash() external view returns (bytes32); - - /// @notice Returns error message of latest update request posted to the Witnet Request Board. - /// @dev Returning empty string if the latest update request remains unsolved, or - /// @dev if it was succesfully solved with no errors. - function latestUpdateErrorMessage() external view returns (string memory); - - /// @notice Returns status code of latest update request posted to the Witnet Request Board: - /// @dev Status codes: - /// @dev - 200: update request was succesfully solved with no errors - /// @dev - 400: update request was solved with errors - /// @dev - 404: update request was not solved yet - function latestUpdateStatus() external view returns (uint256); - - /// @notice Returns `true` if latest update request posted to the Witnet Request Board - /// @notice has not been solved yet by the Witnet oracle. - function pendingUpdate() external view returns (bool); - - /// @notice Posts a new price update request to the Witnet Request Board. Requires payment of a fee - /// @notice that depends on the value of `tx.gasprice`. See `estimateUpdateFee(uint256)`. - /// @dev If previous update request was not solved yet, calling this method again allows - /// @dev upgrading the update fee if called with a higher `tx.gasprice` value. - function requestUpdate() external payable; - - /// @notice Tells whether this contract implements the interface defined by `interfaceId`. - /// @dev See the corresponding https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] - /// @dev to learn more about how these ids are created. - function supportsInterface(bytes4) external view returns (bool); -} diff --git a/contracts/interfaces/V2/IWitnetPriceFeeds.sol b/contracts/interfaces/IWitnetPriceFeeds.sol similarity index 100% rename from contracts/interfaces/V2/IWitnetPriceFeeds.sol rename to contracts/interfaces/IWitnetPriceFeeds.sol diff --git a/contracts/interfaces/IWitnetPriceRouter.sol b/contracts/interfaces/IWitnetPriceRouter.sol deleted file mode 100644 index 23b25cfaa..000000000 --- a/contracts/interfaces/IWitnetPriceRouter.sol +++ /dev/null @@ -1,56 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >=0.7.0 <0.9.0; -pragma experimental ABIEncoderV2; - -import "ado-contracts/contracts/interfaces/IERC2362.sol"; -import "./IERC165.sol"; - -/// @title The Witnet Price Router basic interface. -/// @dev Guides implementation of price feeds aggregation contracts. -/// @author The Witnet Foundation. -abstract contract IWitnetPriceRouter - is - IERC2362 -{ - /// Emitted everytime a currency pair is attached to a new price feed contract - /// @dev See https://github.com/adoracles/ADOIPs/blob/main/adoip-0010.md - /// @dev to learn how these ids are created. - event CurrencyPairSet(bytes32 indexed erc2362ID, IERC165 pricefeed); - - /// @notice Helper pure function: returns hash of the provided ERC2362-compliant currency pair caption (aka ID). - function currencyPairId(string memory) external pure virtual returns (bytes32); - - /// @notice Returns the ERC-165-compliant price feed contract currently serving - /// @notice updates on the given currency pair. - function getPriceFeed(bytes32 _erc2362id) external view virtual returns (IERC165); - - /// @notice Returns human-readable ERC2362-based caption of the currency pair being - /// @notice served by the given price feed contract address. - /// @dev Should fail if the given price feed contract address is not currently - /// @dev registered in the router. - function getPriceFeedCaption(IERC165) external view virtual returns (string memory); - - /// @notice Returns human-readable caption of the ERC2362-based currency pair identifier, if known. - function lookupERC2362ID(bytes32 _erc2362id) external view virtual returns (string memory); - - /// @notice Register a price feed contract that will serve updates for the given currency pair. - /// @dev Setting zero address to a currency pair implies that it will not be served any longer. - /// @dev Otherwise, should fail if the price feed contract does not support the `IWitnetPriceFeed` interface, - /// @dev or if given price feed is already serving another currency pair (within this WitnetPriceRouter instance). - function setPriceFeed( - IERC165 _pricefeed, - uint256 _decimals, - string calldata _base, - string calldata _quote - ) - external virtual; - - /// @notice Returns list of known currency pairs IDs. - function supportedCurrencyPairs() external view virtual returns (bytes32[] memory); - - /// @notice Returns `true` if given pair is currently being served by a compliant price feed contract. - function supportsCurrencyPair(bytes32 _erc2362id) external view virtual returns (bool); - - /// @notice Returns `true` if given price feed contract is currently serving updates to any known currency pair. - function supportsPriceFeed(IERC165 _priceFeed) external view virtual returns (bool); -} diff --git a/contracts/interfaces/V2/IWitnetPriceSolver.sol b/contracts/interfaces/IWitnetPriceSolver.sol similarity index 63% rename from contracts/interfaces/V2/IWitnetPriceSolver.sol rename to contracts/interfaces/IWitnetPriceSolver.sol index e6068e60e..b495cd735 100644 --- a/contracts/interfaces/V2/IWitnetPriceSolver.sol +++ b/contracts/interfaces/IWitnetPriceSolver.sol @@ -2,17 +2,18 @@ pragma solidity >=0.8.0 <0.9.0; -import "../../libs/WitnetV2.sol"; +import "../libs/WitnetV2.sol"; interface IWitnetPriceSolver { struct Price { uint value; uint timestamp; - bytes32 drTxHash; - Witnet.ResultStatus status; + bytes32 tallyHash; + WitnetV2.ResponseStatus status; } - function class() external pure returns (bytes4); + function class() external pure returns (string memory); function delegator() external view returns (address); function solve(bytes4 feedId) external view returns (Price memory); + function specs() external pure returns (bytes4); function validate(bytes4 feedId, string[] calldata initdata) external; } \ No newline at end of file diff --git a/contracts/interfaces/V2/IWitnetPriceSolverDeployer.sol b/contracts/interfaces/IWitnetPriceSolverDeployer.sol similarity index 100% rename from contracts/interfaces/V2/IWitnetPriceSolverDeployer.sol rename to contracts/interfaces/IWitnetPriceSolverDeployer.sol diff --git a/contracts/interfaces/IWitnetRandomness.sol b/contracts/interfaces/IWitnetRandomness.sol deleted file mode 100644 index f3759b945..000000000 --- a/contracts/interfaces/IWitnetRandomness.sol +++ /dev/null @@ -1,106 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity >=0.7.0 <0.9.0; - -import "../WitnetRequestBoard.sol"; -import "../requests/WitnetRequest.sol"; - -/// @title The Witnet Randomness generator interface. -/// @author Witnet Foundation. -interface IWitnetRandomness { - - /// Thrown every time a new WitnetRandomnessRequest gets succesfully posted to the WitnetRequestBoard. - /// @param from Address from which the randomize() function was called. - /// @param prevBlock Block number in which a randomness request got posted just before this one. 0 if none. - /// @param witnetQueryId Unique query id assigned to this request by the WRB. - /// @param witnetRequestHash SHA-256 hash of the WitnetRandomnessRequest actual bytecode just posted to the WRB. - event Randomized( - address indexed from, - uint256 indexed prevBlock, - uint256 witnetQueryId, - bytes32 witnetRequestHash - ); - - /// @notice Returns amount of wei required to be paid as a fee when requesting randomization with a - /// transaction gas price as the one given. - function estimateRandomizeFee(uint256 _gasPrice) external view returns (uint256); - - /// @notice Retrieves data of a randomization request that got successfully posted to the WRB within a given block. - /// @dev Returns zero values if no randomness request was actually posted within a given block. - /// @param _block Block number whose randomness request is being queried for. - /// @return _from Address from which the latest randomness request was posted. - /// @return _id Unique request identifier as provided by the WRB. - /// @return _prevBlock Block number in which a randomness request got posted just before this one. 0 if none. - /// @return _nextBlock Block number in which a randomness request got posted just after this one, 0 if none. - function getRandomizeData(uint256 _block) - external view returns (address _from, uint256 _id, uint256 _prevBlock, uint256 _nextBlock); - - /// @notice Retrieves the randomness generated upon solving a request that was posted within a given block, - /// if any, or to the _first_ request posted after that block, otherwise. Should the intended - /// request happen to be finalized with errors on the Witnet oracle network side, this function - /// will recursively try to return randomness from the next non-faulty randomization request found - /// in storage, if any. - /// @dev Fails if: - /// @dev i. no `randomize()` was not called in either the given block, or afterwards. - /// @dev ii. a request posted in/after given block does exist, but no result has been provided yet. - /// @dev iii. all requests in/after the given block were solved with errors. - /// @param _block Block number from which the search will start. - function getRandomnessAfter(uint256 _block) external view returns (bytes32); - - /// @notice Tells what is the number of the next block in which a randomization request was posted after the given one. - /// @param _block Block number from which the search will start. - /// @return Number of the first block found after the given one, or `0` otherwise. - function getRandomnessNextBlock(uint256 _block) external view returns (uint256); - - /// @notice Gets previous block in which a randomness request was posted before the given one. - /// @param _block Block number from which the search will start. - /// @return First block found before the given one, or `0` otherwise. - function getRandomnessPrevBlock(uint256 _block) external view returns (uint256); - - /// @notice Returns `true` only when the randomness request that got posted within given block was already - /// reported back from the Witnet oracle, either successfully or with an error of any kind. - function isRandomized(uint256 _block) external view returns (bool); - - /// @notice Returns latest block in which a randomness request got sucessfully posted to the WRB. - function latestRandomizeBlock() external view returns (uint256); - - /// @notice Generates a pseudo-random number uniformly distributed within the range [0 .. _range), by using - /// @notice the given `_nonce` value and the randomness returned by `getRandomnessAfter(_block)`. - /// @dev Fails under same conditions as `getRandomnessAfter(uint256)` may do. - /// @param _range Range within which the uniformly-distributed random number will be generated. - /// @param _nonce Nonce value enabling multiple random numbers from the same randomness value. - /// @param _block Block number from which the search will start. - function random(uint32 _range, uint256 _nonce, uint256 _block) external view returns (uint32); - - /// @notice Generates a pseudo-random number uniformly distributed within the range [0 .. _range), by using - /// @notice the given `_nonce` value and the given `_seed` as a source of entropy. - /// @param _range Range within which the uniformly-distributed random number will be generated. - /// @param _nonce Nonce value enabling multiple random numbers from the same randomness value. - /// @param _seed Seed value used as entropy source. - function random(uint32 _range, uint256 _nonce, bytes32 _seed) external pure returns (uint32); - - /// @notice Requests the Witnet oracle to generate an EVM-agnostic and trustless source of randomness. - /// @notice Only one randomness request per block will be actually posted to the WRB. Should there - /// @notice already be a posted request within current block, it will try to upgrade Witnet fee of current's - /// @notice block randomness request according to current gas price. In both cases, all unused funds shall - /// @notice be transfered back to the tx sender. - /// @return _usedFunds Amount of funds actually used from those provided by the tx sender. - function randomize() external payable returns (uint256 _usedFunds); - - /// @notice Increases Witnet fee related to a pending-to-be-solved randomness request, as much as it - /// @notice may be required in proportion to how much bigger the current tx gas price is with respect the - /// @notice highest gas price that was paid in either previous fee upgrades, or when the given randomness - /// @notice request was posted. All unused funds shall be transferred back to the tx sender. - /// @return _usedFunds Amount of dunds actually used from those provided by the tx sender. - function upgradeRandomizeFee(uint256 _block) external payable returns (uint256 _usedFunds); - - /// @notice Returns address of the WitnetRequestBoard being used for posting randomness requests to Wtinet. - function witnet() external view returns (WitnetRequestBoard); - - /// @notice Returns address of the WitnetRequestRandomness contract being used for solving randomness. - function witnetRandomnessRequest() external view returns (WitnetRequest); - - /// @notice Returns SLA parameters that are being used every time there's a new randomness request. - function witnetRandomnessSLA() external view returns (WitnetV2.RadonSLA memory); - -} \ No newline at end of file diff --git a/contracts/interfaces/IWitnetRandomnessAdmin.sol b/contracts/interfaces/IWitnetRandomnessAdmin.sol deleted file mode 100644 index 741eb6648..000000000 --- a/contracts/interfaces/IWitnetRandomnessAdmin.sol +++ /dev/null @@ -1,13 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity >=0.8.0 <0.9.0; - -import "../libs/WitnetV2.sol"; - -interface IWitnetRandomnessAdmin { - function owner() external view returns (address); - function acceptOwnership() external; - function pendingOwner() external returns (address); - function transferOwnership(address) external; - function settleWitnetRandomnessSLA(WitnetV2.RadonSLA calldata) external returns (bytes32); -} \ No newline at end of file diff --git a/contracts/interfaces/IWitnetRequest.sol b/contracts/interfaces/IWitnetRequest.sol deleted file mode 100644 index c5b5a43fb..000000000 --- a/contracts/interfaces/IWitnetRequest.sol +++ /dev/null @@ -1,15 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity >=0.7.0 <0.9.0; - -/// @title The Witnet Data Request basic interface. -/// @author The Witnet Foundation. -interface IWitnetRequest { - - /// @notice A `IWitnetRequest` is constructed around a `bytes` value containing - /// @notice a well-formed Witnet Data Request using Protocol Buffers. - function bytecode() external view returns (bytes memory); - - /// @notice Returns SHA256 hash of Witnet Data Request as CBOR-encoded bytes. - function hash() external view returns (bytes32); -} diff --git a/contracts/interfaces/IWitnetRequestBoardDeprecating.sol b/contracts/interfaces/IWitnetRequestBoardDeprecating.sol deleted file mode 100644 index 7e9a6cd09..000000000 --- a/contracts/interfaces/IWitnetRequestBoardDeprecating.sol +++ /dev/null @@ -1,41 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity >=0.7.0 <0.9.0; -pragma experimental ABIEncoderV2; - -import "../libs/Witnet.sol"; - -/// @title Witnet Request Board info interface. -/// @author The Witnet Foundation. -interface IWitnetRequestBoardDeprecating { - - /// =============================================================================================================== - /// --- Deprecating funcionality v0.5 ----------------------------------------------------------------------------- - - /// Tell if a Witnet.Result is successful. - /// @param _result An instance of Witnet.Result. - /// @return `true` if successful, `false` if errored. - function isOk(Witnet.Result memory _result) external pure returns (bool); - - /// Decode a bytes value from a Witnet.Result as a `bytes32` value. - /// @param _result An instance of Witnet.Result. - /// @return The `bytes32` decoded from the Witnet.Result. - function asBytes32(Witnet.Result memory _result) external pure returns (bytes32); - - /// Generate a suitable error message for a member of `Witnet.ResultErrorCodes` and its corresponding arguments. - /// @dev WARN: Note that client contracts should wrap this function into a try-catch foreseing potential errors generated in this function - /// @param _result An instance of `Witnet.Result`. - /// @return A tuple containing the `CBORValue.Error memory` decoded from the `Witnet.Result`, plus a loggable error message. - function asErrorMessage(Witnet.Result memory _result) external pure returns (Witnet.ResultErrorCodes, string memory); - - /// Decode a natural numeric value from a Witnet.Result as a `uint` value. - /// @param _result An instance of Witnet.Result. - /// @return The `uint` decoded from the Witnet.Result. - function asUint64(Witnet.Result memory _result) external pure returns (uint64); - - /// Decode raw CBOR bytes into a Witnet.Result instance. - /// @param _cborBytes Raw bytes representing a CBOR-encoded value. - /// @return A `Witnet.Result` instance. - function resultFromCborBytes(bytes memory _cborBytes) external pure returns (Witnet.Result memory); - -} diff --git a/contracts/interfaces/IWitnetRequestBoardEvents.sol b/contracts/interfaces/IWitnetRequestBoardEvents.sol deleted file mode 100644 index 54eb31ab4..000000000 --- a/contracts/interfaces/IWitnetRequestBoardEvents.sol +++ /dev/null @@ -1,17 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity >=0.7.0 <0.9.0; - -/// @title Witnet Request Board emitting events interface. -/// @author The Witnet Foundation. -interface IWitnetRequestBoardEvents { - - /// Emitted when a Witnet Data Request is posted to the WRB. - event PostedRequest(uint256 queryId, address from); - - /// Emitted when a Witnet-solved result is reported to the WRB. - event PostedResult(uint256 queryId, address from); - - /// Emitted when all data related to given query is deleted from the WRB. - event DeletedQuery(uint256 queryId, address from); -} diff --git a/contracts/interfaces/IWitnetRequestBoardReporter.sol b/contracts/interfaces/IWitnetRequestBoardReporter.sol index 28895bd9d..ed679d34e 100644 --- a/contracts/interfaces/IWitnetRequestBoardReporter.sol +++ b/contracts/interfaces/IWitnetRequestBoardReporter.sol @@ -6,37 +6,43 @@ pragma solidity >=0.7.0 <0.9.0; /// @author The Witnet Foundation. interface IWitnetRequestBoardReporter { + /// @notice Estimates the actual earnings (or loss), in WEI, that a reporter would get by reporting result to given query, + /// @notice based on the gas price of the calling transaction. Data requesters should consider upgrading the reward on + /// @notice queries providing no actual earnings. + /// @dev Fails if the query does not exist, or if deleted. + function estimateQueryEarnings(uint256[] calldata queryIds, uint256 gasPrice) external view returns (int256); + /// @notice Reports the Witnet-provided result to a previously posted request. /// @dev Will assume `block.timestamp` as the timestamp at which the request was solved. /// @dev Fails if: - /// @dev - the `_queryId` is not in 'Posted' status. - /// @dev - provided `_drTxHash` is zero; + /// @dev - the `_witnetQueryId` is not in 'Posted' status. + /// @dev - provided `_tallyHash` is zero; /// @dev - length of provided `_result` is zero. - /// @param _queryId The unique identifier of the data request. - /// @param _drTxHash The hash of the corresponding data request transaction in Witnet. - /// @param _result The result itself as bytes. + /// @param witnetQueryId The unique identifier of the data request. + /// @param witnetQueryResultTallyHash The hash of the corresponding data request transaction in Witnet. + /// @param witnetQueryResultCborBytes The result itself as bytes. function reportResult( - uint256 _queryId, - bytes32 _drTxHash, - bytes calldata _result - ) external; + uint256 witnetQueryId, + bytes32 witnetQueryResultTallyHash, + bytes calldata witnetQueryResultCborBytes + ) external returns (uint256); /// @notice Reports the Witnet-provided result to a previously posted request. /// @dev Fails if: /// @dev - called from unauthorized address; - /// @dev - the `_queryId` is not in 'Posted' status. - /// @dev - provided `_drTxHash` is zero; + /// @dev - the `_witnetQueryId` is not in 'Posted' status. + /// @dev - provided `_tallyHash` is zero; /// @dev - length of provided `_result` is zero. - /// @param _queryId The unique query identifier - /// @param _timestamp The timestamp of the solving tally transaction in Witnet. - /// @param _drTxHash The hash of the corresponding data request transaction in Witnet. - /// @param _result The result itself as bytes. + /// @param witnetQueryId The unique query identifier + /// @param witnetQueryResultTimestamp The timestamp of the solving tally transaction in Witnet. + /// @param witnetQueryResultTallyHash The hash of the corresponding data request transaction in Witnet. + /// @param witnetQueryResultCborBytes The result itself as bytes. function reportResult( - uint256 _queryId, - uint256 _timestamp, - bytes32 _drTxHash, - bytes calldata _result - ) external; + uint256 witnetQueryId, + uint32 witnetQueryResultTimestamp, + bytes32 witnetQueryResultTallyHash, + bytes calldata witnetQueryResultCborBytes + ) external returns (uint256); /// @notice Reports Witnet-provided results to multiple requests within a single EVM tx. /// @dev Must emit a PostedResult event for every succesfully reported result. @@ -46,13 +52,13 @@ interface IWitnetRequestBoardReporter { /// - hash of the corresponding data request tx at the Witnet side-chain level; /// - data request result in raw bytes. /// @param _verbose If true, must emit a BatchReportError event for every failing report, if any. - function reportResultBatch(BatchResult[] calldata _batchResults, bool _verbose) external; + function reportResultBatch(BatchResult[] calldata _batchResults, bool _verbose) external returns (uint256); struct BatchResult { uint256 queryId; - uint256 timestamp; - bytes32 drTxHash; - bytes cborBytes; + uint32 queryResultTimestamp; + bytes32 queryResultTallyHash; + bytes queryResultCborBytes; } event BatchReportError(uint256 queryId, string reason); diff --git a/contracts/interfaces/IWitnetRequestBoardRequestor.sol b/contracts/interfaces/IWitnetRequestBoardRequestor.sol deleted file mode 100644 index 2dbb46537..000000000 --- a/contracts/interfaces/IWitnetRequestBoardRequestor.sol +++ /dev/null @@ -1,73 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity >=0.7.0 <0.9.0; -pragma experimental ABIEncoderV2; - -import "../libs/WitnetV2.sol"; - -/// @title Witnet Requestor Interface -/// @notice It defines how to interact with the Witnet Request Board in order to: -/// - request the execution of Witnet Radon scripts (data request); -/// - upgrade the resolution reward of any previously posted request, in case gas price raises in mainnet; -/// - read the result of any previously posted request, eventually reported by the Witnet DON. -/// - remove from storage all data related to past and solved data requests, and results. -/// @author The Witnet Foundation. -interface IWitnetRequestBoardRequestor { - - /// @notice Returns query's result current status from a requester's point of view: - /// @notice - 0 => Void: the query is either non-existent or deleted; - /// @notice - 1 => Awaiting: the query has not yet been reported; - /// @notice - 2 => Ready: the query has been succesfully solved; - /// @notice - 3 => Error: the query couldn't get solved due to some issue. - /// @param _queryId The unique query identifier. - function checkResultStatus(uint256 _queryId) external view returns (Witnet.ResultStatus); - - /// @notice Gets error code identifying some possible failure on the resolution of the given query. - /// @param _queryId The unique query identifier. - function checkResultError(uint256 _queryId) external view returns (Witnet.ResultError memory); - - /// @notice Retrieves a copy of all Witnet-provided data related to a previously posted request, removing the whole query from the WRB storage. - /// @dev Fails if the `_queryId` is not in 'Reported' status, or called from an address different to - /// @dev the one that actually posted the given request. - /// @param _queryId The unique query identifier. - function deleteQuery(uint256 _queryId) external returns (Witnet.Response memory); - - /// @notice Requests the execution of the given Witnet Data Request in expectation that it will be relayed and solved by the Witnet DON. - /// @notice A reward amount is escrowed by the Witnet Request Board that will be transferred to the reporter who relays back the Witnet-provided - /// @notice result to this request. - /// @dev Fails if: - /// @dev - provided reward is too low. - /// @dev - provided script is zero address. - /// @dev - provided script bytecode is empty. - /// @param addr The address of the IWitnetRequest contract that can provide the actual Data Request bytecode. - /// @return _queryId Unique query identifier. - function postRequest(IWitnetRequest addr) external payable returns (uint256 _queryId); - - /// @notice Requests the execution of the given Witnet Data Request in expectation that it will be relayed and solved by the Witnet DON. - /// @notice A reward amount is escrowed by the Witnet Request Board that will be transferred to the reporter who relays back the Witnet-provided - /// @notice result to this request. - /// @dev Fails if, provided reward is too low. - /// @param radHash The RAD hash of the data request to be solved by Witnet. - /// @param slaHash The SLA hash of the data request to be solved by Witnet. - /// @return _queryId Unique query identifier. - function postRequest(bytes32 radHash, bytes32 slaHash) external payable returns (uint256 _queryId); - - /// @notice Requests the execution of the given Witnet Data Request in expectation that it will be relayed and solved by the Witnet DON. - /// @notice A reward amount is escrowed by the Witnet Request Board that will be transferred to the reporter who relays back the Witnet-provided - /// @notice result to this request. - /// @dev Fails if, provided reward is too low. - /// @param radHash The RAD hash of the data request to be solved by Witnet. - /// @param slaParams The SLA params of the data request to be solved by Witnet. - /// @return _queryId Unique query identifier. - function postRequest(bytes32 radHash, WitnetV2.RadonSLA calldata slaParams) external payable returns (uint256 _queryId); - - /// @notice Increments the reward of a previously posted request by adding the transaction value to it. - /// @dev Updates request `gasPrice` in case this method is called with a higher - /// @dev gas price value than the one used in previous calls to `postRequest` or - /// @dev `upgradeReward`. - /// @dev Fails if the `_queryId` is not in 'Posted' status. - /// @dev Fails also in case the request `gasPrice` is increased, and the new - /// @dev reward value gets below new recalculated threshold. - /// @param _queryId The unique query identifier. - function upgradeReward(uint256 _queryId) external payable; -} diff --git a/contracts/interfaces/IWitnetRequestBoardView.sol b/contracts/interfaces/IWitnetRequestBoardView.sol deleted file mode 100644 index d86000ee5..000000000 --- a/contracts/interfaces/IWitnetRequestBoardView.sol +++ /dev/null @@ -1,75 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity >=0.7.0 <0.9.0; -pragma experimental ABIEncoderV2; - -import "../libs/Witnet.sol"; - -/// @title Witnet Request Board info interface. -/// @author The Witnet Foundation. -interface IWitnetRequestBoardView { - - /// @notice Estimates the amount of reward we need to insert for a given gas price. - /// @param _gasPrice The gas price for which we need to calculate the rewards. - function estimateReward(uint256 _gasPrice) external view returns (uint256); - - /// @notice Returns next query id to be generated by the Witnet Request Board. - function getNextQueryId() external view returns (uint256); - - /// @notice Gets the whole Query data contents, if any, no matter its current status. - function getQueryData(uint256 _queryId) external view returns (Witnet.Query memory); - - /// @notice Gets current status of given query. - function getQueryStatus(uint256 _queryId) external view returns (Witnet.QueryStatus); - - /// @notice Retrieves the whole Request record posted to the Witnet Request Board. - /// @dev Fails if the `_queryId` is not valid or, if it has already been reported - /// @dev or deleted. - /// @param _queryId The unique identifier of a previously posted query. - function readRequest(uint256 _queryId) external view returns (Witnet.Request memory); - - /// @notice Retrieves the serialized bytecode of a previously posted Witnet Data Request. - /// @dev Fails if the `_queryId` is not valid, or if the related script bytecode - /// @dev got changed after being posted. Returns empty array once it gets reported, - /// @dev or deleted. - /// @param _queryId The unique query identifier. - function readRequestBytecode(uint256 _queryId) external view returns (bytes memory); - - /// @notice Retrieves the gas price that any assigned reporter will have to pay when reporting - /// result to a previously posted Witnet data request. - /// @dev Fails if the `_queryId` is not valid or, if it has already been - /// @dev reported, or deleted. - /// @param _queryId The unique query identifie - function readRequestGasPrice(uint256 _queryId) external view returns (uint256); - - /// @notice Retrieves the reward currently set for the referred query. - /// @dev Fails if the `_queryId` is not valid or, if it has already been - /// @dev reported, or deleted. - /// @param _queryId The unique query identifier. - function readRequestReward(uint256 _queryId) external view returns (uint256); - - /// @notice Retrieves the whole `Witnet.Response` record referred to a previously posted Witnet Data Request. - /// @dev Fails if the `_queryId` is not in 'Reported' status. - /// @param _queryId The unique query identifier. - function readResponse(uint256 _queryId) external view returns (Witnet.Response memory); - - /// @notice Retrieves error codes of given query. - /// @dev Fails if the `_queryId` is not in 'Reported' status, or if no actual error. - /// @param _queryId The unique query identifier. - function readResponseDrTxHash(uint256 _queryId) external view returns (bytes32); - - /// @notice Retrieves the address that reported the result to a previously-posted request. - /// @dev Fails if the `_queryId` is not in 'Reported' status. - /// @param _queryId The unique query identifier. - function readResponseReporter(uint256 _queryId) external view returns (address); - - /// @notice Retrieves the Witnet-provided CBOR-bytes result of a previously posted request. - /// @dev Fails if the `_queryId` is not in 'Reported' status. - /// @param _queryId The unique query identifier. - function readResponseResult(uint256 _queryId) external view returns (Witnet.Result memory); - - /// @notice Retrieves the timestamp in which the result to the referred query was solved by the Witnet DON. - /// @dev Fails if the `_queryId` is not in 'Reported' status. - /// @param _queryId The unique query identifier. - function readResponseTimestamp(uint256 _queryId) external view returns (uint256); -} diff --git a/contracts/interfaces/IWitnetRequestBytecodes.sol b/contracts/interfaces/IWitnetRequestBytecodes.sol new file mode 100644 index 000000000..f93b9f7b6 --- /dev/null +++ b/contracts/interfaces/IWitnetRequestBytecodes.sol @@ -0,0 +1,57 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.8.0 <0.9.0; + +import "../libs/Witnet.sol"; + +interface IWitnetRequestBytecodes { + + error UnknownRadonRetrieval(bytes32 hash); + error UnknownRadonReducer(bytes32 hash); + error UnknownRadonRequest(bytes32 hash); + + event NewDataProvider(uint256 index); + event NewRadonRetrievalHash(bytes32 hash); + event NewRadonReducerHash(bytes32 hash); + event NewRadHash(bytes32 hash); + + function bytecodeOf(bytes32 radHash) external view returns (bytes memory); + function hashOf(bytes calldata) external view returns (bytes32); + + function lookupDataProvider(uint256 index) external view returns (string memory, uint); + function lookupDataProviderIndex(string calldata authority) external view returns (uint); + function lookupDataProviderSources(uint256 index, uint256 offset, uint256 length) external view returns (bytes32[] memory); + + function lookupRadonReducer(bytes32 hash) external view returns (Witnet.RadonReducer memory); + + function lookupRadonRetrieval(bytes32 hash) external view returns (Witnet.RadonRetrieval memory); + function lookupRadonRetrievalArgsCount(bytes32 hash) external view returns (uint8); + function lookupRadonRetrievalResultDataType(bytes32 hash) external view returns (Witnet.RadonDataTypes); + + function lookupRadonRequestAggregator(bytes32 radHash) external view returns (Witnet.RadonReducer memory); + function lookupRadonRequestResultMaxSize(bytes32 radHash) external view returns (uint16); + function lookupRadonRequestResultDataType(bytes32 radHash) external view returns (Witnet.RadonDataTypes); + function lookupRadonRequestSources(bytes32 radHash) external view returns (bytes32[] memory); + function lookupRadonRequestSourcesCount(bytes32 radHash) external view returns (uint); + function lookupRadonRequestTally(bytes32 radHash) external view returns (Witnet.RadonReducer memory); + + function verifyRadonRetrieval( + Witnet.RadonDataRequestMethods requestMethod, + string calldata requestURL, + string calldata requestBody, + string[2][] calldata requestHeaders, + bytes calldata requestRadonScript + ) external returns (bytes32 hash); + + function verifyRadonReducer(Witnet.RadonReducer calldata reducer) + external returns (bytes32 hash); + + function verifyRadonRequest( + bytes32[] calldata sources, + bytes32 aggregator, + bytes32 tally, + uint16 resultMaxSize, + string[][] calldata args + ) external returns (bytes32 radHash); + + function totalDataProviders() external view returns (uint); +} diff --git a/contracts/interfaces/V2/IWitnetRequestFactory.sol b/contracts/interfaces/IWitnetRequestFactory.sol similarity index 71% rename from contracts/interfaces/V2/IWitnetRequestFactory.sol rename to contracts/interfaces/IWitnetRequestFactory.sol index d706ae9a7..6a48ff8e1 100644 --- a/contracts/interfaces/V2/IWitnetRequestFactory.sol +++ b/contracts/interfaces/IWitnetRequestFactory.sol @@ -2,16 +2,15 @@ pragma solidity >=0.7.0 <0.9.0; -import "../../WitnetBytecodes.sol"; - interface IWitnetRequestFactory { + event WitnetRequestTemplateBuilt(address template, bool parameterized); + function buildRequestTemplate( bytes32[] memory sourcesIds, bytes32 aggregatorId, bytes32 tallyId, uint16 resultDataMaxSize ) external returns (address template); - function class() external view returns (bytes4); - function registry() external view returns (WitnetBytecodes); + } \ No newline at end of file diff --git a/contracts/interfaces/IWitnetRequestParser.sol b/contracts/interfaces/IWitnetRequestParser.sol deleted file mode 100644 index bedf56cfc..000000000 --- a/contracts/interfaces/IWitnetRequestParser.sol +++ /dev/null @@ -1,99 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity >=0.7.0 <0.9.0; -pragma experimental ABIEncoderV2; - -import "../libs/Witnet.sol"; - -/// @title The Witnet interface for decoding Witnet-provided request to Data Requests. -/// This interface exposes functions to check for the success/failure of -/// a Witnet-provided result, as well as to parse and convert result into -/// Solidity types suitable to the application level. -/// @author The Witnet Foundation. -interface IWitnetRequestParser { - - /// Decode raw CBOR bytes into a Witnet.Result instance. - /// @param _cborBytes Raw bytes representing a CBOR-encoded value. - /// @return A `Witnet.Result` instance. - function resultFromCborBytes(bytes memory _cborBytes) external pure returns (Witnet.Result memory); - - /// Tell if a Witnet.Result is successful. - /// @param _result An instance of Witnet.Result. - /// @return `true` if successful, `false` if errored. - function isOk(Witnet.Result memory _result) external pure returns (bool); - - /// Tell if a Witnet.Result is errored. - /// @param _result An instance of Witnet.Result. - /// @return `true` if errored, `false` if successful. - function isError(Witnet.Result memory _result) external pure returns (bool); - - /// Decode a boolean value from a Witnet.Result as an `bool` value. - /// @param _result An instance of Witnet.Result. - /// @return The `bool` decoded from the Witnet.Result. - function asBool(Witnet.Result memory _result) external pure returns (bool); - - /// Decode a bytes value from a Witnet.Result as a `bytes` value. - /// @param _result An instance of Witnet.Result. - /// @return The `bytes` decoded from the Witnet.Result. - function asBytes(Witnet.Result memory _result) external pure returns (bytes memory); - - /// Decode a bytes value from a Witnet.Result as a `bytes32` value. - /// @param _result An instance of Witnet.Result. - /// @return The `bytes32` decoded from the Witnet.Result. - function asBytes32(Witnet.Result memory _result) external pure returns (bytes32); - - /// Decode an error code from a Witnet.Result as a member of `Witnet.ResultErrorCodes`. - /// @param _result An instance of `Witnet.Result`. - /// @return The `CBORValue.Error memory` decoded from the Witnet.Result. - function asErrorCode(Witnet.Result memory _result) external pure returns (Witnet.ResultErrorCodes); - - /// Generate a suitable error message for a member of `Witnet.ResultErrorCodes` and its corresponding arguments. - /// @dev WARN: Note that client contracts should wrap this function into a try-catch foreseing potential errors generated in this function - /// @param _result An instance of `Witnet.Result`. - /// @return A tuple containing the `CBORValue.Error memory` decoded from the `Witnet.Result`, plus a loggable error message. - function asErrorMessage(Witnet.Result memory _result) external pure returns (Witnet.ResultErrorCodes, string memory); - - /// Decode a fixed16 (half-precision) numeric value from a Witnet.Result as an `int32` value. - /// @dev Due to the lack of support for floating or fixed point arithmetic in the EVM, this method offsets all values. - /// by 5 decimal orders so as to get a fixed precision of 5 decimal positions, which should be OK for most `fixed16`. - /// use cases. In other words, the output of this method is 10,000 times the actual value, encoded into an `int32`. - /// @param _result An instance of Witnet.Result. - /// @return The `int32` decoded from the Witnet.Result. - function asFixed16(Witnet.Result memory _result) external pure returns (int32); - - /// Decode an array of fixed16 values from a Witnet.Result as an `int32[]` value. - /// @param _result An instance of Witnet.Result. - /// @return The `int32[]` decoded from the Witnet.Result. - function asFixed16Array(Witnet.Result memory _result) external pure returns (int32[] memory); - - /// Decode a integer numeric value from a Witnet.Result as an `int128` value. - /// @param _result An instance of Witnet.Result. - /// @return The `int` decoded from the Witnet.Result. - function asInt128(Witnet.Result memory _result) external pure returns (int); - - /// Decode an array of integer numeric values from a Witnet.Result as an `int128[]` value. - /// @param _result An instance of Witnet.Result. - /// @return The `int128[]` decoded from the Witnet.Result. - function asInt128Array(Witnet.Result memory _result) external pure returns (int[] memory); - - /// Decode a string value from a Witnet.Result as a `string` value. - /// @param _result An instance of Witnet.Result. - /// @return The `string` decoded from the Witnet.Result. - function asString(Witnet.Result memory _result) external pure returns (string memory); - - /// Decode an array of string values from a Witnet.Result as a `string[]` value. - /// @param _result An instance of Witnet.Result. - /// @return The `string[]` decoded from the Witnet.Result. - function asStringArray(Witnet.Result memory _result) external pure returns (string[] memory); - - /// Decode a natural numeric value from a Witnet.Result as a `uint` value. - /// @param _result An instance of Witnet.Result. - /// @return The `uint` decoded from the Witnet.Result. - function asUint64(Witnet.Result memory _result) external pure returns (uint); - - /// Decode an array of natural numeric values from a Witnet.Result as a `uint[]` value. - /// @param _result An instance of Witnet.Result. - /// @return The `uint[]` decoded from the Witnet.Result. - function asUint64Array(Witnet.Result memory _result) external pure returns (uint[] memory); - -} diff --git a/contracts/interfaces/V2/IWitnetBytecodes.sol b/contracts/interfaces/V2/IWitnetBytecodes.sol deleted file mode 100644 index 10d7f2c8c..000000000 --- a/contracts/interfaces/V2/IWitnetBytecodes.sol +++ /dev/null @@ -1,81 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity >=0.8.0 <0.9.0; - -import "../../libs/WitnetV2.sol"; - -interface IWitnetBytecodes { - - function bytecodeOf(bytes32 radHash) external view returns (bytes memory); - function bytecodeOf(bytes32 radHash, bytes32 slahHash) external view returns (bytes memory); - - function hashOf( - bytes32[] calldata sources, - bytes32 aggregator, - bytes32 tally, - uint16 resultMaxSize, - string[][] calldata args - ) external pure returns (bytes32); - function hashOf(bytes32 radHash, bytes32 slaHash) external pure returns (bytes32 drQueryHash); - function hashWeightWitsOf(bytes32 radHash, bytes32 slaHash) external view returns ( - bytes32 drQueryHash, - uint32 drQueryWeight, - uint256 drQueryWits - ); - - function lookupDataProvider(uint256 index) external view returns (string memory, uint); - function lookupDataProviderIndex(string calldata authority) external view returns (uint); - function lookupDataProviderSources(uint256 index, uint256 offset, uint256 length) external view returns (bytes32[] memory); - - function lookupRadonReducer(bytes32 hash) external view returns (WitnetV2.RadonReducer memory); - - function lookupRadonRetrieval(bytes32 hash) external view returns (WitnetV2.RadonRetrieval memory); - function lookupRadonRetrievalArgsCount(bytes32 hash) external view returns (uint8); - function lookupRadonRetrievalResultDataType(bytes32 hash) external view returns (WitnetV2.RadonDataTypes); - - function lookupRadonRequestAggregator(bytes32 radHash) external view returns (WitnetV2.RadonReducer memory); - function lookupRadonRequestResultMaxSize(bytes32 radHash) external view returns (uint256); - function lookupRadonRequestResultDataType(bytes32 radHash) external view returns (WitnetV2.RadonDataTypes); - function lookupRadonRequestSources(bytes32 radHash) external view returns (bytes32[] memory); - function lookupRadonRequestSourcesCount(bytes32 radHash) external view returns (uint); - function lookupRadonRequestTally(bytes32 radHash) external view returns (WitnetV2.RadonReducer memory); - - function lookupRadonSLA(bytes32 slaHash) external view returns (WitnetV2.RadonSLA memory); - function lookupRadonSLAReward(bytes32 slaHash) external view returns (uint); - - function verifyRadonRetrieval( - WitnetV2.DataRequestMethods requestMethod, - string calldata requestSchema, - string calldata requestAuthority, - string calldata requestPath, - string calldata requestQuery, - string calldata requestBody, - string[2][] calldata requestHeaders, - bytes calldata requestRadonScript - ) external returns (bytes32 hash); - - function verifyRadonRetrieval( - WitnetV2.DataRequestMethods requestMethod, - string calldata requestURL, - string calldata requestBody, - string[2][] calldata requestHeaders, - bytes calldata requestRadonScript - ) external returns (bytes32 hash); - - function verifyRadonReducer(WitnetV2.RadonReducer calldata reducer) - external returns (bytes32 hash); - - function verifyRadonRequest( - bytes32[] calldata sources, - bytes32 aggregator, - bytes32 tally, - uint16 resultMaxSize, - string[][] calldata args - ) external returns (bytes32 radHash); - - function verifyRadonSLA(WitnetV2.RadonSLA calldata sla) - external returns (bytes32 slaHash); - - function totalDataProviders() external view returns (uint); - -} \ No newline at end of file diff --git a/contracts/interfaces/V2/IWitnetBytecodesErrors.sol b/contracts/interfaces/V2/IWitnetBytecodesErrors.sol deleted file mode 100644 index 84d72e671..000000000 --- a/contracts/interfaces/V2/IWitnetBytecodesErrors.sol +++ /dev/null @@ -1,10 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity >=0.8.0 <0.9.0; - -interface IWitnetBytecodesErrors { - error UnknownRadonRetrieval(bytes32 hash); - error UnknownRadonReducer(bytes32 hash); - error UnknownRadonRequest(bytes32 hash); - error UnknownRadonSLA(bytes32 hash); -} \ No newline at end of file diff --git a/contracts/interfaces/V2/IWitnetBytecodesEvents.sol b/contracts/interfaces/V2/IWitnetBytecodesEvents.sol deleted file mode 100644 index 35924f6d8..000000000 --- a/contracts/interfaces/V2/IWitnetBytecodesEvents.sol +++ /dev/null @@ -1,11 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity >=0.8.0 <0.9.0; - -interface IWitnetBytecodesEvents { - event NewDataProvider(uint256 index); - event NewRadonRetrievalHash(bytes32 hash); - event NewRadonReducerHash(bytes32 hash); - event NewRadHash(bytes32 hash); - event NewSlaHash(bytes32 hash); -} \ No newline at end of file diff --git a/contracts/interfaces/V2/IWitnetFeeds.sol b/contracts/interfaces/V2/IWitnetFeeds.sol deleted file mode 100644 index 56dfa705c..000000000 --- a/contracts/interfaces/V2/IWitnetFeeds.sol +++ /dev/null @@ -1,33 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity >=0.8.0 <0.9.0; - -import "../../WitnetRequestBoard.sol"; - -interface IWitnetFeeds { - function dataType() external view returns (WitnetV2.RadonDataTypes); - function prefix() external view returns (string memory); - function registry() external view returns (WitnetBytecodes); - function witnet() external view returns (WitnetRequestBoard); - - function defaultRadonSLA() external view returns (WitnetV2.RadonSLA memory); - - function estimateUpdateBaseFee(bytes4 feedId, uint256 evmGasPrice, uint256 witEvmPrice) external view returns (uint); - function estimateUpdateBaseFee(bytes4 feedId, uint256 evmGasPrice, uint256 witEvmPrice, bytes32 slaHash) external view returns (uint); - - function latestResponse(bytes4 feedId) external view returns (Witnet.Response memory); - function latestResult(bytes4 feedId) external view returns (Witnet.Result memory); - - function latestUpdateQueryId(bytes4 feedId) external view returns (uint256); - function latestUpdateRequest(bytes4 feedId) external view returns (Witnet.Request memory); - function latestUpdateResponse(bytes4 feedId) external view returns (Witnet.Response memory); - function latestUpdateResultError(bytes4 feedId) external view returns (Witnet.ResultError memory); - function latestUpdateResultStatus(bytes4 feedId) external view returns (Witnet.ResultStatus); - - function lookupBytecode(bytes4 feedId) external view returns (bytes memory); - function lookupRadHash(bytes4 feedId) external view returns (bytes32); - function lookupRetrievals(bytes4 feedId) external view returns (WitnetV2.RadonRetrieval[] memory); - - function requestUpdate(bytes4 feedId) external payable returns (uint256 usedFunds); - function requestUpdate(bytes4 feedId, bytes32 slaHash) external payable returns (uint256 usedFunds); -} \ No newline at end of file diff --git a/contracts/interfaces/V2/IWitnetFeedsEvents.sol b/contracts/interfaces/V2/IWitnetFeedsEvents.sol deleted file mode 100644 index f619e98ca..000000000 --- a/contracts/interfaces/V2/IWitnetFeedsEvents.sol +++ /dev/null @@ -1,12 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity >=0.8.0 <0.9.0; - -interface IWitnetFeedsEvents { - event DeletedFeed(address indexed from, bytes4 indexed feedId, string caption); - event SettledFeed(address indexed from, bytes4 indexed feedId, string caption, bytes32 radHash); - event SettledFeedSolver(address indexed from, bytes4 indexed feedId, string caption, address solver); - event SettledRadonSLA(address indexed from, bytes32 slaHash); - event UpdatingFeed(address indexed from, bytes4 indexed feedId, bytes32 slaHash, uint256 value); - event UpdatingFeedReward(address indexed from, bytes4 indexed feedId, uint256 value); -} \ No newline at end of file diff --git a/contracts/libs/Create3.sol b/contracts/libs/Create3.sol new file mode 100644 index 000000000..103f02026 --- /dev/null +++ b/contracts/libs/Create3.sol @@ -0,0 +1,113 @@ +// SPDX-License-Identifier: AGPL-3.0-only + +pragma solidity ^0.8.0; + +/// @notice Deploy to deterministic addresses without an initcode factor. +/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/CREATE3.sol) +/// @author 0xSequence (https://github.com/0xSequence/create3/blob/master/contracts/Create3.sol) + +library Create3 { + + //--------------------------------------------------------------------------------// + // Opcode | Opcode + Arguments | Description | Stack View // + //--------------------------------------------------------------------------------// + // 0x36 | 0x36 | CALLDATASIZE | size // + // 0x3d | 0x3d | RETURNDATASIZE | 0 size // + // 0x3d | 0x3d | RETURNDATASIZE | 0 0 size // + // 0x37 | 0x37 | CALLDATACOPY | // + // 0x36 | 0x36 | CALLDATASIZE | size // + // 0x3d | 0x3d | RETURNDATASIZE | 0 size // + // 0x34 | 0x34 | CALLVALUE | value 0 size // + // 0xf0 | 0xf0 | CREATE | newContract // + //--------------------------------------------------------------------------------// + // Opcode | Opcode + Arguments | Description | Stack View // + //--------------------------------------------------------------------------------// + // 0x67 | 0x67XXXXXXXXXXXXXXXX | PUSH8 bytecode | bytecode // + // 0x3d | 0x3d | RETURNDATASIZE | 0 bytecode // + // 0x52 | 0x52 | MSTORE | // + // 0x60 | 0x6008 | PUSH1 08 | 8 // + // 0x60 | 0x6018 | PUSH1 18 | 24 8 // + // 0xf3 | 0xf3 | RETURN | // + //--------------------------------------------------------------------------------// + + bytes internal constant CREATE3_FACTORY_BYTECODE = hex"67_36_3d_3d_37_36_3d_34_f0_3d_52_60_08_60_18_f3"; + bytes32 internal constant CREATE3_FACTORY_CODEHASH = keccak256(CREATE3_FACTORY_BYTECODE); + + /// @notice Creates a new contract with given `_creationCode` and `_salt` + /// @param _salt Salt of the contract creation, resulting address will be derivated from this value only + /// @param _creationCode Creation code (constructor) of the contract to be deployed, this value doesn't affect the resulting address + /// @return addr of the deployed contract, reverts on error + function deploy(bytes32 _salt, bytes memory _creationCode) + internal + returns (address) + { + return deploy(_salt, _creationCode, 0); + } + + /// @notice Creates a new contract with given `_creationCode`, `_salt` and `_value`. + /// @param _salt Salt of the contract creation, resulting address will be derivated from this value only + /// @param _creationCode Creation code (constructor) of the contract to be deployed, this value doesn't affect the resulting address + /// @param _value In WEI of ETH to be forwarded to child contract + /// @return _deployed The address of the deployed contract. + function deploy(bytes32 _salt, bytes memory _creationCode, uint256 _value) + internal + returns (address _deployed) + { + // Get target final address + _deployed = determineAddr(_salt); + if (_deployed.code.length != 0) revert("Create3: target already exists"); + + // Create factory + address _factory; + bytes memory _factoryBytecode = CREATE3_FACTORY_BYTECODE; + /// @solidity memory-safe-assembly + assembly { + // Deploy a factory contract with our pre-made bytecode via CREATE2. + // We start 32 bytes into the code to avoid copying the byte length. + _factory := create2(0, add(_factoryBytecode, 32), mload(_factoryBytecode), _salt) + } + require(_factory != address(0), "Create3: error creating factory"); + + // Use factory to deploy target + (bool _success, ) = _factory.call{value: _value}(_creationCode); + require(_success && _deployed.code.length != 0, "Create3: error creating target"); + } + + /// @notice Computes the resulting address of a contract deployed using address(this) and the given `_salt` + /// @param _salt Salt of the contract creation, resulting address will be derivated from this value only + /// @return addr of the deployed contract, reverts on error + /// @dev The address creation formula is: keccak256(rlp([keccak256(0xff ++ address(this) ++ _salt ++ keccak256(childBytecode))[12:], 0x01])) + function determineAddr(bytes32 _salt) internal view returns (address) { + address _factory = address( + uint160( + uint256( + keccak256( + abi.encodePacked( + hex'ff', + address(this), + _salt, + CREATE3_FACTORY_CODEHASH + ) + ) + ) + ) + ); + return address( + uint160( + uint256( + keccak256( + abi.encodePacked( + // 0xd6 = 0xc0 (short RLP prefix) + 0x16 (length of: 0x94 ++ _factory ++ 0x01) + // 0x94 = 0x80 + 0x14 (0x14 = the length of an address, 20 bytes, in hex) + hex"d6_94", + _factory, + // _factory's nonce on which the target is created: 0x1 + hex"01" + ) + ) + ) + ) + ); + } + +} \ No newline at end of file diff --git a/contracts/libs/Witnet.sol b/contracts/libs/Witnet.sol index 07e50c786..dbdb5b15a 100644 --- a/contracts/libs/Witnet.sol +++ b/contracts/libs/Witnet.sol @@ -3,7 +3,6 @@ pragma solidity >=0.7.0 <0.9.0; pragma experimental ABIEncoderV2; -import "../interfaces/IWitnetRequest.sol"; import "./WitnetCBOR.sol"; library Witnet { @@ -29,14 +28,14 @@ library Witnet { /// Data kept in EVM-storage for every Request posted to the Witnet Request Board. struct Request { - address addr; // Address of the IWitnetRequest contract containing Witnet data request raw bytecode. + address addr; // Address of the (deprecated) IWitnetRequest contract containing Witnet data request raw bytecode. bytes32 slaHash; // Radon SLA hash of the Witnet data request. bytes32 radHash; // Radon radHash of the Witnet data request. uint256 gasprice; // Minimum gas price the DR resolver should pay on the solving tx. uint256 reward; // Escrowed reward to be paid to the DR resolver. } - /// Data kept in EVM-storage containing Witnet-provided response metadata and result. + /// Data kept in EVM-storage containing the Witnet-provided response metadata and CBOR-encoded result. struct Response { address reporter; // Address from which the result was reported. uint256 timestamp; // Timestamp of the Witnet-provided result. @@ -67,125 +66,528 @@ library Witnet { enum ResultErrorCodes { /// 0x00: Unknown error. Something went really bad! Unknown, + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /// Script format errors ============================================================================================= - /// 0x01: At least one of the source scripts is not a valid CBOR-encoded value. - SourceScriptNotCBOR, - /// 0x02: The CBOR value decoded from a source script is not an Array. - SourceScriptNotArray, - /// 0x03: The Array value decoded form a source script is not a valid Data Request. - SourceScriptNotRADON, - /// Unallocated - ScriptFormat0x04, ScriptFormat0x05, ScriptFormat0x06, ScriptFormat0x07, ScriptFormat0x08, ScriptFormat0x09, - ScriptFormat0x0A, ScriptFormat0x0B, ScriptFormat0x0C, ScriptFormat0x0D, ScriptFormat0x0E, ScriptFormat0x0F, + /// Source-specific format error sub-codes ============================================================================ + /// 0x01: At least one of the source scripts is not a valid CBOR-encoded value. + SourceScriptNotCBOR, + /// 0x02: The CBOR value decoded from a source script is not an Array. + SourceScriptNotArray, + /// 0x03: The Array value decoded form a source script is not a valid Data Request. + SourceScriptNotRADON, + /// 0x04: The request body of at least one data source was not properly formated. + SourceRequestBody, + /// 0x05: The request headers of at least one data source was not properly formated. + SourceRequestHeaders, + /// 0x06: The request URL of at least one data source was not properly formated. + SourceRequestURL, + /// Unallocated + SourceFormat0x07, SourceFormat0x08, SourceFormat0x09, SourceFormat0x0A, SourceFormat0x0B, SourceFormat0x0C, + SourceFormat0x0D, SourceFormat0x0E, SourceFormat0x0F, + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /// Complexity errors ================================================================================================ - /// 0x10: The request contains too many sources. - RequestTooManySources, - /// 0x11: The script contains too many calls. - ScriptTooManyCalls, - /// Unallocated - Complexity0x12, Complexity0x13, Complexity0x14, Complexity0x15, Complexity0x16, Complexity0x17, Complexity0x18, - Complexity0x19, Complexity0x1A, Complexity0x1B, Complexity0x1C, Complexity0x1D, Complexity0x1E, Complexity0x1F, + /// Complexity error sub-codes ======================================================================================== + /// 0x10: The request contains too many sources. + RequestTooManySources, + /// 0x11: The script contains too many calls. + ScriptTooManyCalls, + /// Unallocated + Complexity0x12, Complexity0x13, Complexity0x14, Complexity0x15, Complexity0x16, Complexity0x17, Complexity0x18, + Complexity0x19, Complexity0x1A, Complexity0x1B, Complexity0x1C, Complexity0x1D, Complexity0x1E, Complexity0x1F, + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + /// Lack of support error sub-codes =================================================================================== + /// 0x20: Some Radon operator code was found that is not supported (1+ args). + UnsupportedOperator, + /// 0x21: Some Radon filter opcode is not currently supported (1+ args). + UnsupportedFilter, + /// 0x22: Some Radon request type is not currently supported (1+ args). + UnsupportedHashFunction, + /// 0x23: Some Radon reducer opcode is not currently supported (1+ args) + UnsupportedReducer, + /// 0x24: Some Radon hash function is not currently supported (1+ args). + UnsupportedRequestType, + /// 0x25: Some Radon encoding function is not currently supported (1+ args). + UnsupportedEncodingFunction, + /// Unallocated + Operator0x26, Operator0x27, + /// 0x28: Wrong number (or type) of arguments were passed to some Radon operator. + WrongArguments, + /// Unallocated + Operator0x29, Operator0x2A, Operator0x2B, Operator0x2C, Operator0x2D, Operator0x2E, Operator0x2F, + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + /// Retrieve-specific circumstantial error sub-codes ================================================================================ + /// 0x30: A majority of data sources returned an HTTP status code other than 200 (1+ args): + HttpErrors, + /// 0x31: A majority of data sources timed out: + RetrievalsTimeout, + /// Unallocated + RetrieveCircumstance0x32, RetrieveCircumstance0x33, RetrieveCircumstance0x34, RetrieveCircumstance0x35, + RetrieveCircumstance0x36, RetrieveCircumstance0x37, RetrieveCircumstance0x38, RetrieveCircumstance0x39, + RetrieveCircumstance0x3A, RetrieveCircumstance0x3B, RetrieveCircumstance0x3C, RetrieveCircumstance0x3D, + RetrieveCircumstance0x3E, RetrieveCircumstance0x3F, + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /// Operator errors =================================================================================================== - /// 0x20: The operator does not exist. - UnsupportedOperator, - /// Unallocated - Operator0x21, Operator0x22, Operator0x23, Operator0x24, Operator0x25, Operator0x26, Operator0x27, Operator0x28, - Operator0x29, Operator0x2A, Operator0x2B, Operator0x2C, Operator0x2D, Operator0x2E, Operator0x2F, + /// Scripting-specific runtime error sub-code ========================================================================= + /// 0x40: Math operator caused an underflow. + MathUnderflow, + /// 0x41: Math operator caused an overflow. + MathOverflow, + /// 0x42: Math operator tried to divide by zero. + MathDivisionByZero, + /// 0x43:Wrong input to subscript call. + WrongSubscriptInput, + /// 0x44: Value cannot be extracted from input binary buffer. + BufferIsNotValue, + /// 0x45: Value cannot be decoded from expected type. + Decode, + /// 0x46: Unexpected empty array. + EmptyArray, + /// 0x47: Value cannot be encoded to expected type. + Encode, + /// 0x48: Failed to filter input values (1+ args). + Filter, + /// 0x49: Failed to hash input value. + Hash, + /// 0x4A: Mismatching array ranks. + MismatchingArrays, + /// 0x4B: Failed to process non-homogenous array. + NonHomegeneousArray, + /// 0x4C: Failed to parse syntax of some input value, or argument. + Parse, + /// 0x4E: Parsing logic limits were exceeded. + ParseOverflow, + /// 0x4F: Unallocated + ScriptError0x4F, + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /// Retrieval-specific errors ========================================================================================= - /// 0x30: At least one of the sources could not be retrieved, but returned HTTP error. - HTTP, - /// 0x31: Retrieval of at least one of the sources timed out. - RetrievalTimeout, - /// Unallocated - Retrieval0x32, Retrieval0x33, Retrieval0x34, Retrieval0x35, Retrieval0x36, Retrieval0x37, Retrieval0x38, - Retrieval0x39, Retrieval0x3A, Retrieval0x3B, Retrieval0x3C, Retrieval0x3D, Retrieval0x3E, Retrieval0x3F, + /// Actual first-order result error codes ============================================================================= + /// 0x50: Not enough reveal quorum was reached on tally stage: + InsufficientQuorum, + /// 0x51: No actual reveal majority was reached on tally stage: + InsufficientMajority, + /// 0x52: Not enough commits were received before tally stage: + InsufficientCommits, + /// 0x53: Generic error during tally execution (to be deprecated after WIP #0028) + TallyExecution, + /// 0x54: A majority of data sources could either be temporarily unresponsive or failing to report the requested data: + CircumstantialFailure, + /// 0x55: At least one data source is inconsistent when queried through multiple transports at once: + InconsistentSources, + /// 0x56: Any one of the (multiple) Retrieve, Aggregate or Tally scripts were badly formated: + MalformedDataRequest, + /// 0x57: Values returned from a majority of data sources don't match the expected schema: + MalformedResponses, + /// Unallocated: + OtherError0x58, OtherError0x59, OtherError0x5A, OtherError0x5B, OtherError0x5C, OtherError0x5D, OtherError0x5E, + /// 0x5F: Size of serialized tally result exceeds allowance: + OversizedTallyResult, + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /// Math errors ======================================================================================================= - /// 0x40: Math operator caused an underflow. - Underflow, - /// 0x41: Math operator caused an overflow. - Overflow, - /// 0x42: Tried to divide by zero. - DivisionByZero, - /// Unallocated - Math0x43, Math0x44, Math0x45, Math0x46, Math0x47, Math0x48, Math0x49, - Math0x4A, Math0x4B, Math0x4C, Math0x4D, Math0x4E, Math0x4F, + /// Inter-stage runtime error sub-codes =============================================================================== + /// 0x60: Data aggregation reveals could not get decoded on the tally stage: + MalformedReveals, + /// 0x61: The result to data aggregation could not get encoded: + EncodeReveals, + /// 0x62: A mode tie ocurred when calculating some mode value on the aggregation or the tally stage: + ModeTie, + /// Unallocated: + OtherError0x63, OtherError0x64, OtherError0x65, OtherError0x66, OtherError0x67, OtherError0x68, OtherError0x69, + OtherError0x6A, OtherError0x6B, OtherError0x6C, OtherError0x6D, OtherError0x6E, OtherError0x6F, + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /// Other errors ====================================================================================================== - /// 0x50: Received zero reveals - NoReveals, - /// 0x51: Insufficient consensus in tally precondition clause - InsufficientConsensus, - /// 0x52: Received zero commits - InsufficientCommits, - /// 0x53: Generic error during tally execution - TallyExecution, - /// Unallocated - OtherError0x54, OtherError0x55, OtherError0x56, OtherError0x57, OtherError0x58, OtherError0x59, - OtherError0x5A, OtherError0x5B, OtherError0x5C, OtherError0x5D, OtherError0x5E, OtherError0x5F, - /// 0x60: Invalid reveal serialization (malformed reveals are converted to this value) - MalformedReveal, - /// Unallocated - OtherError0x61, OtherError0x62, OtherError0x63, OtherError0x64, OtherError0x65, OtherError0x66, - OtherError0x67, OtherError0x68, OtherError0x69, OtherError0x6A, OtherError0x6B, OtherError0x6C, - OtherError0x6D, OtherError0x6E,OtherError0x6F, + /// Runtime access error sub-codes ==================================================================================== + /// 0x70: Tried to access a value from an array using an index that is out of bounds (1+ args): + ArrayIndexOutOfBounds, + /// 0x71: Tried to access a value from a map using a key that does not exist (1+ args): + MapKeyNotFound, + /// 0X72: Tried to extract value from a map using a JSON Path that returns no values (+1 args): + JsonPathNotFound, + /// Unallocated: + OtherError0x73, OtherError0x74, OtherError0x75, OtherError0x76, OtherError0x77, OtherError0x78, + OtherError0x79, OtherError0x7A, OtherError0x7B, OtherError0x7C, OtherError0x7D, OtherError0x7E, OtherError0x7F, + OtherError0x80, OtherError0x81, OtherError0x82, OtherError0x83, OtherError0x84, OtherError0x85, OtherError0x86, + OtherError0x87, OtherError0x88, OtherError0x89, OtherError0x8A, OtherError0x8B, OtherError0x8C, OtherError0x8D, + OtherError0x8E, OtherError0x8F, OtherError0x90, OtherError0x91, OtherError0x92, OtherError0x93, OtherError0x94, + OtherError0x95, OtherError0x96, OtherError0x97, OtherError0x98, OtherError0x99, OtherError0x9A, OtherError0x9B, + OtherError0x9C, OtherError0x9D, OtherError0x9E, OtherError0x9F, OtherError0xA0, OtherError0xA1, OtherError0xA2, + OtherError0xA3, OtherError0xA4, OtherError0xA5, OtherError0xA6, OtherError0xA7, OtherError0xA8, OtherError0xA9, + OtherError0xAA, OtherError0xAB, OtherError0xAC, OtherError0xAD, OtherError0xAE, OtherError0xAF, OtherError0xB0, + OtherError0xB1, OtherError0xB2, OtherError0xB3, OtherError0xB4, OtherError0xB5, OtherError0xB6, OtherError0xB7, + OtherError0xB8, OtherError0xB9, OtherError0xBA, OtherError0xBB, OtherError0xBC, OtherError0xBD, OtherError0xBE, + OtherError0xBF, OtherError0xC0, OtherError0xC1, OtherError0xC2, OtherError0xC3, OtherError0xC4, OtherError0xC5, + OtherError0xC6, OtherError0xC7, OtherError0xC8, OtherError0xC9, OtherError0xCA, OtherError0xCB, OtherError0xCC, + OtherError0xCD, OtherError0xCE, OtherError0xCF, OtherError0xD0, OtherError0xD1, OtherError0xD2, OtherError0xD3, + OtherError0xD4, OtherError0xD5, OtherError0xD6, OtherError0xD7, OtherError0xD8, OtherError0xD9, OtherError0xDA, + OtherError0xDB, OtherError0xDC, OtherError0xDD, OtherError0xDE, OtherError0xDF, + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /// Access errors ===================================================================================================== - /// 0x70: Tried to access a value from an array using an index that is out of bounds - ArrayIndexOutOfBounds, - /// 0x71: Tried to access a value from a map using a key that does not exist - MapKeyNotFound, - /// Unallocated - OtherError0x72, OtherError0x73, OtherError0x74, OtherError0x75, OtherError0x76, OtherError0x77, OtherError0x78, - OtherError0x79, OtherError0x7A, OtherError0x7B, OtherError0x7C, OtherError0x7D, OtherError0x7E, OtherError0x7F, - OtherError0x80, OtherError0x81, OtherError0x82, OtherError0x83, OtherError0x84, OtherError0x85, OtherError0x86, - OtherError0x87, OtherError0x88, OtherError0x89, OtherError0x8A, OtherError0x8B, OtherError0x8C, OtherError0x8D, - OtherError0x8E, OtherError0x8F, OtherError0x90, OtherError0x91, OtherError0x92, OtherError0x93, OtherError0x94, - OtherError0x95, OtherError0x96, OtherError0x97, OtherError0x98, OtherError0x99, OtherError0x9A, OtherError0x9B, - OtherError0x9C, OtherError0x9D, OtherError0x9E, OtherError0x9F, OtherError0xA0, OtherError0xA1, OtherError0xA2, - OtherError0xA3, OtherError0xA4, OtherError0xA5, OtherError0xA6, OtherError0xA7, OtherError0xA8, OtherError0xA9, - OtherError0xAA, OtherError0xAB, OtherError0xAC, OtherError0xAD, OtherError0xAE, OtherError0xAF, OtherError0xB0, - OtherError0xB1, OtherError0xB2, OtherError0xB3, OtherError0xB4, OtherError0xB5, OtherError0xB6, OtherError0xB7, - OtherError0xB8, OtherError0xB9, OtherError0xBA, OtherError0xBB, OtherError0xBC, OtherError0xBD, OtherError0xBE, - OtherError0xBF, OtherError0xC0, OtherError0xC1, OtherError0xC2, OtherError0xC3, OtherError0xC4, OtherError0xC5, - OtherError0xC6, OtherError0xC7, OtherError0xC8, OtherError0xC9, OtherError0xCA, OtherError0xCB, OtherError0xCC, - OtherError0xCD, OtherError0xCE, OtherError0xCF, OtherError0xD0, OtherError0xD1, OtherError0xD2, OtherError0xD3, - OtherError0xD4, OtherError0xD5, OtherError0xD6, OtherError0xD7, OtherError0xD8, OtherError0xD9, OtherError0xDA, - OtherError0xDB, OtherError0xDC, OtherError0xDD, OtherError0xDE, OtherError0xDF, + /// Inter-client generic error codes ================================================================================== + /// Data requests that cannot be relayed into the Witnet blockchain should be reported + /// with one of these errors. + /// 0xE0: Requests that cannot be parsed must always get this error as their result. + BridgeMalformedDataRequest, + /// 0xE1: Witnesses exceeds 100 + BridgePoorIncentives, + /// 0xE2: The request is rejected on the grounds that it may cause the submitter to spend or stake an + /// amount of value that is unjustifiably high when compared with the reward they will be getting + BridgeOversizedTallyResult, + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /// Bridge errors: errors that only belong in inter-client communication ============================================== - /// 0xE0: Requests that cannot be parsed must always get this error as their result. - /// However, this is not a valid result in a Tally transaction, because invalid requests - /// are never included into blocks and therefore never get a Tally in response. - BridgeMalformedRequest, - /// 0xE1: Witnesses exceeds 100 - BridgePoorIncentives, - /// 0xE2: The request is rejected on the grounds that it may cause the submitter to spend or stake an - /// amount of value that is unjustifiably high when compared with the reward they will be getting - BridgeOversizedResult, - /// Unallocated - OtherError0xE3, OtherError0xE4, OtherError0xE5, OtherError0xE6, OtherError0xE7, OtherError0xE8, OtherError0xE9, - OtherError0xEA, OtherError0xEB, OtherError0xEC, OtherError0xED, OtherError0xEE, OtherError0xEF, OtherError0xF0, - OtherError0xF1, OtherError0xF2, OtherError0xF3, OtherError0xF4, OtherError0xF5, OtherError0xF6, OtherError0xF7, - OtherError0xF8, OtherError0xF9, OtherError0xFA, OtherError0xFB, OtherError0xFC, OtherError0xFD, OtherError0xFE, + /// Unallocated ======================================================================================================= + OtherError0xE3, OtherError0xE4, OtherError0xE5, OtherError0xE6, OtherError0xE7, OtherError0xE8, OtherError0xE9, + OtherError0xEA, OtherError0xEB, OtherError0xEC, OtherError0xED, OtherError0xEE, OtherError0xEF, OtherError0xF0, + OtherError0xF1, OtherError0xF2, OtherError0xF3, OtherError0xF4, OtherError0xF5, OtherError0xF6, OtherError0xF7, + OtherError0xF8, OtherError0xF9, OtherError0xFA, OtherError0xFB, OtherError0xFC, OtherError0xFD, OtherError0xFE, + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /// 0xFF: Some tally error is not intercepted but should + /// 0xFF: Some tally error is not intercepted but it should (0+ args) UnhandledIntercept } + function isCircumstantial(ResultErrorCodes self) internal pure returns (bool) { + return (self == ResultErrorCodes.CircumstantialFailure); + } + + function lackOfConsensus(ResultErrorCodes self) internal pure returns (bool) { + return ( + self == ResultErrorCodes.InsufficientCommits + || self == ResultErrorCodes.InsufficientMajority + || self == ResultErrorCodes.InsufficientQuorum + ); + } + + function isRetriable(ResultErrorCodes self) internal pure returns (bool) { + return ( + lackOfConsensus(self) + || isCircumstantial(self) + || poorIncentives(self) + ); + } + + function poorIncentives(ResultErrorCodes self) internal pure returns (bool) { + return ( + self == ResultErrorCodes.OversizedTallyResult + || self == ResultErrorCodes.InsufficientCommits + || self == ResultErrorCodes.BridgePoorIncentives + || self == ResultErrorCodes.BridgeOversizedTallyResult + ); + } + + + /// Possible Radon data request methods that can be used within a Radon Retrieval. + enum RadonDataRequestMethods { + /* 0 */ Unknown, + /* 1 */ HttpGet, + /* 2 */ Rng, + /* 3 */ HttpPost, + /* 4 */ HttpHead + } + + /// Possible types either processed by Witnet Radon Scripts or included within results to Witnet Data Requests. + enum RadonDataTypes { + /* 0x00 */ Any, + /* 0x01 */ Array, + /* 0x02 */ Bool, + /* 0x03 */ Bytes, + /* 0x04 */ Integer, + /* 0x05 */ Float, + /* 0x06 */ Map, + /* 0x07 */ String, + Unused0x08, Unused0x09, Unused0x0A, Unused0x0B, + Unused0x0C, Unused0x0D, Unused0x0E, Unused0x0F, + /* 0x10 */ Same, + /* 0x11 */ Inner, + /* 0x12 */ Match, + /* 0x13 */ Subscript + } + + /// Structure defining some data filtering that can be applied at the Aggregation or the Tally stages + /// within a Witnet Data Request resolution workflow. + struct RadonFilter { + RadonFilterOpcodes opcode; + bytes args; + } + + /// Filtering methods currently supported on the Witnet blockchain. + enum RadonFilterOpcodes { + /* 0x00 */ Reserved0x00, //GreaterThan, + /* 0x01 */ Reserved0x01, //LessThan, + /* 0x02 */ Reserved0x02, //Equals, + /* 0x03 */ Reserved0x03, //AbsoluteDeviation, + /* 0x04 */ Reserved0x04, //RelativeDeviation + /* 0x05 */ StandardDeviation, + /* 0x06 */ Reserved0x06, //Top, + /* 0x07 */ Reserved0x07, //Bottom, + /* 0x08 */ Mode, + /* 0x09 */ Reserved0x09 //LessOrEqualThan + } + + /// Structure defining the array of filters and reducting function to be applied at either the Aggregation + /// or the Tally stages within a Witnet Data Request resolution workflow. + struct RadonReducer { + RadonReducerOpcodes opcode; + RadonFilter[] filters; + } + + /// Reducting functions currently supported on the Witnet blockchain. + enum RadonReducerOpcodes { + /* 0x00 */ Reserved0x00, //Minimum, + /* 0x01 */ Reserved0x01, //Maximum, + /* 0x02 */ Mode, + /* 0x03 */ AverageMean, + /* 0x04 */ Reserved0x04, //AverageMeanWeighted, + /* 0x05 */ AverageMedian, + /* 0x06 */ Reserved0x06, //AverageMedianWeighted, + /* 0x07 */ StandardDeviation, + /* 0x08 */ Reserved0x08, //AverageDeviation, + /* 0x09 */ Reserved0x09, //MedianDeviation, + /* 0x0A */ Reserved0x10, //MaximumDeviation, + /* 0x0B */ ConcatenateAndHash + } + + /// Structure containing all the parameters that fully describe a Witnet Radon Retrieval within a Witnet Data Request. + struct RadonRetrieval { + uint8 argsCount; + RadonDataRequestMethods method; + RadonDataTypes resultDataType; + string url; + string body; + string[2][] headers; + bytes script; + } + + /// Structure containing the Retrieve-Attestation-Delivery parts of a Witnet Data Request. + struct RadonRAD { + RadonRetrieval[] retrieve; + RadonReducer aggregate; + RadonReducer tally; + } + + /// Structure containing the Service Level Aggreement parameters of a Witnet Data Request. + struct RadonSLA { + uint8 numWitnesses; + uint8 minConsensusPercentage; + uint64 witnessReward; + uint64 witnessCollateral; + uint64 minerCommitRevealFee; + } + /// =============================================================================================================== - /// --- 'Witnet.Result' helper methods ---------------------------------------------------------------------------- + /// --- 'uint*' helper methods ------------------------------------------------------------------------------------ - modifier _isError(Result memory result) { - require(!result.success, "Witnet: no actual errors"); - _; + /// @notice Convert a `uint8` into a 2 characters long `string` representing its two less significant hexadecimal values. + function toHexString(uint8 _u) + internal pure + returns (string memory) + { + bytes memory b2 = new bytes(2); + uint8 d0 = uint8(_u / 16) + 48; + uint8 d1 = uint8(_u % 16) + 48; + if (d0 > 57) + d0 += 7; + if (d1 > 57) + d1 += 7; + b2[0] = bytes1(d0); + b2[1] = bytes1(d1); + return string(b2); + } + + /// @notice Convert a `uint8` into a 1, 2 or 3 characters long `string` representing its. + /// three less significant decimal values. + function toString(uint8 _u) + internal pure + returns (string memory) + { + if (_u < 10) { + bytes memory b1 = new bytes(1); + b1[0] = bytes1(uint8(_u) + 48); + return string(b1); + } else if (_u < 100) { + bytes memory b2 = new bytes(2); + b2[0] = bytes1(uint8(_u / 10) + 48); + b2[1] = bytes1(uint8(_u % 10) + 48); + return string(b2); + } else { + bytes memory b3 = new bytes(3); + b3[0] = bytes1(uint8(_u / 100) + 48); + b3[1] = bytes1(uint8(_u % 100 / 10) + 48); + b3[2] = bytes1(uint8(_u % 10) + 48); + return string(b3); + } + } + + /// @notice Convert a `uint` into a string` representing its value. + function toString(uint v) + internal pure + returns (string memory) + { + uint maxlength = 100; + bytes memory reversed = new bytes(maxlength); + uint i = 0; + do { + uint8 remainder = uint8(v % 10); + v = v / 10; + reversed[i ++] = bytes1(48 + remainder); + } while (v != 0); + bytes memory buf = new bytes(i); + for (uint j = 1; j <= i; j ++) { + buf[j - 1] = reversed[i - j]; + } + return string(buf); + } + + + /// =============================================================================================================== + /// --- 'bytes' helper methods ------------------------------------------------------------------------------------ + + /// @dev Transform given bytes into a Witnet.Result instance. + /// @param cborBytes Raw bytes representing a CBOR-encoded value. + /// @return A `Witnet.Result` instance. + function toWitnetResult(bytes memory cborBytes) + internal pure + returns (Witnet.Result memory) + { + WitnetCBOR.CBOR memory cborValue = WitnetCBOR.fromBytes(cborBytes); + return _resultFromCborValue(cborValue); + } + + function toAddress(bytes memory _value) internal pure returns (address) { + return address(toBytes20(_value)); + } + + function toBytes4(bytes memory _value) internal pure returns (bytes4) { + return bytes4(toFixedBytes(_value, 4)); + } + + function toBytes20(bytes memory _value) internal pure returns (bytes20) { + return bytes20(toFixedBytes(_value, 20)); + } + + function toBytes32(bytes memory _value) internal pure returns (bytes32) { + return toFixedBytes(_value, 32); + } + + function toFixedBytes(bytes memory _value, uint8 _numBytes) + internal pure + returns (bytes32 _bytes32) + { + assert(_numBytes <= 32); + unchecked { + uint _len = _value.length > _numBytes ? _numBytes : _value.length; + for (uint _i = 0; _i < _len; _i ++) { + _bytes32 |= bytes32(_value[_i] & 0xff) >> (_i * 8); + } + } } + + /// =============================================================================================================== + /// --- 'string' helper methods ----------------------------------------------------------------------------------- + + function toLowerCase(string memory str) + internal pure + returns (string memory) + { + bytes memory lowered = new bytes(bytes(str).length); + unchecked { + for (uint i = 0; i < lowered.length; i ++) { + uint8 char = uint8(bytes(str)[i]); + if (char >= 65 && char <= 90) { + lowered[i] = bytes1(char + 32); + } else { + lowered[i] = bytes1(char); + } + } + } + return string(lowered); + } + + /// @notice Converts bytes32 into string. + function toString(bytes32 _bytes32) + internal pure + returns (string memory) + { + bytes memory _bytes = new bytes(_toStringLength(_bytes32)); + for (uint _i = 0; _i < _bytes.length;) { + _bytes[_i] = _bytes32[_i]; + unchecked { + _i ++; + } + } + return string(_bytes); + } + + function tryUint(string memory str) + internal pure + returns (uint res, bool) + { + unchecked { + for (uint256 i = 0; i < bytes(str).length; i++) { + if ( + (uint8(bytes(str)[i]) - 48) < 0 + || (uint8(bytes(str)[i]) - 48) > 9 + ) { + return (0, false); + } + res += (uint8(bytes(str)[i]) - 48) * 10 ** (bytes(str).length - i - 1); + } + return (res, true); + } + } + + + // /// =============================================================================================================== + // /// --- 'Witnet.Request' helper methods --------------------------------------------------------------------------- + + // function packRequesterCallbackGasLimit(address requester, uint96 callbackGasLimit) internal pure returns (bytes32) { + // return bytes32(uint(bytes32(bytes20(requester))) | callbackGasLimit); + // } + + // function unpackRequester(Request storage self) internal view returns (address) { + // return address(bytes20(self.fromCallbackGas)); + // } + + // function unpackCallbackGasLimit(Request storage self) internal view returns (uint96) { + // return uint96(uint(self.fromCallbackGas)); + // } + + // function unpackRequesterAndCallbackGasLimit(Request storage self) internal view returns (address, uint96) { + // bytes32 _packed = self.fromCallbackGas; + // return (address(bytes20(_packed)), uint96(uint(_packed))); + // } + + + // /// =============================================================================================================== + // /// --- 'Witnet.Response' helper methods -------------------------------------------------------------------------- + + // function packReporterEvmFinalityBlock(address reporter, uint256 evmFinalityBlock) internal pure returns (bytes32) { + // return bytes32(uint(bytes32(bytes20(reporter))) << 96 | uint96(evmFinalityBlock)); + // } + + // function unpackWitnetReporter(Response storage self) internal view returns (address) { + // return address(bytes20(self.fromFinality)); + // } + + // function unpackEvmFinalityBlock(Response storage self) internal view returns (uint256) { + // return uint(uint96(uint(self.fromFinality))); + // } + + // function unpackEvmFinalityBlock(bytes32 fromFinality) internal pure returns (uint256) { + // return uint(uint96(uint(fromFinality))); + // } + + // function unpackWitnetReporterAndEvmFinalityBlock(Response storage self) internal view returns (address, uint256) { + // bytes32 _packed = self.fromFinality; + // return (address(bytes20(_packed)), uint(uint96(uint(_packed)))); + // } + + + /// =============================================================================================================== + /// --- 'Witnet.Result' helper methods ---------------------------------------------------------------------------- + modifier _isReady(Result memory result) { require(result.success, "Witnet: tried to decode value from errored result."); _; @@ -344,168 +746,60 @@ library Witnet { } - /// =============================================================================================================== - /// --- 'bytes' helper methods ------------------------------------------------------------------------------------ - - /// @dev Transform given bytes into a Witnet.Result instance. - /// @param bytecode Raw bytes representing a CBOR-encoded value. - /// @return A `Witnet.Result` instance. - function resultFromCborBytes(bytes memory bytecode) - internal pure - returns (Witnet.Result memory) - { - WitnetCBOR.CBOR memory cborValue = WitnetCBOR.fromBytes(bytecode); - return _resultFromCborValue(cborValue); - } - - function toAddress(bytes memory _value) internal pure returns (address) { - return address(toBytes20(_value)); - } - - function toBytes4(bytes memory _value) internal pure returns (bytes4) { - return bytes4(toFixedBytes(_value, 4)); - } - - function toBytes20(bytes memory _value) internal pure returns (bytes20) { - return bytes20(toFixedBytes(_value, 20)); - } - - function toBytes32(bytes memory _value) internal pure returns (bytes32) { - return toFixedBytes(_value, 32); - } - - function toFixedBytes(bytes memory _value, uint8 _numBytes) - internal pure - returns (bytes32 _bytes32) - { - assert(_numBytes <= 32); - unchecked { - uint _len = _value.length > _numBytes ? _numBytes : _value.length; - for (uint _i = 0; _i < _len; _i ++) { - _bytes32 |= bytes32(_value[_i] & 0xff) >> (_i * 8); - } - } - } - - - /// =============================================================================================================== - /// --- 'string' helper methods ----------------------------------------------------------------------------------- - - function toLowerCase(string memory str) - internal pure - returns (string memory) - { - bytes memory lowered = new bytes(bytes(str).length); - unchecked { - for (uint i = 0; i < lowered.length; i ++) { - uint8 char = uint8(bytes(str)[i]); - if (char >= 65 && char <= 90) { - lowered[i] = bytes1(char + 32); - } else { - lowered[i] = bytes1(char); - } - } - } - return string(lowered); - } - - /// @notice Converts bytes32 into string. - function toString(bytes32 _bytes32) - internal pure - returns (string memory) - { - bytes memory _bytes = new bytes(_toStringLength(_bytes32)); - for (uint _i = 0; _i < _bytes.length;) { - _bytes[_i] = _bytes32[_i]; - unchecked { - _i ++; - } - } - return string(_bytes); - } - - function tryUint(string memory str) - internal pure - returns (uint res, bool) - { - unchecked { - for (uint256 i = 0; i < bytes(str).length; i++) { - if ( - (uint8(bytes(str)[i]) - 48) < 0 - || (uint8(bytes(str)[i]) - 48) > 9 - ) { - return (0, false); - } - res += (uint8(bytes(str)[i]) - 48) * 10 ** (bytes(str).length - i - 1); - } - return (res, true); - } - } - - - /// =============================================================================================================== - /// --- 'uint8' helper methods ------------------------------------------------------------------------------------ - - /// @notice Convert a `uint8` into a 2 characters long `string` representing its two less significant hexadecimal values. - function toHexString(uint8 _u) - internal pure - returns (string memory) - { - bytes memory b2 = new bytes(2); - uint8 d0 = uint8(_u / 16) + 48; - uint8 d1 = uint8(_u % 16) + 48; - if (d0 > 57) - d0 += 7; - if (d1 > 57) - d1 += 7; - b2[0] = bytes1(d0); - b2[1] = bytes1(d1); - return string(b2); - } - - /// @notice Convert a `uint8` into a 1, 2 or 3 characters long `string` representing its. - /// three less significant decimal values. - function toString(uint8 _u) - internal pure - returns (string memory) - { - if (_u < 10) { - bytes memory b1 = new bytes(1); - b1[0] = bytes1(uint8(_u) + 48); - return string(b1); - } else if (_u < 100) { - bytes memory b2 = new bytes(2); - b2[0] = bytes1(uint8(_u / 10) + 48); - b2[1] = bytes1(uint8(_u % 10) + 48); - return string(b2); - } else { - bytes memory b3 = new bytes(3); - b3[0] = bytes1(uint8(_u / 100) + 48); - b3[1] = bytes1(uint8(_u % 100 / 10) + 48); - b3[2] = bytes1(uint8(_u % 10) + 48); - return string(b3); - } - } - - /// @notice Convert a `uint` into a string` representing its value. - function toString(uint v) - internal pure - returns (string memory) - { - uint maxlength = 100; - bytes memory reversed = new bytes(maxlength); - uint i = 0; - do { - uint8 remainder = uint8(v % 10); - v = v / 10; - reversed[i ++] = bytes1(48 + remainder); - } while (v != 0); - bytes memory buf = new bytes(i); - for (uint j = 1; j <= i; j ++) { - buf[j - 1] = reversed[i - j]; - } - return string(buf); - } + // /// =============================================================================================================== + // /// --- 'Witnet.RadonSLA' helper methods -------------------------------------------------------------------------- + + // /// @notice Returns `true` if all witnessing parameters in `b` have same + // /// @notice value or greater than the ones in `a`. + // function equalOrGreaterThan(RadonSLA memory a, RadonSLA memory b) + // internal pure returns (bool) + // { + // return ( + // a.numWitnesses >= b.numWitnesses + // && a.minConsensusPercentage >= b.minConsensusPercentage + // && a.witnessReward >= b.witnessReward + // && a.witnessCollateral >= b.witnessCollateral + // && a.minerCommitRevealFee >= b.minerCommitRevealFee + // ); + // } + + // function isValid(Witnet.RadonSLA memory sla) + // internal pure returns (bool) + // { + // return ( + // sla.witnessReward > 0 + // && sla.numWitnesses > 0 && sla.numWitnesses <= 127 + // && sla.minConsensusPercentage > 50 && sla.minConsensusPercentage < 100 + // && sla.witnessCollateral > 0 + // && sla.witnessCollateral / sla.witnessReward <= 127 + // ); + // } + + // function toBytes32(RadonSLA memory sla) internal pure returns (bytes32) { + // return bytes32( + // uint(sla.witnessReward) + // | sla.witnessCollateral << 64 + // | sla.minerCommitRevealFee << 128 + // | sla.numWitnesses << 248 + // | sla.minConsensusPercentage << 232 + // ); + // } + + // function toRadonSLA(bytes32 _packed) internal pure returns (RadonSLA memory) { + // return RadonSLA({ + // numWitnesses: uint8(uint(_packed >> 248)), + // minConsensusPercentage: uint8(uint(_packed >> 232) & 0xff), + // witnessReward: uint64(uint(_packed) & 0xffffffffffffffff), + // witnessCollateral: uint64(uint(_packed >> 64) & 0xffffffffffffffff), + // minerCommitRevealFee: uint64(uint(_packed >> 128) & 0xffffffffffffffff) + // }); + // } + + // function witnessingFee(Witnet.RadonSLA memory sla) + // internal pure returns (uint64) + // { + // return sla.witnessReward * sla.numWitnesses; + // } /// =============================================================================================================== diff --git a/contracts/libs/WitnetEncodingLib.sol b/contracts/libs/WitnetEncodingLib.sol index 15618f9f3..36065dc3b 100644 --- a/contracts/libs/WitnetEncodingLib.sol +++ b/contracts/libs/WitnetEncodingLib.sol @@ -2,7 +2,7 @@ pragma solidity >=0.8.0 <0.9.0; -import "./WitnetV2.sol"; +import "./Witnet.sol"; /// @title A library for encoding Witnet Data Requests. /// @author The Witnet Foundation. @@ -13,25 +13,35 @@ library WitnetEncodingLib { using WitnetCBOR for WitnetCBOR.CBOR[]; bytes internal constant WITNET_RADON_OPCODES_RESULT_TYPES = - hex"10ffffffffffffffffffffffffffffff0401ff010203050406071311ff01ffff07ff02ffffffffffffffffffffffffff0703ffffffffffffffffffffffffffff0405070202ff04040404ffffffffffff05070402040205050505ff04ff04ffffff010203050406070101ffffffffffff02ff050404000106060707ffffffffff"; + hex"10ffffffffffffffffffffffffffffff040100010203050406071311ff0101ff07ff02ffffffffffffffffffffffffff070304ff04ffffffffffffff03ffffff0405070202ff0404040403ffffffffff05070402040205050505ff04ff04ffff07010203050406070101ff06ffff06ff0203050404000106060707070701ffff"; // 10ffffffffffffffffffffffffffffff - // 0401ff000203050406070100ff01ffff + // 040100001203050406070100ff0101ff // 07ff02ffffffffffffffffffffffffff - // 0703ffffffffffffffffffffffffffff - // 0405070202ff04040404ffffffffffff + // 070304ff04ffffffffffffff03ffffff + // 0405070202ff0404040403ffffffffff // 05070402040205050505ff04ff04ffff - // ff010203050406070101ffffffffffff - // 02ff050404000106060707ffffffffff + // 07010203050406070101ff06ffff06ff + // 0203050404000106060707070701ffff + + error UnsupportedDataRequestMethod(uint8 method, string schema, string body, string[2][] headers); + error UnsupportedRadonDataType(uint8 datatype, uint256 maxlength); + error UnsupportedRadonFilterOpcode(uint8 opcode); + error UnsupportedRadonFilterArgs(uint8 opcode, bytes args); + error UnsupportedRadonReducerOpcode(uint8 opcode); + error UnsupportedRadonReducerScript(uint8 opcode, bytes script, uint256 offset); + error UnsupportedRadonScript(bytes script, uint256 offset); + error UnsupportedRadonScriptOpcode(bytes script, uint256 cursor, uint8 opcode); + error UnsupportedRadonTallyScript(bytes32 hash); /// =============================================================================================================== - /// --- WitnetLib internal methods -------------------------------------------------------------------------------- + /// --- WitnetEncodingLib internal methods -------------------------------------------------------------------------------- - function size(WitnetV2.RadonDataTypes _type) internal pure returns (uint16) { - if (_type == WitnetV2.RadonDataTypes.Integer - || _type == WitnetV2.RadonDataTypes.Float + function size(Witnet.RadonDataTypes _type) internal pure returns (uint16) { + if (_type == Witnet.RadonDataTypes.Integer + || _type == Witnet.RadonDataTypes.Float ) { return 9; - } else if (_type == WitnetV2.RadonDataTypes.Bool) { + } else if (_type == Witnet.RadonDataTypes.Bool) { return 1; } else { // undetermined @@ -41,7 +51,7 @@ library WitnetEncodingLib { /// =============================================================================================================== - /// --- WitnetLib public methods (if used library will have to linked to calling contracts) ----------------------- + /// --- WitnetEncodingLib public methods (if used library will have to linked to calling contracts) ----------------------- /// @notice Encode bytes array into given major type (UTF-8 not yet supported) /// @param buf Bytes array @@ -131,7 +141,7 @@ library WitnetEncodingLib { } } - function encode(WitnetV2.RadonRetrieval memory source) + function encode(Witnet.RadonRetrieval memory source) public pure returns (bytes memory) { @@ -191,7 +201,7 @@ library WitnetEncodingLib { } function encode( - WitnetV2.RadonRetrieval[] memory sources, + Witnet.RadonRetrieval[] memory sources, string[][] memory args, bytes memory aggregatorInnerBytecode, bytes memory tallyInnerBytecode, @@ -218,11 +228,11 @@ library WitnetEncodingLib { ); } - function encode(WitnetV2.RadonReducer memory reducer) + function encode(Witnet.RadonReducer memory reducer) public pure returns (bytes memory bytecode) { - if (reducer.script.length == 0) { + // if (reducer.script.length == 0) { for (uint ix = 0; ix < reducer.filters.length; ix ++) { bytecode = abi.encodePacked( bytecode, @@ -233,15 +243,15 @@ library WitnetEncodingLib { bytecode, encode(reducer.opcode) ); - } else { - return abi.encodePacked( - encode(uint64(reducer.script.length), bytes1(0x18)), - reducer.script - ); - } + // } else { + // return abi.encodePacked( + // encode(uint64(reducer.script.length), bytes1(0x18)), + // reducer.script + // ); + // } } - function encode(WitnetV2.RadonFilter memory filter) + function encode(Witnet.RadonFilter memory filter) public pure returns (bytes memory bytecode) { @@ -259,7 +269,7 @@ library WitnetEncodingLib { ); } - function encode(WitnetV2.RadonReducerOpcodes opcode) + function encode(Witnet.RadonReducerOpcodes opcode) public pure returns (bytes memory) { @@ -267,7 +277,7 @@ library WitnetEncodingLib { return encode(uint64(opcode), bytes1(0x10)); } - function encode(WitnetV2.RadonSLA memory sla) + function encode(Witnet.RadonSLA memory sla) public pure returns (bytes memory) { @@ -299,7 +309,7 @@ library WitnetEncodingLib { return cbor.buffer.data; } - function replaceWildcards(WitnetV2.RadonRetrieval memory self, string[] memory args) + function replaceWildcards(Witnet.RadonRetrieval memory self, string[] memory args) public pure { self.url = WitnetBuffer.replace(self.url, args); @@ -311,7 +321,7 @@ library WitnetEncodingLib { } function validate( - WitnetV2.DataRequestMethods method, + Witnet.RadonDataRequestMethods method, string memory url, string memory body, string[2][] memory headers, @@ -323,16 +333,16 @@ library WitnetEncodingLib { if (!( bytes(url).length > 0 && ( - method == WitnetV2.DataRequestMethods.HttpGet - || method == WitnetV2.DataRequestMethods.HttpPost - || method == WitnetV2.DataRequestMethods.HttpHead + method == Witnet.RadonDataRequestMethods.HttpGet + || method == Witnet.RadonDataRequestMethods.HttpPost + || method == Witnet.RadonDataRequestMethods.HttpHead ) - || method == WitnetV2.DataRequestMethods.Rng + || method == Witnet.RadonDataRequestMethods.Rng && bytes(url).length == 0 && headers.length == 0 && script.length >= 1 )) { - revert WitnetV2.UnsupportedDataRequestMethod( + revert UnsupportedDataRequestMethod( uint8(method), url, body, @@ -340,170 +350,121 @@ library WitnetEncodingLib { ); } return keccak256(abi.encode(method, url, body, headers, script)); - } - - function validate( - WitnetV2.DataRequestMethods method, - string memory schema, - string memory authority, - string memory path, - string memory query, - string memory body, - string[2][] memory headers, - bytes memory script - ) - public pure - returns (bytes32) - { - if (!( - (method == WitnetV2.DataRequestMethods.HttpGet - || method == WitnetV2.DataRequestMethods.HttpPost - || method == WitnetV2.DataRequestMethods.HttpHead - ) - && bytes(authority).length > 0 - && ( - bytes(schema).length == 0 - || keccak256(bytes(schema)) == keccak256(bytes("https://")) - || keccak256(bytes(schema)) == keccak256(bytes("http://")) - ) - || method == WitnetV2.DataRequestMethods.Rng - && bytes(schema).length == 0 - && bytes(authority).length == 0 - && bytes(path).length == 0 - && bytes(query).length == 0 - && bytes(body).length == 0 - && headers.length == 0 - && script.length >= 1 - )) { - revert WitnetV2.UnsupportedDataRequestMethod( - uint8(method), - schema, - body, - headers - ); - } - return keccak256(abi.encode( - method, - schema, - authority, - path, - query, - body, - headers, - script - )); } function validate( - WitnetV2.RadonDataTypes dataType, + Witnet.RadonDataTypes dataType, uint16 maxDataSize ) public pure returns (uint16) { if ( - dataType == WitnetV2.RadonDataTypes.Any - || dataType == WitnetV2.RadonDataTypes.String - || dataType == WitnetV2.RadonDataTypes.Bytes - || dataType == WitnetV2.RadonDataTypes.Array - || dataType == WitnetV2.RadonDataTypes.Map + dataType == Witnet.RadonDataTypes.Any + || dataType == Witnet.RadonDataTypes.String + || dataType == Witnet.RadonDataTypes.Bytes + || dataType == Witnet.RadonDataTypes.Array + || dataType == Witnet.RadonDataTypes.Map ) { - if (/*maxDataSize == 0 ||*/maxDataSize > 2048) { - revert WitnetV2.UnsupportedRadonDataType( + if (maxDataSize == 0) { + revert UnsupportedRadonDataType( uint8(dataType), maxDataSize ); } - return maxDataSize; + return maxDataSize + 3; // TODO: determine CBOR-encoding length overhead } else if ( - dataType == WitnetV2.RadonDataTypes.Integer - || dataType == WitnetV2.RadonDataTypes.Float - || dataType == WitnetV2.RadonDataTypes.Bool + dataType == Witnet.RadonDataTypes.Integer + || dataType == Witnet.RadonDataTypes.Float + || dataType == Witnet.RadonDataTypes.Bool ) { - return 0; // TBD: size(dataType); + return 9; } else { - revert WitnetV2.UnsupportedRadonDataType( + revert UnsupportedRadonDataType( uint8(dataType), size(dataType) ); } } - function validate(WitnetV2.RadonFilter memory filter) + function validate(Witnet.RadonFilter memory filter) public pure { if ( - filter.opcode == WitnetV2.RadonFilterOpcodes.StandardDeviation + filter.opcode == Witnet.RadonFilterOpcodes.StandardDeviation ) { // check filters that require arguments if (filter.args.length == 0) { - revert WitnetV2.RadonFilterMissingArgs(uint8(filter.opcode)); + revert UnsupportedRadonFilterArgs(uint8(filter.opcode), filter.args); } } else if ( - filter.opcode == WitnetV2.RadonFilterOpcodes.Mode + filter.opcode == Witnet.RadonFilterOpcodes.Mode ) { // check filters that don't require any arguments if (filter.args.length > 0) { - revert WitnetV2.UnsupportedRadonFilterArgs(uint8(filter.opcode), filter.args); + revert UnsupportedRadonFilterArgs(uint8(filter.opcode), filter.args); } } else { // reject unsupported opcodes - revert WitnetV2.UnsupportedRadonFilterOpcode(uint8(filter.opcode)); + revert UnsupportedRadonFilterOpcode(uint8(filter.opcode)); } } - function validate(WitnetV2.RadonReducer memory reducer) + function validate(Witnet.RadonReducer memory reducer) public pure { - if (reducer.script.length == 0) { + // if (reducer.script.length == 0) { if (!( - reducer.opcode == WitnetV2.RadonReducerOpcodes.AverageMean - || reducer.opcode == WitnetV2.RadonReducerOpcodes.StandardDeviation - || reducer.opcode == WitnetV2.RadonReducerOpcodes.Mode - || reducer.opcode == WitnetV2.RadonReducerOpcodes.ConcatenateAndHash - || reducer.opcode == WitnetV2.RadonReducerOpcodes.AverageMedian + reducer.opcode == Witnet.RadonReducerOpcodes.AverageMean + || reducer.opcode == Witnet.RadonReducerOpcodes.StandardDeviation + || reducer.opcode == Witnet.RadonReducerOpcodes.Mode + || reducer.opcode == Witnet.RadonReducerOpcodes.ConcatenateAndHash + || reducer.opcode == Witnet.RadonReducerOpcodes.AverageMedian )) { - revert WitnetV2.UnsupportedRadonReducerOpcode(uint8(reducer.opcode)); + revert UnsupportedRadonReducerOpcode(uint8(reducer.opcode)); } for (uint ix = 0; ix < reducer.filters.length; ix ++) { validate(reducer.filters[ix]); } - } else { - if (uint8(reducer.opcode) != 0xff || reducer.filters.length > 0) { - revert WitnetV2.UnsupportedRadonReducerScript( - uint8(reducer.opcode), - reducer.script, - 0 - ); - } - } + // } else { + // if (uint8(reducer.opcode) != 0xff || reducer.filters.length > 0) { + // revert UnsupportedRadonReducerScript( + // uint8(reducer.opcode), + // reducer.script, + // 0 + // ); + // } + // } } - function validate(WitnetV2.RadonSLA memory sla) + function validate(Witnet.RadonSLA memory sla) public pure { if (sla.witnessReward == 0) { - revert WitnetV2.RadonSlaNoReward(); + revert("WitnetEncodingLib: invalid SLA: no reward"); } if (sla.numWitnesses == 0) { - revert WitnetV2.RadonSlaNoWitnesses(); + revert("WitnetEncodingLib: invalid SLA: no witnesses"); } else if (sla.numWitnesses > 127) { - revert WitnetV2.RadonSlaTooManyWitnesses(sla.numWitnesses); + revert("WitnetEncodingLib: invalid SLA: too many witnesses (>127)"); } if ( sla.minConsensusPercentage < 51 || sla.minConsensusPercentage > 99 ) { - revert WitnetV2.RadonSlaConsensusOutOfRange(sla.minConsensusPercentage); + revert("WitnetEncodingLib: invalid SLA: consensus percentage out of range"); + } + if (sla.witnessCollateral > 0) { + revert("WitnetEncodingLib: invalid SLA: no collateral"); } - if (sla.witnessCollateral < 10 ** 9) { - revert WitnetV2.RadonSlaLowCollateral(sla.witnessCollateral); + if (sla.witnessCollateral / sla.witnessReward > 127) { + revert("WitnetEncodingLib: invalid SLA: collateral/reward ratio too high (>127)"); } } function verifyRadonScriptResultDataType(bytes memory script) public pure - returns (WitnetV2.RadonDataTypes) + returns (Witnet.RadonDataTypes) { return _verifyRadonScriptResultDataType( WitnetCBOR.fromBytes(script), @@ -513,7 +474,7 @@ library WitnetEncodingLib { /// =============================================================================================================== - /// --- WitnetLib private methods --------------------------------------------------------------------------------- + /// --- WitnetEncodingLib private methods --------------------------------------------------------------------------------- function _replaceCborWildcards( WitnetCBOR.CBOR memory self, @@ -538,7 +499,7 @@ library WitnetEncodingLib { function _verifyRadonScriptResultDataType(WitnetCBOR.CBOR memory self, bool flip) private pure - returns (WitnetV2.RadonDataTypes) + returns (Witnet.RadonDataTypes) { if (self.majorType == WitnetCBOR.MAJOR_TYPE_ARRAY) { WitnetCBOR.CBOR[] memory items = self.readArray(); @@ -548,7 +509,7 @@ library WitnetEncodingLib { : _verifyRadonScriptResultDataType(items[items.length - 2], true) ; } else { - return WitnetV2.RadonDataTypes.Any; + return Witnet.RadonDataTypes.Any; } } else if (self.majorType == WitnetCBOR.MAJOR_TYPE_INT) { uint cursor = self.buffer.cursor; @@ -557,14 +518,14 @@ library WitnetEncodingLib { ? 0xff : uint8(WITNET_RADON_OPCODES_RESULT_TYPES[opcode]) ); - if (dataType > uint8(type(WitnetV2.RadonDataTypes).max)) { - revert WitnetV2.UnsupportedRadonScriptOpcode( + if (dataType > uint8(type(Witnet.RadonDataTypes).max)) { + revert UnsupportedRadonScriptOpcode( self.buffer.data, cursor, uint8(opcode) ); } - return WitnetV2.RadonDataTypes(dataType); + return Witnet.RadonDataTypes(dataType); } else { revert WitnetCBOR.UnexpectedMajorType( WitnetCBOR.MAJOR_TYPE_INT, diff --git a/contracts/libs/WitnetErrorsLib.sol b/contracts/libs/WitnetErrorsLib.sol index 54c017569..8f2eaddc3 100644 --- a/contracts/libs/WitnetErrorsLib.sol +++ b/contracts/libs/WitnetErrorsLib.sol @@ -3,16 +3,19 @@ pragma solidity >=0.7.0 <0.9.0; pragma experimental ABIEncoderV2; -import "./Witnet.sol"; +import "./WitnetV2.sol"; /// @title A library for interpreting Witnet resolution errors /// @author The Witnet Foundation. library WitnetErrorsLib { + using Witnet for bytes; using Witnet for uint8; using Witnet for uint256; + using Witnet for Witnet.ResultErrorCodes; using WitnetCBOR for WitnetCBOR.CBOR; + // ================================================================================================================ // --- Library public methods ------------------------------------------------------------------------------------- @@ -28,6 +31,52 @@ library WitnetErrorsLib { ); } + function asResultError(WitnetV2.ResponseStatus _status, bytes memory _cborBytes) + public pure + returns (Witnet.ResultError memory) + { + if ( + _status == WitnetV2.ResponseStatus.Error + || _status == WitnetV2.ResponseStatus.Ready + ) { + return resultErrorFromCborBytes(_cborBytes); + } else if ( + _status == WitnetV2.ResponseStatus.AwaitingError + || _status == WitnetV2.ResponseStatus.AwaitingReady + ) { + return Witnet.ResultError({ + code: Witnet.ResultErrorCodes.Unknown, + reason: "WitnetErrorsLib: not yet finalized" + }); + } if (_status == WitnetV2.ResponseStatus.Awaiting) { + return Witnet.ResultError({ + code: Witnet.ResultErrorCodes.Unknown, + reason: "WitnetErrorsLib: not yet solved" + }); + } else { + return Witnet.ResultError({ + code: Witnet.ResultErrorCodes.Unknown, + reason: "WitnetErrorsLib: unknown query" + }); + } + } + + function resultErrorCodesFromCborBytes(bytes memory cborBytes) + public pure + returns ( + Witnet.ResultErrorCodes _code, + Witnet.ResultErrorCodes _subcode + ) + { + WitnetCBOR.CBOR[] memory _errors = _errorsFromResult(cborBytes.toWitnetResult()); + if (_errors.length > 1) { + _code = Witnet.ResultErrorCodes(_errors[0].readUint()); + if (_errors.length > 2) { + _subcode = Witnet.ResultErrorCodes(_errors[1].readUint()); + } + } + } + /// @notice Extract error code and description string from given CBOR-encoded value. /// @dev Client contracts should wrap this function into a try-catch foreseeing potential parsing errors. /// @return _error Witnet.ResultError data struct containing error code and description. @@ -50,8 +99,7 @@ library WitnetErrorsLib { private pure returns(WitnetCBOR.CBOR[] memory) { - Witnet.Result memory result = Witnet.resultFromCborBytes(cborBytes); - return _errorsFromResult(result); + return _errorsFromResult(cborBytes.toWitnetResult()); } /// @dev Extract error codes from a Witnet.Result value. @@ -73,177 +121,154 @@ library WitnetErrorsLib { if (errors.length < 2) { return Witnet.ResultError({ code: Witnet.ResultErrorCodes.Unknown, - reason: "Unknown error: no error code was found." + reason: "Critical: no error code was found." }); - } - else { + } else { _error.code = Witnet.ResultErrorCodes(errors[0].readUint()); } - // switch on _error.code - if ( - _error.code == Witnet.ResultErrorCodes.SourceScriptNotCBOR - && errors.length > 1 - ) { - _error.reason = string(abi.encodePacked( - "Witnet: Radon: invalid CBOR value." - )); - } else if ( - _error.code == Witnet.ResultErrorCodes.SourceScriptNotArray - && errors.length > 1 - ) { - _error.reason = string(abi.encodePacked( - "Witnet: Radon: CBOR value expected to be an array of calls." - )); - } else if ( - _error.code == Witnet.ResultErrorCodes.SourceScriptNotRADON - && errors.length > 1 - ) { - _error.reason = string(abi.encodePacked( - "Witnet: Radon: CBOR value expected to be a data request." - )); - } else if ( - _error.code == Witnet.ResultErrorCodes.RequestTooManySources - && errors.length > 1 - ) { - _error.reason = string(abi.encodePacked( - "Witnet: Radon: too many sources." - )); - } else if ( - _error.code == Witnet.ResultErrorCodes.ScriptTooManyCalls - && errors.length > 1 - ) { - _error.reason = string(abi.encodePacked( - "Witnet: Radon: too many calls." - )); - } else if ( - _error.code == Witnet.ResultErrorCodes.UnsupportedOperator - && errors.length > 3 - ) { - _error.reason = string(abi.encodePacked( - "Witnet: Radon: unsupported '", - errors[2].readString(), - "' for input type '", - errors[1].readString(), - "'." - )); - } else if ( - _error.code == Witnet.ResultErrorCodes.HTTP - && errors.length > 2 - ) { - _error.reason = string(abi.encodePacked( - "Witnet: Retrieval: HTTP/", - errors[1].readUint().toString(), - " error." - )); - } else if ( - _error.code == Witnet.ResultErrorCodes.RetrievalTimeout - && errors.length > 1 - ) { - _error.reason = string(abi.encodePacked( - "Witnet: Retrieval: timeout." - )); - } else if ( - _error.code == Witnet.ResultErrorCodes.Underflow - && errors.length > 1 - ) { - _error.reason = string(abi.encodePacked( - "Witnet: Aggregation: math underflow." - )); - } else if ( - _error.code == Witnet.ResultErrorCodes.Overflow - && errors.length > 1 - ) { - _error.reason = string(abi.encodePacked( - "Witnet: Aggregation: math overflow." - )); - } else if ( - _error.code == Witnet.ResultErrorCodes.DivisionByZero - && errors.length > 1 - ) { - _error.reason = string(abi.encodePacked( - "Witnet: Aggregation: division by zero." - )); - } else if ( - _error.code == Witnet.ResultErrorCodes.BridgeMalformedRequest - ) { - _error.reason = "Witnet: Bridge: malformed data request cannot be processed."; - } else if ( - _error.code == Witnet.ResultErrorCodes.BridgePoorIncentives - ) { - _error.reason = "Witnet: Bridge: rejected due to poor witnessing incentives."; - } else if ( - _error.code == Witnet.ResultErrorCodes.BridgeOversizedResult - ) { - _error.reason = "Witnet: Bridge: rejected due to poor bridging incentives."; - } else if ( - _error.code == Witnet.ResultErrorCodes.InsufficientConsensus - && errors.length > 3 - ) { - uint reached = (errors[1].additionalInformation == 25 - ? uint(int(errors[1].readFloat16() / 10 ** 4)) - : uint(int(errors[1].readFloat64() / 10 ** 15)) - ); - uint expected = (errors[2].additionalInformation == 25 - ? uint(int(errors[2].readFloat16() / 10 ** 4)) - : uint(int(errors[2].readFloat64() / 10 ** 15)) - ); - _error.reason = string(abi.encodePacked( - "Witnet: Tally: insufficient consensus: ", - reached.toString(), - "% <= ", - expected.toString(), - "%." - )); + string memory _prefix; + if (_error.code.isCircumstantial()) { + _prefix = "Circumstantial: "; + } else if (_error.code.poorIncentives()) { + _prefix = "Poor incentives: "; + } else if (_error.code.lackOfConsensus()) { + _prefix = "Consensual: "; + } else { + _prefix = "Critical: "; + } + _error.reason = string(abi.encodePacked(_prefix, _stringify(_error.code, errors))); + } + + function _stringify(Witnet.ResultErrorCodes code, WitnetCBOR.CBOR[] memory args) + private pure + returns (string memory) + { + if (code == Witnet.ResultErrorCodes.InsufficientCommits) { + return "insufficient commits."; + } else if ( - _error.code == Witnet.ResultErrorCodes.InsufficientCommits + code == Witnet.ResultErrorCodes.CircumstantialFailure + && args.length > 2 ) { - _error.reason = "Witnet: Tally: insufficient commits."; + return _stringify(args[1].readUint(), args); + + } else if (code == Witnet.ResultErrorCodes.InsufficientMajority) { + return "insufficient majority."; + + } else if (code == Witnet.ResultErrorCodes.InsufficientQuorum) { + return "insufficient quorum."; + + } else if (code == Witnet.ResultErrorCodes.BridgePoorIncentives) { + return "as for the bridge."; + } else if ( - _error.code == Witnet.ResultErrorCodes.TallyExecution - && errors.length > 3 + code == Witnet.ResultErrorCodes.OversizedTallyResult + || code == Witnet.ResultErrorCodes.BridgeOversizedTallyResult ) { - _error.reason = string(abi.encodePacked( - "Witnet: Tally: execution error: ", - errors[2].readString(), - "." - )); + return "oversized result."; + + } else if (code == Witnet.ResultErrorCodes.InconsistentSources) { + return "inconsistent sources."; + } else if ( - _error.code == Witnet.ResultErrorCodes.ArrayIndexOutOfBounds - && errors.length > 2 + code == Witnet.ResultErrorCodes.MalformedResponses + && args.length > 2 ) { - _error.reason = string(abi.encodePacked( - "Witnet: Aggregation: tried to access a value from an array with an index (", - errors[1].readUint().toString(), - ") out of bounds." + return string(abi.encodePacked( + "malformed response: ", + _stringify(args[1].readUint(), args) )); + } else if ( - _error.code == Witnet.ResultErrorCodes.MapKeyNotFound - && errors.length > 2 + code == Witnet.ResultErrorCodes.MalformedDataRequest + || code == Witnet.ResultErrorCodes.BridgeMalformedDataRequest + ) { - _error.reason = string(abi.encodePacked( - "Witnet: Aggregation: tried to access a value from a map with a key (\"", - errors[1].readString(), - "\") that was not found." + if (args.length > 2) { + return string(abi.encodePacked( + "malformed request: ", + _stringify(args[1].readUint(), args) + )); + } else { + return "malformed request."; + } + + } else if (code == Witnet.ResultErrorCodes.UnhandledIntercept) { + if (args.length > 2) { + return string(abi.encodePacked( + "unhandled intercept on tally (+", + (args.length - 2).toString(), + " args)." + )); + } else { + return "unhandled intercept on tally."; + } + + } else { + return string(abi.encodePacked( + "0x", + uint8(code).toHexString() )); - } else if ( - _error.code == Witnet.ResultErrorCodes.NoReveals - ) { - _error.reason = "Witnet: Tally: no reveals."; - } else if ( - _error.code == Witnet.ResultErrorCodes.MalformedReveal - ) { - _error.reason = "Witnet: Tally: malformed reveal."; - } else if ( - _error.code == Witnet.ResultErrorCodes.UnhandledIntercept - ) { - _error.reason = "Witnet: Tally: unhandled intercept."; + } + } + + function _stringify(uint subcode, WitnetCBOR.CBOR[] memory args) + private pure + returns (string memory) + { + Witnet.ResultErrorCodes _code = Witnet.ResultErrorCodes(subcode); + + // circumstantial subcodes: + if (_code == Witnet.ResultErrorCodes.HttpErrors) { + if (args.length > 3) { + return string(abi.encodePacked( + "http/", + args[2].readUint().toString() + )); + } else { + return "unspecific http status code."; + } + + } else if (_code == Witnet.ResultErrorCodes.RetrievalsTimeout) { + return "response timeout."; + + } else if (_code == Witnet.ResultErrorCodes.ArrayIndexOutOfBounds) { + if (args.length > 3) { + return string(abi.encodePacked( + "array index out of bounds: ", + args[2].readUint().toString() + )); + } else { + return "array index out of bounds."; + } + + } else if (_code == Witnet.ResultErrorCodes.MapKeyNotFound) { + if (args.length > 3) { + return string(abi.encodePacked( + "map key not found: ", + args[2].readString() + )); + } else { + return "map key not found."; + } + + } else if (_code == Witnet.ResultErrorCodes.JsonPathNotFound) { + if (args.length > 3) { + return string(abi.encodePacked( + "json path returned no values: ", + args[2].readString() + )); + } else { + return "json path returned no values."; + } + } else { - _error.reason = string(abi.encodePacked( - "Unhandled error: 0x", - Witnet.toHexString(uint8(_error.code)), - errors.length > 2 - ? string(abi.encodePacked(" (", uint(errors.length - 1).toString(), " params).")) - : "." + return string(abi.encodePacked( + "0x", + Witnet.toHexString(uint8(_code)), + args.length > 3 + ? string(abi.encodePacked(" (+", uint(args.length - 3).toString(), " args)")) + : "" )); } } diff --git a/contracts/libs/WitnetPriceFeedsLib.sol b/contracts/libs/WitnetPriceFeedsLib.sol index 44ed75b09..d64458925 100644 --- a/contracts/libs/WitnetPriceFeedsLib.sol +++ b/contracts/libs/WitnetPriceFeedsLib.sol @@ -3,12 +3,12 @@ pragma solidity >=0.7.0 <0.9.0; pragma experimental ABIEncoderV2; -import "../interfaces/V2/IWitnetPriceSolver.sol"; -import "../interfaces/V2/IWitnetPriceSolverDeployer.sol"; +import "../interfaces/IWitnetPriceSolver.sol"; +import "../interfaces/IWitnetPriceSolverDeployer.sol"; -import "./Slices.sol"; +import "../libs/Slices.sol"; -/// @title Ancillary external library for WitnetPriceFeeds implementations. +/// @title Ancillary deployable library for WitnetPriceFeeds. /// @dev Features: /// @dev - deployment of counter-factual IWitnetPriceSolver instances. /// @dev - validation of feed caption strings. @@ -37,9 +37,10 @@ library WitnetPriceFeedsLib { 0 ) } - assert(_solver == _createdContract); + // assert(_solver == _createdContract); // fails on TEN chains + _solver = _createdContract; require( - IWitnetPriceSolver(_solver).class() == type(IWitnetPriceSolver).interfaceId, + IWitnetPriceSolver(_solver).specs() == type(IWitnetPriceSolver).interfaceId, "WitnetPriceFeedsLib: uncompliant solver implementation" ); } diff --git a/contracts/libs/WitnetV2.sol b/contracts/libs/WitnetV2.sol index 4b9c0912c..0f18811ae 100644 --- a/contracts/libs/WitnetV2.sol +++ b/contracts/libs/WitnetV2.sol @@ -6,208 +6,126 @@ import "./Witnet.sol"; library WitnetV2 { - error IndexOutOfBounds(uint256 index, uint256 range); - error InsufficientBalance(uint256 weiBalance, uint256 weiExpected); - error InsufficientFee(uint256 weiProvided, uint256 weiExpected); - error Unauthorized(address violator); - - error RadonFilterMissingArgs(uint8 opcode); - - error RadonRequestNoSources(); - error RadonRequestSourcesArgsMismatch(uint expected, uint actual); - error RadonRequestMissingArgs(uint index, uint expected, uint actual); - error RadonRequestResultsMismatch(uint index, uint8 read, uint8 expected); - error RadonRequestTooHeavy(bytes bytecode, uint weight); - - error RadonSlaNoReward(); - error RadonSlaNoWitnesses(); - error RadonSlaTooManyWitnesses(uint256 numWitnesses); - error RadonSlaConsensusOutOfRange(uint256 percentage); - error RadonSlaLowCollateral(uint256 witnessCollateral); - - error UnsupportedDataRequestMethod(uint8 method, string schema, string body, string[2][] headers); - error UnsupportedRadonDataType(uint8 datatype, uint256 maxlength); - error UnsupportedRadonFilterOpcode(uint8 opcode); - error UnsupportedRadonFilterArgs(uint8 opcode, bytes args); - error UnsupportedRadonReducerOpcode(uint8 opcode); - error UnsupportedRadonReducerScript(uint8 opcode, bytes script, uint256 offset); - error UnsupportedRadonScript(bytes script, uint256 offset); - error UnsupportedRadonScriptOpcode(bytes script, uint256 cursor, uint8 opcode); - error UnsupportedRadonTallyScript(bytes32 hash); - - function toEpoch(uint _timestamp) internal pure returns (uint) { - return 1 + (_timestamp - 11111) / 15; + /// Struct containing both request and response data related to every query posted to the Witnet Request Board + struct Query { + Request request; + Response response; } - function toTimestamp(uint _epoch) internal pure returns (uint) { - return 111111+ _epoch * 15; - } - - struct Beacon { - uint256 escrow; - uint256 evmBlock; - uint256 gasprice; - address relayer; - address slasher; - uint256 superblockIndex; - uint256 superblockRoot; - } - - enum BeaconStatus { - Idle - } - - struct Block { - bytes32 blockHash; - bytes32 drTxsRoot; - bytes32 drTallyTxsRoot; - } - - enum BlockStatus { - Idle - } - - struct DrPost { - uint256 block; - DrPostStatus status; - DrPostRequest request; - DrPostResponse response; - } - - /// Data kept in EVM-storage for every Request posted to the Witnet Request Board. - struct DrPostRequest { - uint256 epoch; - address requester; - address reporter; - bytes32 radHash; - bytes32 slaHash; - uint256 weiReward; - } - - /// Data kept in EVM-storage containing Witnet-provided response metadata and result. - struct DrPostResponse { - address disputer; - address reporter; - uint256 escrowed; - uint256 drCommitTxEpoch; - uint256 drTallyTxEpoch; - bytes32 drTallyTxHash; - bytes drTallyResultCborBytes; - } - - enum DrPostStatus { - Void, - Deleted, - Expired, + /// Possible status of a Witnet query. + enum QueryStatus { + Unknown, Posted, - Disputed, Reported, - Finalized, - Accepted, - Rejected - } - - struct DataProvider { - string authority; - uint256 totalEndpoints; - mapping (uint256 => bytes32) endpoints; - } - - enum DataRequestMethods { - /* 0 */ Unknown, - /* 1 */ HttpGet, - /* 2 */ Rng, - /* 3 */ HttpPost, - /* 4 */ HttpHead - } - - enum RadonDataTypes { - /* 0x00 */ Any, - /* 0x01 */ Array, - /* 0x02 */ Bool, - /* 0x03 */ Bytes, - /* 0x04 */ Integer, - /* 0x05 */ Float, - /* 0x06 */ Map, - /* 0x07 */ String, - Unused0x08, Unused0x09, Unused0x0A, Unused0x0B, - Unused0x0C, Unused0x0D, Unused0x0E, Unused0x0F, - /* 0x10 */ Same, - /* 0x11 */ Inner, - /* 0x12 */ Match, - /* 0x13 */ Subscript + Undeliverable, + Finalized } - struct RadonFilter { - RadonFilterOpcodes opcode; - bytes args; - } - - enum RadonFilterOpcodes { - /* 0x00 */ GreaterThan, - /* 0x01 */ LessThan, - /* 0x02 */ Equals, - /* 0x03 */ AbsoluteDeviation, - /* 0x04 */ RelativeDeviation, - /* 0x05 */ StandardDeviation, - /* 0x06 */ Top, - /* 0x07 */ Bottom, - /* 0x08 */ Mode, - /* 0x09 */ LessOrEqualThan - } - - struct RadonReducer { - RadonReducerOpcodes opcode; - RadonFilter[] filters; - bytes script; - } - - enum RadonReducerOpcodes { - /* 0x00 */ Minimum, - /* 0x01 */ Maximum, - /* 0x02 */ Mode, - /* 0x03 */ AverageMean, - /* 0x04 */ AverageMeanWeighted, - /* 0x05 */ AverageMedian, - /* 0x06 */ AverageMedianWeighted, - /* 0x07 */ StandardDeviation, - /* 0x08 */ AverageDeviation, - /* 0x09 */ MedianDeviation, - /* 0x0A */ MaximumDeviation, - /* 0x0B */ ConcatenateAndHash - } - - struct RadonRetrieval { - uint8 argsCount; - DataRequestMethods method; - RadonDataTypes resultDataType; - string url; - string body; - string[2][] headers; - bytes script; + /// Data kept in EVM-storage for every Request posted to the Witnet Request Board. + struct Request { + address requester; // EVM address from which the request was posted. + uint24 gasCallback; // Max callback gas limit upon response, if a callback is required. + uint72 evmReward; // EVM amount in wei eventually to be paid to the legit result reporter. + bytes witnetBytecode; // Optional: Witnet Data Request bytecode to be solved by the Witnet blockchain. + bytes32 witnetRAD; // Optional: Previously verified hash of the Witnet Data Request to be solved. + WitnetV2.RadonSLA witnetSLA; // Minimum Service-Level parameters to be committed by the Witnet blockchain. + } + + /// Response metadata and result as resolved by the Witnet blockchain. + struct Response { + address reporter; // EVM address from which the Data Request result was reported. + uint64 finality; // EVM block number at which the reported data will be considered to be finalized. + uint32 resultTimestamp; // Unix timestamp (seconds) at which the data request was resolved in the Witnet blockchain. + bytes32 resultTallyHash; // Unique hash of the commit/reveal act in the Witnet blockchain that resolved the data request. + bytes resultCborBytes; // CBOR-encode result to the request, as resolved in the Witnet blockchain. + } + + /// Response status from a requester's point of view. + enum ResponseStatus { + Void, + Awaiting, + Ready, + Error, + AwaitingReady, + AwaitingError } struct RadonSLA { - uint numWitnesses; - uint minConsensusPercentage; - uint witnessReward; - uint witnessCollateral; - uint minerCommitRevealFee; + /// @notice Number of nodes in the Witnet blockchain that will take part in solving the data request. + uint8 committeeSize; + + /// @notice Fee in $nanoWIT paid to every node in the Witnet blockchain involved in solving the data request. + /// @dev Witnet nodes participating as witnesses will have to stake as collateral 100x this amount. + uint64 witnessingFee; } - /// @notice Returns `true` if all witnessing parameters in `b` have same - /// @notice value or greater than the ones in `a`. - function equalOrGreaterThan(RadonSLA memory a, RadonSLA memory b) - internal pure - returns (bool) + + /// =============================================================================================================== + /// --- 'WitnetV2.RadonSLA' helper methods ------------------------------------------------------------------------ + + function equalOrGreaterThan(RadonSLA memory a, RadonSLA memory b) + internal pure returns (bool) { + return (a.committeeSize >= b.committeeSize); + } + + function isValid(RadonSLA calldata sla) internal pure returns (bool) { return ( - a.numWitnesses >= b.numWitnesses - && a.minConsensusPercentage >= b.minConsensusPercentage - && a.witnessReward >= b.witnessReward - && a.witnessCollateral >= b.witnessCollateral - && a.minerCommitRevealFee >= b.minerCommitRevealFee + sla.witnessingFee > 0 + && sla.committeeSize > 0 && sla.committeeSize <= 127 + // v1.7.x requires witnessing collateral to be greater or equal to 20 WIT: + && sla.witnessingFee * 100 >= 20 * 10 ** 9 ); } + function toV1(RadonSLA memory self) internal pure returns (Witnet.RadonSLA memory) { + return Witnet.RadonSLA({ + numWitnesses: self.committeeSize, + minConsensusPercentage: 51, + witnessReward: self.witnessingFee, + witnessCollateral: self.witnessingFee * 100, + minerCommitRevealFee: self.witnessingFee + }); + } + + function witTotalFee(RadonSLA calldata self) internal pure returns (uint64) { + return self.witnessingFee * (self.committeeSize + 3); + } + + uint256 internal constant _WITNET_GENESIS_TIMESTAMP = 1602666045; + uint256 internal constant _WITNET_GENESIS_EPOCH_SECONDS = 45; + + uint256 internal constant _WITNET_2_0_EPOCH = 1234567; + uint256 internal constant _WITNET_2_0_EPOCH_SECONDS = 30; + uint256 internal constant _WITNET_2_0_TIMESTAMP = _WITNET_GENESIS_TIMESTAMP + _WITNET_2_0_EPOCH * _WITNET_GENESIS_EPOCH_SECONDS; + + function timestampToWitnetEpoch(uint _timestamp) internal pure returns (uint) { + if (_timestamp > _WITNET_2_0_TIMESTAMP ) { + return ( + _WITNET_2_0_EPOCH + ( + _timestamp - _WITNET_2_0_TIMESTAMP + ) / _WITNET_2_0_EPOCH_SECONDS + ); + } else if (_timestamp > _WITNET_GENESIS_TIMESTAMP) { + return ( + 1 + ( + _timestamp - _WITNET_GENESIS_TIMESTAMP + ) / _WITNET_GENESIS_EPOCH_SECONDS + ); + } else { + return 0; + } + } + + function witnetEpochToTimestamp(uint _epoch) internal pure returns (uint) { + if (_epoch >= _WITNET_2_0_EPOCH) { + return ( + _WITNET_2_0_TIMESTAMP + ( + _epoch - _WITNET_2_0_EPOCH + ) * _WITNET_2_0_EPOCH_SECONDS + ); + } else { + return (_WITNET_GENESIS_TIMESTAMP + _epoch * _WITNET_GENESIS_EPOCH_SECONDS); + } + } } \ No newline at end of file diff --git a/contracts/mocks/MyDapp.sol b/contracts/mocks/MyDapp.sol new file mode 100644 index 000000000..ff779d195 --- /dev/null +++ b/contracts/mocks/MyDapp.sol @@ -0,0 +1,89 @@ +// SPDX-License-Identifier: MIT + +pragma solidity >=0.7.0 <0.9.0; +pragma experimental ABIEncoderV2; + +import "../apps/UsingWitnetRandomness.sol"; + +contract MyDapp + is + UsingWitnetRandomness +{ + using WitnetCBOR for WitnetCBOR.CBOR; + + event Randomizing(uint256 queryId); + event Randomized(uint256 queryId, bytes32 randomness); + event Error(uint256 queryId, Witnet.ResultErrorCodes errorCode); + + bytes32 public randomness; + bytes32 public witnetRandomnessRadHash; + uint64 public immutable callbackGasLimit; + bytes public witnetRandomnessBytecode; + struct Rubbish { + bytes32 slot1; + bytes32 slot2; + bytes32 slot3; + } + Rubbish public rubbish; + + uint256 private immutable __randomizeValue; + + constructor(WitnetOracle _wrb, uint16 _baseFeeOverheadPercentage, uint24 _callbackGasLimit) + UsingWitnetRandomness( + _wrb, + _baseFeeOverheadPercentage, + _callbackGasLimit + ) + { + callbackGasLimit = _callbackGasLimit; + rubbish.slot1 = blockhash(block.number - 1); + rubbish.slot2 = blockhash(block.number - 2); + rubbish.slot3 = blockhash(block.number - 3); + witnetRandomnessRadHash = __witnetRandomnessRadHash; + witnetRandomnessBytecode = witnet().registry().bytecodeOf(__witnetRandomnessRadHash); + __randomizeValue = _witnetEstimateEvmReward(); + } + + function getRandomizeValue() external view returns (uint256) { + return __randomizeValue; + } + + function randomize() external payable returns (uint256 _randomizeId) { + _randomizeId = __witnetRandomize(__randomizeValue); + if (__randomizeValue < msg.value) { + payable(msg.sender).transfer(msg.value - __randomizeValue); + } + } + + /// @notice Method to be called from the WitnetOracle contract as soon as the given Witnet `queryId` + /// @notice gets reported, if reported with no errors. + /// @dev It should revert if called from any other address different to the WitnetOracle being used + /// @dev by the WitnetConsumer contract. Within the implementation of this method, the WitnetConsumer + /// @dev can call to the WRB as to retrieve the Witnet tracking information (i.e. the `witnetDrTxHash` + /// @dev and `witnetDrCommitTxTimestamp`), or the finality status, of the result being reported. + function reportWitnetQueryResult( + uint256 _witnetQueryId, uint64, bytes32, uint256, + WitnetCBOR.CBOR calldata witnetResultCborValue + ) + override external + onlyFromWitnet + { + // randomness = _witnetReadRandomizeFromResultValue(witnetResultCborValue); + // delete rubbish; + // witnet.burnQuery(_witnetQueryId); + // emit Result(queryId, _witnetReadRandomizeFromResultValue(cborValue)); + } + + function reportWitnetQueryError( + uint256 witnetQueryId, + uint64, bytes32, uint256, + Witnet.ResultErrorCodes errorCode, WitnetCBOR.CBOR calldata + ) + virtual external + onlyFromWitnet + { + emit Error(witnetQueryId, errorCode); + } + + +} diff --git a/contracts/mocks/WitnetMockedPriceFeeds.sol b/contracts/mocks/WitnetMockedPriceFeeds.sol new file mode 100644 index 000000000..6d1efb169 --- /dev/null +++ b/contracts/mocks/WitnetMockedPriceFeeds.sol @@ -0,0 +1,22 @@ +// SPDX-License-Identifier: MIT + +pragma solidity >=0.7.0 <0.9.0; +pragma experimental ABIEncoderV2; + +import "./WitnetMockedRequestBoard.sol"; +import "../core/defaults/WitnetPriceFeedsDefault.sol"; + +/// @title Mocked implementation of `WitnetPriceFeeds`. +/// @dev TO BE USED ONLY ON DEVELOPMENT ENVIRONMENTS. +/// @dev ON SUPPORTED TESTNETS AND MAINNETS, PLEASE USE +/// @dev THE `WitnetPriceFeeds` CONTRACT ADDRESS PROVIDED +/// @dev BY THE WITNET FOUNDATION. +contract WitnetMockedPriceFeeds is WitnetPriceFeedsDefault { + constructor(WitnetMockedRequestBoard _wrb) + WitnetPriceFeedsDefault( + _wrb, + false, + bytes32("mocked") + ) + {} +} diff --git a/contracts/mocks/WitnetMockedRequestBoard.sol b/contracts/mocks/WitnetMockedRequestBoard.sol new file mode 100644 index 000000000..1538c1aee --- /dev/null +++ b/contracts/mocks/WitnetMockedRequestBoard.sol @@ -0,0 +1,42 @@ +// SPDX-License-Identifier: MIT + +pragma solidity >=0.7.0 <0.9.0; +pragma experimental ABIEncoderV2; + +import "./WitnetMockedRequestBytecodes.sol"; +import "./WitnetMockedRequestFactory.sol"; +import "../core/defaults/WitnetRequestBoardTrustableDefault.sol"; + +import "./WitnetMockedPriceFeeds.sol"; + +/// @title Mocked implementation of `WitnetOracle`. +/// @dev TO BE USED ONLY ON DEVELOPMENT ENVIRONMENTS. +/// @dev ON SUPPORTED TESTNETS AND MAINNETS, PLEASE USE +/// @dev THE `WitnetOracle` CONTRACT ADDRESS PROVIDED +/// @dev BY THE WITNET FOUNDATION. +contract WitnetMockedRequestBoard + is + WitnetRequestBoardTrustableDefault +{ + WitnetRequestFactory private __factory; + + constructor(WitnetMockedRequestBytecodes _registry) + WitnetRequestBoardTrustableDefault( + WitnetRequestFactory(address(0)), + WitnetRequestBytecodes(address(_registry)), + false, + bytes32("mocked"), + 60000, 65000, 70000, 20000 + ) + { + __acls().isReporter_[msg.sender] = true; + } + + function factory() override public view returns (WitnetRequestFactory) { + return __factory; + } + + function setFactory(WitnetMockedRequestFactory _factory) external onlyOwner { + __factory = WitnetRequestFactory(address(_factory)); + } +} \ No newline at end of file diff --git a/contracts/mocks/WitnetMockedRequestBytecodes.sol b/contracts/mocks/WitnetMockedRequestBytecodes.sol new file mode 100644 index 000000000..43f9926dc --- /dev/null +++ b/contracts/mocks/WitnetMockedRequestBytecodes.sol @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: MIT + +pragma solidity >=0.7.0 <0.9.0; +pragma experimental ABIEncoderV2; + +import "../core/defaults/WitnetRequestBytecodesDefault.sol"; + +/// @title Mocked implementation of `WitnetRequestBytecodes`. +/// @dev TO BE USED ONLY ON DEVELOPMENT ENVIRONMENTS. +/// @dev ON SUPPORTED TESTNETS AND MAINNETS, PLEASE USE +/// @dev THE `WitnetRequestBytecodes` CONTRACT ADDRESS PROVIDED +/// @dev BY THE WITNET FOUNDATION. +contract WitnetMockedRequestBytecodes is WitnetRequestBytecodesDefault { + constructor() + WitnetRequestBytecodesDefault( + false, + bytes32("mocked") + ) + {} +} diff --git a/contracts/mocks/WitnetMockedRequestFactory.sol b/contracts/mocks/WitnetMockedRequestFactory.sol new file mode 100644 index 000000000..9390b54be --- /dev/null +++ b/contracts/mocks/WitnetMockedRequestFactory.sol @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: MIT + +pragma solidity >=0.7.0 <0.9.0; +pragma experimental ABIEncoderV2; + +import "./WitnetMockedRequestBoard.sol"; +import "../core/defaults/WitnetRequestFactoryDefault.sol"; + +/// @title Mocked implementation of `WitnetRequestFactory`. +/// @dev TO BE USED ONLY ON DEVELOPMENT ENVIRONMENTS. +/// @dev ON SUPPORTED TESTNETS AND MAINNETS, PLEASE USE +/// @dev THE `WitnetRequestFactory` CONTRACT ADDRESS PROVIDED +/// @dev BY THE WITNET FOUNDATION. +contract WitnetMockedRequestFactory + is + WitnetRequestFactoryDefault +{ + constructor (WitnetMockedRequestBoard _wrb) + WitnetRequestFactoryDefault( + WitnetOracle(address(_wrb)), + WitnetRequestBytecodes(_wrb.registry()), + false, + bytes32("mocked") + ) + {} +} \ No newline at end of file diff --git a/contracts/patterns/Create2Factory.sol b/contracts/patterns/Create2Factory.sol deleted file mode 100644 index 8456e590a..000000000 --- a/contracts/patterns/Create2Factory.sol +++ /dev/null @@ -1,44 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity >=0.8.0 <0.9.0; - -/// @title Based on Singleton Factory (EIP-2470), authored by Guilherme Schmidt (Status Research & Development GmbH) -/// @notice Exposes CREATE2 (EIP-1014) to deploy bytecode on deterministic addresses based on initialization code and salt. - -contract Create2Factory { - - /// @notice Deploys `_initCode` using `_salt` for defining the deterministic address. - /// @param _initCode Initialization code. - /// @param _salt Arbitrary value to modify resulting address. - /// @return createdContract Created contract address. - function deploy(bytes memory _initCode, bytes32 _salt) - public - returns (address payable createdContract) - { - assembly { - createdContract := create2(0, add(_initCode, 0x20), mload(_initCode), _salt) - } - } - - /// @notice Determine singleton contract address that might be created from this factory, given its `_initCode` and a `_salt`. - /// @param _initCode Initialization code. - /// @param _salt Arbitrary value to modify resulting address. - /// @return expectedAddr Expected contract address. - function determineAddr(bytes memory _initCode, bytes32 _salt) - public - view - returns (address) - { - return address( - uint160(uint(keccak256( - abi.encodePacked( - bytes1(0xff), - address(this), - _salt, - keccak256(_initCode) - ) - ))) - ); - } - -} \ No newline at end of file diff --git a/contracts/patterns/Destructible.sol b/contracts/patterns/Destructible.sol deleted file mode 100644 index 08b5f0669..000000000 --- a/contracts/patterns/Destructible.sol +++ /dev/null @@ -1,8 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity >=0.6.0 <0.9.0; - -interface Destructible { - /// @dev Self-destruct the whole contract. - function destruct() external; -} diff --git a/contracts/patterns/ERC165.sol b/contracts/patterns/ERC165.sol deleted file mode 100644 index 607071bbb..000000000 --- a/contracts/patterns/ERC165.sol +++ /dev/null @@ -1,3 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; -import "@openzeppelin/contracts/utils/introspection/ERC165.sol"; diff --git a/contracts/patterns/Payable.sol b/contracts/patterns/Payable.sol index 6ff570307..8313a0c71 100644 --- a/contracts/patterns/Payable.sol +++ b/contracts/patterns/Payable.sol @@ -1,8 +1,7 @@ // SPDX-License-Identifier: MIT - pragma solidity >=0.6.0 <0.9.0; -import "../interfaces/IERC20.sol"; +import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; abstract contract Payable { IERC20 public immutable currency; @@ -21,5 +20,5 @@ abstract contract Payable { function _getMsgValue() internal view virtual returns (uint256); /// Perform safe transfer or whatever token is used for paying rewards. - function _safeTransferTo(address payable, uint256) internal virtual; + function __safeTransferTo(address payable, uint256) internal virtual; } diff --git a/contracts/patterns/Proxiable.sol b/contracts/patterns/Proxiable.sol index 966c5802d..a2eb2bf73 100644 --- a/contracts/patterns/Proxiable.sol +++ b/contracts/patterns/Proxiable.sol @@ -10,6 +10,7 @@ abstract contract Proxiable { struct ProxiableSlot { address implementation; address proxy; + bytes32 codehash; } function __implementation() internal view returns (address) { diff --git a/contracts/patterns/ReentrancyGuard.sol b/contracts/patterns/ReentrancyGuard.sol index 56ff2e0ba..497a698f0 100644 --- a/contracts/patterns/ReentrancyGuard.sol +++ b/contracts/patterns/ReentrancyGuard.sol @@ -1,3 +1,3 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; +import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; diff --git a/contracts/patterns/Upgradeable.sol b/contracts/patterns/Upgradeable.sol index 74f913462..bd72a3a3e 100644 --- a/contracts/patterns/Upgradeable.sol +++ b/contracts/patterns/Upgradeable.sol @@ -35,12 +35,7 @@ abstract contract Upgradeable is Initializable, Proxiable { constructor (bool _isUpgradable) { address _base = address(this); - bytes32 _codehash; - assembly { - _codehash := extcodehash(_base) - } _BASE = _base; - _CODEHASH = _codehash; _UPGRADABLE = _isUpgradable; } @@ -50,8 +45,11 @@ abstract contract Upgradeable is Initializable, Proxiable { } /// @dev Retrieves the immutable codehash of this contract, even if invoked as delegatecall. - function codehash() public view returns (bytes32) { - return _CODEHASH; + function codehash() public view returns (bytes32 _codehash) { + address _base = _BASE; + assembly { + _codehash := extcodehash(_base) + } } /// @dev Determines whether the logic of this contract is potentially upgradable. diff --git a/hardhat.config.js b/hardhat.config.js new file mode 100644 index 000000000..677130bbb --- /dev/null +++ b/hardhat.config.js @@ -0,0 +1,53 @@ +require("@nomicfoundation/hardhat-verify") + +const settings = require("./settings") +const utils = require("./src/utils") +const [, target] = utils.getRealmNetworkFromArgs() + +module.exports = { + paths: { + sources: "./contracts", + }, + networks: Object.fromEntries( + Object.entries(settings.getNetworks()) + .map(([network, config]) => { + return [network, { + chainId: config.network_id, + gas: config?.gas, + gasPrice: config?.gasPrice, + url: `http://${config?.host || "localhost"}:${config?.port || 8545}`, + }] + }) + ), + solidity: settings.getCompilers(target), + sourcify: { + enabled: true, + apiUrl: "https://sourcify.dev/server", + browserUrl: "https://repo.sourcify.dev", + }, + etherscan: { + apiKey: Object.fromEntries( + Object.entries(settings.getNetworks()) + .filter(([, config]) => config?.verify !== undefined) + .map(([network, config]) => { + const [ecosystem] = utils.getRealmNetworkFromString(network) + const envar = `ETHERSCAN_${ecosystem.toUpperCase()}_API_KEY` + return [network, + config?.verify?.apiKey || process.env[envar] || process.env.ETHERSCAN_API_KEY || "MY_API_KEY", + ] + }), + ), + customChains: Object.entries(settings.getNetworks()) + .filter(([, config]) => config?.verify !== undefined) + .map(([network, config]) => { + return { + network, + chainId: config.network_id, + urls: { + apiURL: config?.apiUrl, + browserURL: config?.browserUrl, + }, + } + }), + }, +} diff --git a/migrations/abis/WitnetProxy.json b/migrations/abis/WitnetProxy.json deleted file mode 100644 index 8aa75fc01..000000000 --- a/migrations/abis/WitnetProxy.json +++ /dev/null @@ -1,7310 +0,0 @@ -{ - "contractName": "WitnetProxy", - "abi": [ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "Upgraded", - "type": "event" - }, - { - "stateMutability": "payable", - "type": "fallback", - "payable": true - }, - { - "stateMutability": "payable", - "type": "receive", - "payable": true - }, - { - "inputs": [], - "name": "implementation", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function", - "constant": true - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_newImplementation", - "type": "address" - }, - { - "internalType": "bytes", - "name": "_initData", - "type": "bytes" - } - ], - "name": "upgradeTo", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_initData\",\"type\":\"bytes\"}],\"name\":\"upgradeTo\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"author\":\"The Witnet Foundation.\",\"kind\":\"dev\",\"methods\":{\"upgradeTo(address,bytes)\":{\"params\":{\"_initData\":\"Raw data with which new implementation will be initialized.\",\"_newImplementation\":\"New implementation address.\"},\"returns\":{\"_0\":\"Returns whether new implementation would be further upgradable, or not.\"}}},\"title\":\"WitnetProxy: upgradable delegate-proxy contract. \",\"version\":1},\"userdoc\":{\"events\":{\"Upgraded(address)\":{\"notice\":\"Event emitted every time the implementation gets updated.\"}},\"kind\":\"user\",\"methods\":{\"constructor\":{\"notice\":\"Constructor with no params as to ease eventual support of Singleton pattern (i.e. ERC-2470).\"},\"implementation()\":{\"notice\":\"Returns proxy's current implementation address.\"},\"upgradeTo(address,bytes)\":{\"notice\":\"Upgrades the `implementation` address.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"project:/contracts/impls/WitnetProxy.sol\":\"WitnetProxy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"keccak256\":\"0xe798cadb41e2da274913e4b3183a80f50fb057a42238fe8467e077268100ec27\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://899f850f7df5a270bccfb765d70069959ca1c20d3a7381c1c3bda8a3ffee1935\",\"dweb:/ipfs/QmVdnAqwyX2L3nX2HDA5WKGtVBFyH1nKE9A1k7fZnPBkhP\"]},\"@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol\":{\"keccak256\":\"0x2edcb41c121abc510932e8d83ff8b82cf9cdde35e7c297622f5c29ef0af25183\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://72460c66cd1c3b1c11b863e0d8df0a1c56f37743019e468dc312c754f43e3b06\",\"dweb:/ipfs/QmPExYKiNb9PUsgktQBupPaM33kzDHxaYoVeJdLhv8s879\"]},\"project:/contracts/impls/WitnetProxy.sol\":{\"keccak256\":\"0x1c779834ad2643469ffdaa70da075bd4617326663539b018e3a2756873997e3d\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://142b32cd3be904194a8b370e6e1e5c961d9e70674903a47c6a3aac6aea770cfa\",\"dweb:/ipfs/Qme3UTCXqJFAdA7MJBKfQc3kUQjAoTuaMoifU8encsJU9P\"]},\"project:/contracts/patterns/Initializable.sol\":{\"keccak256\":\"0xaac470e87f361cf15d68d1618d6eb7d4913885d33ccc39c797841a9591d44296\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://ef3760b2039feda8715d4bd9f8de8e3885f25573d12ba92f52d626ba880a08bf\",\"dweb:/ipfs/QmP2mfHPBKkjTAKft95sPDb4PBsjfmAwc47Kdcv3xYSf3g\"]},\"project:/contracts/patterns/Proxiable.sol\":{\"keccak256\":\"0xe1b1bb7ba2e2fc799b33648f6f89a1b0e82a75dd275071215b3fd8c82327a2cb\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://a025a64d64d46c7ced3c1c99f4380841ec495a0bb6fbe4426ff9b32e16fa4769\",\"dweb:/ipfs/QmRuUrv285bTD9pPCppUGNMTQkCqqceXSXEJrEnpN2H778\"]},\"project:/contracts/patterns/Upgradeable.sol\":{\"keccak256\":\"0x27ca1e658f13f0128d17ff27e9640670b22afdab6163c0daa14f2ec0853b5954\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://f2eceac1ee77596a31e7ee2f11145ce188eef649e3095b2a26d746a250df2b81\",\"dweb:/ipfs/QmcEh2umA5McbU9VHY319XW8rw4Fs79a7dKGC3F2no8biL\"]}},\"version\":1}", - "bytecode": "0x608060405234801561001057600080fd5b50610912806100206000396000f3fe60806040526004361061002d5760003560e01c80635c60da1b146100655780636fbc15e91461009757610034565b3661003457005b600061003e6100c7565b905060405136600082376000803683855af43d806000843e818015610061578184f35b8184fd5b34801561007157600080fd5b5061007a6100c7565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156100a357600080fd5b506100b76100b2366004610757565b6100f5565b604051901515815260200161008e565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b60006001600160a01b0383166101525760405162461bcd60e51b815260206004820181905260248201527f5769746e657450726f78793a206e756c6c20696d706c656d656e746174696f6e60448201526064015b60405180910390fd5b600061015c6100c7565b90506001600160a01b0381161561053857806001600160a01b0316846001600160a01b0316036101ce5760405162461bcd60e51b815260206004820152601f60248201527f5769746e657450726f78793a206e6f7468696e6720746f2075706772616465006044820152606401610149565b806001600160a01b0316635479d9406040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015610228575060408051601f3d908101601f1916820190925261022591810190610827565b60015b6102875760405162461bcd60e51b815260206004820152602a60248201527f5769746e657450726f78793a20756e61626c6520746f20636865636b207570676044820152697261646162696c69747960b01b6064820152608401610149565b806102d45760405162461bcd60e51b815260206004820152601b60248201527f5769746e657450726f78793a206e6f742075706772616461626c6500000000006044820152606401610149565b5060405133602482015260009081906001600160a01b0384169060440160408051601f198184030181529181526020820180516001600160e01b03166335ac4b0560e11b179052516103269190610874565b600060405180830381855af49150503d8060008114610361576040519150601f19603f3d011682016040523d82523d6000602084013e610366565b606091505b5091509150816103b85760405162461bcd60e51b815260206004820152601a60248201527f5769746e657450726f78793a206e6f7420636f6d706c69616e740000000000006044820152606401610149565b808060200190518101906103cc9190610827565b6104185760405162461bcd60e51b815260206004820152601b60248201527f5769746e657450726f78793a206e6f7420617574686f72697a656400000000006044820152606401610149565b856001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610456573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061047a9190610890565b836001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156104b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104dc9190610890565b146105355760405162461bcd60e51b8152602060048201526024808201527f5769746e657450726f78793a2070726f786961626c655555494473206d69736d6044820152630c2e8c6d60e31b6064820152608401610149565b50505b6000846001600160a01b03168460405160240161055591906108a9565b60408051601f198184030181529181526020820180516001600160e01b031663439fab9160e01b1790525161058a9190610874565b600060405180830381855af49150503d80600081146105c5576040519150601f19603f3d011682016040523d82523d6000602084013e6105ca565b606091505b50509050806106255760405162461bcd60e51b815260206004820152602160248201527f5769746e657450726f78793a20756e61626c6520746f20696e697469616c697a6044820152606560f81b6064820152608401610149565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0387169081179091556040517fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a2846001600160a01b0316635479d9406040518163ffffffff1660e01b8152600401602060405180830381865afa9250505080156106e5575060408051601f3d908101601f191682019092526106e291810190610827565b60015b6107315760405162461bcd60e51b815260206004820152601a60248201527f5769746e657450726f78793a206e6f7420636f6d706c69616e740000000000006044820152606401610149565b925061073b915050565b92915050565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561076a57600080fd5b82356001600160a01b038116811461078157600080fd5b9150602083013567ffffffffffffffff8082111561079e57600080fd5b818501915085601f8301126107b257600080fd5b8135818111156107c4576107c4610741565b604051601f8201601f19908116603f011681019083821181831017156107ec576107ec610741565b8160405282815288602084870101111561080557600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b60006020828403121561083957600080fd5b8151801515811461084957600080fd5b9392505050565b60005b8381101561086b578181015183820152602001610853565b50506000910152565b60008251610886818460208701610850565b9190910192915050565b6000602082840312156108a257600080fd5b5051919050565b60208152600082518060208401526108c8816040850160208701610850565b601f01601f1916919091016040019291505056fea26469706673582212200771bc4bad015c089efb2351eb3266c8aad36c8daccf86bbf3421605ef5fc23c64736f6c63430008110033", - "deployedBytecode": "0x60806040526004361061002d5760003560e01c80635c60da1b146100655780636fbc15e91461009757610034565b3661003457005b600061003e6100c7565b905060405136600082376000803683855af43d806000843e818015610061578184f35b8184fd5b34801561007157600080fd5b5061007a6100c7565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156100a357600080fd5b506100b76100b2366004610757565b6100f5565b604051901515815260200161008e565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b60006001600160a01b0383166101525760405162461bcd60e51b815260206004820181905260248201527f5769746e657450726f78793a206e756c6c20696d706c656d656e746174696f6e60448201526064015b60405180910390fd5b600061015c6100c7565b90506001600160a01b0381161561053857806001600160a01b0316846001600160a01b0316036101ce5760405162461bcd60e51b815260206004820152601f60248201527f5769746e657450726f78793a206e6f7468696e6720746f2075706772616465006044820152606401610149565b806001600160a01b0316635479d9406040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015610228575060408051601f3d908101601f1916820190925261022591810190610827565b60015b6102875760405162461bcd60e51b815260206004820152602a60248201527f5769746e657450726f78793a20756e61626c6520746f20636865636b207570676044820152697261646162696c69747960b01b6064820152608401610149565b806102d45760405162461bcd60e51b815260206004820152601b60248201527f5769746e657450726f78793a206e6f742075706772616461626c6500000000006044820152606401610149565b5060405133602482015260009081906001600160a01b0384169060440160408051601f198184030181529181526020820180516001600160e01b03166335ac4b0560e11b179052516103269190610874565b600060405180830381855af49150503d8060008114610361576040519150601f19603f3d011682016040523d82523d6000602084013e610366565b606091505b5091509150816103b85760405162461bcd60e51b815260206004820152601a60248201527f5769746e657450726f78793a206e6f7420636f6d706c69616e740000000000006044820152606401610149565b808060200190518101906103cc9190610827565b6104185760405162461bcd60e51b815260206004820152601b60248201527f5769746e657450726f78793a206e6f7420617574686f72697a656400000000006044820152606401610149565b856001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610456573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061047a9190610890565b836001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156104b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104dc9190610890565b146105355760405162461bcd60e51b8152602060048201526024808201527f5769746e657450726f78793a2070726f786961626c655555494473206d69736d6044820152630c2e8c6d60e31b6064820152608401610149565b50505b6000846001600160a01b03168460405160240161055591906108a9565b60408051601f198184030181529181526020820180516001600160e01b031663439fab9160e01b1790525161058a9190610874565b600060405180830381855af49150503d80600081146105c5576040519150601f19603f3d011682016040523d82523d6000602084013e6105ca565b606091505b50509050806106255760405162461bcd60e51b815260206004820152602160248201527f5769746e657450726f78793a20756e61626c6520746f20696e697469616c697a6044820152606560f81b6064820152608401610149565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0387169081179091556040517fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a2846001600160a01b0316635479d9406040518163ffffffff1660e01b8152600401602060405180830381865afa9250505080156106e5575060408051601f3d908101601f191682019092526106e291810190610827565b60015b6107315760405162461bcd60e51b815260206004820152601a60248201527f5769746e657450726f78793a206e6f7420636f6d706c69616e740000000000006044820152606401610149565b925061073b915050565b92915050565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561076a57600080fd5b82356001600160a01b038116811461078157600080fd5b9150602083013567ffffffffffffffff8082111561079e57600080fd5b818501915085601f8301126107b257600080fd5b8135818111156107c4576107c4610741565b604051601f8201601f19908116603f011681019083821181831017156107ec576107ec610741565b8160405282815288602084870101111561080557600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b60006020828403121561083957600080fd5b8151801515811461084957600080fd5b9392505050565b60005b8381101561086b578181015183820152602001610853565b50506000910152565b60008251610886818460208701610850565b9190910192915050565b6000602082840312156108a257600080fd5b5051919050565b60208152600082518060208401526108c8816040850160208701610850565b601f01601f1916919091016040019291505056fea26469706673582212200771bc4bad015c089efb2351eb3266c8aad36c8daccf86bbf3421605ef5fc23c64736f6c63430008110033", - "immutableReferences": {}, - "generatedSources": [], - "deployedGeneratedSources": [ - { - "ast": { - "nodeType": "YulBlock", - "src": "0:6066:84", - "statements": [ - { - "nodeType": "YulBlock", - "src": "6:3:84", - "statements": [] - }, - { - "body": { - "nodeType": "YulBlock", - "src": "115:102:84", - "statements": [ - { - "nodeType": "YulAssignment", - "src": "125:26:84", - "value": { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "137:9:84" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "148:2:84", - "type": "", - "value": "32" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "133:3:84" - }, - "nodeType": "YulFunctionCall", - "src": "133:18:84" - }, - "variableNames": [ - { - "name": "tail", - "nodeType": "YulIdentifier", - "src": "125:4:84" - } - ] - }, - { - "expression": { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "167:9:84" - }, - { - "arguments": [ - { - "name": "value0", - "nodeType": "YulIdentifier", - "src": "182:6:84" - }, - { - "arguments": [ - { - "arguments": [ - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "198:3:84", - "type": "", - "value": "160" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "203:1:84", - "type": "", - "value": "1" - } - ], - "functionName": { - "name": "shl", - "nodeType": "YulIdentifier", - "src": "194:3:84" - }, - "nodeType": "YulFunctionCall", - "src": "194:11:84" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "207:1:84", - "type": "", - "value": "1" - } - ], - "functionName": { - "name": "sub", - "nodeType": "YulIdentifier", - "src": "190:3:84" - }, - "nodeType": "YulFunctionCall", - "src": "190:19:84" - } - ], - "functionName": { - "name": "and", - "nodeType": "YulIdentifier", - "src": "178:3:84" - }, - "nodeType": "YulFunctionCall", - "src": "178:32:84" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "160:6:84" - }, - "nodeType": "YulFunctionCall", - "src": "160:51:84" - }, - "nodeType": "YulExpressionStatement", - "src": "160:51:84" - } - ] - }, - "name": "abi_encode_tuple_t_address__to_t_address__fromStack_reversed", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "headStart", - "nodeType": "YulTypedName", - "src": "84:9:84", - "type": "" - }, - { - "name": "value0", - "nodeType": "YulTypedName", - "src": "95:6:84", - "type": "" - } - ], - "returnVariables": [ - { - "name": "tail", - "nodeType": "YulTypedName", - "src": "106:4:84", - "type": "" - } - ], - "src": "14:203:84" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "254:95:84", - "statements": [ - { - "expression": { - "arguments": [ - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "271:1:84", - "type": "", - "value": "0" - }, - { - "arguments": [ - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "278:3:84", - "type": "", - "value": "224" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "283:10:84", - "type": "", - "value": "0x4e487b71" - } - ], - "functionName": { - "name": "shl", - "nodeType": "YulIdentifier", - "src": "274:3:84" - }, - "nodeType": "YulFunctionCall", - "src": "274:20:84" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "264:6:84" - }, - "nodeType": "YulFunctionCall", - "src": "264:31:84" - }, - "nodeType": "YulExpressionStatement", - "src": "264:31:84" - }, - { - "expression": { - "arguments": [ - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "311:1:84", - "type": "", - "value": "4" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "314:4:84", - "type": "", - "value": "0x41" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "304:6:84" - }, - "nodeType": "YulFunctionCall", - "src": "304:15:84" - }, - "nodeType": "YulExpressionStatement", - "src": "304:15:84" - }, - { - "expression": { - "arguments": [ - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "335:1:84", - "type": "", - "value": "0" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "338:4:84", - "type": "", - "value": "0x24" - } - ], - "functionName": { - "name": "revert", - "nodeType": "YulIdentifier", - "src": "328:6:84" - }, - "nodeType": "YulFunctionCall", - "src": "328:15:84" - }, - "nodeType": "YulExpressionStatement", - "src": "328:15:84" - } - ] - }, - "name": "panic_error_0x41", - "nodeType": "YulFunctionDefinition", - "src": "222:127:84" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "450:999:84", - "statements": [ - { - "body": { - "nodeType": "YulBlock", - "src": "496:16:84", - "statements": [ - { - "expression": { - "arguments": [ - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "505:1:84", - "type": "", - "value": "0" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "508:1:84", - "type": "", - "value": "0" - } - ], - "functionName": { - "name": "revert", - "nodeType": "YulIdentifier", - "src": "498:6:84" - }, - "nodeType": "YulFunctionCall", - "src": "498:12:84" - }, - "nodeType": "YulExpressionStatement", - "src": "498:12:84" - } - ] - }, - "condition": { - "arguments": [ - { - "arguments": [ - { - "name": "dataEnd", - "nodeType": "YulIdentifier", - "src": "471:7:84" - }, - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "480:9:84" - } - ], - "functionName": { - "name": "sub", - "nodeType": "YulIdentifier", - "src": "467:3:84" - }, - "nodeType": "YulFunctionCall", - "src": "467:23:84" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "492:2:84", - "type": "", - "value": "64" - } - ], - "functionName": { - "name": "slt", - "nodeType": "YulIdentifier", - "src": "463:3:84" - }, - "nodeType": "YulFunctionCall", - "src": "463:32:84" - }, - "nodeType": "YulIf", - "src": "460:52:84" - }, - { - "nodeType": "YulVariableDeclaration", - "src": "521:36:84", - "value": { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "547:9:84" - } - ], - "functionName": { - "name": "calldataload", - "nodeType": "YulIdentifier", - "src": "534:12:84" - }, - "nodeType": "YulFunctionCall", - "src": "534:23:84" - }, - "variables": [ - { - "name": "value", - "nodeType": "YulTypedName", - "src": "525:5:84", - "type": "" - } - ] - }, - { - "body": { - "nodeType": "YulBlock", - "src": "620:16:84", - "statements": [ - { - "expression": { - "arguments": [ - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "629:1:84", - "type": "", - "value": "0" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "632:1:84", - "type": "", - "value": "0" - } - ], - "functionName": { - "name": "revert", - "nodeType": "YulIdentifier", - "src": "622:6:84" - }, - "nodeType": "YulFunctionCall", - "src": "622:12:84" - }, - "nodeType": "YulExpressionStatement", - "src": "622:12:84" - } - ] - }, - "condition": { - "arguments": [ - { - "arguments": [ - { - "name": "value", - "nodeType": "YulIdentifier", - "src": "579:5:84" - }, - { - "arguments": [ - { - "name": "value", - "nodeType": "YulIdentifier", - "src": "590:5:84" - }, - { - "arguments": [ - { - "arguments": [ - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "605:3:84", - "type": "", - "value": "160" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "610:1:84", - "type": "", - "value": "1" - } - ], - "functionName": { - "name": "shl", - "nodeType": "YulIdentifier", - "src": "601:3:84" - }, - "nodeType": "YulFunctionCall", - "src": "601:11:84" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "614:1:84", - "type": "", - "value": "1" - } - ], - "functionName": { - "name": "sub", - "nodeType": "YulIdentifier", - "src": "597:3:84" - }, - "nodeType": "YulFunctionCall", - "src": "597:19:84" - } - ], - "functionName": { - "name": "and", - "nodeType": "YulIdentifier", - "src": "586:3:84" - }, - "nodeType": "YulFunctionCall", - "src": "586:31:84" - } - ], - "functionName": { - "name": "eq", - "nodeType": "YulIdentifier", - "src": "576:2:84" - }, - "nodeType": "YulFunctionCall", - "src": "576:42:84" - } - ], - "functionName": { - "name": "iszero", - "nodeType": "YulIdentifier", - "src": "569:6:84" - }, - "nodeType": "YulFunctionCall", - "src": "569:50:84" - }, - "nodeType": "YulIf", - "src": "566:70:84" - }, - { - "nodeType": "YulAssignment", - "src": "645:15:84", - "value": { - "name": "value", - "nodeType": "YulIdentifier", - "src": "655:5:84" - }, - "variableNames": [ - { - "name": "value0", - "nodeType": "YulIdentifier", - "src": "645:6:84" - } - ] - }, - { - "nodeType": "YulVariableDeclaration", - "src": "669:46:84", - "value": { - "arguments": [ - { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "700:9:84" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "711:2:84", - "type": "", - "value": "32" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "696:3:84" - }, - "nodeType": "YulFunctionCall", - "src": "696:18:84" - } - ], - "functionName": { - "name": "calldataload", - "nodeType": "YulIdentifier", - "src": "683:12:84" - }, - "nodeType": "YulFunctionCall", - "src": "683:32:84" - }, - "variables": [ - { - "name": "offset", - "nodeType": "YulTypedName", - "src": "673:6:84", - "type": "" - } - ] - }, - { - "nodeType": "YulVariableDeclaration", - "src": "724:28:84", - "value": { - "kind": "number", - "nodeType": "YulLiteral", - "src": "734:18:84", - "type": "", - "value": "0xffffffffffffffff" - }, - "variables": [ - { - "name": "_1", - "nodeType": "YulTypedName", - "src": "728:2:84", - "type": "" - } - ] - }, - { - "body": { - "nodeType": "YulBlock", - "src": "779:16:84", - "statements": [ - { - "expression": { - "arguments": [ - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "788:1:84", - "type": "", - "value": "0" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "791:1:84", - "type": "", - "value": "0" - } - ], - "functionName": { - "name": "revert", - "nodeType": "YulIdentifier", - "src": "781:6:84" - }, - "nodeType": "YulFunctionCall", - "src": "781:12:84" - }, - "nodeType": "YulExpressionStatement", - "src": "781:12:84" - } - ] - }, - "condition": { - "arguments": [ - { - "name": "offset", - "nodeType": "YulIdentifier", - "src": "767:6:84" - }, - { - "name": "_1", - "nodeType": "YulIdentifier", - "src": "775:2:84" - } - ], - "functionName": { - "name": "gt", - "nodeType": "YulIdentifier", - "src": "764:2:84" - }, - "nodeType": "YulFunctionCall", - "src": "764:14:84" - }, - "nodeType": "YulIf", - "src": "761:34:84" - }, - { - "nodeType": "YulVariableDeclaration", - "src": "804:32:84", - "value": { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "818:9:84" - }, - { - "name": "offset", - "nodeType": "YulIdentifier", - "src": "829:6:84" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "814:3:84" - }, - "nodeType": "YulFunctionCall", - "src": "814:22:84" - }, - "variables": [ - { - "name": "_2", - "nodeType": "YulTypedName", - "src": "808:2:84", - "type": "" - } - ] - }, - { - "body": { - "nodeType": "YulBlock", - "src": "884:16:84", - "statements": [ - { - "expression": { - "arguments": [ - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "893:1:84", - "type": "", - "value": "0" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "896:1:84", - "type": "", - "value": "0" - } - ], - "functionName": { - "name": "revert", - "nodeType": "YulIdentifier", - "src": "886:6:84" - }, - "nodeType": "YulFunctionCall", - "src": "886:12:84" - }, - "nodeType": "YulExpressionStatement", - "src": "886:12:84" - } - ] - }, - "condition": { - "arguments": [ - { - "arguments": [ - { - "arguments": [ - { - "name": "_2", - "nodeType": "YulIdentifier", - "src": "863:2:84" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "867:4:84", - "type": "", - "value": "0x1f" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "859:3:84" - }, - "nodeType": "YulFunctionCall", - "src": "859:13:84" - }, - { - "name": "dataEnd", - "nodeType": "YulIdentifier", - "src": "874:7:84" - } - ], - "functionName": { - "name": "slt", - "nodeType": "YulIdentifier", - "src": "855:3:84" - }, - "nodeType": "YulFunctionCall", - "src": "855:27:84" - } - ], - "functionName": { - "name": "iszero", - "nodeType": "YulIdentifier", - "src": "848:6:84" - }, - "nodeType": "YulFunctionCall", - "src": "848:35:84" - }, - "nodeType": "YulIf", - "src": "845:55:84" - }, - { - "nodeType": "YulVariableDeclaration", - "src": "909:26:84", - "value": { - "arguments": [ - { - "name": "_2", - "nodeType": "YulIdentifier", - "src": "932:2:84" - } - ], - "functionName": { - "name": "calldataload", - "nodeType": "YulIdentifier", - "src": "919:12:84" - }, - "nodeType": "YulFunctionCall", - "src": "919:16:84" - }, - "variables": [ - { - "name": "_3", - "nodeType": "YulTypedName", - "src": "913:2:84", - "type": "" - } - ] - }, - { - "body": { - "nodeType": "YulBlock", - "src": "958:22:84", - "statements": [ - { - "expression": { - "arguments": [], - "functionName": { - "name": "panic_error_0x41", - "nodeType": "YulIdentifier", - "src": "960:16:84" - }, - "nodeType": "YulFunctionCall", - "src": "960:18:84" - }, - "nodeType": "YulExpressionStatement", - "src": "960:18:84" - } - ] - }, - "condition": { - "arguments": [ - { - "name": "_3", - "nodeType": "YulIdentifier", - "src": "950:2:84" - }, - { - "name": "_1", - "nodeType": "YulIdentifier", - "src": "954:2:84" - } - ], - "functionName": { - "name": "gt", - "nodeType": "YulIdentifier", - "src": "947:2:84" - }, - "nodeType": "YulFunctionCall", - "src": "947:10:84" - }, - "nodeType": "YulIf", - "src": "944:36:84" - }, - { - "nodeType": "YulVariableDeclaration", - "src": "989:17:84", - "value": { - "arguments": [ - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "1003:2:84", - "type": "", - "value": "31" - } - ], - "functionName": { - "name": "not", - "nodeType": "YulIdentifier", - "src": "999:3:84" - }, - "nodeType": "YulFunctionCall", - "src": "999:7:84" - }, - "variables": [ - { - "name": "_4", - "nodeType": "YulTypedName", - "src": "993:2:84", - "type": "" - } - ] - }, - { - "nodeType": "YulVariableDeclaration", - "src": "1015:23:84", - "value": { - "arguments": [ - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "1035:2:84", - "type": "", - "value": "64" - } - ], - "functionName": { - "name": "mload", - "nodeType": "YulIdentifier", - "src": "1029:5:84" - }, - "nodeType": "YulFunctionCall", - "src": "1029:9:84" - }, - "variables": [ - { - "name": "memPtr", - "nodeType": "YulTypedName", - "src": "1019:6:84", - "type": "" - } - ] - }, - { - "nodeType": "YulVariableDeclaration", - "src": "1047:71:84", - "value": { - "arguments": [ - { - "name": "memPtr", - "nodeType": "YulIdentifier", - "src": "1069:6:84" - }, - { - "arguments": [ - { - "arguments": [ - { - "arguments": [ - { - "arguments": [ - { - "name": "_3", - "nodeType": "YulIdentifier", - "src": "1093:2:84" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "1097:4:84", - "type": "", - "value": "0x1f" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "1089:3:84" - }, - "nodeType": "YulFunctionCall", - "src": "1089:13:84" - }, - { - "name": "_4", - "nodeType": "YulIdentifier", - "src": "1104:2:84" - } - ], - "functionName": { - "name": "and", - "nodeType": "YulIdentifier", - "src": "1085:3:84" - }, - "nodeType": "YulFunctionCall", - "src": "1085:22:84" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "1109:2:84", - "type": "", - "value": "63" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "1081:3:84" - }, - "nodeType": "YulFunctionCall", - "src": "1081:31:84" - }, - { - "name": "_4", - "nodeType": "YulIdentifier", - "src": "1114:2:84" - } - ], - "functionName": { - "name": "and", - "nodeType": "YulIdentifier", - "src": "1077:3:84" - }, - "nodeType": "YulFunctionCall", - "src": "1077:40:84" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "1065:3:84" - }, - "nodeType": "YulFunctionCall", - "src": "1065:53:84" - }, - "variables": [ - { - "name": "newFreePtr", - "nodeType": "YulTypedName", - "src": "1051:10:84", - "type": "" - } - ] - }, - { - "body": { - "nodeType": "YulBlock", - "src": "1177:22:84", - "statements": [ - { - "expression": { - "arguments": [], - "functionName": { - "name": "panic_error_0x41", - "nodeType": "YulIdentifier", - "src": "1179:16:84" - }, - "nodeType": "YulFunctionCall", - "src": "1179:18:84" - }, - "nodeType": "YulExpressionStatement", - "src": "1179:18:84" - } - ] - }, - "condition": { - "arguments": [ - { - "arguments": [ - { - "name": "newFreePtr", - "nodeType": "YulIdentifier", - "src": "1136:10:84" - }, - { - "name": "_1", - "nodeType": "YulIdentifier", - "src": "1148:2:84" - } - ], - "functionName": { - "name": "gt", - "nodeType": "YulIdentifier", - "src": "1133:2:84" - }, - "nodeType": "YulFunctionCall", - "src": "1133:18:84" - }, - { - "arguments": [ - { - "name": "newFreePtr", - "nodeType": "YulIdentifier", - "src": "1156:10:84" - }, - { - "name": "memPtr", - "nodeType": "YulIdentifier", - "src": "1168:6:84" - } - ], - "functionName": { - "name": "lt", - "nodeType": "YulIdentifier", - "src": "1153:2:84" - }, - "nodeType": "YulFunctionCall", - "src": "1153:22:84" - } - ], - "functionName": { - "name": "or", - "nodeType": "YulIdentifier", - "src": "1130:2:84" - }, - "nodeType": "YulFunctionCall", - "src": "1130:46:84" - }, - "nodeType": "YulIf", - "src": "1127:72:84" - }, - { - "expression": { - "arguments": [ - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "1215:2:84", - "type": "", - "value": "64" - }, - { - "name": "newFreePtr", - "nodeType": "YulIdentifier", - "src": "1219:10:84" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "1208:6:84" - }, - "nodeType": "YulFunctionCall", - "src": "1208:22:84" - }, - "nodeType": "YulExpressionStatement", - "src": "1208:22:84" - }, - { - "expression": { - "arguments": [ - { - "name": "memPtr", - "nodeType": "YulIdentifier", - "src": "1246:6:84" - }, - { - "name": "_3", - "nodeType": "YulIdentifier", - "src": "1254:2:84" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "1239:6:84" - }, - "nodeType": "YulFunctionCall", - "src": "1239:18:84" - }, - "nodeType": "YulExpressionStatement", - "src": "1239:18:84" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "1303:16:84", - "statements": [ - { - "expression": { - "arguments": [ - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "1312:1:84", - "type": "", - "value": "0" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "1315:1:84", - "type": "", - "value": "0" - } - ], - "functionName": { - "name": "revert", - "nodeType": "YulIdentifier", - "src": "1305:6:84" - }, - "nodeType": "YulFunctionCall", - "src": "1305:12:84" - }, - "nodeType": "YulExpressionStatement", - "src": "1305:12:84" - } - ] - }, - "condition": { - "arguments": [ - { - "arguments": [ - { - "arguments": [ - { - "name": "_2", - "nodeType": "YulIdentifier", - "src": "1280:2:84" - }, - { - "name": "_3", - "nodeType": "YulIdentifier", - "src": "1284:2:84" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "1276:3:84" - }, - "nodeType": "YulFunctionCall", - "src": "1276:11:84" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "1289:2:84", - "type": "", - "value": "32" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "1272:3:84" - }, - "nodeType": "YulFunctionCall", - "src": "1272:20:84" - }, - { - "name": "dataEnd", - "nodeType": "YulIdentifier", - "src": "1294:7:84" - } - ], - "functionName": { - "name": "gt", - "nodeType": "YulIdentifier", - "src": "1269:2:84" - }, - "nodeType": "YulFunctionCall", - "src": "1269:33:84" - }, - "nodeType": "YulIf", - "src": "1266:53:84" - }, - { - "expression": { - "arguments": [ - { - "arguments": [ - { - "name": "memPtr", - "nodeType": "YulIdentifier", - "src": "1345:6:84" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "1353:2:84", - "type": "", - "value": "32" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "1341:3:84" - }, - "nodeType": "YulFunctionCall", - "src": "1341:15:84" - }, - { - "arguments": [ - { - "name": "_2", - "nodeType": "YulIdentifier", - "src": "1362:2:84" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "1366:2:84", - "type": "", - "value": "32" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "1358:3:84" - }, - "nodeType": "YulFunctionCall", - "src": "1358:11:84" - }, - { - "name": "_3", - "nodeType": "YulIdentifier", - "src": "1371:2:84" - } - ], - "functionName": { - "name": "calldatacopy", - "nodeType": "YulIdentifier", - "src": "1328:12:84" - }, - "nodeType": "YulFunctionCall", - "src": "1328:46:84" - }, - "nodeType": "YulExpressionStatement", - "src": "1328:46:84" - }, - { - "expression": { - "arguments": [ - { - "arguments": [ - { - "arguments": [ - { - "name": "memPtr", - "nodeType": "YulIdentifier", - "src": "1398:6:84" - }, - { - "name": "_3", - "nodeType": "YulIdentifier", - "src": "1406:2:84" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "1394:3:84" - }, - "nodeType": "YulFunctionCall", - "src": "1394:15:84" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "1411:2:84", - "type": "", - "value": "32" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "1390:3:84" - }, - "nodeType": "YulFunctionCall", - "src": "1390:24:84" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "1416:1:84", - "type": "", - "value": "0" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "1383:6:84" - }, - "nodeType": "YulFunctionCall", - "src": "1383:35:84" - }, - "nodeType": "YulExpressionStatement", - "src": "1383:35:84" - }, - { - "nodeType": "YulAssignment", - "src": "1427:16:84", - "value": { - "name": "memPtr", - "nodeType": "YulIdentifier", - "src": "1437:6:84" - }, - "variableNames": [ - { - "name": "value1", - "nodeType": "YulIdentifier", - "src": "1427:6:84" - } - ] - } - ] - }, - "name": "abi_decode_tuple_t_addresst_bytes_memory_ptr", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "headStart", - "nodeType": "YulTypedName", - "src": "408:9:84", - "type": "" - }, - { - "name": "dataEnd", - "nodeType": "YulTypedName", - "src": "419:7:84", - "type": "" - } - ], - "returnVariables": [ - { - "name": "value0", - "nodeType": "YulTypedName", - "src": "431:6:84", - "type": "" - }, - { - "name": "value1", - "nodeType": "YulTypedName", - "src": "439:6:84", - "type": "" - } - ], - "src": "354:1095:84" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "1549:92:84", - "statements": [ - { - "nodeType": "YulAssignment", - "src": "1559:26:84", - "value": { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "1571:9:84" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "1582:2:84", - "type": "", - "value": "32" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "1567:3:84" - }, - "nodeType": "YulFunctionCall", - "src": "1567:18:84" - }, - "variableNames": [ - { - "name": "tail", - "nodeType": "YulIdentifier", - "src": "1559:4:84" - } - ] - }, - { - "expression": { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "1601:9:84" - }, - { - "arguments": [ - { - "arguments": [ - { - "name": "value0", - "nodeType": "YulIdentifier", - "src": "1626:6:84" - } - ], - "functionName": { - "name": "iszero", - "nodeType": "YulIdentifier", - "src": "1619:6:84" - }, - "nodeType": "YulFunctionCall", - "src": "1619:14:84" - } - ], - "functionName": { - "name": "iszero", - "nodeType": "YulIdentifier", - "src": "1612:6:84" - }, - "nodeType": "YulFunctionCall", - "src": "1612:22:84" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "1594:6:84" - }, - "nodeType": "YulFunctionCall", - "src": "1594:41:84" - }, - "nodeType": "YulExpressionStatement", - "src": "1594:41:84" - } - ] - }, - "name": "abi_encode_tuple_t_bool__to_t_bool__fromStack_reversed", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "headStart", - "nodeType": "YulTypedName", - "src": "1518:9:84", - "type": "" - }, - { - "name": "value0", - "nodeType": "YulTypedName", - "src": "1529:6:84", - "type": "" - } - ], - "returnVariables": [ - { - "name": "tail", - "nodeType": "YulTypedName", - "src": "1540:4:84", - "type": "" - } - ], - "src": "1454:187:84" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "1820:182:84", - "statements": [ - { - "expression": { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "1837:9:84" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "1848:2:84", - "type": "", - "value": "32" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "1830:6:84" - }, - "nodeType": "YulFunctionCall", - "src": "1830:21:84" - }, - "nodeType": "YulExpressionStatement", - "src": "1830:21:84" - }, - { - "expression": { - "arguments": [ - { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "1871:9:84" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "1882:2:84", - "type": "", - "value": "32" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "1867:3:84" - }, - "nodeType": "YulFunctionCall", - "src": "1867:18:84" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "1887:2:84", - "type": "", - "value": "32" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "1860:6:84" - }, - "nodeType": "YulFunctionCall", - "src": "1860:30:84" - }, - "nodeType": "YulExpressionStatement", - "src": "1860:30:84" - }, - { - "expression": { - "arguments": [ - { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "1910:9:84" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "1921:2:84", - "type": "", - "value": "64" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "1906:3:84" - }, - "nodeType": "YulFunctionCall", - "src": "1906:18:84" - }, - { - "hexValue": "5769746e657450726f78793a206e756c6c20696d706c656d656e746174696f6e", - "kind": "string", - "nodeType": "YulLiteral", - "src": "1926:34:84", - "type": "", - "value": "WitnetProxy: null implementation" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "1899:6:84" - }, - "nodeType": "YulFunctionCall", - "src": "1899:62:84" - }, - "nodeType": "YulExpressionStatement", - "src": "1899:62:84" - }, - { - "nodeType": "YulAssignment", - "src": "1970:26:84", - "value": { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "1982:9:84" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "1993:2:84", - "type": "", - "value": "96" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "1978:3:84" - }, - "nodeType": "YulFunctionCall", - "src": "1978:18:84" - }, - "variableNames": [ - { - "name": "tail", - "nodeType": "YulIdentifier", - "src": "1970:4:84" - } - ] - } - ] - }, - "name": "abi_encode_tuple_t_stringliteral_d599eaa5e68d91d75c142446490ab9a15fd0284a41ce949219b5b4d8f267239a__to_t_string_memory_ptr__fromStack_reversed", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "headStart", - "nodeType": "YulTypedName", - "src": "1797:9:84", - "type": "" - } - ], - "returnVariables": [ - { - "name": "tail", - "nodeType": "YulTypedName", - "src": "1811:4:84", - "type": "" - } - ], - "src": "1646:356:84" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "2181:181:84", - "statements": [ - { - "expression": { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "2198:9:84" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "2209:2:84", - "type": "", - "value": "32" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "2191:6:84" - }, - "nodeType": "YulFunctionCall", - "src": "2191:21:84" - }, - "nodeType": "YulExpressionStatement", - "src": "2191:21:84" - }, - { - "expression": { - "arguments": [ - { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "2232:9:84" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "2243:2:84", - "type": "", - "value": "32" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "2228:3:84" - }, - "nodeType": "YulFunctionCall", - "src": "2228:18:84" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "2248:2:84", - "type": "", - "value": "31" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "2221:6:84" - }, - "nodeType": "YulFunctionCall", - "src": "2221:30:84" - }, - "nodeType": "YulExpressionStatement", - "src": "2221:30:84" - }, - { - "expression": { - "arguments": [ - { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "2271:9:84" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "2282:2:84", - "type": "", - "value": "64" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "2267:3:84" - }, - "nodeType": "YulFunctionCall", - "src": "2267:18:84" - }, - { - "hexValue": "5769746e657450726f78793a206e6f7468696e6720746f2075706772616465", - "kind": "string", - "nodeType": "YulLiteral", - "src": "2287:33:84", - "type": "", - "value": "WitnetProxy: nothing to upgrade" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "2260:6:84" - }, - "nodeType": "YulFunctionCall", - "src": "2260:61:84" - }, - "nodeType": "YulExpressionStatement", - "src": "2260:61:84" - }, - { - "nodeType": "YulAssignment", - "src": "2330:26:84", - "value": { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "2342:9:84" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "2353:2:84", - "type": "", - "value": "96" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "2338:3:84" - }, - "nodeType": "YulFunctionCall", - "src": "2338:18:84" - }, - "variableNames": [ - { - "name": "tail", - "nodeType": "YulIdentifier", - "src": "2330:4:84" - } - ] - } - ] - }, - "name": "abi_encode_tuple_t_stringliteral_e332eab1bae45430d1201a30c0d80d8fcb5570f9e70201a9eb7b229e17fd2084__to_t_string_memory_ptr__fromStack_reversed", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "headStart", - "nodeType": "YulTypedName", - "src": "2158:9:84", - "type": "" - } - ], - "returnVariables": [ - { - "name": "tail", - "nodeType": "YulTypedName", - "src": "2172:4:84", - "type": "" - } - ], - "src": "2007:355:84" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "2445:199:84", - "statements": [ - { - "body": { - "nodeType": "YulBlock", - "src": "2491:16:84", - "statements": [ - { - "expression": { - "arguments": [ - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "2500:1:84", - "type": "", - "value": "0" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "2503:1:84", - "type": "", - "value": "0" - } - ], - "functionName": { - "name": "revert", - "nodeType": "YulIdentifier", - "src": "2493:6:84" - }, - "nodeType": "YulFunctionCall", - "src": "2493:12:84" - }, - "nodeType": "YulExpressionStatement", - "src": "2493:12:84" - } - ] - }, - "condition": { - "arguments": [ - { - "arguments": [ - { - "name": "dataEnd", - "nodeType": "YulIdentifier", - "src": "2466:7:84" - }, - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "2475:9:84" - } - ], - "functionName": { - "name": "sub", - "nodeType": "YulIdentifier", - "src": "2462:3:84" - }, - "nodeType": "YulFunctionCall", - "src": "2462:23:84" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "2487:2:84", - "type": "", - "value": "32" - } - ], - "functionName": { - "name": "slt", - "nodeType": "YulIdentifier", - "src": "2458:3:84" - }, - "nodeType": "YulFunctionCall", - "src": "2458:32:84" - }, - "nodeType": "YulIf", - "src": "2455:52:84" - }, - { - "nodeType": "YulVariableDeclaration", - "src": "2516:29:84", - "value": { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "2535:9:84" - } - ], - "functionName": { - "name": "mload", - "nodeType": "YulIdentifier", - "src": "2529:5:84" - }, - "nodeType": "YulFunctionCall", - "src": "2529:16:84" - }, - "variables": [ - { - "name": "value", - "nodeType": "YulTypedName", - "src": "2520:5:84", - "type": "" - } - ] - }, - { - "body": { - "nodeType": "YulBlock", - "src": "2598:16:84", - "statements": [ - { - "expression": { - "arguments": [ - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "2607:1:84", - "type": "", - "value": "0" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "2610:1:84", - "type": "", - "value": "0" - } - ], - "functionName": { - "name": "revert", - "nodeType": "YulIdentifier", - "src": "2600:6:84" - }, - "nodeType": "YulFunctionCall", - "src": "2600:12:84" - }, - "nodeType": "YulExpressionStatement", - "src": "2600:12:84" - } - ] - }, - "condition": { - "arguments": [ - { - "arguments": [ - { - "name": "value", - "nodeType": "YulIdentifier", - "src": "2567:5:84" - }, - { - "arguments": [ - { - "arguments": [ - { - "name": "value", - "nodeType": "YulIdentifier", - "src": "2588:5:84" - } - ], - "functionName": { - "name": "iszero", - "nodeType": "YulIdentifier", - "src": "2581:6:84" - }, - "nodeType": "YulFunctionCall", - "src": "2581:13:84" - } - ], - "functionName": { - "name": "iszero", - "nodeType": "YulIdentifier", - "src": "2574:6:84" - }, - "nodeType": "YulFunctionCall", - "src": "2574:21:84" - } - ], - "functionName": { - "name": "eq", - "nodeType": "YulIdentifier", - "src": "2564:2:84" - }, - "nodeType": "YulFunctionCall", - "src": "2564:32:84" - } - ], - "functionName": { - "name": "iszero", - "nodeType": "YulIdentifier", - "src": "2557:6:84" - }, - "nodeType": "YulFunctionCall", - "src": "2557:40:84" - }, - "nodeType": "YulIf", - "src": "2554:60:84" - }, - { - "nodeType": "YulAssignment", - "src": "2623:15:84", - "value": { - "name": "value", - "nodeType": "YulIdentifier", - "src": "2633:5:84" - }, - "variableNames": [ - { - "name": "value0", - "nodeType": "YulIdentifier", - "src": "2623:6:84" - } - ] - } - ] - }, - "name": "abi_decode_tuple_t_bool_fromMemory", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "headStart", - "nodeType": "YulTypedName", - "src": "2411:9:84", - "type": "" - }, - { - "name": "dataEnd", - "nodeType": "YulTypedName", - "src": "2422:7:84", - "type": "" - } - ], - "returnVariables": [ - { - "name": "value0", - "nodeType": "YulTypedName", - "src": "2434:6:84", - "type": "" - } - ], - "src": "2367:277:84" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "2823:232:84", - "statements": [ - { - "expression": { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "2840:9:84" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "2851:2:84", - "type": "", - "value": "32" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "2833:6:84" - }, - "nodeType": "YulFunctionCall", - "src": "2833:21:84" - }, - "nodeType": "YulExpressionStatement", - "src": "2833:21:84" - }, - { - "expression": { - "arguments": [ - { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "2874:9:84" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "2885:2:84", - "type": "", - "value": "32" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "2870:3:84" - }, - "nodeType": "YulFunctionCall", - "src": "2870:18:84" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "2890:2:84", - "type": "", - "value": "42" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "2863:6:84" - }, - "nodeType": "YulFunctionCall", - "src": "2863:30:84" - }, - "nodeType": "YulExpressionStatement", - "src": "2863:30:84" - }, - { - "expression": { - "arguments": [ - { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "2913:9:84" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "2924:2:84", - "type": "", - "value": "64" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "2909:3:84" - }, - "nodeType": "YulFunctionCall", - "src": "2909:18:84" - }, - { - "hexValue": "5769746e657450726f78793a20756e61626c6520746f20636865636b20757067", - "kind": "string", - "nodeType": "YulLiteral", - "src": "2929:34:84", - "type": "", - "value": "WitnetProxy: unable to check upg" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "2902:6:84" - }, - "nodeType": "YulFunctionCall", - "src": "2902:62:84" - }, - "nodeType": "YulExpressionStatement", - "src": "2902:62:84" - }, - { - "expression": { - "arguments": [ - { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "2984:9:84" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "2995:2:84", - "type": "", - "value": "96" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "2980:3:84" - }, - "nodeType": "YulFunctionCall", - "src": "2980:18:84" - }, - { - "hexValue": "7261646162696c697479", - "kind": "string", - "nodeType": "YulLiteral", - "src": "3000:12:84", - "type": "", - "value": "radability" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "2973:6:84" - }, - "nodeType": "YulFunctionCall", - "src": "2973:40:84" - }, - "nodeType": "YulExpressionStatement", - "src": "2973:40:84" - }, - { - "nodeType": "YulAssignment", - "src": "3022:27:84", - "value": { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "3034:9:84" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "3045:3:84", - "type": "", - "value": "128" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "3030:3:84" - }, - "nodeType": "YulFunctionCall", - "src": "3030:19:84" - }, - "variableNames": [ - { - "name": "tail", - "nodeType": "YulIdentifier", - "src": "3022:4:84" - } - ] - } - ] - }, - "name": "abi_encode_tuple_t_stringliteral_7f859058ad3ee4e192700ff813ed67dc892a0c7de91510ee584a0ac25fc982fc__to_t_string_memory_ptr__fromStack_reversed", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "headStart", - "nodeType": "YulTypedName", - "src": "2800:9:84", - "type": "" - } - ], - "returnVariables": [ - { - "name": "tail", - "nodeType": "YulTypedName", - "src": "2814:4:84", - "type": "" - } - ], - "src": "2649:406:84" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "3234:177:84", - "statements": [ - { - "expression": { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "3251:9:84" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "3262:2:84", - "type": "", - "value": "32" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "3244:6:84" - }, - "nodeType": "YulFunctionCall", - "src": "3244:21:84" - }, - "nodeType": "YulExpressionStatement", - "src": "3244:21:84" - }, - { - "expression": { - "arguments": [ - { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "3285:9:84" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "3296:2:84", - "type": "", - "value": "32" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "3281:3:84" - }, - "nodeType": "YulFunctionCall", - "src": "3281:18:84" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "3301:2:84", - "type": "", - "value": "27" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "3274:6:84" - }, - "nodeType": "YulFunctionCall", - "src": "3274:30:84" - }, - "nodeType": "YulExpressionStatement", - "src": "3274:30:84" - }, - { - "expression": { - "arguments": [ - { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "3324:9:84" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "3335:2:84", - "type": "", - "value": "64" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "3320:3:84" - }, - "nodeType": "YulFunctionCall", - "src": "3320:18:84" - }, - { - "hexValue": "5769746e657450726f78793a206e6f742075706772616461626c65", - "kind": "string", - "nodeType": "YulLiteral", - "src": "3340:29:84", - "type": "", - "value": "WitnetProxy: not upgradable" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "3313:6:84" - }, - "nodeType": "YulFunctionCall", - "src": "3313:57:84" - }, - "nodeType": "YulExpressionStatement", - "src": "3313:57:84" - }, - { - "nodeType": "YulAssignment", - "src": "3379:26:84", - "value": { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "3391:9:84" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "3402:2:84", - "type": "", - "value": "96" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "3387:3:84" - }, - "nodeType": "YulFunctionCall", - "src": "3387:18:84" - }, - "variableNames": [ - { - "name": "tail", - "nodeType": "YulIdentifier", - "src": "3379:4:84" - } - ] - } - ] - }, - "name": "abi_encode_tuple_t_stringliteral_d96132834a96bae5cb2f32cb07f13985dcde0f2358055c198eb3065af6c5aa7f__to_t_string_memory_ptr__fromStack_reversed", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "headStart", - "nodeType": "YulTypedName", - "src": "3211:9:84", - "type": "" - } - ], - "returnVariables": [ - { - "name": "tail", - "nodeType": "YulTypedName", - "src": "3225:4:84", - "type": "" - } - ], - "src": "3060:351:84" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "3482:184:84", - "statements": [ - { - "nodeType": "YulVariableDeclaration", - "src": "3492:10:84", - "value": { - "kind": "number", - "nodeType": "YulLiteral", - "src": "3501:1:84", - "type": "", - "value": "0" - }, - "variables": [ - { - "name": "i", - "nodeType": "YulTypedName", - "src": "3496:1:84", - "type": "" - } - ] - }, - { - "body": { - "nodeType": "YulBlock", - "src": "3561:63:84", - "statements": [ - { - "expression": { - "arguments": [ - { - "arguments": [ - { - "name": "dst", - "nodeType": "YulIdentifier", - "src": "3586:3:84" - }, - { - "name": "i", - "nodeType": "YulIdentifier", - "src": "3591:1:84" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "3582:3:84" - }, - "nodeType": "YulFunctionCall", - "src": "3582:11:84" - }, - { - "arguments": [ - { - "arguments": [ - { - "name": "src", - "nodeType": "YulIdentifier", - "src": "3605:3:84" - }, - { - "name": "i", - "nodeType": "YulIdentifier", - "src": "3610:1:84" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "3601:3:84" - }, - "nodeType": "YulFunctionCall", - "src": "3601:11:84" - } - ], - "functionName": { - "name": "mload", - "nodeType": "YulIdentifier", - "src": "3595:5:84" - }, - "nodeType": "YulFunctionCall", - "src": "3595:18:84" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "3575:6:84" - }, - "nodeType": "YulFunctionCall", - "src": "3575:39:84" - }, - "nodeType": "YulExpressionStatement", - "src": "3575:39:84" - } - ] - }, - "condition": { - "arguments": [ - { - "name": "i", - "nodeType": "YulIdentifier", - "src": "3522:1:84" - }, - { - "name": "length", - "nodeType": "YulIdentifier", - "src": "3525:6:84" - } - ], - "functionName": { - "name": "lt", - "nodeType": "YulIdentifier", - "src": "3519:2:84" - }, - "nodeType": "YulFunctionCall", - "src": "3519:13:84" - }, - "nodeType": "YulForLoop", - "post": { - "nodeType": "YulBlock", - "src": "3533:19:84", - "statements": [ - { - "nodeType": "YulAssignment", - "src": "3535:15:84", - "value": { - "arguments": [ - { - "name": "i", - "nodeType": "YulIdentifier", - "src": "3544:1:84" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "3547:2:84", - "type": "", - "value": "32" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "3540:3:84" - }, - "nodeType": "YulFunctionCall", - "src": "3540:10:84" - }, - "variableNames": [ - { - "name": "i", - "nodeType": "YulIdentifier", - "src": "3535:1:84" - } - ] - } - ] - }, - "pre": { - "nodeType": "YulBlock", - "src": "3515:3:84", - "statements": [] - }, - "src": "3511:113:84" - }, - { - "expression": { - "arguments": [ - { - "arguments": [ - { - "name": "dst", - "nodeType": "YulIdentifier", - "src": "3644:3:84" - }, - { - "name": "length", - "nodeType": "YulIdentifier", - "src": "3649:6:84" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "3640:3:84" - }, - "nodeType": "YulFunctionCall", - "src": "3640:16:84" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "3658:1:84", - "type": "", - "value": "0" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "3633:6:84" - }, - "nodeType": "YulFunctionCall", - "src": "3633:27:84" - }, - "nodeType": "YulExpressionStatement", - "src": "3633:27:84" - } - ] - }, - "name": "copy_memory_to_memory_with_cleanup", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "src", - "nodeType": "YulTypedName", - "src": "3460:3:84", - "type": "" - }, - { - "name": "dst", - "nodeType": "YulTypedName", - "src": "3465:3:84", - "type": "" - }, - { - "name": "length", - "nodeType": "YulTypedName", - "src": "3470:6:84", - "type": "" - } - ], - "src": "3416:250:84" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "3808:150:84", - "statements": [ - { - "nodeType": "YulVariableDeclaration", - "src": "3818:27:84", - "value": { - "arguments": [ - { - "name": "value0", - "nodeType": "YulIdentifier", - "src": "3838:6:84" - } - ], - "functionName": { - "name": "mload", - "nodeType": "YulIdentifier", - "src": "3832:5:84" - }, - "nodeType": "YulFunctionCall", - "src": "3832:13:84" - }, - "variables": [ - { - "name": "length", - "nodeType": "YulTypedName", - "src": "3822:6:84", - "type": "" - } - ] - }, - { - "expression": { - "arguments": [ - { - "arguments": [ - { - "name": "value0", - "nodeType": "YulIdentifier", - "src": "3893:6:84" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "3901:4:84", - "type": "", - "value": "0x20" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "3889:3:84" - }, - "nodeType": "YulFunctionCall", - "src": "3889:17:84" - }, - { - "name": "pos", - "nodeType": "YulIdentifier", - "src": "3908:3:84" - }, - { - "name": "length", - "nodeType": "YulIdentifier", - "src": "3913:6:84" - } - ], - "functionName": { - "name": "copy_memory_to_memory_with_cleanup", - "nodeType": "YulIdentifier", - "src": "3854:34:84" - }, - "nodeType": "YulFunctionCall", - "src": "3854:66:84" - }, - "nodeType": "YulExpressionStatement", - "src": "3854:66:84" - }, - { - "nodeType": "YulAssignment", - "src": "3929:23:84", - "value": { - "arguments": [ - { - "name": "pos", - "nodeType": "YulIdentifier", - "src": "3940:3:84" - }, - { - "name": "length", - "nodeType": "YulIdentifier", - "src": "3945:6:84" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "3936:3:84" - }, - "nodeType": "YulFunctionCall", - "src": "3936:16:84" - }, - "variableNames": [ - { - "name": "end", - "nodeType": "YulIdentifier", - "src": "3929:3:84" - } - ] - } - ] - }, - "name": "abi_encode_tuple_packed_t_bytes_memory_ptr__to_t_bytes_memory_ptr__nonPadded_inplace_fromStack_reversed", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "pos", - "nodeType": "YulTypedName", - "src": "3784:3:84", - "type": "" - }, - { - "name": "value0", - "nodeType": "YulTypedName", - "src": "3789:6:84", - "type": "" - } - ], - "returnVariables": [ - { - "name": "end", - "nodeType": "YulTypedName", - "src": "3800:3:84", - "type": "" - } - ], - "src": "3671:287:84" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "4137:176:84", - "statements": [ - { - "expression": { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "4154:9:84" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "4165:2:84", - "type": "", - "value": "32" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "4147:6:84" - }, - "nodeType": "YulFunctionCall", - "src": "4147:21:84" - }, - "nodeType": "YulExpressionStatement", - "src": "4147:21:84" - }, - { - "expression": { - "arguments": [ - { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "4188:9:84" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "4199:2:84", - "type": "", - "value": "32" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "4184:3:84" - }, - "nodeType": "YulFunctionCall", - "src": "4184:18:84" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "4204:2:84", - "type": "", - "value": "26" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "4177:6:84" - }, - "nodeType": "YulFunctionCall", - "src": "4177:30:84" - }, - "nodeType": "YulExpressionStatement", - "src": "4177:30:84" - }, - { - "expression": { - "arguments": [ - { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "4227:9:84" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "4238:2:84", - "type": "", - "value": "64" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "4223:3:84" - }, - "nodeType": "YulFunctionCall", - "src": "4223:18:84" - }, - { - "hexValue": "5769746e657450726f78793a206e6f7420636f6d706c69616e74", - "kind": "string", - "nodeType": "YulLiteral", - "src": "4243:28:84", - "type": "", - "value": "WitnetProxy: not compliant" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "4216:6:84" - }, - "nodeType": "YulFunctionCall", - "src": "4216:56:84" - }, - "nodeType": "YulExpressionStatement", - "src": "4216:56:84" - }, - { - "nodeType": "YulAssignment", - "src": "4281:26:84", - "value": { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "4293:9:84" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "4304:2:84", - "type": "", - "value": "96" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "4289:3:84" - }, - "nodeType": "YulFunctionCall", - "src": "4289:18:84" - }, - "variableNames": [ - { - "name": "tail", - "nodeType": "YulIdentifier", - "src": "4281:4:84" - } - ] - } - ] - }, - "name": "abi_encode_tuple_t_stringliteral_fe0c5d56f2e637bc6ae9d29f1058c00159080f3dd6202013ecdbcca6e4740a65__to_t_string_memory_ptr__fromStack_reversed", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "headStart", - "nodeType": "YulTypedName", - "src": "4114:9:84", - "type": "" - } - ], - "returnVariables": [ - { - "name": "tail", - "nodeType": "YulTypedName", - "src": "4128:4:84", - "type": "" - } - ], - "src": "3963:350:84" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "4492:177:84", - "statements": [ - { - "expression": { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "4509:9:84" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "4520:2:84", - "type": "", - "value": "32" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "4502:6:84" - }, - "nodeType": "YulFunctionCall", - "src": "4502:21:84" - }, - "nodeType": "YulExpressionStatement", - "src": "4502:21:84" - }, - { - "expression": { - "arguments": [ - { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "4543:9:84" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "4554:2:84", - "type": "", - "value": "32" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "4539:3:84" - }, - "nodeType": "YulFunctionCall", - "src": "4539:18:84" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "4559:2:84", - "type": "", - "value": "27" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "4532:6:84" - }, - "nodeType": "YulFunctionCall", - "src": "4532:30:84" - }, - "nodeType": "YulExpressionStatement", - "src": "4532:30:84" - }, - { - "expression": { - "arguments": [ - { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "4582:9:84" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "4593:2:84", - "type": "", - "value": "64" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "4578:3:84" - }, - "nodeType": "YulFunctionCall", - "src": "4578:18:84" - }, - { - "hexValue": "5769746e657450726f78793a206e6f7420617574686f72697a6564", - "kind": "string", - "nodeType": "YulLiteral", - "src": "4598:29:84", - "type": "", - "value": "WitnetProxy: not authorized" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "4571:6:84" - }, - "nodeType": "YulFunctionCall", - "src": "4571:57:84" - }, - "nodeType": "YulExpressionStatement", - "src": "4571:57:84" - }, - { - "nodeType": "YulAssignment", - "src": "4637:26:84", - "value": { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "4649:9:84" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "4660:2:84", - "type": "", - "value": "96" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "4645:3:84" - }, - "nodeType": "YulFunctionCall", - "src": "4645:18:84" - }, - "variableNames": [ - { - "name": "tail", - "nodeType": "YulIdentifier", - "src": "4637:4:84" - } - ] - } - ] - }, - "name": "abi_encode_tuple_t_stringliteral_ba8d4d661ce88eb2915ba133e6cad533938b754d7b66d8253879ef2c2193ecb2__to_t_string_memory_ptr__fromStack_reversed", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "headStart", - "nodeType": "YulTypedName", - "src": "4469:9:84", - "type": "" - } - ], - "returnVariables": [ - { - "name": "tail", - "nodeType": "YulTypedName", - "src": "4483:4:84", - "type": "" - } - ], - "src": "4318:351:84" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "4755:103:84", - "statements": [ - { - "body": { - "nodeType": "YulBlock", - "src": "4801:16:84", - "statements": [ - { - "expression": { - "arguments": [ - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "4810:1:84", - "type": "", - "value": "0" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "4813:1:84", - "type": "", - "value": "0" - } - ], - "functionName": { - "name": "revert", - "nodeType": "YulIdentifier", - "src": "4803:6:84" - }, - "nodeType": "YulFunctionCall", - "src": "4803:12:84" - }, - "nodeType": "YulExpressionStatement", - "src": "4803:12:84" - } - ] - }, - "condition": { - "arguments": [ - { - "arguments": [ - { - "name": "dataEnd", - "nodeType": "YulIdentifier", - "src": "4776:7:84" - }, - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "4785:9:84" - } - ], - "functionName": { - "name": "sub", - "nodeType": "YulIdentifier", - "src": "4772:3:84" - }, - "nodeType": "YulFunctionCall", - "src": "4772:23:84" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "4797:2:84", - "type": "", - "value": "32" - } - ], - "functionName": { - "name": "slt", - "nodeType": "YulIdentifier", - "src": "4768:3:84" - }, - "nodeType": "YulFunctionCall", - "src": "4768:32:84" - }, - "nodeType": "YulIf", - "src": "4765:52:84" - }, - { - "nodeType": "YulAssignment", - "src": "4826:26:84", - "value": { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "4842:9:84" - } - ], - "functionName": { - "name": "mload", - "nodeType": "YulIdentifier", - "src": "4836:5:84" - }, - "nodeType": "YulFunctionCall", - "src": "4836:16:84" - }, - "variableNames": [ - { - "name": "value0", - "nodeType": "YulIdentifier", - "src": "4826:6:84" - } - ] - } - ] - }, - "name": "abi_decode_tuple_t_bytes32_fromMemory", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "headStart", - "nodeType": "YulTypedName", - "src": "4721:9:84", - "type": "" - }, - { - "name": "dataEnd", - "nodeType": "YulTypedName", - "src": "4732:7:84", - "type": "" - } - ], - "returnVariables": [ - { - "name": "value0", - "nodeType": "YulTypedName", - "src": "4744:6:84", - "type": "" - } - ], - "src": "4674:184:84" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "5037:226:84", - "statements": [ - { - "expression": { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "5054:9:84" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "5065:2:84", - "type": "", - "value": "32" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "5047:6:84" - }, - "nodeType": "YulFunctionCall", - "src": "5047:21:84" - }, - "nodeType": "YulExpressionStatement", - "src": "5047:21:84" - }, - { - "expression": { - "arguments": [ - { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "5088:9:84" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "5099:2:84", - "type": "", - "value": "32" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "5084:3:84" - }, - "nodeType": "YulFunctionCall", - "src": "5084:18:84" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "5104:2:84", - "type": "", - "value": "36" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "5077:6:84" - }, - "nodeType": "YulFunctionCall", - "src": "5077:30:84" - }, - "nodeType": "YulExpressionStatement", - "src": "5077:30:84" - }, - { - "expression": { - "arguments": [ - { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "5127:9:84" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "5138:2:84", - "type": "", - "value": "64" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "5123:3:84" - }, - "nodeType": "YulFunctionCall", - "src": "5123:18:84" - }, - { - "hexValue": "5769746e657450726f78793a2070726f786961626c655555494473206d69736d", - "kind": "string", - "nodeType": "YulLiteral", - "src": "5143:34:84", - "type": "", - "value": "WitnetProxy: proxiableUUIDs mism" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "5116:6:84" - }, - "nodeType": "YulFunctionCall", - "src": "5116:62:84" - }, - "nodeType": "YulExpressionStatement", - "src": "5116:62:84" - }, - { - "expression": { - "arguments": [ - { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "5198:9:84" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "5209:2:84", - "type": "", - "value": "96" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "5194:3:84" - }, - "nodeType": "YulFunctionCall", - "src": "5194:18:84" - }, - { - "hexValue": "61746368", - "kind": "string", - "nodeType": "YulLiteral", - "src": "5214:6:84", - "type": "", - "value": "atch" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "5187:6:84" - }, - "nodeType": "YulFunctionCall", - "src": "5187:34:84" - }, - "nodeType": "YulExpressionStatement", - "src": "5187:34:84" - }, - { - "nodeType": "YulAssignment", - "src": "5230:27:84", - "value": { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "5242:9:84" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "5253:3:84", - "type": "", - "value": "128" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "5238:3:84" - }, - "nodeType": "YulFunctionCall", - "src": "5238:19:84" - }, - "variableNames": [ - { - "name": "tail", - "nodeType": "YulIdentifier", - "src": "5230:4:84" - } - ] - } - ] - }, - "name": "abi_encode_tuple_t_stringliteral_f3c1ad1fa1688d47e62cc4dd5b4be101315ef47e38e05aa3a37a4ef2e1cec0a8__to_t_string_memory_ptr__fromStack_reversed", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "headStart", - "nodeType": "YulTypedName", - "src": "5014:9:84", - "type": "" - } - ], - "returnVariables": [ - { - "name": "tail", - "nodeType": "YulTypedName", - "src": "5028:4:84", - "type": "" - } - ], - "src": "4863:400:84" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "5387:275:84", - "statements": [ - { - "expression": { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "5404:9:84" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "5415:2:84", - "type": "", - "value": "32" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "5397:6:84" - }, - "nodeType": "YulFunctionCall", - "src": "5397:21:84" - }, - "nodeType": "YulExpressionStatement", - "src": "5397:21:84" - }, - { - "nodeType": "YulVariableDeclaration", - "src": "5427:27:84", - "value": { - "arguments": [ - { - "name": "value0", - "nodeType": "YulIdentifier", - "src": "5447:6:84" - } - ], - "functionName": { - "name": "mload", - "nodeType": "YulIdentifier", - "src": "5441:5:84" - }, - "nodeType": "YulFunctionCall", - "src": "5441:13:84" - }, - "variables": [ - { - "name": "length", - "nodeType": "YulTypedName", - "src": "5431:6:84", - "type": "" - } - ] - }, - { - "expression": { - "arguments": [ - { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "5474:9:84" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "5485:2:84", - "type": "", - "value": "32" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "5470:3:84" - }, - "nodeType": "YulFunctionCall", - "src": "5470:18:84" - }, - { - "name": "length", - "nodeType": "YulIdentifier", - "src": "5490:6:84" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "5463:6:84" - }, - "nodeType": "YulFunctionCall", - "src": "5463:34:84" - }, - "nodeType": "YulExpressionStatement", - "src": "5463:34:84" - }, - { - "expression": { - "arguments": [ - { - "arguments": [ - { - "name": "value0", - "nodeType": "YulIdentifier", - "src": "5545:6:84" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "5553:2:84", - "type": "", - "value": "32" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "5541:3:84" - }, - "nodeType": "YulFunctionCall", - "src": "5541:15:84" - }, - { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "5562:9:84" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "5573:2:84", - "type": "", - "value": "64" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "5558:3:84" - }, - "nodeType": "YulFunctionCall", - "src": "5558:18:84" - }, - { - "name": "length", - "nodeType": "YulIdentifier", - "src": "5578:6:84" - } - ], - "functionName": { - "name": "copy_memory_to_memory_with_cleanup", - "nodeType": "YulIdentifier", - "src": "5506:34:84" - }, - "nodeType": "YulFunctionCall", - "src": "5506:79:84" - }, - "nodeType": "YulExpressionStatement", - "src": "5506:79:84" - }, - { - "nodeType": "YulAssignment", - "src": "5594:62:84", - "value": { - "arguments": [ - { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "5610:9:84" - }, - { - "arguments": [ - { - "arguments": [ - { - "name": "length", - "nodeType": "YulIdentifier", - "src": "5629:6:84" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "5637:2:84", - "type": "", - "value": "31" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "5625:3:84" - }, - "nodeType": "YulFunctionCall", - "src": "5625:15:84" - }, - { - "arguments": [ - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "5646:2:84", - "type": "", - "value": "31" - } - ], - "functionName": { - "name": "not", - "nodeType": "YulIdentifier", - "src": "5642:3:84" - }, - "nodeType": "YulFunctionCall", - "src": "5642:7:84" - } - ], - "functionName": { - "name": "and", - "nodeType": "YulIdentifier", - "src": "5621:3:84" - }, - "nodeType": "YulFunctionCall", - "src": "5621:29:84" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "5606:3:84" - }, - "nodeType": "YulFunctionCall", - "src": "5606:45:84" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "5653:2:84", - "type": "", - "value": "64" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "5602:3:84" - }, - "nodeType": "YulFunctionCall", - "src": "5602:54:84" - }, - "variableNames": [ - { - "name": "tail", - "nodeType": "YulIdentifier", - "src": "5594:4:84" - } - ] - } - ] - }, - "name": "abi_encode_tuple_t_bytes_memory_ptr__to_t_bytes_memory_ptr__fromStack_reversed", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "headStart", - "nodeType": "YulTypedName", - "src": "5356:9:84", - "type": "" - }, - { - "name": "value0", - "nodeType": "YulTypedName", - "src": "5367:6:84", - "type": "" - } - ], - "returnVariables": [ - { - "name": "tail", - "nodeType": "YulTypedName", - "src": "5378:4:84", - "type": "" - } - ], - "src": "5268:394:84" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "5841:223:84", - "statements": [ - { - "expression": { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "5858:9:84" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "5869:2:84", - "type": "", - "value": "32" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "5851:6:84" - }, - "nodeType": "YulFunctionCall", - "src": "5851:21:84" - }, - "nodeType": "YulExpressionStatement", - "src": "5851:21:84" - }, - { - "expression": { - "arguments": [ - { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "5892:9:84" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "5903:2:84", - "type": "", - "value": "32" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "5888:3:84" - }, - "nodeType": "YulFunctionCall", - "src": "5888:18:84" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "5908:2:84", - "type": "", - "value": "33" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "5881:6:84" - }, - "nodeType": "YulFunctionCall", - "src": "5881:30:84" - }, - "nodeType": "YulExpressionStatement", - "src": "5881:30:84" - }, - { - "expression": { - "arguments": [ - { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "5931:9:84" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "5942:2:84", - "type": "", - "value": "64" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "5927:3:84" - }, - "nodeType": "YulFunctionCall", - "src": "5927:18:84" - }, - { - "hexValue": "5769746e657450726f78793a20756e61626c6520746f20696e697469616c697a", - "kind": "string", - "nodeType": "YulLiteral", - "src": "5947:34:84", - "type": "", - "value": "WitnetProxy: unable to initializ" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "5920:6:84" - }, - "nodeType": "YulFunctionCall", - "src": "5920:62:84" - }, - "nodeType": "YulExpressionStatement", - "src": "5920:62:84" - }, - { - "expression": { - "arguments": [ - { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "6002:9:84" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "6013:2:84", - "type": "", - "value": "96" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "5998:3:84" - }, - "nodeType": "YulFunctionCall", - "src": "5998:18:84" - }, - { - "hexValue": "65", - "kind": "string", - "nodeType": "YulLiteral", - "src": "6018:3:84", - "type": "", - "value": "e" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "5991:6:84" - }, - "nodeType": "YulFunctionCall", - "src": "5991:31:84" - }, - "nodeType": "YulExpressionStatement", - "src": "5991:31:84" - }, - { - "nodeType": "YulAssignment", - "src": "6031:27:84", - "value": { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "6043:9:84" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "6054:3:84", - "type": "", - "value": "128" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "6039:3:84" - }, - "nodeType": "YulFunctionCall", - "src": "6039:19:84" - }, - "variableNames": [ - { - "name": "tail", - "nodeType": "YulIdentifier", - "src": "6031:4:84" - } - ] - } - ] - }, - "name": "abi_encode_tuple_t_stringliteral_55e9f07b665adf0e8c084720fbd831f583a2d75f5997894b64a77e28a0171f3c__to_t_string_memory_ptr__fromStack_reversed", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "headStart", - "nodeType": "YulTypedName", - "src": "5818:9:84", - "type": "" - } - ], - "returnVariables": [ - { - "name": "tail", - "nodeType": "YulTypedName", - "src": "5832:4:84", - "type": "" - } - ], - "src": "5667:397:84" - } - ] - }, - "contents": "{\n { }\n function abi_encode_tuple_t_address__to_t_address__fromStack_reversed(headStart, value0) -> tail\n {\n tail := add(headStart, 32)\n mstore(headStart, and(value0, sub(shl(160, 1), 1)))\n }\n function panic_error_0x41()\n {\n mstore(0, shl(224, 0x4e487b71))\n mstore(4, 0x41)\n revert(0, 0x24)\n }\n function abi_decode_tuple_t_addresst_bytes_memory_ptr(headStart, dataEnd) -> value0, value1\n {\n if slt(sub(dataEnd, headStart), 64) { revert(0, 0) }\n let value := calldataload(headStart)\n if iszero(eq(value, and(value, sub(shl(160, 1), 1)))) { revert(0, 0) }\n value0 := value\n let offset := calldataload(add(headStart, 32))\n let _1 := 0xffffffffffffffff\n if gt(offset, _1) { revert(0, 0) }\n let _2 := add(headStart, offset)\n if iszero(slt(add(_2, 0x1f), dataEnd)) { revert(0, 0) }\n let _3 := calldataload(_2)\n if gt(_3, _1) { panic_error_0x41() }\n let _4 := not(31)\n let memPtr := mload(64)\n let newFreePtr := add(memPtr, and(add(and(add(_3, 0x1f), _4), 63), _4))\n if or(gt(newFreePtr, _1), lt(newFreePtr, memPtr)) { panic_error_0x41() }\n mstore(64, newFreePtr)\n mstore(memPtr, _3)\n if gt(add(add(_2, _3), 32), dataEnd) { revert(0, 0) }\n calldatacopy(add(memPtr, 32), add(_2, 32), _3)\n mstore(add(add(memPtr, _3), 32), 0)\n value1 := memPtr\n }\n function abi_encode_tuple_t_bool__to_t_bool__fromStack_reversed(headStart, value0) -> tail\n {\n tail := add(headStart, 32)\n mstore(headStart, iszero(iszero(value0)))\n }\n function abi_encode_tuple_t_stringliteral_d599eaa5e68d91d75c142446490ab9a15fd0284a41ce949219b5b4d8f267239a__to_t_string_memory_ptr__fromStack_reversed(headStart) -> tail\n {\n mstore(headStart, 32)\n mstore(add(headStart, 32), 32)\n mstore(add(headStart, 64), \"WitnetProxy: null implementation\")\n tail := add(headStart, 96)\n }\n function abi_encode_tuple_t_stringliteral_e332eab1bae45430d1201a30c0d80d8fcb5570f9e70201a9eb7b229e17fd2084__to_t_string_memory_ptr__fromStack_reversed(headStart) -> tail\n {\n mstore(headStart, 32)\n mstore(add(headStart, 32), 31)\n mstore(add(headStart, 64), \"WitnetProxy: nothing to upgrade\")\n tail := add(headStart, 96)\n }\n function abi_decode_tuple_t_bool_fromMemory(headStart, dataEnd) -> value0\n {\n if slt(sub(dataEnd, headStart), 32) { revert(0, 0) }\n let value := mload(headStart)\n if iszero(eq(value, iszero(iszero(value)))) { revert(0, 0) }\n value0 := value\n }\n function abi_encode_tuple_t_stringliteral_7f859058ad3ee4e192700ff813ed67dc892a0c7de91510ee584a0ac25fc982fc__to_t_string_memory_ptr__fromStack_reversed(headStart) -> tail\n {\n mstore(headStart, 32)\n mstore(add(headStart, 32), 42)\n mstore(add(headStart, 64), \"WitnetProxy: unable to check upg\")\n mstore(add(headStart, 96), \"radability\")\n tail := add(headStart, 128)\n }\n function abi_encode_tuple_t_stringliteral_d96132834a96bae5cb2f32cb07f13985dcde0f2358055c198eb3065af6c5aa7f__to_t_string_memory_ptr__fromStack_reversed(headStart) -> tail\n {\n mstore(headStart, 32)\n mstore(add(headStart, 32), 27)\n mstore(add(headStart, 64), \"WitnetProxy: not upgradable\")\n tail := add(headStart, 96)\n }\n function copy_memory_to_memory_with_cleanup(src, dst, length)\n {\n let i := 0\n for { } lt(i, length) { i := add(i, 32) }\n {\n mstore(add(dst, i), mload(add(src, i)))\n }\n mstore(add(dst, length), 0)\n }\n function abi_encode_tuple_packed_t_bytes_memory_ptr__to_t_bytes_memory_ptr__nonPadded_inplace_fromStack_reversed(pos, value0) -> end\n {\n let length := mload(value0)\n copy_memory_to_memory_with_cleanup(add(value0, 0x20), pos, length)\n end := add(pos, length)\n }\n function abi_encode_tuple_t_stringliteral_fe0c5d56f2e637bc6ae9d29f1058c00159080f3dd6202013ecdbcca6e4740a65__to_t_string_memory_ptr__fromStack_reversed(headStart) -> tail\n {\n mstore(headStart, 32)\n mstore(add(headStart, 32), 26)\n mstore(add(headStart, 64), \"WitnetProxy: not compliant\")\n tail := add(headStart, 96)\n }\n function abi_encode_tuple_t_stringliteral_ba8d4d661ce88eb2915ba133e6cad533938b754d7b66d8253879ef2c2193ecb2__to_t_string_memory_ptr__fromStack_reversed(headStart) -> tail\n {\n mstore(headStart, 32)\n mstore(add(headStart, 32), 27)\n mstore(add(headStart, 64), \"WitnetProxy: not authorized\")\n tail := add(headStart, 96)\n }\n function abi_decode_tuple_t_bytes32_fromMemory(headStart, dataEnd) -> value0\n {\n if slt(sub(dataEnd, headStart), 32) { revert(0, 0) }\n value0 := mload(headStart)\n }\n function abi_encode_tuple_t_stringliteral_f3c1ad1fa1688d47e62cc4dd5b4be101315ef47e38e05aa3a37a4ef2e1cec0a8__to_t_string_memory_ptr__fromStack_reversed(headStart) -> tail\n {\n mstore(headStart, 32)\n mstore(add(headStart, 32), 36)\n mstore(add(headStart, 64), \"WitnetProxy: proxiableUUIDs mism\")\n mstore(add(headStart, 96), \"atch\")\n tail := add(headStart, 128)\n }\n function abi_encode_tuple_t_bytes_memory_ptr__to_t_bytes_memory_ptr__fromStack_reversed(headStart, value0) -> tail\n {\n mstore(headStart, 32)\n let length := mload(value0)\n mstore(add(headStart, 32), length)\n copy_memory_to_memory_with_cleanup(add(value0, 32), add(headStart, 64), length)\n tail := add(add(headStart, and(add(length, 31), not(31))), 64)\n }\n function abi_encode_tuple_t_stringliteral_55e9f07b665adf0e8c084720fbd831f583a2d75f5997894b64a77e28a0171f3c__to_t_string_memory_ptr__fromStack_reversed(headStart) -> tail\n {\n mstore(headStart, 32)\n mstore(add(headStart, 32), 33)\n mstore(add(headStart, 64), \"WitnetProxy: unable to initializ\")\n mstore(add(headStart, 96), \"e\")\n tail := add(headStart, 128)\n }\n}", - "id": 84, - "language": "Yul", - "name": "#utility.yul" - } - ], - "sourceMap": "244:4800:28:-:0;;;500:17;;;;;;;;;;244:4800;;;;;;", - "deployedSourceMap": "244:4800:28:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;726:23;752:16;:14;:16::i;:::-;726:42;;1116:4;1110:11;1156:14;1153:1;1148:3;1135:36;1260:1;1257;1241:14;1236:3;1219:15;1212:5;1199:63;1288:16;1341:4;1338:1;1333:3;1318:28;1367:6;1391:119;;;;1653:4;1648:3;1641:17;1391:119;1485:4;1480:3;1473:17;1761:110;;;;;;;;;;;;;:::i;:::-;;;-1:-1:-1;;;;;178:32:84;;;160:51;;148:2;133:18;1761:110:28;;;;;;;;2165:2454;;;;;;;;;;-1:-1:-1;2165:2454:28;;;;;:::i;:::-;;:::i;:::-;;;1619:14:84;;1612:22;1594:41;;1582:2;1567:18;2165:2454:28;1454:187:84;1761:110:28;4955:66;1835:28;-1:-1:-1;;;;;1835:28:28;;1761:110::o;2165:2454::-;2261:4;-1:-1:-1;;;;;2338:32:28;;2330:77;;;;-1:-1:-1;;;2330:77:28;;1848:2:84;2330:77:28;;;1830:21:84;;;1867:18;;;1860:30;1926:34;1906:18;;;1899:62;1978:18;;2330:77:28;;;;;;;;;2420:26;2449:16;:14;:16::i;:::-;2420:45;-1:-1:-1;;;;;;2480:32:28;;;2476:1285;;2632:18;-1:-1:-1;;;;;2610:40:28;:18;-1:-1:-1;;;;;2610:40:28;;2602:84;;;;-1:-1:-1;;;2602:84:28;;2209:2:84;2602:84:28;;;2191:21:84;2248:2;2228:18;;;2221:30;2287:33;2267:18;;;2260:61;2338:18;;2602:84:28;2007:355:84;2602:84:28;2802:18;-1:-1:-1;;;;;2790:44:28;;:46;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;2790:46:28;;;;;;;;-1:-1:-1;;2790:46:28;;;;;;;;;;;;:::i;:::-;;;2786:262;;2980:52;;-1:-1:-1;;;2980:52:28;;2851:2:84;2980:52:28;;;2833:21:84;2890:2;2870:18;;;2863:30;2929:34;2909:18;;;2902:62;-1:-1:-1;;;2980:18:84;;;2973:40;3030:19;;2980:52:28;2649:406:84;2786:262:28;2893:13;2885:53;;;;-1:-1:-1;;;2885:53:28;;3262:2:84;2885:53:28;;;3244:21:84;3301:2;3281:18;;;3274:30;3340:29;3320:18;;;3313:57;3387:18;;2885:53:28;3060:351:84;2885:53:28;-1:-1:-1;3252:125:28;;3348:10;3252:125;;;160:51:84;3161:15:28;;;;-1:-1:-1;;;;;3202:31:28;;;133:18:84;;3252:125:28;;;-1:-1:-1;;3252:125:28;;;;;;;;;;;;;;-1:-1:-1;;;;;3252:125:28;-1:-1:-1;;;3252:125:28;;;3202:190;;;3252:125;3202:190;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3160:232;;;;3415:10;3407:49;;;;-1:-1:-1;;;3407:49:28;;4165:2:84;3407:49:28;;;4147:21:84;4204:2;4184:18;;;4177:30;4243:28;4223:18;;;4216:56;4289:18;;3407:49:28;3963:350:84;3407:49:28;3490:7;3479:27;;;;;;;;;;;;:::i;:::-;3471:67;;;;-1:-1:-1;;;3471:67:28;;4520:2:84;3471:67:28;;;4502:21:84;4559:2;4539:18;;;4532:30;4598:29;4578:18;;;4571:57;4645:18;;3471:67:28;4318:351:84;3471:67:28;3642:18;-1:-1:-1;;;;;3630:45:28;;:47;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;3591:18;-1:-1:-1;;;;;3579:45:28;;:47;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;:98;3553:196;;;;-1:-1:-1;;;3553:196:28;;5065:2:84;3553:196:28;;;5047:21:84;5104:2;5084:18;;;5077:30;5143:34;5123:18;;;5116:62;-1:-1:-1;;;5194:18:84;;;5187:34;5238:19;;3553:196:28;4863:400:84;3553:196:28;2514:1247;;2476:1285;3846:20;3871:18;-1:-1:-1;;;;;3871:31:28;3997:9;3917:104;;;;;;;;:::i;:::-;;;;-1:-1:-1;;3917:104:28;;;;;;;;;;;;;;-1:-1:-1;;;;;3917:104:28;-1:-1:-1;;;3917:104:28;;;3871:161;;;3917:104;3871:161;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3845:187;;;4051:15;4043:61;;;;-1:-1:-1;;;4043:61:28;;5869:2:84;4043:61:28;;;5851:21:84;5908:2;5888:18;;;5881:30;5947:34;5927:18;;;5920:62;-1:-1:-1;;;5998:18:84;;;5991:31;6039:19;;4043:61:28;5667:397:84;4043:61:28;4955:66;4199:49;;-1:-1:-1;;;;;;4199:49:28;-1:-1:-1;;;;;4199:49:28;;;;;;;;4264:28;;;;-1:-1:-1;;4264:28:28;4421:18;-1:-1:-1;;;;;4409:44:28;;:46;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;4409:46:28;;;;;;;;-1:-1:-1;;4409:46:28;;;;;;;;;;;;:::i;:::-;;;4405:207;;4563:37;;-1:-1:-1;;;4563:37:28;;4165:2:84;4563:37:28;;;4147:21:84;4204:2;4184:18;;;4177:30;4243:28;4223:18;;;4216:56;4289:18;;4563:37:28;3963:350:84;4405:207:28;4507:13;-1:-1:-1;4500:20:28;;-1:-1:-1;;4500:20:28;2165:2454;;;;;:::o;222:127:84:-;283:10;278:3;274:20;271:1;264:31;314:4;311:1;304:15;338:4;335:1;328:15;354:1095;431:6;439;492:2;480:9;471:7;467:23;463:32;460:52;;;508:1;505;498:12;460:52;534:23;;-1:-1:-1;;;;;586:31:84;;576:42;;566:70;;632:1;629;622:12;566:70;655:5;-1:-1:-1;711:2:84;696:18;;683:32;734:18;764:14;;;761:34;;;791:1;788;781:12;761:34;829:6;818:9;814:22;804:32;;874:7;867:4;863:2;859:13;855:27;845:55;;896:1;893;886:12;845:55;932:2;919:16;954:2;950;947:10;944:36;;;960:18;;:::i;:::-;1035:2;1029:9;1003:2;1089:13;;-1:-1:-1;;1085:22:84;;;1109:2;1081:31;1077:40;1065:53;;;1133:18;;;1153:22;;;1130:46;1127:72;;;1179:18;;:::i;:::-;1219:10;1215:2;1208:22;1254:2;1246:6;1239:18;1294:7;1289:2;1284;1280;1276:11;1272:20;1269:33;1266:53;;;1315:1;1312;1305:12;1266:53;1371:2;1366;1362;1358:11;1353:2;1345:6;1341:15;1328:46;1416:1;1411:2;1406;1398:6;1394:15;1390:24;1383:35;1437:6;1427:16;;;;;;;354:1095;;;;;:::o;2367:277::-;2434:6;2487:2;2475:9;2466:7;2462:23;2458:32;2455:52;;;2503:1;2500;2493:12;2455:52;2535:9;2529:16;2588:5;2581:13;2574:21;2567:5;2564:32;2554:60;;2610:1;2607;2600:12;2554:60;2633:5;2367:277;-1:-1:-1;;;2367:277:84:o;3416:250::-;3501:1;3511:113;3525:6;3522:1;3519:13;3511:113;;;3601:11;;;3595:18;3582:11;;;3575:39;3547:2;3540:10;3511:113;;;-1:-1:-1;;3658:1:84;3640:16;;3633:27;3416:250::o;3671:287::-;3800:3;3838:6;3832:13;3854:66;3913:6;3908:3;3901:4;3893:6;3889:17;3854:66;:::i;:::-;3936:16;;;;;3671:287;-1:-1:-1;;3671:287:84:o;4674:184::-;4744:6;4797:2;4785:9;4776:7;4772:23;4768:32;4765:52;;;4813:1;4810;4803:12;4765:52;-1:-1:-1;4836:16:84;;4674:184;-1:-1:-1;4674:184:84:o;5268:394::-;5415:2;5404:9;5397:21;5378:4;5447:6;5441:13;5490:6;5485:2;5474:9;5470:18;5463:34;5506:79;5578:6;5573:2;5562:9;5558:18;5553:2;5545:6;5541:15;5506:79;:::i;:::-;5646:2;5625:15;-1:-1:-1;;5621:29:84;5606:45;;;;5653:2;5602:54;;5268:394;-1:-1:-1;;5268:394:84:o", - "source": "// SPDX-License-Identifier: MIT\r\n\r\npragma solidity >=0.7.0 <0.9.0;\r\npragma experimental ABIEncoderV2;\r\n\r\nimport \"../patterns/Upgradeable.sol\";\r\n\r\n/// @title WitnetProxy: upgradable delegate-proxy contract. \r\n/// @author The Witnet Foundation.\r\ncontract WitnetProxy {\r\n\r\n /// Event emitted every time the implementation gets updated.\r\n event Upgraded(address indexed implementation); \r\n\r\n /// Constructor with no params as to ease eventual support of Singleton pattern (i.e. ERC-2470).\r\n constructor () {}\r\n\r\n receive() virtual external payable {}\r\n\r\n /// Payable fallback accepts delegating calls to payable functions. \r\n fallback() external payable { /* solhint-disable no-complex-fallback */\r\n address _implementation = implementation();\r\n assembly { /* solhint-disable avoid-low-level-calls */\r\n // Gas optimized delegate call to 'implementation' contract.\r\n // Note: `msg.data`, `msg.sender` and `msg.value` will be passed over \r\n // to actual implementation of `msg.sig` within `implementation` contract.\r\n let ptr := mload(0x40)\r\n calldatacopy(ptr, 0, calldatasize())\r\n let result := delegatecall(gas(), _implementation, ptr, calldatasize(), 0, 0)\r\n let size := returndatasize()\r\n returndatacopy(ptr, 0, size)\r\n switch result\r\n case 0 { \r\n // pass back revert message:\r\n revert(ptr, size) \r\n }\r\n default {\r\n // pass back same data as returned by 'implementation' contract:\r\n return(ptr, size) \r\n }\r\n }\r\n }\r\n\r\n /// Returns proxy's current implementation address.\r\n function implementation() public view returns (address) {\r\n return __proxySlot().implementation;\r\n }\r\n\r\n /// Upgrades the `implementation` address.\r\n /// @param _newImplementation New implementation address.\r\n /// @param _initData Raw data with which new implementation will be initialized.\r\n /// @return Returns whether new implementation would be further upgradable, or not.\r\n function upgradeTo(address _newImplementation, bytes memory _initData)\r\n public returns (bool)\r\n {\r\n // New implementation cannot be null:\r\n require(_newImplementation != address(0), \"WitnetProxy: null implementation\");\r\n\r\n address _oldImplementation = implementation();\r\n if (_oldImplementation != address(0)) {\r\n // New implementation address must differ from current one:\r\n require(_newImplementation != _oldImplementation, \"WitnetProxy: nothing to upgrade\");\r\n\r\n // Assert whether current implementation is intrinsically upgradable:\r\n try Upgradeable(_oldImplementation).isUpgradable() returns (bool _isUpgradable) {\r\n require(_isUpgradable, \"WitnetProxy: not upgradable\");\r\n } catch {\r\n revert(\"WitnetProxy: unable to check upgradability\");\r\n }\r\n\r\n // Assert whether current implementation allows `msg.sender` to upgrade the proxy:\r\n (bool _wasCalled, bytes memory _result) = _oldImplementation.delegatecall(\r\n abi.encodeWithSignature(\r\n \"isUpgradableFrom(address)\",\r\n msg.sender\r\n )\r\n );\r\n require(_wasCalled, \"WitnetProxy: not compliant\");\r\n require(abi.decode(_result, (bool)), \"WitnetProxy: not authorized\");\r\n require(\r\n Upgradeable(_oldImplementation).proxiableUUID() == Upgradeable(_newImplementation).proxiableUUID(),\r\n \"WitnetProxy: proxiableUUIDs mismatch\"\r\n );\r\n }\r\n\r\n // Initialize new implementation within proxy-context storage:\r\n (bool _wasInitialized,) = _newImplementation.delegatecall(\r\n abi.encodeWithSignature(\r\n \"initialize(bytes)\",\r\n _initData\r\n )\r\n );\r\n require(_wasInitialized, \"WitnetProxy: unable to initialize\");\r\n\r\n // If all checks and initialization pass, update implementation address:\r\n __proxySlot().implementation = _newImplementation;\r\n emit Upgraded(_newImplementation);\r\n\r\n // Asserts new implementation complies w/ minimal implementation of Upgradeable interface:\r\n try Upgradeable(_newImplementation).isUpgradable() returns (bool _isUpgradable) {\r\n return _isUpgradable;\r\n }\r\n catch {\r\n revert (\"WitnetProxy: not compliant\");\r\n }\r\n }\r\n\r\n /// @dev Complying with EIP-1967, retrieves storage struct containing proxy's current implementation address.\r\n function __proxySlot() private pure returns (Proxiable.ProxiableSlot storage _slot) {\r\n assembly {\r\n // bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\r\n _slot.slot := 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\r\n }\r\n }\r\n\r\n}\r\n", - "sourcePath": "C:\\Users\\guill\\github\\guidiaz\\witnet-solidity-bridge\\contracts\\impls\\WitnetProxy.sol", - "ast": { - "absolutePath": "project:/contracts/impls/WitnetProxy.sol", - "exportedSymbols": { - "AddressUpgradeable": [ - 452 - ], - "Initializable": [ - 168 - ], - "Proxiable": [ - 23471 - ], - "Upgradeable": [ - 23590 - ], - "WitnetProxy": [ - 6719 - ] - }, - "id": 6720, - "license": "MIT", - "nodeType": "SourceUnit", - "nodes": [ - { - "id": 6517, - "literals": [ - "solidity", - ">=", - "0.7", - ".0", - "<", - "0.9", - ".0" - ], - "nodeType": "PragmaDirective", - "src": "35:31:28" - }, - { - "id": 6518, - "literals": [ - "experimental", - "ABIEncoderV2" - ], - "nodeType": "PragmaDirective", - "src": "68:33:28" - }, - { - "absolutePath": "project:/contracts/patterns/Upgradeable.sol", - "file": "../patterns/Upgradeable.sol", - "id": 6519, - "nameLocation": "-1:-1:-1", - "nodeType": "ImportDirective", - "scope": 6720, - "sourceUnit": 23591, - "src": "105:37:28", - "symbolAliases": [], - "unitAlias": "" - }, - { - "abstract": false, - "baseContracts": [], - "canonicalName": "WitnetProxy", - "contractDependencies": [], - "contractKind": "contract", - "documentation": { - "id": 6520, - "nodeType": "StructuredDocumentation", - "src": "146:98:28", - "text": "@title WitnetProxy: upgradable delegate-proxy contract. \n @author The Witnet Foundation." - }, - "fullyImplemented": true, - "id": 6719, - "linearizedBaseContracts": [ - 6719 - ], - "name": "WitnetProxy", - "nameLocation": "253:11:28", - "nodeType": "ContractDefinition", - "nodes": [ - { - "anonymous": false, - "documentation": { - "id": 6521, - "nodeType": "StructuredDocumentation", - "src": "274:61:28", - "text": "Event emitted every time the implementation gets updated." - }, - "eventSelector": "bc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", - "id": 6525, - "name": "Upgraded", - "nameLocation": "347:8:28", - "nodeType": "EventDefinition", - "parameters": { - "id": 6524, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 6523, - "indexed": true, - "mutability": "mutable", - "name": "implementation", - "nameLocation": "372:14:28", - "nodeType": "VariableDeclaration", - "scope": 6525, - "src": "356:30:28", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 6522, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "356:7:28", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "355:32:28" - }, - "src": "341:47:28" - }, - { - "body": { - "id": 6529, - "nodeType": "Block", - "src": "515:2:28", - "statements": [] - }, - "documentation": { - "id": 6526, - "nodeType": "StructuredDocumentation", - "src": "398:96:28", - "text": "Constructor with no params as to ease eventual support of Singleton pattern (i.e. ERC-2470)." - }, - "id": 6530, - "implemented": true, - "kind": "constructor", - "modifiers": [], - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 6527, - "nodeType": "ParameterList", - "parameters": [], - "src": "512:2:28" - }, - "returnParameters": { - "id": 6528, - "nodeType": "ParameterList", - "parameters": [], - "src": "515:0:28" - }, - "scope": 6719, - "src": "500:17:28", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "public" - }, - { - "body": { - "id": 6533, - "nodeType": "Block", - "src": "560:2:28", - "statements": [] - }, - "id": 6534, - "implemented": true, - "kind": "receive", - "modifiers": [], - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 6531, - "nodeType": "ParameterList", - "parameters": [], - "src": "532:2:28" - }, - "returnParameters": { - "id": 6532, - "nodeType": "ParameterList", - "parameters": [], - "src": "560:0:28" - }, - "scope": 6719, - "src": "525:37:28", - "stateMutability": "payable", - "virtual": true, - "visibility": "external" - }, - { - "body": { - "id": 6544, - "nodeType": "Block", - "src": "673:1023:28", - "statements": [ - { - "assignments": [ - 6539 - ], - "declarations": [ - { - "constant": false, - "id": 6539, - "mutability": "mutable", - "name": "_implementation", - "nameLocation": "734:15:28", - "nodeType": "VariableDeclaration", - "scope": 6544, - "src": "726:23:28", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 6538, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "726:7:28", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "id": 6542, - "initialValue": { - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 6540, - "name": "implementation", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6556, - "src": "752:14:28", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_address_$", - "typeString": "function () view returns (address)" - } - }, - "id": 6541, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "nameLocations": [], - "names": [], - "nodeType": "FunctionCall", - "src": "752:16:28", - "tryCall": false, - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "726:42:28" - }, - { - "AST": { - "nodeType": "YulBlock", - "src": "788:901:28", - "statements": [ - { - "nodeType": "YulVariableDeclaration", - "src": "1099:22:28", - "value": { - "arguments": [ - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "1116:4:28", - "type": "", - "value": "0x40" - } - ], - "functionName": { - "name": "mload", - "nodeType": "YulIdentifier", - "src": "1110:5:28" - }, - "nodeType": "YulFunctionCall", - "src": "1110:11:28" - }, - "variables": [ - { - "name": "ptr", - "nodeType": "YulTypedName", - "src": "1103:3:28", - "type": "" - } - ] - }, - { - "expression": { - "arguments": [ - { - "name": "ptr", - "nodeType": "YulIdentifier", - "src": "1148:3:28" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "1153:1:28", - "type": "", - "value": "0" - }, - { - "arguments": [], - "functionName": { - "name": "calldatasize", - "nodeType": "YulIdentifier", - "src": "1156:12:28" - }, - "nodeType": "YulFunctionCall", - "src": "1156:14:28" - } - ], - "functionName": { - "name": "calldatacopy", - "nodeType": "YulIdentifier", - "src": "1135:12:28" - }, - "nodeType": "YulFunctionCall", - "src": "1135:36:28" - }, - "nodeType": "YulExpressionStatement", - "src": "1135:36:28" - }, - { - "nodeType": "YulVariableDeclaration", - "src": "1185:77:28", - "value": { - "arguments": [ - { - "arguments": [], - "functionName": { - "name": "gas", - "nodeType": "YulIdentifier", - "src": "1212:3:28" - }, - "nodeType": "YulFunctionCall", - "src": "1212:5:28" - }, - { - "name": "_implementation", - "nodeType": "YulIdentifier", - "src": "1219:15:28" - }, - { - "name": "ptr", - "nodeType": "YulIdentifier", - "src": "1236:3:28" - }, - { - "arguments": [], - "functionName": { - "name": "calldatasize", - "nodeType": "YulIdentifier", - "src": "1241:12:28" - }, - "nodeType": "YulFunctionCall", - "src": "1241:14:28" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "1257:1:28", - "type": "", - "value": "0" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "1260:1:28", - "type": "", - "value": "0" - } - ], - "functionName": { - "name": "delegatecall", - "nodeType": "YulIdentifier", - "src": "1199:12:28" - }, - "nodeType": "YulFunctionCall", - "src": "1199:63:28" - }, - "variables": [ - { - "name": "result", - "nodeType": "YulTypedName", - "src": "1189:6:28", - "type": "" - } - ] - }, - { - "nodeType": "YulVariableDeclaration", - "src": "1276:28:28", - "value": { - "arguments": [], - "functionName": { - "name": "returndatasize", - "nodeType": "YulIdentifier", - "src": "1288:14:28" - }, - "nodeType": "YulFunctionCall", - "src": "1288:16:28" - }, - "variables": [ - { - "name": "size", - "nodeType": "YulTypedName", - "src": "1280:4:28", - "type": "" - } - ] - }, - { - "expression": { - "arguments": [ - { - "name": "ptr", - "nodeType": "YulIdentifier", - "src": "1333:3:28" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "1338:1:28", - "type": "", - "value": "0" - }, - { - "name": "size", - "nodeType": "YulIdentifier", - "src": "1341:4:28" - } - ], - "functionName": { - "name": "returndatacopy", - "nodeType": "YulIdentifier", - "src": "1318:14:28" - }, - "nodeType": "YulFunctionCall", - "src": "1318:28:28" - }, - "nodeType": "YulExpressionStatement", - "src": "1318:28:28" - }, - { - "cases": [ - { - "body": { - "nodeType": "YulBlock", - "src": "1399:111:28", - "statements": [ - { - "expression": { - "arguments": [ - { - "name": "ptr", - "nodeType": "YulIdentifier", - "src": "1480:3:28" - }, - { - "name": "size", - "nodeType": "YulIdentifier", - "src": "1485:4:28" - } - ], - "functionName": { - "name": "revert", - "nodeType": "YulIdentifier", - "src": "1473:6:28" - }, - "nodeType": "YulFunctionCall", - "src": "1473:17:28" - }, - "nodeType": "YulExpressionStatement", - "src": "1473:17:28" - } - ] - }, - "nodeType": "YulCase", - "src": "1391:119:28", - "value": { - "kind": "number", - "nodeType": "YulLiteral", - "src": "1396:1:28", - "type": "", - "value": "0" - } - }, - { - "body": { - "nodeType": "YulBlock", - "src": "1536:142:28", - "statements": [ - { - "expression": { - "arguments": [ - { - "name": "ptr", - "nodeType": "YulIdentifier", - "src": "1648:3:28" - }, - { - "name": "size", - "nodeType": "YulIdentifier", - "src": "1653:4:28" - } - ], - "functionName": { - "name": "return", - "nodeType": "YulIdentifier", - "src": "1641:6:28" - }, - "nodeType": "YulFunctionCall", - "src": "1641:17:28" - }, - "nodeType": "YulExpressionStatement", - "src": "1641:17:28" - } - ] - }, - "nodeType": "YulCase", - "src": "1528:150:28", - "value": "default" - } - ], - "expression": { - "name": "result", - "nodeType": "YulIdentifier", - "src": "1367:6:28" - }, - "nodeType": "YulSwitch", - "src": "1360:318:28" - } - ] - }, - "evmVersion": "london", - "externalReferences": [ - { - "declaration": 6539, - "isOffset": false, - "isSlot": false, - "src": "1219:15:28", - "valueSize": 1 - } - ], - "id": 6543, - "nodeType": "InlineAssembly", - "src": "779:910:28" - } - ] - }, - "documentation": { - "id": 6535, - "nodeType": "StructuredDocumentation", - "src": "570:69:28", - "text": "Payable fallback accepts delegating calls to payable functions. " - }, - "id": 6545, - "implemented": true, - "kind": "fallback", - "modifiers": [], - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 6536, - "nodeType": "ParameterList", - "parameters": [], - "src": "653:2:28" - }, - "returnParameters": { - "id": 6537, - "nodeType": "ParameterList", - "parameters": [], - "src": "673:0:28" - }, - "scope": 6719, - "src": "645:1051:28", - "stateMutability": "payable", - "virtual": false, - "visibility": "external" - }, - { - "body": { - "id": 6555, - "nodeType": "Block", - "src": "1817:54:28", - "statements": [ - { - "expression": { - "expression": { - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 6551, - "name": "__proxySlot", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6718, - "src": "1835:11:28", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_pure$__$returns$_t_struct$_ProxiableSlot_$23442_storage_ptr_$", - "typeString": "function () pure returns (struct Proxiable.ProxiableSlot storage pointer)" - } - }, - "id": 6552, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "nameLocations": [], - "names": [], - "nodeType": "FunctionCall", - "src": "1835:13:28", - "tryCall": false, - "typeDescriptions": { - "typeIdentifier": "t_struct$_ProxiableSlot_$23442_storage_ptr", - "typeString": "struct Proxiable.ProxiableSlot storage pointer" - } - }, - "id": 6553, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberLocation": "1849:14:28", - "memberName": "implementation", - "nodeType": "MemberAccess", - "referencedDeclaration": 23439, - "src": "1835:28:28", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "functionReturnParameters": 6550, - "id": 6554, - "nodeType": "Return", - "src": "1828:35:28" - } - ] - }, - "documentation": { - "id": 6546, - "nodeType": "StructuredDocumentation", - "src": "1704:51:28", - "text": "Returns proxy's current implementation address." - }, - "functionSelector": "5c60da1b", - "id": 6556, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "implementation", - "nameLocation": "1770:14:28", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 6547, - "nodeType": "ParameterList", - "parameters": [], - "src": "1784:2:28" - }, - "returnParameters": { - "id": 6550, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 6549, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 6556, - "src": "1808:7:28", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 6548, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1808:7:28", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "1807:9:28" - }, - "scope": 6719, - "src": "1761:110:28", - "stateMutability": "view", - "virtual": false, - "visibility": "public" - }, - { - "body": { - "id": 6708, - "nodeType": "Block", - "src": "2272:2347:28", - "statements": [ - { - "expression": { - "arguments": [ - { - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 6572, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "id": 6567, - "name": "_newImplementation", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6559, - "src": "2338:18:28", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "arguments": [ - { - "hexValue": "30", - "id": 6570, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2368:1:28", - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - } - ], - "id": 6569, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "2360:7:28", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": { - "id": 6568, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2360:7:28", - "typeDescriptions": {} - } - }, - "id": 6571, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "typeConversion", - "lValueRequested": false, - "nameLocations": [], - "names": [], - "nodeType": "FunctionCall", - "src": "2360:10:28", - "tryCall": false, - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "2338:32:28", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "hexValue": "5769746e657450726f78793a206e756c6c20696d706c656d656e746174696f6e", - "id": 6573, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2372:34:28", - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_d599eaa5e68d91d75c142446490ab9a15fd0284a41ce949219b5b4d8f267239a", - "typeString": "literal_string \"WitnetProxy: null implementation\"" - }, - "value": "WitnetProxy: null implementation" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_d599eaa5e68d91d75c142446490ab9a15fd0284a41ce949219b5b4d8f267239a", - "typeString": "literal_string \"WitnetProxy: null implementation\"" - } - ], - "id": 6566, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 4294967278, - 4294967278 - ], - "referencedDeclaration": 4294967278, - "src": "2330:7:28", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 6574, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "nameLocations": [], - "names": [], - "nodeType": "FunctionCall", - "src": "2330:77:28", - "tryCall": false, - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 6575, - "nodeType": "ExpressionStatement", - "src": "2330:77:28" - }, - { - "assignments": [ - 6577 - ], - "declarations": [ - { - "constant": false, - "id": 6577, - "mutability": "mutable", - "name": "_oldImplementation", - "nameLocation": "2428:18:28", - "nodeType": "VariableDeclaration", - "scope": 6708, - "src": "2420:26:28", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 6576, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2420:7:28", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "id": 6580, - "initialValue": { - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 6578, - "name": "implementation", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6556, - "src": "2449:14:28", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_address_$", - "typeString": "function () view returns (address)" - } - }, - "id": 6579, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "nameLocations": [], - "names": [], - "nodeType": "FunctionCall", - "src": "2449:16:28", - "tryCall": false, - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "2420:45:28" - }, - { - "condition": { - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 6586, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "id": 6581, - "name": "_oldImplementation", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6577, - "src": "2480:18:28", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "arguments": [ - { - "hexValue": "30", - "id": 6584, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2510:1:28", - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - } - ], - "id": 6583, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "2502:7:28", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": { - "id": 6582, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2502:7:28", - "typeDescriptions": {} - } - }, - "id": 6585, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "typeConversion", - "lValueRequested": false, - "nameLocations": [], - "names": [], - "nodeType": "FunctionCall", - "src": "2502:10:28", - "tryCall": false, - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "2480:32:28", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 6662, - "nodeType": "IfStatement", - "src": "2476:1285:28", - "trueBody": { - "id": 6661, - "nodeType": "Block", - "src": "2514:1247:28", - "statements": [ - { - "expression": { - "arguments": [ - { - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 6590, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "id": 6588, - "name": "_newImplementation", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6559, - "src": "2610:18:28", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "id": 6589, - "name": "_oldImplementation", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6577, - "src": "2632:18:28", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "2610:40:28", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "hexValue": "5769746e657450726f78793a206e6f7468696e6720746f2075706772616465", - "id": 6591, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2652:33:28", - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_e332eab1bae45430d1201a30c0d80d8fcb5570f9e70201a9eb7b229e17fd2084", - "typeString": "literal_string \"WitnetProxy: nothing to upgrade\"" - }, - "value": "WitnetProxy: nothing to upgrade" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_e332eab1bae45430d1201a30c0d80d8fcb5570f9e70201a9eb7b229e17fd2084", - "typeString": "literal_string \"WitnetProxy: nothing to upgrade\"" - } - ], - "id": 6587, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 4294967278, - 4294967278 - ], - "referencedDeclaration": 4294967278, - "src": "2602:7:28", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 6592, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "nameLocations": [], - "names": [], - "nodeType": "FunctionCall", - "src": "2602:84:28", - "tryCall": false, - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 6593, - "nodeType": "ExpressionStatement", - "src": "2602:84:28" - }, - { - "clauses": [ - { - "block": { - "id": 6607, - "nodeType": "Block", - "src": "2866:88:28", - "statements": [ - { - "expression": { - "arguments": [ - { - "id": 6603, - "name": "_isUpgradable", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6600, - "src": "2893:13:28", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "hexValue": "5769746e657450726f78793a206e6f742075706772616461626c65", - "id": 6604, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2908:29:28", - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_d96132834a96bae5cb2f32cb07f13985dcde0f2358055c198eb3065af6c5aa7f", - "typeString": "literal_string \"WitnetProxy: not upgradable\"" - }, - "value": "WitnetProxy: not upgradable" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_d96132834a96bae5cb2f32cb07f13985dcde0f2358055c198eb3065af6c5aa7f", - "typeString": "literal_string \"WitnetProxy: not upgradable\"" - } - ], - "id": 6602, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 4294967278, - 4294967278 - ], - "referencedDeclaration": 4294967278, - "src": "2885:7:28", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 6605, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "nameLocations": [], - "names": [], - "nodeType": "FunctionCall", - "src": "2885:53:28", - "tryCall": false, - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 6606, - "nodeType": "ExpressionStatement", - "src": "2885:53:28" - } - ] - }, - "errorName": "", - "id": 6608, - "nodeType": "TryCatchClause", - "parameters": { - "id": 6601, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 6600, - "mutability": "mutable", - "name": "_isUpgradable", - "nameLocation": "2851:13:28", - "nodeType": "VariableDeclaration", - "scope": 6608, - "src": "2846:18:28", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 6599, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "2846:4:28", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "visibility": "internal" - } - ], - "src": "2845:20:28" - }, - "src": "2837:117:28" - }, - { - "block": { - "id": 6613, - "nodeType": "Block", - "src": "2961:87:28", - "statements": [ - { - "expression": { - "arguments": [ - { - "hexValue": "5769746e657450726f78793a20756e61626c6520746f20636865636b207570677261646162696c697479", - "id": 6610, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2987:44:28", - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_7f859058ad3ee4e192700ff813ed67dc892a0c7de91510ee584a0ac25fc982fc", - "typeString": "literal_string \"WitnetProxy: unable to check upgradability\"" - }, - "value": "WitnetProxy: unable to check upgradability" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_stringliteral_7f859058ad3ee4e192700ff813ed67dc892a0c7de91510ee584a0ac25fc982fc", - "typeString": "literal_string \"WitnetProxy: unable to check upgradability\"" - } - ], - "id": 6609, - "name": "revert", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 4294967277, - 4294967277 - ], - "referencedDeclaration": 4294967277, - "src": "2980:6:28", - "typeDescriptions": { - "typeIdentifier": "t_function_revert_pure$_t_string_memory_ptr_$returns$__$", - "typeString": "function (string memory) pure" - } - }, - "id": 6611, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "nameLocations": [], - "names": [], - "nodeType": "FunctionCall", - "src": "2980:52:28", - "tryCall": false, - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 6612, - "nodeType": "ExpressionStatement", - "src": "2980:52:28" - } - ] - }, - "errorName": "", - "id": 6614, - "nodeType": "TryCatchClause", - "src": "2955:93:28" - } - ], - "externalCall": { - "arguments": [], - "expression": { - "argumentTypes": [], - "expression": { - "arguments": [ - { - "id": 6595, - "name": "_oldImplementation", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6577, - "src": "2802:18:28", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 6594, - "name": "Upgradeable", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 23590, - "src": "2790:11:28", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_Upgradeable_$23590_$", - "typeString": "type(contract Upgradeable)" - } - }, - "id": 6596, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "nameLocations": [], - "names": [], - "nodeType": "FunctionCall", - "src": "2790:31:28", - "tryCall": false, - "typeDescriptions": { - "typeIdentifier": "t_contract$_Upgradeable_$23590", - "typeString": "contract Upgradeable" - } - }, - "id": 6597, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberLocation": "2822:12:28", - "memberName": "isUpgradable", - "nodeType": "MemberAccess", - "referencedDeclaration": 23569, - "src": "2790:44:28", - "typeDescriptions": { - "typeIdentifier": "t_function_external_view$__$returns$_t_bool_$", - "typeString": "function () view external returns (bool)" - } - }, - "id": 6598, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "nameLocations": [], - "names": [], - "nodeType": "FunctionCall", - "src": "2790:46:28", - "tryCall": true, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 6615, - "nodeType": "TryStatement", - "src": "2786:262:28" - }, - { - "assignments": [ - 6617, - 6619 - ], - "declarations": [ - { - "constant": false, - "id": 6617, - "mutability": "mutable", - "name": "_wasCalled", - "nameLocation": "3166:10:28", - "nodeType": "VariableDeclaration", - "scope": 6661, - "src": "3161:15:28", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 6616, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "3161:4:28", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 6619, - "mutability": "mutable", - "name": "_result", - "nameLocation": "3191:7:28", - "nodeType": "VariableDeclaration", - "scope": 6661, - "src": "3178:20:28", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes" - }, - "typeName": { - "id": 6618, - "name": "bytes", - "nodeType": "ElementaryTypeName", - "src": "3178:5:28", - "typeDescriptions": { - "typeIdentifier": "t_bytes_storage_ptr", - "typeString": "bytes" - } - }, - "visibility": "internal" - } - ], - "id": 6629, - "initialValue": { - "arguments": [ - { - "arguments": [ - { - "hexValue": "697355706772616461626c6546726f6d286164647265737329", - "id": 6624, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3298:27:28", - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_6b58960af5008b519145bb1cb07a67ee0927d8e642573c92f5babc4d0c2721d7", - "typeString": "literal_string \"isUpgradableFrom(address)\"" - }, - "value": "isUpgradableFrom(address)" - }, - { - "expression": { - "id": 6625, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4294967281, - "src": "3348:3:28", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 6626, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberLocation": "3352:6:28", - "memberName": "sender", - "nodeType": "MemberAccess", - "src": "3348:10:28", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_stringliteral_6b58960af5008b519145bb1cb07a67ee0927d8e642573c92f5babc4d0c2721d7", - "typeString": "literal_string \"isUpgradableFrom(address)\"" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "expression": { - "id": 6622, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4294967295, - "src": "3252:3:28", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 6623, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberLocation": "3256:19:28", - "memberName": "encodeWithSignature", - "nodeType": "MemberAccess", - "src": "3252:23:28", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodewithsignature_pure$_t_string_memory_ptr_$returns$_t_bytes_memory_ptr_$", - "typeString": "function (string memory) pure returns (bytes memory)" - } - }, - "id": 6627, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "nameLocations": [], - "names": [], - "nodeType": "FunctionCall", - "src": "3252:125:28", - "tryCall": false, - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "expression": { - "id": 6620, - "name": "_oldImplementation", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6577, - "src": "3202:18:28", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 6621, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberLocation": "3221:12:28", - "memberName": "delegatecall", - "nodeType": "MemberAccess", - "src": "3202:31:28", - "typeDescriptions": { - "typeIdentifier": "t_function_baredelegatecall_nonpayable$_t_bytes_memory_ptr_$returns$_t_bool_$_t_bytes_memory_ptr_$", - "typeString": "function (bytes memory) returns (bool,bytes memory)" - } - }, - "id": 6628, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "nameLocations": [], - "names": [], - "nodeType": "FunctionCall", - "src": "3202:190:28", - "tryCall": false, - "typeDescriptions": { - "typeIdentifier": "t_tuple$_t_bool_$_t_bytes_memory_ptr_$", - "typeString": "tuple(bool,bytes memory)" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "3160:232:28" - }, - { - "expression": { - "arguments": [ - { - "id": 6631, - "name": "_wasCalled", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6617, - "src": "3415:10:28", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "hexValue": "5769746e657450726f78793a206e6f7420636f6d706c69616e74", - "id": 6632, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3427:28:28", - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_fe0c5d56f2e637bc6ae9d29f1058c00159080f3dd6202013ecdbcca6e4740a65", - "typeString": "literal_string \"WitnetProxy: not compliant\"" - }, - "value": "WitnetProxy: not compliant" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_fe0c5d56f2e637bc6ae9d29f1058c00159080f3dd6202013ecdbcca6e4740a65", - "typeString": "literal_string \"WitnetProxy: not compliant\"" - } - ], - "id": 6630, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 4294967278, - 4294967278 - ], - "referencedDeclaration": 4294967278, - "src": "3407:7:28", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 6633, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "nameLocations": [], - "names": [], - "nodeType": "FunctionCall", - "src": "3407:49:28", - "tryCall": false, - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 6634, - "nodeType": "ExpressionStatement", - "src": "3407:49:28" - }, - { - "expression": { - "arguments": [ - { - "arguments": [ - { - "id": 6638, - "name": "_result", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6619, - "src": "3490:7:28", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - }, - { - "components": [ - { - "id": 6640, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "3500:4:28", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_bool_$", - "typeString": "type(bool)" - }, - "typeName": { - "id": 6639, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "3500:4:28", - "typeDescriptions": {} - } - } - ], - "id": 6641, - "isConstant": false, - "isInlineArray": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "TupleExpression", - "src": "3499:6:28", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_bool_$", - "typeString": "type(bool)" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - }, - { - "typeIdentifier": "t_type$_t_bool_$", - "typeString": "type(bool)" - } - ], - "expression": { - "id": 6636, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4294967295, - "src": "3479:3:28", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 6637, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberLocation": "3483:6:28", - "memberName": "decode", - "nodeType": "MemberAccess", - "src": "3479:10:28", - "typeDescriptions": { - "typeIdentifier": "t_function_abidecode_pure$__$returns$__$", - "typeString": "function () pure" - } - }, - "id": 6642, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "nameLocations": [], - "names": [], - "nodeType": "FunctionCall", - "src": "3479:27:28", - "tryCall": false, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "hexValue": "5769746e657450726f78793a206e6f7420617574686f72697a6564", - "id": 6643, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3508:29:28", - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_ba8d4d661ce88eb2915ba133e6cad533938b754d7b66d8253879ef2c2193ecb2", - "typeString": "literal_string \"WitnetProxy: not authorized\"" - }, - "value": "WitnetProxy: not authorized" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_ba8d4d661ce88eb2915ba133e6cad533938b754d7b66d8253879ef2c2193ecb2", - "typeString": "literal_string \"WitnetProxy: not authorized\"" - } - ], - "id": 6635, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 4294967278, - 4294967278 - ], - "referencedDeclaration": 4294967278, - "src": "3471:7:28", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 6644, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "nameLocations": [], - "names": [], - "nodeType": "FunctionCall", - "src": "3471:67:28", - "tryCall": false, - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 6645, - "nodeType": "ExpressionStatement", - "src": "3471:67:28" - }, - { - "expression": { - "arguments": [ - { - "commonType": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "id": 6657, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "arguments": [], - "expression": { - "argumentTypes": [], - "expression": { - "arguments": [ - { - "id": 6648, - "name": "_oldImplementation", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6577, - "src": "3591:18:28", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 6647, - "name": "Upgradeable", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 23590, - "src": "3579:11:28", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_Upgradeable_$23590_$", - "typeString": "type(contract Upgradeable)" - } - }, - "id": 6649, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "nameLocations": [], - "names": [], - "nodeType": "FunctionCall", - "src": "3579:31:28", - "tryCall": false, - "typeDescriptions": { - "typeIdentifier": "t_contract$_Upgradeable_$23590", - "typeString": "contract Upgradeable" - } - }, - "id": 6650, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberLocation": "3611:13:28", - "memberName": "proxiableUUID", - "nodeType": "MemberAccess", - "referencedDeclaration": 23437, - "src": "3579:45:28", - "typeDescriptions": { - "typeIdentifier": "t_function_external_view$__$returns$_t_bytes32_$", - "typeString": "function () view external returns (bytes32)" - } - }, - "id": 6651, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "nameLocations": [], - "names": [], - "nodeType": "FunctionCall", - "src": "3579:47:28", - "tryCall": false, - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "arguments": [], - "expression": { - "argumentTypes": [], - "expression": { - "arguments": [ - { - "id": 6653, - "name": "_newImplementation", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6559, - "src": "3642:18:28", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 6652, - "name": "Upgradeable", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 23590, - "src": "3630:11:28", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_Upgradeable_$23590_$", - "typeString": "type(contract Upgradeable)" - } - }, - "id": 6654, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "nameLocations": [], - "names": [], - "nodeType": "FunctionCall", - "src": "3630:31:28", - "tryCall": false, - "typeDescriptions": { - "typeIdentifier": "t_contract$_Upgradeable_$23590", - "typeString": "contract Upgradeable" - } - }, - "id": 6655, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberLocation": "3662:13:28", - "memberName": "proxiableUUID", - "nodeType": "MemberAccess", - "referencedDeclaration": 23437, - "src": "3630:45:28", - "typeDescriptions": { - "typeIdentifier": "t_function_external_view$__$returns$_t_bytes32_$", - "typeString": "function () view external returns (bytes32)" - } - }, - "id": 6656, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "nameLocations": [], - "names": [], - "nodeType": "FunctionCall", - "src": "3630:47:28", - "tryCall": false, - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "src": "3579:98:28", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "hexValue": "5769746e657450726f78793a2070726f786961626c655555494473206d69736d61746368", - "id": 6658, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3696:38:28", - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_f3c1ad1fa1688d47e62cc4dd5b4be101315ef47e38e05aa3a37a4ef2e1cec0a8", - "typeString": "literal_string \"WitnetProxy: proxiableUUIDs mismatch\"" - }, - "value": "WitnetProxy: proxiableUUIDs mismatch" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_f3c1ad1fa1688d47e62cc4dd5b4be101315ef47e38e05aa3a37a4ef2e1cec0a8", - "typeString": "literal_string \"WitnetProxy: proxiableUUIDs mismatch\"" - } - ], - "id": 6646, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 4294967278, - 4294967278 - ], - "referencedDeclaration": 4294967278, - "src": "3553:7:28", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 6659, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "nameLocations": [], - "names": [], - "nodeType": "FunctionCall", - "src": "3553:196:28", - "tryCall": false, - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 6660, - "nodeType": "ExpressionStatement", - "src": "3553:196:28" - } - ] - } - }, - { - "assignments": [ - 6664, - null - ], - "declarations": [ - { - "constant": false, - "id": 6664, - "mutability": "mutable", - "name": "_wasInitialized", - "nameLocation": "3851:15:28", - "nodeType": "VariableDeclaration", - "scope": 6708, - "src": "3846:20:28", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 6663, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "3846:4:28", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "visibility": "internal" - }, - null - ], - "id": 6673, - "initialValue": { - "arguments": [ - { - "arguments": [ - { - "hexValue": "696e697469616c697a6528627974657329", - "id": 6669, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3959:19:28", - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_439fab91f8ccf5be59586b9cf7bb7786c67a661a95ce1cfc146c1ed62922ae26", - "typeString": "literal_string \"initialize(bytes)\"" - }, - "value": "initialize(bytes)" - }, - { - "id": 6670, - "name": "_initData", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6561, - "src": "3997:9:28", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_stringliteral_439fab91f8ccf5be59586b9cf7bb7786c67a661a95ce1cfc146c1ed62922ae26", - "typeString": "literal_string \"initialize(bytes)\"" - }, - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "expression": { - "id": 6667, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4294967295, - "src": "3917:3:28", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 6668, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberLocation": "3921:19:28", - "memberName": "encodeWithSignature", - "nodeType": "MemberAccess", - "src": "3917:23:28", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodewithsignature_pure$_t_string_memory_ptr_$returns$_t_bytes_memory_ptr_$", - "typeString": "function (string memory) pure returns (bytes memory)" - } - }, - "id": 6671, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "nameLocations": [], - "names": [], - "nodeType": "FunctionCall", - "src": "3917:104:28", - "tryCall": false, - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "expression": { - "id": 6665, - "name": "_newImplementation", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6559, - "src": "3871:18:28", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 6666, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberLocation": "3890:12:28", - "memberName": "delegatecall", - "nodeType": "MemberAccess", - "src": "3871:31:28", - "typeDescriptions": { - "typeIdentifier": "t_function_baredelegatecall_nonpayable$_t_bytes_memory_ptr_$returns$_t_bool_$_t_bytes_memory_ptr_$", - "typeString": "function (bytes memory) returns (bool,bytes memory)" - } - }, - "id": 6672, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "nameLocations": [], - "names": [], - "nodeType": "FunctionCall", - "src": "3871:161:28", - "tryCall": false, - "typeDescriptions": { - "typeIdentifier": "t_tuple$_t_bool_$_t_bytes_memory_ptr_$", - "typeString": "tuple(bool,bytes memory)" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "3845:187:28" - }, - { - "expression": { - "arguments": [ - { - "id": 6675, - "name": "_wasInitialized", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6664, - "src": "4051:15:28", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "hexValue": "5769746e657450726f78793a20756e61626c6520746f20696e697469616c697a65", - "id": 6676, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4068:35:28", - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_55e9f07b665adf0e8c084720fbd831f583a2d75f5997894b64a77e28a0171f3c", - "typeString": "literal_string \"WitnetProxy: unable to initialize\"" - }, - "value": "WitnetProxy: unable to initialize" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_55e9f07b665adf0e8c084720fbd831f583a2d75f5997894b64a77e28a0171f3c", - "typeString": "literal_string \"WitnetProxy: unable to initialize\"" - } - ], - "id": 6674, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 4294967278, - 4294967278 - ], - "referencedDeclaration": 4294967278, - "src": "4043:7:28", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 6677, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "nameLocations": [], - "names": [], - "nodeType": "FunctionCall", - "src": "4043:61:28", - "tryCall": false, - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 6678, - "nodeType": "ExpressionStatement", - "src": "4043:61:28" - }, - { - "expression": { - "id": 6683, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "expression": { - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 6679, - "name": "__proxySlot", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6718, - "src": "4199:11:28", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_pure$__$returns$_t_struct$_ProxiableSlot_$23442_storage_ptr_$", - "typeString": "function () pure returns (struct Proxiable.ProxiableSlot storage pointer)" - } - }, - "id": 6680, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "nameLocations": [], - "names": [], - "nodeType": "FunctionCall", - "src": "4199:13:28", - "tryCall": false, - "typeDescriptions": { - "typeIdentifier": "t_struct$_ProxiableSlot_$23442_storage_ptr", - "typeString": "struct Proxiable.ProxiableSlot storage pointer" - } - }, - "id": 6681, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberLocation": "4213:14:28", - "memberName": "implementation", - "nodeType": "MemberAccess", - "referencedDeclaration": 23439, - "src": "4199:28:28", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "id": 6682, - "name": "_newImplementation", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6559, - "src": "4230:18:28", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "4199:49:28", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 6684, - "nodeType": "ExpressionStatement", - "src": "4199:49:28" - }, - { - "eventCall": { - "arguments": [ - { - "id": 6686, - "name": "_newImplementation", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6559, - "src": "4273:18:28", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 6685, - "name": "Upgraded", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6525, - "src": "4264:8:28", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_address_$returns$__$", - "typeString": "function (address)" - } - }, - "id": 6687, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "nameLocations": [], - "names": [], - "nodeType": "FunctionCall", - "src": "4264:28:28", - "tryCall": false, - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 6688, - "nodeType": "EmitStatement", - "src": "4259:33:28" - }, - { - "clauses": [ - { - "block": { - "id": 6699, - "nodeType": "Block", - "src": "4485:47:28", - "statements": [ - { - "expression": { - "id": 6697, - "name": "_isUpgradable", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6695, - "src": "4507:13:28", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "functionReturnParameters": 6565, - "id": 6698, - "nodeType": "Return", - "src": "4500:20:28" - } - ] - }, - "errorName": "", - "id": 6700, - "nodeType": "TryCatchClause", - "parameters": { - "id": 6696, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 6695, - "mutability": "mutable", - "name": "_isUpgradable", - "nameLocation": "4470:13:28", - "nodeType": "VariableDeclaration", - "scope": 6700, - "src": "4465:18:28", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 6694, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "4465:4:28", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "visibility": "internal" - } - ], - "src": "4464:20:28" - }, - "src": "4456:76:28" - }, - { - "block": { - "id": 6705, - "nodeType": "Block", - "src": "4548:64:28", - "statements": [ - { - "expression": { - "arguments": [ - { - "hexValue": "5769746e657450726f78793a206e6f7420636f6d706c69616e74", - "id": 6702, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4571:28:28", - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_fe0c5d56f2e637bc6ae9d29f1058c00159080f3dd6202013ecdbcca6e4740a65", - "typeString": "literal_string \"WitnetProxy: not compliant\"" - }, - "value": "WitnetProxy: not compliant" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_stringliteral_fe0c5d56f2e637bc6ae9d29f1058c00159080f3dd6202013ecdbcca6e4740a65", - "typeString": "literal_string \"WitnetProxy: not compliant\"" - } - ], - "id": 6701, - "name": "revert", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 4294967277, - 4294967277 - ], - "referencedDeclaration": 4294967277, - "src": "4563:6:28", - "typeDescriptions": { - "typeIdentifier": "t_function_revert_pure$_t_string_memory_ptr_$returns$__$", - "typeString": "function (string memory) pure" - } - }, - "id": 6703, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "nameLocations": [], - "names": [], - "nodeType": "FunctionCall", - "src": "4563:37:28", - "tryCall": false, - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 6704, - "nodeType": "ExpressionStatement", - "src": "4563:37:28" - } - ] - }, - "errorName": "", - "id": 6706, - "nodeType": "TryCatchClause", - "src": "4542:70:28" - } - ], - "externalCall": { - "arguments": [], - "expression": { - "argumentTypes": [], - "expression": { - "arguments": [ - { - "id": 6690, - "name": "_newImplementation", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6559, - "src": "4421:18:28", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 6689, - "name": "Upgradeable", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 23590, - "src": "4409:11:28", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_Upgradeable_$23590_$", - "typeString": "type(contract Upgradeable)" - } - }, - "id": 6691, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "nameLocations": [], - "names": [], - "nodeType": "FunctionCall", - "src": "4409:31:28", - "tryCall": false, - "typeDescriptions": { - "typeIdentifier": "t_contract$_Upgradeable_$23590", - "typeString": "contract Upgradeable" - } - }, - "id": 6692, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberLocation": "4441:12:28", - "memberName": "isUpgradable", - "nodeType": "MemberAccess", - "referencedDeclaration": 23569, - "src": "4409:44:28", - "typeDescriptions": { - "typeIdentifier": "t_function_external_view$__$returns$_t_bool_$", - "typeString": "function () view external returns (bool)" - } - }, - "id": 6693, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "nameLocations": [], - "names": [], - "nodeType": "FunctionCall", - "src": "4409:46:28", - "tryCall": true, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 6707, - "nodeType": "TryStatement", - "src": "4405:207:28" - } - ] - }, - "documentation": { - "id": 6557, - "nodeType": "StructuredDocumentation", - "src": "1879:280:28", - "text": "Upgrades the `implementation` address.\n @param _newImplementation New implementation address.\n @param _initData Raw data with which new implementation will be initialized.\n @return Returns whether new implementation would be further upgradable, or not." - }, - "functionSelector": "6fbc15e9", - "id": 6709, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "upgradeTo", - "nameLocation": "2174:9:28", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 6562, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 6559, - "mutability": "mutable", - "name": "_newImplementation", - "nameLocation": "2192:18:28", - "nodeType": "VariableDeclaration", - "scope": 6709, - "src": "2184:26:28", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 6558, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2184:7:28", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 6561, - "mutability": "mutable", - "name": "_initData", - "nameLocation": "2225:9:28", - "nodeType": "VariableDeclaration", - "scope": 6709, - "src": "2212:22:28", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes" - }, - "typeName": { - "id": 6560, - "name": "bytes", - "nodeType": "ElementaryTypeName", - "src": "2212:5:28", - "typeDescriptions": { - "typeIdentifier": "t_bytes_storage_ptr", - "typeString": "bytes" - } - }, - "visibility": "internal" - } - ], - "src": "2183:52:28" - }, - "returnParameters": { - "id": 6565, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 6564, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 6709, - "src": "2261:4:28", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 6563, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "2261:4:28", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "visibility": "internal" - } - ], - "src": "2260:6:28" - }, - "scope": 6719, - "src": "2165:2454:28", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "public" - }, - { - "body": { - "id": 6717, - "nodeType": "Block", - "src": "4826:213:28", - "statements": [ - { - "AST": { - "nodeType": "YulBlock", - "src": "4846:186:28", - "statements": [ - { - "nodeType": "YulAssignment", - "src": "4941:80:28", - "value": { - "kind": "number", - "nodeType": "YulLiteral", - "src": "4955:66:28", - "type": "", - "value": "0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc" - }, - "variableNames": [ - { - "name": "_slot.slot", - "nodeType": "YulIdentifier", - "src": "4941:10:28" - } - ] - } - ] - }, - "evmVersion": "london", - "externalReferences": [ - { - "declaration": 6714, - "isOffset": false, - "isSlot": true, - "src": "4941:10:28", - "suffix": "slot", - "valueSize": 1 - } - ], - "id": 6716, - "nodeType": "InlineAssembly", - "src": "4837:195:28" - } - ] - }, - "documentation": { - "id": 6710, - "nodeType": "StructuredDocumentation", - "src": "4627:109:28", - "text": "@dev Complying with EIP-1967, retrieves storage struct containing proxy's current implementation address." - }, - "id": 6718, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "__proxySlot", - "nameLocation": "4751:11:28", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 6711, - "nodeType": "ParameterList", - "parameters": [], - "src": "4762:2:28" - }, - "returnParameters": { - "id": 6715, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 6714, - "mutability": "mutable", - "name": "_slot", - "nameLocation": "4819:5:28", - "nodeType": "VariableDeclaration", - "scope": 6718, - "src": "4787:37:28", - "stateVariable": false, - "storageLocation": "storage", - "typeDescriptions": { - "typeIdentifier": "t_struct$_ProxiableSlot_$23442_storage_ptr", - "typeString": "struct Proxiable.ProxiableSlot" - }, - "typeName": { - "id": 6713, - "nodeType": "UserDefinedTypeName", - "pathNode": { - "id": 6712, - "name": "Proxiable.ProxiableSlot", - "nameLocations": [ - "4787:9:28", - "4797:13:28" - ], - "nodeType": "IdentifierPath", - "referencedDeclaration": 23442, - "src": "4787:23:28" - }, - "referencedDeclaration": 23442, - "src": "4787:23:28", - "typeDescriptions": { - "typeIdentifier": "t_struct$_ProxiableSlot_$23442_storage_ptr", - "typeString": "struct Proxiable.ProxiableSlot" - } - }, - "visibility": "internal" - } - ], - "src": "4786:39:28" - }, - "scope": 6719, - "src": "4742:297:28", - "stateMutability": "pure", - "virtual": false, - "visibility": "private" - } - ], - "scope": 6720, - "src": "244:4800:28", - "usedErrors": [] - } - ], - "src": "35:5011:28" - }, - "compiler": { - "name": "solc", - "version": "0.8.17+commit.8df45f5f.Emscripten.clang" - }, - "networks": {}, - "schemaVersion": "3.4.13", - "updatedAt": "2023-04-25T18:38:54.596Z", - "networkType": "ethereum", - "devdoc": { - "author": "The Witnet Foundation.", - "kind": "dev", - "methods": { - "upgradeTo(address,bytes)": { - "params": { - "_initData": "Raw data with which new implementation will be initialized.", - "_newImplementation": "New implementation address." - }, - "returns": { - "_0": "Returns whether new implementation would be further upgradable, or not." - } - } - }, - "title": "WitnetProxy: upgradable delegate-proxy contract. ", - "version": 1 - }, - "userdoc": { - "events": { - "Upgraded(address)": { - "notice": "Event emitted every time the implementation gets updated." - } - }, - "kind": "user", - "methods": { - "constructor": { - "notice": "Constructor with no params as to ease eventual support of Singleton pattern (i.e. ERC-2470)." - }, - "implementation()": { - "notice": "Returns proxy's current implementation address." - }, - "upgradeTo(address,bytes)": { - "notice": "Upgrades the `implementation` address." - } - }, - "version": 1 - } -} \ No newline at end of file diff --git a/migrations/addresses.json b/migrations/addresses.json new file mode 100644 index 000000000..1a3e2bc2c --- /dev/null +++ b/migrations/addresses.json @@ -0,0 +1,19 @@ +{ + "default": { + "WitnetDeployer": "0x03232aBE800D1638B30432FeEF300581De323a4E", + "WitnetOracle": "0x000071F0c823bD30D2Bf4CD1E829Eba5A6070000", + "WitnetPriceFeeds": "0x1111AbA2164AcdC6D291b08DfB374280035E1111", + "WitnetRequestBytecodes": "0x000B61Fe075F545fd37767f40391658275900000", + "WitnetRequestFactory": "0x000F4cCF726c5445626DBD6f2258482f61377000" + }, + "ethereum:sepolia": { + "WitnetErrorsLib": "0x77aac367a921DD2a92dfd0351456839663af248F", + "WitnetEncodingLib": "0x967cfE0Edfc52e027849012E5dA706A9e5e62345", + "WitnetPriceFeedsLib": "0x96013096b1305c4009bfa2C2D3e34fEcB3dD4927", + "WitnetRequestBoardTrustableDefault": "0x8C6F4a0DAa1e3Ea1fAcE58031e76187E61620845", + "WitnetRequestBytecodesDefault": "0x8CE5EF0ab67cdC00D32e09f34f74daFb0d049314", + "WitnetRequestFactoryDefault": "0xdd118b23a2199Bf902e149dE407E205e67932bcb", + "WitnetPriceFeedsDefault": "0x9453CE5217a8688B2318455E82A9Fb4E89eD47b6", + "WitnetProxy": "0x21ac85A6c320E6fC89774A98732eAE733032651C" + } +} \ No newline at end of file diff --git a/migrations/constructorArgs.json b/migrations/constructorArgs.json new file mode 100644 index 000000000..a685248aa --- /dev/null +++ b/migrations/constructorArgs.json @@ -0,0 +1,8 @@ +{ + "ethereum:sepolia": { + "WitnetRequestBytecodesDefault": "0000000000000000000000000000000000000000000000000000000000000001322e302e312d3137303438343900000000000000000000000000000000000000", + "WitnetRequestFactoryDefault": "000000000000000000000000000071f0c823bd30d2bf4cd1e829eba5a6070000000000000000000000000000000b61fe075f545fd37767f403916582759000000000000000000000000000000000000000000000000000000000000000000001322e302e312d3332303438366600000000000000000000000000000000000000", + "WitnetRequestBoardTrustableDefault": "000000000000000000000000000f4ccf726c5445626dbd6f2258482f61377000000000000000000000000000000b61fe075f545fd37767f403916582759000000000000000000000000000000000000000000000000000000000000000000001322e302e312d3332303438366600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e3aa000000000000000000000000000000000000000000000000000000000000fef90000000000000000000000000000000000000000000000000000000000010faa0000000000000000000000000000000000000000000000000000000000004e20", + "WitnetPriceFeedsDefault": "000000000000000000000000000071f0c823bd30d2bf4cd1e829eba5a60700000000000000000000000000000000000000000000000000000000000000000001322e302e312d3332303438366600000000000000000000000000000000000000" + } +} \ No newline at end of file diff --git a/migrations/ops/rng/sla/1_set-randomness-sla.js b/migrations/ops/rng/sla/1_set-randomness-sla.js deleted file mode 100644 index 0e53eeef1..000000000 --- a/migrations/ops/rng/sla/1_set-randomness-sla.js +++ /dev/null @@ -1,95 +0,0 @@ -const addresses = require("../../../witnet.addresses") -const utils = require("../../../../scripts/utils") - -const WitnetRandomness = artifacts.require("WitnetRandomness") -const WitnetRequestRandomness = artifacts.require("WitnetRequestRandomness") - -module.exports = async function (_deployer, network) { - const [realm, chain] = utils.getRealmNetworkFromString(network.split("-")[0]) - - const randomizer = await WitnetRandomness.at(addresses[realm][chain].WitnetRandomness) - const request = await WitnetRequestRandomness.at(await randomizer.witnetRandomnessRequest.call()) - const owner = await request.owner.call() - const radonSLA = { ...(await request.witnessingParams.call()) } - - console.log("> WitnetRandomness address:", randomizer.address) - console.log("> WitnetRequestRandomness address:", request.address) - console.log("> WitnetRequestRadnomness owner:", owner) - console.log("> Current commit/reval fee:", radonSLA.witnessingUnitaryFee) - console.log("> Current number of witnesses:", radonSLA.numWitnesses) - console.log("> Current witnessing reward:", radonSLA.witnessingReward) - console.log("> Current witnessing collateral:", radonSLA.witnessingCollateral) - console.log("> Current witnessing consensus:", radonSLA.minWitnessingConsensus, "%") - - const tbs = [false, false, false, false, false] - process.argv.map((argv, index, args) => { - if (argv === "--reward") { - if (args[index + 1] !== radonSLA.witnessingReward) { - radonSLA.witnessingReward = args[index + 1] - tbs[3] = true - } - } else if (argv === "--collateral") { - if (args[index + 1] !== radonSLA.witnessingCollateral) { - radonSLA.witnessingCollateral = args[index + 1] - tbs[2] = true - } - } else if (argv === "--witnesses") { - if (args[index + 1] !== radonSLA.numWitnesses) { - radonSLA.numWitnesses = args[index + 1] - tbs[0] = true - } - } else if (argv === "--quorum") { - if (args[index + 1] !== radonSLA.minWitnessingConsensus) { - radonSLA.minWitnessingConsensus = args[index + 1] - tbs[1] = true - } - } else if (argv === "--unitary-fee") { - if (args[index + 1] !== radonSLA.witnessingUnitaryFee) { - radonSLA.witnessingUnitaryFee = args[index + 1] - tbs[4] = true - } - } - return argv - }) - if (tbs[2]) { - console.log(`\n=> Setting witnessing collateral to ${radonSLA.witnessingCollateral}...`) - try { - const tx = await request.setWitnessingCollateral( - radonSLA.witnessingCollateral, - { from: owner } - ) - console.log(" > transaction hash:", tx.receipt.transactionHash) - } catch (ex) { - console.log(" > Failed:", ex) - } - } - if (tbs[3] || tbs[4]) { - console.log(`\n=> Setting witnessing reward to ${radonSLA.witnessingReward}...`) - console.log(`=> Setting commit/reveal fee to ${radonSLA.witnessingUnitaryFee}...`) - try { - const tx = await request.setWitnessingFees( - radonSLA.witnessingReward, - radonSLA.witnessingUnitaryFee, - { from: owner } - ) - console.log(" > transaction hash:", tx.receipt.transactionHash) - } catch (ex) { - console.log(" > Failed:", ex) - } - } - if (tbs[0] || tbs[1]) { - console.log(`\n=> Setting number of witnesses to ${radonSLA.numWitnesses}...`) - console.log(`=> Setting witnessing consensus to ${radonSLA.minWitnessingConsensus}%...`) - try { - const tx = await request.setWitnessingQuorum( - radonSLA.numWitnesses, - radonSLA.minWitnessingConsensus, - { from: owner } - ) - console.log(" > transaction hash:", tx.receipt.transactionHash) - } catch (ex) { - console.log(" > Failed:", ex) - } - } - console.log() -} diff --git a/migrations/scripts/1_Create2Factory.js b/migrations/scripts/1_Create2Factory.js deleted file mode 100644 index 461307ab9..000000000 --- a/migrations/scripts/1_Create2Factory.js +++ /dev/null @@ -1,59 +0,0 @@ -const fs = require("fs") - -const addresses = require("../witnet.addresses") -const utils = require("../../scripts/utils") - -const Create2Factory = artifacts.require("Create2Factory") - -module.exports = async function (deployer, network, [, from,,,,, master]) { - const isDryRun = network === "test" || network.split("-")[1] === "fork" || network.split("-")[0] === "develop" - const ecosystem = utils.getRealmNetworkFromArgs()[0] - network = network.split("-")[0] - - if (!addresses[ecosystem]) addresses[ecosystem] = {} - if (!addresses[ecosystem][network]) addresses[ecosystem][network] = {} - - let factory - if (utils.isNullAddress(addresses[ecosystem][network]?.Create2Factory)) { - await deployer.deploy(Create2Factory, { from: master }) - factory = await Create2Factory.deployed() - addresses[ecosystem][network].Create2Factory = factory.address - if (!isDryRun) { - utils.saveAddresses(addresses) - } - } else { - factory = await Create2Factory.at(addresses[ecosystem][network].Create2Factory) - Create2Factory.address = factory.address - utils.traceHeader("Skipping 'Create2Factory'") - console.info(" > Contract address:", factory.address) - console.info() - } - - // Settle WitnetProxy bytecode and source code as to guarantee - // salted addresses remain as expected no matter if the solc version - // is changed in migrations/witnet.settings.js - utils.traceHeader("Defrosting 'WitnetProxy' artifact") - fs.writeFileSync( - `build/${ecosystem}/contracts/WitnetProxy.json`, - fs.readFileSync("migrations/abis/WitnetProxy.json"), - { encoding: "utf8", flag: "w" } - ) - const WitnetProxy = artifacts.require("WitnetProxy") - const metadata = JSON.parse(WitnetProxy.metadata) - console.info(" ", "> compiler: ", metadata.compiler.version) - console.info(" ", "> compilation target:", metadata.settings.compilationTarget) - console.info(" ", "> evmVersion: ", metadata.settings.evmVersion) - console.info(" ", "> optimizer: ", JSON.stringify(metadata.settings.optimizer)) - - if (addresses[ecosystem][network]?.WitnetProxy === "") { - await deployer.deploy(WitnetProxy, { from }) - addresses[ecosystem][network].WitnetProxy = WitnetProxy.address - } else { - if (addresses[ecosystem][network]?.WitnetProxy) { - WitnetProxy.address = addresses[ecosystem][network]?.WitnetProxy - } - } - if (!isDryRun) { - utils.saveAddresses(addresses) - } -} diff --git a/migrations/scripts/1_deployer.js b/migrations/scripts/1_deployer.js new file mode 100644 index 000000000..77b526539 --- /dev/null +++ b/migrations/scripts/1_deployer.js @@ -0,0 +1,36 @@ +const utils = require("../../src/utils") + +const WitnetDeployer = artifacts.require("WitnetDeployer") +const WitnetProxy = artifacts.require("WitnetProxy") + +module.exports = async function (deployer, network, [,,, master]) { + const addresses = await utils.readJsonFromFile("./migrations/addresses.json") + if (!addresses[network]) addresses[network] = {} + + const factoryAddr = addresses[network]?.WitnetDeployer || addresses?.default?.WitnetDeployer || "" + if ( + utils.isNullAddress(factoryAddr) || + (await web3.eth.getCode(factoryAddr)).length < 3 + ) { + await deployer.deploy(WitnetDeployer, { from: master }) + const factory = await WitnetDeployer.deployed() + addresses[network].WitnetDeployer = factory.address + if (!utils.isDryRun(network)) { + await utils.overwriteJsonFile("./migrations/addresses.json", addresses) + } + } else { + const factory = await WitnetDeployer.at(factoryAddr) + WitnetDeployer.address = factory.address + utils.traceHeader("Skipped 'WitnetDeployer'") + console.info(" > Contract address:", factory.address) + console.info() + } + + if (utils.isNullAddress(addresses[network]?.WitnetProxy)) { + await deployer.deploy(WitnetProxy, { from: master }) + addresses[network].WitnetProxy = WitnetProxy.address + if (!utils.isDryRun(network)) { + await utils.overwriteJsonFile("./migrations/addresses.json", addresses) + } + } +} diff --git a/migrations/scripts/2_WitnetLibs.js b/migrations/scripts/2_WitnetLibs.js deleted file mode 100644 index 657a3d09d..000000000 --- a/migrations/scripts/2_WitnetLibs.js +++ /dev/null @@ -1,44 +0,0 @@ -const utils = require("../../scripts/utils") - -const WitnetErrorsLib = artifacts.require("WitnetErrorsLib") -const WitnetEncodingLib = artifacts.require("WitnetEncodingLib") - -module.exports = async function (deployer, network, [, from]) { - const isDryRun = network === "test" || network.split("-")[1] === "fork" || network.split("-")[0] === "develop" - const ecosystem = utils.getRealmNetworkFromArgs()[0] - network = network.split("-")[0] - - const addresses = require("../witnet.addresses") - if (!addresses[ecosystem]) addresses[ecosystem] = {} - if (!addresses[ecosystem][network]) addresses[ecosystem][network] = {} - - let lib - if (utils.isNullAddress(addresses[ecosystem][network]?.WitnetErrorsLib)) { - await deployer.deploy(WitnetErrorsLib, { from }) - lib = await WitnetErrorsLib.deployed() - addresses[ecosystem][network].WitnetErrorsLib = lib.address - } else { - lib = await WitnetErrorsLib.at(addresses[ecosystem][network]?.WitnetErrorsLib) - WitnetErrorsLib.address = lib.address - utils.traceHeader("Skipping 'WitnetErrorsLib'") - console.info(" ", "> library address:", lib.address) - console.info() - } - if (!isDryRun) { - utils.saveAddresses(addresses) - } - if (utils.isNullAddress(addresses[ecosystem][network]?.WitnetEncodingLib)) { - await deployer.deploy(WitnetEncodingLib, { from }) - lib = await WitnetEncodingLib.deployed() - addresses[ecosystem][network].WitnetEncodingLib = lib.address - } else { - lib = await WitnetEncodingLib.at(addresses[ecosystem][network]?.WitnetEncodingLib) - WitnetEncodingLib.address = lib.address - utils.traceHeader("Skipping 'WitnetEncodingLib'") - console.info(" ", "> library address:", lib.address) - console.info() - } - if (!isDryRun) { - utils.saveAddresses(addresses) - } -} diff --git a/migrations/scripts/2_libs.js b/migrations/scripts/2_libs.js new file mode 100644 index 000000000..859fe8aa9 --- /dev/null +++ b/migrations/scripts/2_libs.js @@ -0,0 +1,52 @@ +const settings = require("../../settings") +const utils = require("../../src/utils") + +const WitnetDeployer = artifacts.require("WitnetDeployer") + +module.exports = async function (_, network, [, from]) { + const addresses = await utils.readJsonFromFile("./migrations/addresses.json") + if (!addresses[network]) addresses[network] = {} + + const targets = settings.getArtifacts(network) + const libs = [ + targets.WitnetErrorsLib, + targets.WitnetEncodingLib, + targets.WitnetPriceFeedsLib, + ] + + const selection = utils.getWitnetArtifactsFromArgs() + + const deployer = await WitnetDeployer.deployed() + for (const index in libs) { + const key = libs[index] + const artifact = artifacts.require(key) + if ( + utils.isNullAddress(addresses[network][key]) || + (await web3.eth.getCode(addresses[network][key])).length < 3 || + selection.includes(key) + ) { + utils.traceHeader(`Deploying '${key}'...`) + const libInitCode = artifact.toJSON().bytecode + const libAddr = await deployer.determineAddr.call(libInitCode, "0x0", { from }) + console.info(" ", "> account: ", from) + console.info(" ", "> balance: ", web3.utils.fromWei(await web3.eth.getBalance(from), "ether"), "ETH") + const tx = await deployer.deploy(libInitCode, "0x0", { from }) + utils.traceTx(tx) + if ((await web3.eth.getCode(libAddr)).length > 3) { + addresses[network][key] = libAddr + } else { + console.info(`Error: Library was not deployed on expected address: ${libAddr}`) + process.exit(1) + } + if (!utils.isDryRun(network)) { + await utils.overwriteJsonFile("./migrations/addresses.json", addresses) + } + } else { + utils.traceHeader(`Skipped '${key}'`) + } + artifact.address = addresses[network][key] + console.info(" ", "> library address: ", artifact.address) + console.info(" ", "> library codehash: ", web3.utils.soliditySha3(await web3.eth.getCode(artifact.address))) + console.info() + } +} diff --git a/migrations/scripts/3_WitnetBytecodes.js b/migrations/scripts/3_WitnetBytecodes.js deleted file mode 100644 index dccaff2a2..000000000 --- a/migrations/scripts/3_WitnetBytecodes.js +++ /dev/null @@ -1,127 +0,0 @@ -const ethUtils = require("ethereumjs-util") -const { merge } = require("lodash") - -const addresses = require("../witnet.addresses") -const settings = require("../witnet.settings") -const singletons = require("../witnet.salts") -const utils = require("../../scripts/utils") -const version = `${ - require("../../package").version -}-${ - require("child_process").execSync("git rev-parse HEAD").toString().trim().substring(0, 7) -}` - -const Create2Factory = artifacts.require("Create2Factory") -const WitnetProxy = artifacts.require("WitnetProxy") -const WitnetBytecodes = artifacts.require("WitnetBytecodes") -const WitnetEncodingLib = artifacts.require("WitnetEncodingLib") - -module.exports = async function (deployer, network, [, from]) { - const isDryRun = network === "test" || network.split("-")[1] === "fork" || network.split("-")[0] === "develop" - const ecosystem = utils.getRealmNetworkFromArgs()[0] - network = network.split("-")[0] - - if (!addresses[ecosystem]) addresses[ecosystem] = {} - if (!addresses[ecosystem][network]) addresses[ecosystem][network] = {} - - const artifactNames = merge(settings.artifacts.default, settings.artifacts[ecosystem], settings.artifacts[network]) - const WitnetBytecodesImplementation = artifacts.require(artifactNames.WitnetBytecodes) - - let proxy - if (utils.isNullAddress(addresses[ecosystem][network]?.WitnetBytecodes)) { - const factory = await Create2Factory.deployed() - if ( - factory && !utils.isNullAddress(factory.address) && - singletons?.WitnetBytecodes - ) { - // Deploy the proxy via a singleton factory and a salt... - const bytecode = WitnetProxy.toJSON().bytecode - const salt = singletons.WitnetBytecodes?.salt - ? "0x" + ethUtils.setLengthLeft( - ethUtils.toBuffer( - singletons.WitnetBytecodes.salt - ), 32 - ).toString("hex") - : "0x0" - - const proxyAddr = await factory.determineAddr.call(bytecode, salt, { from }) - if ((await web3.eth.getCode(proxyAddr)).length <= 3) { - // deploy instance only if not found in current network: - utils.traceHeader("Singleton inception of 'WitnetBytecodes':") - const balance = await web3.eth.getBalance(from) - const gas = singletons.WitnetBytecodes.gas - const tx = await factory.deploy(bytecode, salt, { from, gas }) - utils.traceTx( - tx.receipt, - web3.utils.fromWei((balance - await web3.eth.getBalance(from)).toString()) - ) - } else { - utils.traceHeader("Singleton 'WitnetBytecodes':") - } - console.info(" ", "> proxy address: ", proxyAddr) - console.info(" ", "> proxy codehash: ", web3.utils.soliditySha3(await web3.eth.getCode(proxyAddr))) - console.info(" ", "> proxy inception salt:", salt) - proxy = await WitnetProxy.at(proxyAddr) - } else { - // Deploy no singleton proxy ... - proxy = await WitnetProxy.new({ from }) - } - addresses[ecosystem][network].WitnetBytecodes = proxy.address - if (!isDryRun) { - utils.saveAddresses(addresses) - } - } else { - proxy = await WitnetProxy.at(addresses[ecosystem][network].WitnetBytecodes) - console.info(` Skipped: 'WitnetBytecodes' deployed at ${proxy.address}`) - } - WitnetBytecodes.address = proxy.address - - let bytecodes - if (utils.isNullAddress(addresses[ecosystem][network]?.WitnetBytecodesImplementation)) { - await deployer.link(WitnetEncodingLib, [WitnetBytecodesImplementation]) - await deployer.deploy( - WitnetBytecodesImplementation, - /* _isUpgradeable */ true, - /* _versionTag */ utils.fromAscii(version), - { from } - ) - bytecodes = await WitnetBytecodesImplementation.deployed() - addresses[ecosystem][network].WitnetBytecodesImplementation = bytecodes.address - if (!isDryRun) { - utils.saveAddresses(addresses) - } - } else { - bytecodes = await WitnetBytecodesImplementation.at(addresses[ecosystem][network].WitnetBytecodesImplementation) - console.info(` Skipped: '${WitnetBytecodesImplementation.contractName}' deployed at ${bytecodes.address}`) - console.info() - WitnetBytecodesImplementation.address = bytecodes.address - await deployer.link(WitnetEncodingLib, WitnetBytecodesImplementation) - } - - const implementation = await proxy.implementation.call({ from }) - if (implementation.toLowerCase() !== bytecodes.address.toLowerCase()) { - const header = `Upgrading 'WitnetBytecodes' at ${proxy.address}...` - console.info() - console.info(" ", header) - console.info(" ", "-".repeat(header.length)) - console.info() - console.info(" > old implementation:", implementation) - console.info(" > new implementation:", bytecodes.address, `(v${await bytecodes.version.call({ from })})`) - if ( - isDryRun || - ["y", "yes"].includes((await utils.prompt(" > Upgrade the proxy ? [y/N] ")).toLowerCase().trim()) - ) { - try { - const tx = await proxy.upgradeTo(bytecodes.address, "0x", { from }) - console.info(" => transaction hash :", tx.receipt.transactionHash) - console.info(" => transaction gas :", tx.receipt.gasUsed) - console.info(" > Done.") - } catch (ex) { - console.info(" !! Cannot upgrade the proxy:") - console.info(ex) - } - } else { - console.info(" > Not upgraded.") - } - } -} diff --git a/migrations/scripts/3_core.js b/migrations/scripts/3_core.js new file mode 100644 index 000000000..b2d001c7e --- /dev/null +++ b/migrations/scripts/3_core.js @@ -0,0 +1,173 @@ +const ethUtils = require("ethereumjs-util") +const settings = require("../../settings") +const utils = require("../../src/utils") +const version = `${ + require("../../package").version +}-${ + require("child_process").execSync("git rev-parse HEAD").toString().trim().substring(0, 7) +}` + +const WitnetDeployer = artifacts.require("WitnetDeployer") + +module.exports = async function (_, network, [, from]) { + const specs = settings.getSpecs(network) + const targets = settings.getArtifacts(network) + + // Deploy/upgrade WitnetRequestBytecodes target implementation, if required + await deploy({ + network, + targets, + from: utils.isDryRun(network) ? from : specs.WitnetRequestBytecodes.from || from, + key: targets.WitnetRequestBytecodes, + libs: specs.WitnetRequestBytecodes.libs, + immutables: specs.WitnetRequestBytecodes.immutables, + intrinsics: { + types: ["bool", "bytes32"], + values: [ + /* _upgradable */ true, + /* _versionTag */ utils.fromAscii(version), + ], + }, + }) + + // Deploy/upgrade WitnetRequestFactory target implementation, if required + await deploy({ + network, + targets, + from: utils.isDryRun(network) ? from : specs.WitnetRequestFactory.from || from, + key: targets.WitnetRequestFactory, + libs: specs.WitnetRequestFactory.libs, + immutables: specs.WitnetRequestFactory.immutables, + intrinsics: { + types: ["address", "address", "bool", "bytes32"], + values: [ + /* _witnet */ await determineProxyAddr(from, specs.WitnetOracle?.vanity || 3), + /* _registry */ await determineProxyAddr(from, specs.WitnetRequestBytecodes?.vanity || 1), + /* _upgradable */ true, + /* _versionTag */ utils.fromAscii(version), + ], + }, + }) + + // Deploy/upgrade WitnetOracle target implementation, if required + await deploy({ + network, + targets, + from: utils.isDryRun(network) ? from : specs.WitnetOracle.from || from, + key: targets.WitnetOracle, + libs: specs.WitnetOracle.libs, + immutables: specs.WitnetOracle.immutables, + intrinsics: { + types: ["address", "address", "bool", "bytes32"], + values: [ + /* _factory */ await determineProxyAddr(from, specs.WitnetRequestFactory?.vanity || 2), + /* _registry */ await determineProxyAddr(from, specs.WitnetRequestBytecodes?.vanity || 1), + /* _upgradable */ true, + /* _versionTag */ utils.fromAscii(version), + ], + }, + }) + + // Deploy/upgrade WitnetPriceFeeds target implementation, if required + await deploy({ + network, + targets, + from: utils.isDryRun(network) ? from : specs.WitnetPriceFeeds.from || from, + key: targets.WitnetPriceFeeds, + libs: specs.WitnetPriceFeeds.libs, + immutables: specs.WitnetPriceFeeds.immutables, + intrinsics: { + types: ["address", "bool", "bytes32"], + values: [ + /* _witnet */ await determineProxyAddr(from, specs.WitnetOracle?.vanity || 3), + /* _upgradable */ true, + /* _versionTag */ utils.fromAscii(version), + ], + }, + }) +} + +async function deploy (specs) { + const { from, key, libs, intrinsics, immutables, network, targets } = specs + + const addresses = await utils.readJsonFromFile("./migrations/addresses.json") + if (!addresses[network]) addresses[network] = {} + + const selection = utils.getWitnetArtifactsFromArgs() + + const contract = artifacts.require(key) + if ( + utils.isNullAddress(addresses[network][key]) || + (await web3.eth.getCode(addresses[network][key])).length < 3 || + selection.includes(key) || + (libs && selection.filter(item => libs.includes(item)).length > 0) + ) { + utils.traceHeader(`Deploying '${key}'...`) + console.info(" ", "> account: ", from) + console.info(" ", "> balance: ", web3.utils.fromWei(await web3.eth.getBalance(from), "ether"), "ETH") + const deployer = await WitnetDeployer.deployed() + let { types, values } = intrinsics + if (immutables?.types) types = [...types, ...immutables.types] + if (immutables?.values) values = [...values, ...immutables.values] + const constructorArgs = web3.eth.abi.encodeParameters(types, values) + if (constructorArgs.length > 2) { + console.info(" ", "> constructor types:", JSON.stringify(types)) + console.info(" ", "> constructor args: ", constructorArgs.slice(2)) + } + const coreBytecode = link(contract.toJSON().bytecode, libs, targets) + if (coreBytecode.indexOf("__") > -1) { + console.info(coreBytecode) + console.info("Error: Cannot deploy due to some missing libs") + process.exit(1) + } + const coreInitCode = coreBytecode + constructorArgs.slice(2) + const coreAddr = await deployer.determineAddr.call(coreInitCode, "0x0", { from }) + const tx = await deployer.deploy(coreInitCode, "0x0", { from }) + utils.traceTx(tx) + if ((await web3.eth.getCode(coreAddr)).length > 3) { + addresses[network][key] = coreAddr + } else { + console.info(`Error: Contract was not deployed on expected address: ${coreAddr}`) + process.exit(1) + } + // save addresses file if required + if (!utils.isDryRun(network)) { + await utils.overwriteJsonFile("./migrations/addresses.json", addresses) + const args = await utils.readJsonFromFile("./migrations/constructorArgs.json") + if (!args[network]) args[network] = {} + args[network][key] = constructorArgs.slice(2) + await utils.overwriteJsonFile("./migrations/constructorArgs.json", args) + } + } else { + utils.traceHeader(`Skipped '${key}'`) + } + contract.address = addresses[network][key] + for (const index in libs) { + const libname = libs[index] + const lib = artifacts.require(libname) + contract.link(lib) + console.info(" ", "> external library: ", `${libname}@${lib.address}`) + }; + console.info(" ", "> contract address: ", contract.address) + console.info(" ", "> contract codehash:", web3.utils.soliditySha3(await web3.eth.getCode(contract.address))) + console.info() + return contract +} + +async function determineProxyAddr (from, nonce) { + const salt = nonce ? "0x" + ethUtils.setLengthLeft(ethUtils.toBuffer(nonce), 32).toString("hex") : "0x0" + const deployer = await WitnetDeployer.deployed() + return await deployer.determineProxyAddr.call(salt, { from }) +} + +function link (bytecode, libs, targets) { + if (libs && Array.isArray(libs) && libs.length > 0) { + for (const index in libs) { + const key = targets[libs[index]] + const lib = artifacts.require(key) + bytecode = bytecode.replaceAll(`__${key}${"_".repeat(38 - key.length)}`, lib.address.slice(2)) + console.info(" ", `> linked library: ${key} => ${lib.address}`) + } + } + return bytecode +} diff --git a/migrations/scripts/4_WitnetRequestFactory.js b/migrations/scripts/4_WitnetRequestFactory.js deleted file mode 100644 index db5102a15..000000000 --- a/migrations/scripts/4_WitnetRequestFactory.js +++ /dev/null @@ -1,126 +0,0 @@ -const ethUtils = require("ethereumjs-util") -const { merge } = require("lodash") - -const addresses = require("../witnet.addresses") -const settings = require("../witnet.settings") -const singletons = require("../witnet.salts") -const utils = require("../../scripts/utils") -const version = `${ - require("../../package").version -}-${ - require("child_process").execSync("git rev-parse HEAD").toString().trim().substring(0, 7) -}` - -const Create2Factory = artifacts.require("Create2Factory") -const WitnetProxy = artifacts.require("WitnetProxy") - -const WitnetBytecodes = artifacts.require("WitnetBytecodes") -const WitnetRequestFactory = artifacts.require("WitnetRequestFactory") - -module.exports = async function (deployer, network, [, from]) { - const isDryRun = network === "test" || network.split("-")[1] === "fork" || network.split("-")[0] === "develop" - const ecosystem = utils.getRealmNetworkFromArgs()[0] - network = network.split("-")[0] - - if (!addresses[ecosystem]) addresses[ecosystem] = {} - if (!addresses[ecosystem][network]) addresses[ecosystem][network] = {} - - const artifactNames = merge(settings.artifacts.default, settings.artifacts[ecosystem], settings.artifacts[network]) - const WitnetRequestFactoryImplementation = artifacts.require(artifactNames.WitnetRequestFactory) - - let proxy - if (utils.isNullAddress(addresses[ecosystem][network]?.WitnetRequestFactory)) { - const create2Factory = await Create2Factory.deployed() - if ( - create2Factory && !utils.isNullAddress(create2Factory.address) && - singletons?.WitnetRequestFactory - ) { - // Deploy the proxy via a singleton factory and a salt... - const bytecode = WitnetProxy.toJSON().bytecode - const salt = singletons.WitnetRequestFactory?.salt - ? "0x" + ethUtils.setLengthLeft( - ethUtils.toBuffer( - singletons.WitnetRequestFactory.salt - ), 32 - ).toString("hex") - : "0x0" - - const proxyAddr = await create2Factory.determineAddr.call(bytecode, salt, { from }) - if ((await web3.eth.getCode(proxyAddr)).length <= 3) { - // deploy instance only if not found in current network: - utils.traceHeader("Singleton inception of 'WitnetRequestFactory':") - const balance = await web3.eth.getBalance(from) - const gas = singletons.WitnetRequestFactory.gas - const tx = await create2Factory.deploy(bytecode, salt, { from, gas }) - utils.traceTx( - tx.receipt, - web3.utils.fromWei((balance - await web3.eth.getBalance(from)).toString()) - ) - } else { - utils.traceHeader("Singleton 'WitnetRequestFactory':") - } - console.info(" ", "> proxy address: ", proxyAddr) - console.info(" ", "> proxy codehash: ", web3.utils.soliditySha3(await web3.eth.getCode(proxyAddr))) - console.info(" ", "> proxy inception salt:", salt) - proxy = await WitnetProxy.at(proxyAddr) - } else { - // Deploy no singleton proxy ... - proxy = await WitnetProxy.new({ from }) - } - addresses[ecosystem][network].WitnetRequestFactory = proxy.address - if (!isDryRun) { - utils.saveAddresses(addresses) - } - } else { - proxy = await WitnetProxy.at(addresses[ecosystem][network].WitnetRequestFactory) - console.info(` Skipped: 'WitnetRequestFactory' deployed at ${proxy.address}`) - } - WitnetRequestFactory.address = proxy.address - - let factory - if (utils.isNullAddress(addresses[ecosystem][network]?.WitnetRequestFactoryImplementation)) { - await deployer.deploy( - WitnetRequestFactoryImplementation, - addresses[ecosystem][network].WitnetBytecodes || WitnetBytecodes.address, - /* _isUpgradeable */ true, - /* _versionTag */ utils.fromAscii(version), - { from } - ) - factory = await WitnetRequestFactoryImplementation.deployed() - addresses[ecosystem][network].WitnetRequestFactoryImplementation = factory.address - if (!isDryRun) { - utils.saveAddresses(addresses) - } - } else { - factory = await WitnetRequestFactoryImplementation.at(addresses[ecosystem][network].WitnetRequestFactoryImplementation) - console.info(` Skipped: '${WitnetRequestFactoryImplementation.contractName}' deployed at ${factory.address}`) - WitnetRequestFactoryImplementation.address = factory.address - } - - const implementation = await proxy.implementation.call({ from }) - if (implementation.toLowerCase() !== factory.address.toLowerCase()) { - const header = `Upgrading 'WitnetRequestFactory' at ${proxy.address}...` - console.info() - console.info(" ", header) - console.info(" ", "-".repeat(header.length)) - console.info() - console.info(" > old implementation:", implementation) - console.info(" > new implementation:", factory.address, `(v${await factory.version.call({ from })})`) - if ( - isDryRun || - ["y", "yes"].includes((await utils.prompt(" > Upgrade the proxy ? [y/N] ")).toLowerCase().trim()) - ) { - try { - const tx = await proxy.upgradeTo(factory.address, "0x", { from }) - console.info(" => transaction hash :", tx.receipt.transactionHash) - console.info(" => transaction gas :", tx.receipt.gasUsed) - console.info(" > Done.") - } catch (ex) { - console.info(" !! Cannot upgrade the proxy:") - console.info(ex) - } - } else { - console.info(" > Not upgraded.") - } - } -} diff --git a/migrations/scripts/4_proxies.js b/migrations/scripts/4_proxies.js new file mode 100644 index 000000000..173fddc7a --- /dev/null +++ b/migrations/scripts/4_proxies.js @@ -0,0 +1,148 @@ +const ethUtils = require("ethereumjs-util") +const merge = require("lodash.merge") +const settings = require("../../settings") +const utils = require("../../src/utils") + +const version = `${ + require("../../package").version +}-${ + require("child_process").execSync("git rev-parse HEAD").toString().trim().substring(0, 7) +}` + +const WitnetDeployer = artifacts.require("WitnetDeployer") +const WitnetProxy = artifacts.require("WitnetProxy") + +module.exports = async function (_, network, [, from, reporter]) { + const targets = settings.getArtifacts(network) + const specs = settings.getSpecs(network) + + const singletons = [ + "WitnetRequestBytecodes", + "WitnetRequestFactory", + "WitnetOracle", + "WitnetPriceFeeds", + ] + + // inject `reporter` within array of addresses as first initialization args + specs.WitnetOracle.mutables = merge({ + types: ["address[]"], + values: [[reporter]], + }, specs.WitnetOracle.mutables + ) + + // Deploy/upgrade singleton proxies, if required + for (const index in singletons) { + const key = singletons[index] + await deploy({ + network, + specs, + targets, + key, + from: utils.isDryRun(network) ? from : specs[key].from || from, + }) + } +} + +async function deploy (target) { + const { from, key, network, specs, targets } = target + + const addresses = await utils.readJsonFromFile("./migrations/addresses.json") + if (!addresses[network]) addresses[network] = {} + + const mutables = specs[key].mutables + const proxy = artifacts.require(key) + const proxySalt = specs[key].vanity + ? "0x" + ethUtils.setLengthLeft(ethUtils.toBuffer(specs[key].vanity), 32).toString("hex") + : "0x0" + + let proxyAddr = addresses[network][key] || addresses?.default[key] || "" + if (utils.isNullAddress(proxyAddr) || (await web3.eth.getCode(proxyAddr)).length < 3) { + utils.traceHeader(`Deploying '${key}'...`) + console.info(" ", "> account: ", from) + console.info(" ", "> balance: ", web3.utils.fromWei(await web3.eth.getBalance(from), "ether"), "ETH") + const deployer = await WitnetDeployer.deployed() + const impl = await artifacts.require(targets[key]).deployed() + proxyAddr = await deployer.determineProxyAddr.call(proxySalt, { from }) + if ((await web3.eth.getCode(proxyAddr)).length < 3) { + const initdata = mutables ? web3.eth.abi.encodeParameters(mutables.types, mutables.values) : "0x" + if (initdata.length > 2) { + console.info(" ", "> initialize types: ", mutables.types) + console.info(" ", "> initialize params:", mutables.values) + } + const tx = await deployer.proxify(proxySalt, impl.address, initdata, { from }) + utils.traceTx(tx) + } else { + try { + const oldImplAddr = await getProxyImplementation(from, proxyAddr) + const oldImpl = await artifacts.require(targets[key]).at(oldImplAddr) + const oldClass = await oldImpl.class.call({ from }) + const newClass = await impl.class.call({ from }) + if (oldClass !== newClass) { + console.info(`Error: proxy address already taken ("${oldClass}" != "${newClass}")`) + process.exit(1) + } else { + console.info(" ", `> recovered proxy address on class "${oldClass}" ;-)`) + } + } catch (ex) { + console.info("Error: cannot check proxy recoverability:", ex) + } + } + if ((await web3.eth.getCode(proxyAddr)).length > 3) { + addresses[network][key] = proxyAddr + } else { + console.info(`Error: Contract was not deployed on expected address: ${proxyAddr}`) + process.exit(1) + } + if (!utils.isDryRun(network)) { + await utils.overwriteJsonFile("./migrations/addresses.json", addresses) + } + } else { + const oldAddr = await getProxyImplementation(from, proxyAddr) + const newImpl = await artifacts.require(targets[key]).deployed() + if (oldAddr !== newImpl.address) { + utils.traceHeader(`Upgrading '${key}'...`) + const newVersion = await newImpl.version.call({ from }) + const color = newVersion === version ? "\x1b[1;97m" : "\x1b[93m" + if ( + (process.argv.length >= 3 && process.argv[2].includes("--upgrade-all")) || ( + ["y", "yes"].includes((await + utils.prompt(` > Upgrade to ${color}${targets[key]} v${newVersion}\x1b[0m? (y/N) `) + ).toLowerCase().trim()) + ) + ) { + const initdata = mutables ? web3.eth.abi.encodeParameters(mutables.types, mutables.values) : "0x" + if (initdata.length > 2) { + console.info(" ", "> initialize types: ", mutables.types) + console.info(" ", "> initialize params:", mutables.values) + } + try { + const tx = await upgradeProxyTo(from, proxyAddr, newImpl.address, initdata) + utils.traceTx(tx) + } catch (ex) { + console.error(" ", "> Exception:\n", ex) + } + } + } else { + utils.traceHeader(`Skipped '${key}'`) + } + } + proxy.address = proxyAddr + const impl = await artifacts.require(targets[key]).at(proxy.address) + console.info(" ", "> proxy address: ", impl.address) + console.info(" ", "> proxy codehash: ", web3.utils.soliditySha3(await web3.eth.getCode(impl.address))) + console.info(" ", "> proxy operator: ", await impl.owner.call({ from })) + console.info(" ", "> impl. address: ", await getProxyImplementation(from, proxy.address)) + console.info(" ", "> impl. version: ", await impl.version.call({ from })) + console.info() + return proxy +} + +async function getProxyImplementation (from, proxyAddr) { + const proxy = await WitnetProxy.at(proxyAddr) + return await proxy.implementation.call({ from }) +} + +async function upgradeProxyTo (from, proxyAddr, implAddr, initData) { + const proxyContract = await WitnetProxy.at(proxyAddr) + return await proxyContract.upgradeTo(implAddr, initData, { from }) +} diff --git a/migrations/scripts/5_WitnetRequestBoard.js b/migrations/scripts/5_WitnetRequestBoard.js deleted file mode 100644 index 9f180baab..000000000 --- a/migrations/scripts/5_WitnetRequestBoard.js +++ /dev/null @@ -1,146 +0,0 @@ -const ethUtils = require("ethereumjs-util") -const { merge } = require("lodash") - -const addresses = require("../witnet.addresses") -const settings = require("../witnet.settings") -const singletons = require("../witnet.salts") -const utils = require("../../scripts/utils") -const version = `${ - require("../../package").version -}-${ - require("child_process").execSync("git rev-parse HEAD").toString().trim().substring(0, 7) -}` - -const Create2Factory = artifacts.require("Create2Factory") -const WitnetProxy = artifacts.require("WitnetProxy") - -const WitnetErrorsLib = artifacts.require("WitnetErrorsLib") -const WitnetRequestFactory = artifacts.require("WitnetRequestFactory") -const WitnetRequestBoard = artifacts.require("WitnetRequestBoard") - -module.exports = async function (deployer, network, [, from, reporter]) { - const isDryRun = network === "test" || network.split("-")[1] === "fork" || network.split("-")[0] === "develop" - const ecosystem = utils.getRealmNetworkFromArgs()[0] - network = network.split("-")[0] - - if (!addresses[ecosystem]) addresses[ecosystem] = {} - if (!addresses[ecosystem][network]) addresses[ecosystem][network] = {} - - const artifactsName = merge(settings.artifacts.default, settings.artifacts[ecosystem], settings.artifacts[network]) - const WitnetRequestBoardImplementation = artifacts.require(artifactsName.WitnetRequestBoard) - - let proxy - const factory = await Create2Factory.deployed() - if (utils.isNullAddress(addresses[ecosystem][network]?.WitnetRequestBoard)) { - if ( - factory && !utils.isNullAddress(factory.address) && - singletons?.WitnetRequestBoard - ) { - // Deploy the proxy via a singleton factory and a salt... - const bytecode = WitnetProxy.toJSON().bytecode - const salt = singletons.WitnetRequestBoard?.salt - ? "0x" + ethUtils.setLengthLeft( - ethUtils.toBuffer( - singletons.WitnetRequestBoard.salt - ), 32 - ).toString("hex") - : "0x0" - - const proxyAddr = await factory.determineAddr.call(bytecode, salt, { from }) - if ((await web3.eth.getCode(proxyAddr)).length <= 3) { - // deploy instance only if not found in current network: - utils.traceHeader("Singleton inception of 'WitnetRequestBoard':") - const balance = await web3.eth.getBalance(from) - const gas = singletons.WitnetRequestBoard.gas - const tx = await factory.deploy(bytecode, salt, { from, gas }) - utils.traceTx( - tx.receipt, - web3.utils.fromWei((balance - await web3.eth.getBalance(from)).toString()) - ) - } else { - utils.traceHeader("Singleton 'WitnetRequestBoard':") - } - console.info(" ", "> proxy address: ", proxyAddr) - console.info(" ", "> proxy codehash: ", web3.utils.soliditySha3(await web3.eth.getCode(proxyAddr))) - console.info(" ", "> proxy inception salt:", salt) - proxy = await WitnetProxy.at(proxyAddr) - } else { - // Deploy no singleton proxy ... - proxy = await WitnetProxy.new({ from }) - } - // update addresses file - addresses[ecosystem][network].WitnetRequestBoard = proxy.address - if (!isDryRun) { - utils.saveAddresses(addresses) - } - } else { - proxy = await WitnetProxy.at(addresses[ecosystem][network].WitnetRequestBoard) - console.info(` Skipped: 'WitnetRequestBoard' deployed at ${proxy.address}`) - } - WitnetRequestBoard.address = proxy.address - - let board - if (utils.isNullAddress(addresses[ecosystem][network]?.WitnetRequestBoardImplementation)) { - await deployer.link(WitnetErrorsLib, WitnetRequestBoardImplementation) - await deployer.deploy( - WitnetRequestBoardImplementation, - WitnetRequestFactory.address, - /* _isUpgradeable */ true, - /* _versionTag */ utils.fromAscii(version), - ...( - // if defined, use network-specific constructor parameters: - settings.constructorParams[network]?.WitnetRequestBoard || - // otherwise, use ecosystem-specific parameters, if any: - settings.constructorParams[ecosystem]?.WitnetRequestBoard || - // or, default defined parameters for WRBs, if any: - settings.constructorParams?.default?.WitnetRequestBoard - ), - { from } - ) - board = await WitnetRequestBoardImplementation.deployed() - addresses[ecosystem][network].WitnetRequestBoardImplementation = board.address - if (!isDryRun) { - utils.saveAddresses(addresses) - } - } else { - board = await WitnetRequestBoardImplementation.at(addresses[ecosystem][network].WitnetRequestBoardImplementation) - console.info(` Skipped: '${WitnetRequestBoardImplementation.contractName}' deployed at ${board.address}`) - console.info() - WitnetRequestBoardImplementation.address = board.address - await deployer.link(WitnetErrorsLib, WitnetRequestBoardImplementation) - } - - const implementation = await proxy.implementation.call({ from }) - if (implementation.toLowerCase() !== board.address.toLowerCase()) { - const header = `Upgrading 'WitnetRequestBoard' at ${proxy.address}...` - console.info() - console.info(" ", header) - console.info(" ", "-".repeat(header.length)) - console.info() - console.info(" > old implementation:", implementation) - console.info(" > new implementation:", board.address, `(v${await board.version.call({ from })})`) - if ( - isDryRun || - ["y", "yes"].includes((await utils.prompt(" > Upgrade the proxy ? [y/N] ")).toLowerCase().trim()) - ) { - try { - const tx = await proxy.upgradeTo( - board.address, - web3.eth.abi.encodeParameter( - "address[]", - [reporter], - ), - { from } - ) - console.info(" => Transaction hash :", tx.receipt.transactionHash) - console.info(" => Transaction gas :", tx.receipt.gasUsed) - console.info(" > Done.") - } catch (ex) { - console.info(" !! Cannot upgrade the proxy:") - console.info(ex) - } - } else { - console.info(" > Not upgraded.") - } - } -} diff --git a/migrations/scripts/6_WitnetRandomness.js b/migrations/scripts/6_WitnetRandomness.js deleted file mode 100644 index 2df37b91b..000000000 --- a/migrations/scripts/6_WitnetRandomness.js +++ /dev/null @@ -1,154 +0,0 @@ -const ethUtils = require("ethereumjs-util") -const { merge } = require("lodash") - -const addresses = require("../witnet.addresses") -const settings = require("../witnet.settings") -const singletons = require("../witnet.salts") -const utils = require("../../scripts/utils") -const version = `${ - require("../../package").version -}-${ - require("child_process").execSync("git rev-parse HEAD").toString().trim().substring(0, 7) -}` - -const Create2Factory = artifacts.require("Create2Factory") -const WitnetProxy = artifacts.require("WitnetProxy") - -const WitnetRandomness = artifacts.require("WitnetRandomness") -const WitnetRequestBoard = artifacts.require("WitnetRequestBoard") - -module.exports = async function (deployer, network, [, from]) { - const isDryRun = network === "test" || network.split("-")[1] === "fork" || network.split("-")[0] === "develop" - const ecosystem = utils.getRealmNetworkFromArgs()[0] - network = network.split("-")[0] - - if (!addresses[ecosystem]) addresses[ecosystem] = {} - if (!addresses[ecosystem][network]) addresses[ecosystem][network] = {} - - console.info() - if (!isDryRun && addresses[ecosystem][network].WitnetRandomness === undefined) { - console.info(`\n WitnetRandomness: Not to be deployed into '${network}'`) - return - } - - const create2Factory = await Create2Factory.deployed() - - const artifactNames = merge(settings.artifacts.default, settings.artifacts[ecosystem], settings.artifacts[network]) - const WitnetRandomnessImplementation = artifacts.require(artifactNames.WitnetRandomness) - - if (addresses[ecosystem][network].WitnetRandomnessImplementation !== undefined) { - let proxy - if (utils.isNullAddress(addresses[ecosystem][network]?.WitnetRandomness)) { - if ( - create2Factory && !utils.isNullAddress(create2Factory.address) && - singletons?.WitnetRandomness - ) { - // Deploy the proxy via a singleton factory and a salt... - const bytecode = WitnetProxy.toJSON().bytecode - const salt = singletons.WitnetRandomness?.salt - ? "0x" + ethUtils.setLengthLeft( - ethUtils.toBuffer( - singletons.WitnetRandomness.salt - ), 32 - ).toString("hex") - : "0x0" - - const proxyAddr = await create2Factory.determineAddr.call(bytecode, salt, { from }) - if ((await web3.eth.getCode(proxyAddr)).length <= 3) { - // deploy instance only if not found in current network: - utils.traceHeader("Singleton inception of 'WitnetRandomness':") - const balance = await web3.eth.getBalance(from) - const gas = singletons.WitnetRandomness.gas - const tx = await create2Factory.deploy(bytecode, salt, { from, gas }) - utils.traceTx( - tx.receipt, - web3.utils.fromWei((balance - await web3.eth.getBalance(from)).toString()) - ) - } else { - utils.traceHeader("Singleton 'WitnetRandomness':") - } - console.info(" ", "> proxy address: ", proxyAddr) - console.info(" ", "> proxy codehash: ", web3.utils.soliditySha3(await web3.eth.getCode(proxyAddr))) - console.info(" ", "> proxy inception salt:", salt) - proxy = await WitnetProxy.at(proxyAddr) - } else { - // Deploy no singleton proxy ... - proxy = await WitnetProxy.new({ from }) - } - addresses[ecosystem][network].WitnetRandomness = proxy.address - if (!isDryRun) { - utils.saveAddresses(addresses) - } - } else { - proxy = await WitnetProxy.at(addresses[ecosystem][network].WitnetRandomness) - console.info(` Skipped: 'WitnetRandomness' deployed at ${proxy.address}`) - } - WitnetRandomness.address = proxy.address - - let randomness - if (utils.isNullAddress(addresses[ecosystem][network]?.WitnetRandomnessImplementation)) { - await deployer.deploy( - WitnetRandomnessImplementation, - WitnetRequestBoard.address, - /* _versionTag */ utils.fromAscii(version), - { from } - ) - randomness = await WitnetRandomnessImplementation.deployed() - addresses[ecosystem][network].WitnetRandomnessImplementation = randomness.address - if (!isDryRun) { - utils.saveAddresses(addresses) - } - } else { - randomness = await WitnetRandomnessImplementation.at( - addresses[ecosystem][network].WitnetRandomnessImplementation - ) - console.info(` Skipped: '${WitnetRandomnessImplementation.contractName}' deployed at ${randomness.address}`) - WitnetRandomnessImplementation.address = randomness.address - } - - const implementation = await proxy.implementation.call({ from }) - if (implementation.toLowerCase() !== randomness.address.toLowerCase()) { - const header = `Upgrading 'WitnetRandomness' at ${proxy.address}...` - console.info() - console.info(" ", header) - console.info(" ", "-".repeat(header.length)) - console.info() - console.info(" > old implementation:", implementation) - console.info(" > new implementation:", randomness.address, `(v${await randomness.version.call({ from })})`) - if ( - isDryRun || - ["y", "yes"].includes((await utils.prompt(" > Upgrade the proxy ? [y/N] ")).toLowerCase().trim()) - ) { - try { - const tx = await proxy.upgradeTo(randomness.address, "0x", { from }) - console.info(" => transaction hash :", tx.receipt.transactionHash) - console.info(" => transaction gas :", tx.receipt.gasUsed) - console.info(" > Done.") - } catch (ex) { - console.info(" !! Cannot upgrade the proxy:") - console.info(ex) - } - } else { - console.info(" > Not upgraded.") - } - } - } else { - if (utils.isNullAddress(addresses[ecosystem][network]?.WitnetRandomness)) { - // deploy unproxified WitnetRandomness contract - await deployer.deploy( - WitnetRandomnessImplementation, - WitnetRequestBoard.address, - utils.fromAscii(version), - { from } - ) - addresses[ecosystem][network].WitnetRandomness = WitnetRandomnessImplementation.address - if (!isDryRun) { - utils.saveAddresses(addresses) - } - } else { - WitnetRandomnessImplementation.address = addresses[ecosystem][network]?.WitnetRandomness - console.info(` Skipped: unproxied 'WitnetRandomness' deployed at ${WitnetRandomnessImplementation.address}`) - } - WitnetRandomness.address = WitnetRandomnessImplementation.address - } -} diff --git a/migrations/scripts/7_WitnetPriceFeeds.js b/migrations/scripts/7_WitnetPriceFeeds.js deleted file mode 100644 index 3c10eacb7..000000000 --- a/migrations/scripts/7_WitnetPriceFeeds.js +++ /dev/null @@ -1,172 +0,0 @@ -const ethUtils = require("ethereumjs-util") -const { merge } = require("lodash") - -const addresses = require("../witnet.addresses") -const settings = require("../witnet.settings") -const singletons = require("../witnet.salts") -const utils = require("../../scripts/utils") -const version = `${ - require("../../package").version -}-${ - require("child_process").execSync("git rev-parse HEAD").toString().trim().substring(0, 7) -}` - -const Create2Factory = artifacts.require("Create2Factory") -const WitnetProxy = artifacts.require("WitnetProxy") - -const WitnetPriceFeeds = artifacts.require("WitnetPriceFeeds") -const WitnetPriceFeedsLib = artifacts.require("WitnetPriceFeedsLib") -const WitnetRequestBoard = artifacts.require("WitnetRequestBoard") - -module.exports = async function (deployer, network, [, from]) { - const isDryRun = network === "test" || network.split("-")[1] === "fork" || network.split("-")[0] === "develop" - const ecosystem = utils.getRealmNetworkFromArgs()[0] - network = network.split("-")[0] - - if (!addresses[ecosystem]) addresses[ecosystem] = {} - if (!addresses[ecosystem][network]) addresses[ecosystem][network] = {} - - console.info() - if (!isDryRun && addresses[ecosystem][network].WitnetPriceFeeds === undefined) { - console.info(`\n WitnetPriceFeeds: Not to be deployed into '${network}'`) - return - } - - const artifactNames = merge(settings.artifacts.default, settings.artifacts[ecosystem], settings.artifacts[network]) - const WitnetPriceFeedsImplementation = artifacts.require(artifactNames.WitnetPriceFeeds) - - if (utils.isNullAddress(addresses[ecosystem][network]?.WitnetPriceFeedsLib)) { - await deployer.deploy(WitnetPriceFeedsLib, { from }) - const lib = await WitnetPriceFeedsLib.deployed() - addresses[ecosystem][network].WitnetPriceFeedsLib = lib.address - if (!isDryRun) { - utils.saveAddresses(addresses) - } - } else { - const lib = await WitnetPriceFeedsLib.at(addresses[ecosystem][network]?.WitnetPriceFeedsLib) - WitnetPriceFeedsLib.address = lib.address - utils.traceHeader("Skipping 'WitnetPriceFeedsLib'") - console.info(" ", "> library address:", lib.address) - console.info() - } - await deployer.link(WitnetPriceFeedsLib, WitnetPriceFeedsImplementation) - - if (addresses[ecosystem][network]?.WitnetPriceFeedsImplementation !== undefined || isDryRun) { - let proxy - if (utils.isNullAddress(addresses[ecosystem][network]?.WitnetPriceFeeds)) { - const create2Factory = await Create2Factory.deployed() - if ( - create2Factory && !utils.isNullAddress(create2Factory.address) && - singletons?.WitnetPriceFeeds - ) { - // Deploy the proxy via a singleton factory and a salt... - const bytecode = WitnetProxy.toJSON().bytecode - const salt = singletons.WitnetPriceFeeds?.salt - ? "0x" + ethUtils.setLengthLeft( - ethUtils.toBuffer( - singletons.WitnetPriceFeeds.salt - ), 32 - ).toString("hex") - : "0x0" - - const proxyAddr = await create2Factory.determineAddr.call(bytecode, salt, { from }) - if ((await web3.eth.getCode(proxyAddr)).length <= 3) { - // deploy instance only if not found in current network: - utils.traceHeader("Singleton inception of 'WitnetPriceFeeds':") - const balance = await web3.eth.getBalance(from) - const gas = singletons.WitnetPriceFeeds.gas - const tx = await create2Factory.deploy(bytecode, salt, { from, gas }) - utils.traceTx( - tx.receipt, - web3.utils.fromWei((balance - await web3.eth.getBalance(from)).toString()) - ) - } else { - utils.traceHeader("Singleton 'WitnetPriceFeeds':") - } - console.info(" ", "> proxy address: ", proxyAddr) - console.info(" ", "> proxy codehash: ", web3.utils.soliditySha3(await web3.eth.getCode(proxyAddr))) - console.info(" ", "> proxy inception salt:", salt) - proxy = await WitnetProxy.at(proxyAddr) - } else { - // Deploy no singleton proxy ... - proxy = await WitnetProxy.new({ from }) - } - addresses[ecosystem][network].WitnetPriceFeeds = proxy.address - if (!isDryRun) { - utils.saveAddresses(addresses) - } - } else { - proxy = await WitnetProxy.at(addresses[ecosystem][network].WitnetPriceFeeds) - console.info(` Skipped: 'WitnetPriceFeeds' deployed at ${proxy.address}`) - } - - let router - if (utils.isNullAddress(addresses[ecosystem][network]?.WitnetPriceFeedsImplementation)) { - await deployer.deploy( - WitnetPriceFeedsImplementation, - WitnetRequestBoard.address, - true, - utils.fromAscii(version), - { from } - ) - router = await WitnetPriceFeedsImplementation.deployed() - addresses[ecosystem][network].WitnetPriceFeedsImplementation = router.address - if (!isDryRun) { - utils.saveAddresses(addresses) - } - } else { - router = await WitnetPriceFeedsImplementation.at( - addresses[ecosystem][network].WitnetPriceFeedsImplementation - ) - console.info(` Skipped: '${WitnetPriceFeedsImplementation.contractName}' deployed at ${router.address}`) - WitnetPriceFeedsImplementation.address = router.address - } - WitnetPriceFeeds.address = proxy.address - - const implementation = await proxy.implementation.call({ from }) - if (implementation.toLowerCase() !== router.address.toLowerCase()) { - const header = `Upgrading 'WitnetPriceFeeds' at ${proxy.address}...` - console.info() - console.info(" ", header) - console.info(" ", "-".repeat(header.length)) - console.info() - console.info(" > old implementation:", implementation) - console.info(" > new implementation:", router.address, `(v${await router.version.call({ from })})`) - if ( - isDryRun || - ["y", "yes"].includes((await utils.prompt(" > Upgrade the proxy ? [y/N] ")).toLowerCase().trim()) - ) { - try { - const tx = await proxy.upgradeTo(router.address, "0x", { from }) - console.info(" => transaction hash :", tx.receipt.transactionHash) - console.info(" => transaction gas :", tx.receipt.gasUsed) - console.info(" > Done.") - } catch (ex) { - console.info(" !! Cannot upgrade the proxy:") - console.info(ex) - } - } else { - console.info(" > Not upgraded.") - } - } - } else { - if (utils.isNullAddress(addresses[ecosystem][network]?.WitnetPriceFeeds)) { - // deploy unproxified WitnetPriceFeeds contract - await deployer.deploy( - WitnetPriceFeedsImplementation, - WitnetRequestBoard.address, - false, - utils.fromAscii(version), - { from } - ) - addresses[ecosystem][network].WitnetPriceFeeds = WitnetPriceFeedsImplementation.address - if (!isDryRun) { - utils.saveAddresses(addresses) - } - } else { - WitnetPriceFeedsImplementation.address = addresses[ecosystem][network]?.WitnetPriceFeeds - console.info(` Skipped: unproxied 'WitnetPriceFeeds' deployed at ${WitnetPriceFeedsImplementation.address}`) - } - WitnetPriceFeeds.address = WitnetPriceFeedsImplementation.address - } -} diff --git a/migrations/scripts/8_WitnetPriceRouter.js b/migrations/scripts/8_WitnetPriceRouter.js deleted file mode 100644 index 16a807697..000000000 --- a/migrations/scripts/8_WitnetPriceRouter.js +++ /dev/null @@ -1,43 +0,0 @@ -const addresses = require("../witnet.addresses") -const utils = require("../../scripts/utils") -const version = `${ - require("../../package").version -}-${ - require("child_process").execSync("git rev-parse HEAD").toString().trim().substring(0, 7) -}` - -const WitnetPriceRouter = artifacts.require("WitnetPriceRouter") - -module.exports = async function (deployer, network, [, from]) { - const isDryRun = network === "test" || network.split("-")[1] === "fork" || network.split("-")[0] === "develop" - const ecosystem = utils.getRealmNetworkFromArgs()[0] - network = network.split("-")[0] - - if (!addresses[ecosystem]) addresses[ecosystem] = {} - if (!addresses[ecosystem][network]) addresses[ecosystem][network] = {} - - console.info() - if (!isDryRun && addresses[ecosystem][network].WitnetPriceRouter === undefined) { - console.info(`\n WitnetPriceRouter: Not to be deployed into '${network}'`) - return - } - - if ( - isDryRun || - utils.isNullAddress(addresses[ecosystem][network]?.WitnetPriceRouter) - ) { - await deployer.deploy( - WitnetPriceRouter, - false, - utils.fromAscii(version), - { from } - ) - addresses[ecosystem][network].WitnetPriceRouter = WitnetPriceRouter.address - if (!isDryRun) { - utils.saveAddresses(addresses) - } - } else { - WitnetPriceRouter.address = addresses[ecosystem][network].WitnetPriceRouter - console.info(` Skipped: 'WitnetPriceRouter' deployed at ${WitnetPriceRouter.address}`) - } -} diff --git a/migrations/witnet.addresses.json b/migrations/witnet.addresses.json deleted file mode 100644 index 0c8ffa9cc..000000000 --- a/migrations/witnet.addresses.json +++ /dev/null @@ -1,908 +0,0 @@ -{ - "default": { - "ethereum.goerli": { - "WitnetProxy": "0xB5447342cA17A40e59d410b340ba412E22e36201", - "Create2Factory": "0xDe312a6f7fA35320E8DD109c8ea42e82806DC45b", - "WitnetBytecodes": "0x0000000e3a3d22d7510B36BdC88994dab11eadc8", - "WitnetPriceFeeds": "0x9999999d139bdBFbF25923ba39F63bBFc7593400", - "WitnetPriceRouter": "0x1cF3Aa9DBF4880d797945726B94B9d29164211BE", - "WitnetRandomness": "0x0123456fbBC59E181D76B6Fe8771953d1953B51a", - "WitnetRequestBoard": "0xb58D05247d16b3F1BD6B59c52f7f61fFef02BeC8", - "WitnetRequestFactory": "0x1111111FDE7dC956E3d7922Bc779D9E2349Afb63", - "WitnetErrorsLib": "0xc71A87657b13A370594967A04b4301a3AcEAF007", - "WitnetEncodingLib": "", - "WitnetPriceFeedsLib": "0x7A6C2Aad6b4b08De09477D0F663b8f90b0db9662", - "WitnetBytecodesImplementation": "", - "WitnetPriceFeedsImplementation": "0xBfFA2ec6225390C517A1bEB83b27a171C6734294", - "WitnetRandomnessImplementation": "0x685528FA605c31aE076e1ee1707041B7Cb356573", - "WitnetRandomnessImplementationV061": "0x6Eb87EcCe6218Cd0e97299331D2aa5d2e53da5cD", - "WitnetRequestBoardImplementation": "0x0e86a89D9Ae5D6182a853375F19dB23e5c600268", - "WitnetRequestFactoryImplementation": "0xeDA4f244FEe1D6a3EA0fB2c0Fc6b7D1c49fEF01D" - }, - "ethereum.sepolia": { - "WitnetProxy": "0xf6d52770453166de85B6B6260Cf22196bC460E88", - "Create2Factory": "0xDe312a6f7fA35320E8DD109c8ea42e82806DC45b", - "WitnetBytecodes": "0x0000000e3a3d22d7510B36BdC88994dab11eadc8", - "WitnetPriceFeeds": "0x9999999d139bdBFbF25923ba39F63bBFc7593400", - "WitnetPriceRouter": "0xdC101573cB42EB7006Ad6C7E08ce8C91fEAcB62C", - "WitnetRandomness": "0x012345000Db5417269d8c70B0142Ae3eF36d7f3e", - "WitnetRequestBoard": "0x777777772C24e6CD34B464D1d71616C444254537", - "WitnetRequestFactory": "0x1111111FDE7dC956E3d7922Bc779D9E2349Afb63", - "WitnetErrorsLib": "0x20f4B1793bb81FFa357E1705AD954BdC232Edc00", - "WitnetEncodingLib": "0xc71A87657b13A370594967A04b4301a3AcEAF007", - "WitnetPriceFeedsLib": "0xBfFA2ec6225390C517A1bEB83b27a171C6734294", - "WitnetBytecodesImplementation": "0xa45206cC3Ae76630Cc4D47A730590Ff9B6d8Ee54", - "WitnetPriceFeedsImplementation": "0x7a56A80A9B169c046EdD1d8f584455a394bc9C71", - "WitnetRandomnessImplementation": "0x7A6C2Aad6b4b08De09477D0F663b8f90b0db9662", - "WitnetRequestBoardImplementation": "0xd8875D7D3087DEec0103d47d4cE0C4a5414874E1", - "WitnetRequestFactoryImplementation": "0x6F68A4d58cEd8e094b42511350527Ed628ACB970" - }, - "ethereum.mainnet": { - "WitnetBytecodes": "0xB8CdB2577dA632a77D6b90526aB53Eb5694Ed2D1", - "WitnetBytecodesImplementation": "", - "WitnetEncodingLib": "", - "WitnetLib": "0xaD18Fd3CC724A11c2B0D8cc7f1B108d8A3388416", - "WitnetPriceRouter": "0x83A757eAe821Ad7B520D9A74952337138A80b2AF", - "WitnetRandomness": "0x894907c7Ab64C1092620B5c8Ba039BB6E611eba8", - "WitnetRequestBoard": "0x9E4fae1c7ac543a81E4E2a5486a0dDaad8194bdA", - "WitnetRequestFactory": "0xdABE9E1B328d5Dd6b96271e5562ee3f7D8D035c4", - "WitnetRequestFactoryImplementation": "0xBfe9473720CC8DCa9615b8B6CFE228C7e1089396" - } - }, - "arbitrum": { - "arbitrum.goerli": { - "WitnetProxy": "0x1b91eAB33362f10A5F803Fe3f0d181F42caFaac3", - "Create2Factory": "0xDe312a6f7fA35320E8DD109c8ea42e82806DC45b", - "WitnetBytecodes": "0x0000000e3a3d22d7510B36BdC88994dab11eadc8", - "WitnetPriceFeeds": "0x9999999d139bdBFbF25923ba39F63bBFc7593400", - "WitnetPriceRouter": "0xAafb2D27E2E0f83dcE501a2879aaD710ec377403", - "WitnetRandomness": "0x0123456fbBC59E181D76B6Fe8771953d1953B51a", - "WitnetRequestBoard": "0xa6a6b2cBE9Ce5B8fF94729F1eC402efc5042AbBF", - "WitnetRequestFactory": "0x1111111FDE7dC956E3d7922Bc779D9E2349Afb63", - "WitnetErrorsLib": "0xf6d52770453166de85B6B6260Cf22196bC460E88", - "WitnetEncodingLib": "", - "WitnetBytecodesImplementation": "", - "WitnetPriceFeedsImplementation": "0x620e20d91C9b0e11ecAE439E7b85138DA2a1003F", - "WitnetRandomnessImplementation": "0x078EE90E16e2e5332EDaA87da19d2743cD8C64DD", - "WitnetRandomnessImplementationV061": "0xB0C5d40A7658b2ab28360aFa6eB5bAeb2fFe86c3", - "WitnetRequestBoardImplementation": "0x7ab66AB288A143D4e07Aff9b729165bFb71DB73a", - "WitnetRequestFactoryImplementation": "0xb5F3c9Dc6Ca7C1078cE5c51c1cE030D6BEEd57E2", - "WitnetPriceFeedsLib": "0x4874cb1732eE1167A006E0Ab047D940ACF04D771" - }, - "arbitrum.one": { - "WitnetProxy": "0x0Dd81412825b9C3960195ab47F14dFa9Fd70e36e", - "Create2Factory": "0xDe312a6f7fA35320E8DD109c8ea42e82806DC45b", - "WitnetBytecodes": "0x0000000e3a3d22d7510B36BdC88994dab11eadc8", - "WitnetPriceFeeds": "0x9999999d139bdBFbF25923ba39F63bBFc7593400", - "WitnetPriceRouter": "0xf56E739C436EA6e65A17DBfaC9D7E57062D19422", - "WitnetRandomness": "0x88888885966F8F77cC6E797aE263C4d091e44A55", - "WitnetRequestBoard": "0x777777772C24e6CD34B464D1d71616C444254537", - "WitnetRequestFactory": "0x1111111FDE7dC956E3d7922Bc779D9E2349Afb63", - "WitnetRequestRandomness": "0xF1Aba51c5097487a62DA9c72fb9Aa7B0c98676C1", - "WitnetErrorsLib": "", - "WitnetEncodingLib": "", - "WitnetBytecodesImplementation": "", - "WitnetPriceFeedsImplementation": "", - "WitnetRandomnessImplementation": "0xa239729c399c9eBae7fdc188A1Dbb2c4a06Cd4Bb", - "WitnetRequestBoardImplementation": "", - "WitnetRequestFactoryImplementation": "0xc42656C501623859565C6d080a7Feb1f2B72b55a" - } - }, - "avalanche": { - "avalanche.testnet": { - "WitnetProxy": "0x1b91eAB33362f10A5F803Fe3f0d181F42caFaac3", - "Create2Factory": "0xDe312a6f7fA35320E8DD109c8ea42e82806DC45b", - "WitnetBytecodes": "0x0000000e3a3d22d7510B36BdC88994dab11eadc8", - "WitnetPriceFeeds": "0x9999999d139bdBFbF25923ba39F63bBFc7593400", - "WitnetPriceRouter": "0x99Af0CF37d1C6b9Bdfe33cc0A89C00D97D3c42F4", - "WitnetRandomness": "0x0123456fbBC59E181D76B6Fe8771953d1953B51a", - "WitnetRequestBoard": "0xD9465D38f50f364b3263Cb219e58d4dB2D584530", - "WitnetRequestFactory": "0x1111111FDE7dC956E3d7922Bc779D9E2349Afb63", - "WitnetErrorsLib": "0xf6d52770453166de85B6B6260Cf22196bC460E88", - "WitnetEncodingLib": "", - "WitnetPriceFeedsLib": "0xBfFA2ec6225390C517A1bEB83b27a171C6734294", - "WitnetBytecodesImplementation": "", - "WitnetPriceFeedsImplementation": "0x8762508A67e71Df04212B256E19faB1771F9a2F4", - "WitnetRandomnessImplementation": "0x685528FA605c31aE076e1ee1707041B7Cb356573", - "WitnetRandomnessImplementationV061": "0xD47fc24C99fD94f33bD2f33FE373b1447bB10724", - "WitnetRequestBoardImplementation": "0x0b75886DeB58F80A75E5cAF10702C5d15FA54437", - "WitnetRequestFactoryImplementation": "0x364E2b91a4C7563288C3ccF7256BA172935CC550" - }, - "avalanche.mainnet": { - "WitnetLib": "0xD39D4d972C7E166856c4eb29E54D3548B4597F53", - "WitnetPriceRouter": "0xBaaF31F4AAc5ab5334b6E239a83bf4E855C55ea7", - "WitnetRandomness": "0xa4A73a2A32320282a4d7dDe6a7467AeFA3B7950F", - "WitnetRequestBoard": "0x1D9c4a8f8B7b5F9B8e2641D81927f8F8Cc7fF079" - } - }, - "boba": { - "boba.bnb.testnet": { - "Create2Factory": "0xDe312a6f7fA35320E8DD109c8ea42e82806DC45b", - "WitnetProxy": "0xc71A87657b13A370594967A04b4301a3AcEAF007", - "WitnetBytecodes": "0x0000000e3a3d22d7510B36BdC88994dab11eadc8", - "WitnetPriceFeeds": "0x9999999d139bdBFbF25923ba39F63bBFc7593400", - "WitnetPriceRouter": "0x8D20457d968c937b7cb65be6B8cC766613fBcF28", - "WitnetRandomness": "0x0123456fbBC59E181D76B6Fe8771953d1953B51a", - "WitnetRequestBoard": "0x777777772C24e6CD34B464D1d71616C444254537", - "WitnetRequestFactory": "0x1111111FDE7dC956E3d7922Bc779D9E2349Afb63", - "WitnetErrorsLib": "0x2F0912fa566B5B3215e746Dc108d85fDd4A8113A", - "WitnetEncodingLib": "", - "WitnetPriceFeedsLib": "0x5c1dD29563203883A5D5C3136783D3119B2C4e57", - "WitnetBytecodesImplementation": "", - "WitnetPriceFeedsImplementation": "0xd0f725Bf11bA75D291506d396FbcbeCAb5384e95", - "WitnetRandomnessImplementation": "0x08a6a53B8bCE95677fFA85813C32Bb8228cd114c", - "WitnetRequestBoardImplementation": "0x276Da4D5720EFaD1fBE417d27BD838707e61ba8C", - "WitnetRequestFactoryImplementation": "0xce66333c9D7BE37D61d3c5b57D6D41ff082Ca92f" - }, - "boba.bnb.mainnet": { - "Create2Factory": "0xDe312a6f7fA35320E8DD109c8ea42e82806DC45b", - "WitnetProxy": "0x0Dd81412825b9C3960195ab47F14dFa9Fd70e36e", - "WitnetBytecodes": "0x0000000e3a3d22d7510B36BdC88994dab11eadc8", - "WitnetPriceFeeds": "0x9999999d139bdBFbF25923ba39F63bBFc7593400", - "WitnetPriceRouter": "0x62a1b1D6E5bA031846894FC5C3609f586c78D23D", - "WitnetRandomness": "0x88888885966F8F77cC6E797aE263C4d091e44A55", - "WitnetRequestBoard": "0x777777772C24e6CD34B464D1d71616C444254537", - "WitnetRequestFactory": "0x1111111FDE7dC956E3d7922Bc779D9E2349Afb63", - "WitnetErrorsLib": "", - "WitnetEncodingLib": "", - "WitnetPriceFeedsLib": "0x7AA219C444f68eDBD5789d89076efA8A3f09996b", - "WitnetBytecodesImplementation": "", - "WitnetPriceFeedsImplementation": "0xc45c93083F7B97Cdb700D4D2ADE6a727E04793ff", - "WitnetRandomnessImplementation": "0xC467B6E0F700D3E044C9F20BB76957eEC0B33c8C", - "WitnetRequestBoardImplementation": "", - "WitnetRequestFactoryImplementation": "0x4756097b9184327713D07b3ac4C2a898468220B1", - "WitnetRequestRandomness": "0xA99B485363DBAe90D17B10F988C4e1Ae895048e0" - }, - "boba.ethereum.goerli": { - "WitnetProxy": "0x1b91eAB33362f10A5F803Fe3f0d181F42caFaac3", - "Create2Factory": "0xDe312a6f7fA35320E8DD109c8ea42e82806DC45b", - "WitnetBytecodes": "0x0000000e3a3d22d7510B36BdC88994dab11eadc8", - "WitnetPriceFeeds": "0x9999999d139bdBFbF25923ba39F63bBFc7593400", - "WitnetPriceRouter": "0xB4B2E2e00e9d6E5490d55623E4F403EC84c6D33f", - "WitnetRandomness": "0x0123456fbBC59E181D76B6Fe8771953d1953B51a", - "WitnetRequestBoard": "0x58D8ECe142c60f5707594a7C1D90e46eAE5AF431", - "WitnetRequestFactory": "0x1111111FDE7dC956E3d7922Bc779D9E2349Afb63", - "WitnetErrorsLib": "0xf6d52770453166de85B6B6260Cf22196bC460E88", - "WitnetEncodingLib": "", - "WitnetPriceFeedsLib": "0x6dc0E2AC80550F901cd4d5F5a4C48333A0ca97Ee", - "WitnetBytecodesImplementation": "", - "WitnetPriceFeedsImplementation": "0x4874cb1732eE1167A006E0Ab047D940ACF04D771", - "WitnetRandomnessImplementation": "0xd8875D7D3087DEec0103d47d4cE0C4a5414874E1", - "WitnetRandomnessImplementationV061": "0xeD074DA2A76FD2Ca90C1508930b4FB4420e413B0", - "WitnetRequestBoardImplementation": "0x685528FA605c31aE076e1ee1707041B7Cb356573", - "WitnetRequestFactoryImplementation": "0x364E2b91a4C7563288C3ccF7256BA172935CC550" - }, - "boba.ethereum.mainnet": { - "WitnetLib": "0x6473063EBEabC0606A4159b7d9F79BB306ED0D2A", - "WitnetPriceRouter": "0x93f61D0D5F623144e7C390415B70102A9Cc90bA5", - "WitnetRandomness": "0x3D7Ccf6518deBE3d2fd20c4b6AEc3FD904c0Ad29", - "WitnetRequestBoard": "0xd3AD9a4b26527E3bA5Fc60B75Eb002D47D98e292" - } - }, - "celo": { - "celo.alfajores": { - "Create2Factory": "0xDe312a6f7fA35320E8DD109c8ea42e82806DC45b", - "WitnetProxy": "0x4743325168af9195Aa5b25e491E9bE87d87E7F93", - "WitnetBytecodes": "0x0000000e3a3d22d7510B36BdC88994dab11eadc8", - "WitnetPriceFeeds": "0x9999999d139bdBFbF25923ba39F63bBFc7593400", - "WitnetPriceRouter": "0x6f8A7E2bBc1eDb8782145cD1089251f6e2C738AE", - "WitnetRandomness": "0x0123456fbBC59E181D76B6Fe8771953d1953B51a", - "WitnetRequestBoard": "0x99a0B5eb260Fe3BfcF9d658850e3dD6d6B69183A", - "WitnetRequestFactory": "0x1111111FDE7dC956E3d7922Bc779D9E2349Afb63", - "WitnetErrorsLib": "0x364E2b91a4C7563288C3ccF7256BA172935CC550", - "WitnetEncodingLib": "", - "WitnetPriceFeedsLib": "0x50AA08187D2F648Dd428784AF6489c3F12e942CC", - "WitnetBytecodesImplementation": "", - "WitnetPriceFeedsImplementation": "0x654B79823f244c2476907F21EBD20cFebC04D0A5", - "WitnetRandomnessImplementation": "0xFB36b14df6D319A5A7F418C80b0700664A4f9e6a", - "WitnetRandomnessImplementationV061": "0xbD804467270bCD832b4948242453CA66972860F5", - "WitnetRequestBoardImplementation": "0xe381f706f2932049A844791f41b2863884c4e6CA", - "WitnetRequestFactoryImplementation": "0x4874cb1732eE1167A006E0Ab047D940ACF04D771" - }, - "celo.mainnet": { - "Create2Factory": "0xDe312a6f7fA35320E8DD109c8ea42e82806DC45b", - "WitnetProxy": "0xF1Aba51c5097487a62DA9c72fb9Aa7B0c98676C1", - "WitnetBytecodes": "0x0000000e3a3d22d7510B36BdC88994dab11eadc8", - "WitnetPriceFeeds": "0x9999999d139bdBFbF25923ba39F63bBFc7593400", - "WitnetPriceRouter": "0x931673904eB6E69D775e35F522c0EA35575297Cb", - "WitnetRandomness": "0x0123456fbBC59E181D76B6Fe8771953d1953B51a", - "WitnetRequestBoard": "0x03E709E6422E30C033456FCde38C70A12553E468", - "WitnetRequestFactory": "0x1111111FDE7dC956E3d7922Bc779D9E2349Afb63", - "WitnetErrorsLib": "0x92a68143Ee3C2527C2B07e4354efAF89fd75a359", - "WitnetEncodingLib": "", - "WitnetPriceFeedsLib": "0x760C146699B76c84Cc8050f57728F2Dc374cbf25", - "WitnetBytecodesImplementation": "", - "WitnetPriceFeedsImplementation": "0x76ffF94D527504e90DaCB12d710590ba8227299E", - "WitnetRandomnessImplementation": "0x6Af31B632A20185ff96FC47a8576a6980Cd99FEC", - "WitnetRandomnessImplementationV061": "0x6023fF93A3b37791a94B15D6AEaD488933b01Db3", - "WitnetRequestBoardImplementation": "0x5A13430A283701BE24cE7E1712B38F31d4B9ac58", - "WitnetRequestFactoryImplementation": "0x0d13c6058DDE86da77565ED6038C065Af71e9208" - } - }, - "conflux": { - "conflux.core.testnet": { - "WitnetProxy": "0x8E077eBf150a5f09e26805F1CB1d14671834b63A", - "Create2Factory": "0x8644e9b7306cD4e6E5a3dB2aA7DFDE2744eAE676", - "WitnetBytecodes": "0x8E6AEaC77a18DF3e90B1446BB2210013A331Cb12", - "WitnetPriceFeeds": "0x8FDD679F4D1d2bfb97B5e5fD90c8E3E6ce0ce75c", - "WitnetPriceRouter": "0x8F61C7b18F69bB87D6151B8a5D733E1945ea6c25", - "WitnetRandomness": "0x882D16154E7190eDA27ed4CE6606d204Aa70EC90", - "WitnetRequestBoard": "0x8aB653B73a0e0552dDdce8c76F97c6AA826EFbD4", - "WitnetRequestFactory": "0x83eFF90a51D7da324AE1580eab6Ee0c9D45ad509", - "WitnetErrorsLib": "0x8d5Fda8c48dF35f321301e69c3c605AABCA474b1", - "WitnetEncodingLib": "", - "WitnetBytecodesImplementation": "", - "WitnetPriceFeedsImplementation": "0x81f3EB9a7853F8e1357f6BB61E7BB610F73605F1", - "WitnetRandomnessImplementationV061": "0x887bC8Db7D91413D1575071925Ee8d77fE2CBc81", - "WitnetRequestBoardImplementation": "0x8d19a968CeAA0d31cD9E0434574C8dC5710ddBac", - "WitnetRequestFactoryImplementation": "0x89a49b46864049b16dFcf185740Ac89Eec8Fd670", - "WitnetPriceFeedsLib": "0x87cA78592Cb691BA3a1919c2d83Ed578e8E0Ae0a" - }, - "conflux.core.mainnet": { - "WitnetLib": "0x8A026e6956B4DB3E81bb113401798e59cFBEA4C6", - "WitnetPriceRouter": "0x806c8dFd322EE2d52b188CC472e0814F64304C32", - "WitnetRandomness": "0x8C3824A9A6C3F5B0ac107E2c7dBc8d88c14aF6D9", - "WitnetRequestBoard": "0x84C708bfd79bBC83Ad8753dAb1852EfE9D6712CC" - }, - "conflux.espace.testnet": { - "WitnetProxy": "0x1b91eAB33362f10A5F803Fe3f0d181F42caFaac3", - "Create2Factory": "0xDe312a6f7fA35320E8DD109c8ea42e82806DC45b", - "WitnetBytecodes": "0x0000000e3a3d22d7510B36BdC88994dab11eadc8", - "WitnetPriceFeeds": "0x9999999d139bdBFbF25923ba39F63bBFc7593400", - "WitnetPriceRouter": "0x49C0BCce51a8B28f92d008394F06d5B259657F33", - "WitnetRandomness": "0x0123456fbBC59E181D76B6Fe8771953d1953B51a", - "WitnetRequestBoard": "0x0C4be6AA667df48de54BA174bE7948875fdf152B", - "WitnetRequestFactory": "0x1111111FDE7dC956E3d7922Bc779D9E2349Afb63", - "WitnetErrorsLib": "0xf6d52770453166de85B6B6260Cf22196bC460E88", - "WitnetEncodingLib": "", - "WitnetPriceFeedsLib": "0x7A6C2Aad6b4b08De09477D0F663b8f90b0db9662", - "WitnetBytecodesImplementation": "", - "WitnetPriceFeedsImplementation": "0x6bF6F65Ad0859e9Ee869DAD252a29c9daAa27449", - "WitnetRandomnessImplementation": "0x0b75886DeB58F80A75E5cAF10702C5d15FA54437", - "WitnetRandomnessImplementationV061": "0xa784093826e2894Ab3Db315f4e05F0F26407BBfF", - "WitnetRequestBoardImplementation": "0x1f35F6d6BE5Bd574b2B00Ac2Dc0BeCAfcc04Ed51", - "WitnetRequestFactoryImplementation": "0xeDA4f244FEe1D6a3EA0fB2c0Fc6b7D1c49fEF01D" - }, - "conflux.espace.mainnet": { - "WitnetLib": "0x1D9c4a8f8B7b5F9B8e2641D81927f8F8Cc7fF079", - "WitnetPriceRouter": "0xD39D4d972C7E166856c4eb29E54D3548B4597F53", - "WitnetRandomness": "0x1ebd93231a7fe551e1d6405404df34909eff4c2c", - "WitnetRequestBoard": "0xd653fbd7c736838289262F0F41A458f35393C88a" - } - }, - "cronos": { - "cronos.testnet": { - "Create2Factory": "0xDe312a6f7fA35320E8DD109c8ea42e82806DC45b", - "WitnetProxy": "0x7A6C2Aad6b4b08De09477D0F663b8f90b0db9662", - "WitnetBytecodes": "0x0000000e3a3d22d7510B36BdC88994dab11eadc8", - "WitnetPriceFeeds": "0x9999999d139bdBFbF25923ba39F63bBFc7593400", - "WitnetPriceRouter": "0xeD074DA2A76FD2Ca90C1508930b4FB4420e413B0", - "WitnetRandomness": "0x0123456fbBC59E181D76B6Fe8771953d1953B51a", - "WitnetRequestBoard": "0x58D8ECe142c60f5707594a7C1D90e46eAE5AF431", - "WitnetRequestFactory": "0x1111111FDE7dC956E3d7922Bc779D9E2349Afb63", - "WitnetErrorsLib": "0x4874cb1732eE1167A006E0Ab047D940ACF04D771", - "WitnetEncodingLib": "", - "WitnetPriceFeedsLib": "0xB1Ee13a85B2593D5191f3a2A08f175b1c918B9bb", - "WitnetBytecodesImplementation": "", - "WitnetPriceFeedsImplementation": "0x7538f6Bff94B0F7F0A0802376238Aab0D2528521", - "WitnetRandomnessImplementation": "0xe145A4D3335D5F78d7e9cB6a3C1832155cB4Be01", - "WitnetRandomnessImplementationV061": "0x0017A464A86f48B342Cae3b8Fe29cFCDaA7b0643", - "WitnetRequestBoardImplementation": "0x3093731aECf4d9Be53b153E27A36D2E02647479F", - "WitnetRequestFactoryImplementation": "0xA8767A6EA3099De344499B35f725A38E3cD15562" - }, - "cronos.mainnet": { - "WitnetLib": "0x1D9c4a8f8B7b5F9B8e2641D81927f8F8Cc7fF079", - "WitnetPriceRouter": "0xD39D4d972C7E166856c4eb29E54D3548B4597F53", - "WitnetRandomness": "0x3737be6FcFf5B3B0f9DCc9a9ae1Da56561D0d0d3", - "WitnetRequestBoard": "0xd653fbd7c736838289262F0F41A458f35393C88a" - } - }, - "cube": { - "cube.testnet": { - "WitnetProxy": "", - "Create2Factory": "", - "WitnetBytecodes": "", - "WitnetPriceFeeds": "", - "WitnetPriceRouter": "0xB4B2E2e00e9d6E5490d55623E4F403EC84c6D33f", - "WitnetRandomness": "", - "WitnetRequestBoard": "0x58D8ECe142c60f5707594a7C1D90e46eAE5AF431", - "WitnetRequestFactory": "", - "WitnetErrorsLib": "", - "WitnetEncodingLib": "", - "WitnetPriceFeedsLib": "", - "WitnetBytecodesImplementation": "", - "WitnetPriceFeedsImplementation": "", - "WitnetRandomnessImplementation": "", - "WitnetRandomnessImplementationV061": "0xeD074DA2A76FD2Ca90C1508930b4FB4420e413B0", - "WitnetRequestBoardImplementation": "", - "WitnetRequestFactoryImplementation": "" - }, - "cube.mainnet": { - "WitnetLib": "0x1D9c4a8f8B7b5F9B8e2641D81927f8F8Cc7fF079", - "WitnetPriceRouter": "0xE22f48DDdcb34BD34489fE224d7fFC1b0a361D87", - "WitnetRandomness": "0xD39D4d972C7E166856c4eb29E54D3548B4597F53", - "WitnetRequestBoard": "0xd653fbd7c736838289262F0F41A458f35393C88a" - } - }, - "dogechain": { - "dogechain.testnet": { - "WitnetProxy": "0x1b91eAB33362f10A5F803Fe3f0d181F42caFaac3", - "Create2Factory": "0xDe312a6f7fA35320E8DD109c8ea42e82806DC45b", - "WitnetBytecodes": "0x0000000e3a3d22d7510B36BdC88994dab11eadc8", - "WitnetPriceFeeds": "0x9999999d139bdBFbF25923ba39F63bBFc7593400", - "WitnetPriceRouter": "0x9E943Ab1FD0D35B3BaDe31AA78D60C485EA1a604", - "WitnetRandomness": "0x0123456fbBC59E181D76B6Fe8771953d1953B51a", - "WitnetRequestBoard": "0x58D8ECe142c60f5707594a7C1D90e46eAE5AF431", - "WitnetRequestFactory": "0x1111111FDE7dC956E3d7922Bc779D9E2349Afb63", - "WitnetErrorsLib": "0xf6d52770453166de85B6B6260Cf22196bC460E88", - "WitnetEncodingLib": "", - "WitnetPriceFeedsLib": "0x6dc0E2AC80550F901cd4d5F5a4C48333A0ca97Ee", - "WitnetBytecodesImplementation": "", - "WitnetPriceFeedsImplementation": "0xdC101573cB42EB7006Ad6C7E08ce8C91fEAcB62C", - "WitnetRandomnessImplementation": "0x8762508A67e71Df04212B256E19faB1771F9a2F4", - "WitnetRandomnessImplementationV061": "0xD9465D38f50f364b3263Cb219e58d4dB2D584530", - "WitnetRequestBoardImplementation": "0xb6E0e5a64C7c02Fa477A5254dca35ED967570DF5", - "WitnetRequestFactoryImplementation": "0x364E2b91a4C7563288C3ccF7256BA172935CC550" - }, - "dogechain.mainnet": { - "WitnetLib": "0xD39D4d972C7E166856c4eb29E54D3548B4597F53", - "WitnetPriceRouter": "0xD7f7933992c25A504e9Ddf7e76a3c1D6c432b25D", - "WitnetRandomness": "0xD7f7933992c25A504e9Ddf7e76a3c1D6c432b25D", - "WitnetRequestBoard": "0xF2712e7114A237625EFC8bBA6a6ed1Bb8b6029c9" - } - }, - "elastos": { - "elastos.testnet": { - "WitnetProxy": "0x840bafDC40D88F54Db41327fe1C85241f9151243", - "Create2Factory": "0xDe312a6f7fA35320E8DD109c8ea42e82806DC45b", - "WitnetBytecodes": "0x0000000e3a3d22d7510B36BdC88994dab11eadc8", - "WitnetPriceFeeds": "0x9999999d139bdBFbF25923ba39F63bBFc7593400", - "WitnetPriceRouter": "0x4874cb1732eE1167A006E0Ab047D940ACF04D771", - "WitnetRandomness": "0x0123456fbBC59E181D76B6Fe8771953d1953B51a", - "WitnetRequestBoard": "0x777777772C24e6CD34B464D1d71616C444254537", - "WitnetRequestFactory": "0x1111111FDE7dC956E3d7922Bc779D9E2349Afb63", - "WitnetErrorsLib": "0xEdb5535994bF19d56c30F5BEa0937232E198F671", - "WitnetEncodingLib": "", - "WitnetPriceFeedsLib": "0xC1266fA3D24f5d63E2e34633b3F829E9156be0d6", - "WitnetBytecodesImplementation": "", - "WitnetPriceFeedsImplementation": "0xdA489690BDfd6e4d76DE3b937f40342bAd281bc9", - "WitnetRandomnessImplementation": "0x83587BcfD1f75B5D08c4e27F098F99783cc693cb", - "WitnetRandomnessImplementationV079": "0x9597b5708CDB58fF057ca494574951Fc3d9163f7", - "WitnetRequestBoardImplementation": "0xfC62b6B0ec3eCF1Fa031B31b468be51E025a36f1", - "WitnetRequestFactoryImplementation": "0x4779A692aC089E02FD1301B0b53Fa1a02985a83F" - }, - "elastos.mainnet": { - "WitnetProxy": "0x0000000e3a3d22d7510B36BdC88994dab11eadc8", - "Create2Factory": "0xDe312a6f7fA35320E8DD109c8ea42e82806DC45b", - "WitnetBytecodes": "0x0000000e3a3d22d7510B36BdC88994dab11eadc8", - "WitnetPriceFeeds": "0x9999999d139bdBFbF25923ba39F63bBFc7593400", - "WitnetPriceRouter": "0x0Aa147F25CE8BfaA4E6B4B2CCa91f595bD732CD4", - "WitnetRandomness": "0x88888885966F8F77cC6E797aE263C4d091e44A55", - "WitnetRequestBoard": "0x777777772C24e6CD34B464D1d71616C444254537", - "WitnetRequestFactory": "0x1111111FDE7dC956E3d7922Bc779D9E2349Afb63", - "WitnetErrorsLib": "", - "WitnetEncodingLib": "", - "WitnetBytecodesImplementation": "", - "WitnetPriceFeedsImplementation": "0x79c27c0555C95DBfd38e97023c3257376aaa154d", - "WitnetRandomnessImplementation": "0x92a68143Ee3C2527C2B07e4354efAF89fd75a359", - "WitnetRequestBoardImplementation": "", - "WitnetRequestFactoryImplementation": "0x7AA219C444f68eDBD5789d89076efA8A3f09996b", - "WitnetRequestRandomness": "0x217C32Cf5755aB281809f29F21c107cD0E4652B3", - "WitnetPriceFeedsLib": "0x62a1b1D6E5bA031846894FC5C3609f586c78D23D" - } - }, - "fuse": { - "fuse.testnet": { - "WitnetProxy": "0x1b91eAB33362f10A5F803Fe3f0d181F42caFaac3", - "Create2Factory": "0xDe312a6f7fA35320E8DD109c8ea42e82806DC45b", - "WitnetBytecodes": "0x0000000e3a3d22d7510B36BdC88994dab11eadc8", - "WitnetPriceFeeds": "0x9999999d139bdBFbF25923ba39F63bBFc7593400", - "WitnetPriceRouter": "0xB4f1f8E27799256ec95C5b5A8d2A5722Bd542E69", - "WitnetRandomness": "0x0123456fbBC59E181D76B6Fe8771953d1953B51a", - "WitnetRequestBoard": "0x777777772C24e6CD34B464D1d71616C444254537", - "WitnetRequestFactory": "0x1111111FDE7dC956E3d7922Bc779D9E2349Afb63", - "WitnetErrorsLib": "0x123a7AcE0879C4645b19A69c2ba8B3E4d01fBfD6", - "WitnetEncodingLib": "", - "WitnetPriceFeedsLib": "0xEeA1423D8cAf1e9440495842613Ec042046065aC", - "WitnetBytecodesImplementation": "", - "WitnetPriceFeedsImplementation": "0x3280539A77C578C3eF698f53f29CDba00eC9B72E", - "WitnetRandomnessImplementation": "0x1e7e21B4b1102cf3b8bD5e110bbBdc80D43A9dEa", - "WitnetRandomnessImplementationV079": "0x7A6C2Aad6b4b08De09477D0F663b8f90b0db9662", - "WitnetRequestBoardImplementation": "0xda5223Df6c769B91C50517C9C0b1563F618A89e4", - "WitnetRequestFactoryImplementation": "0x83e8f5B6D4D94CAC5943689616B96786c2465c9A" - } - }, - "gnosis": { - "gnosis.testnet": { - "Create2Factory": "0xDe312a6f7fA35320E8DD109c8ea42e82806DC45b", - "WitnetProxy": "0x1b91eAB33362f10A5F803Fe3f0d181F42caFaac3", - "WitnetBytecodes": "0x0000000e3a3d22d7510B36BdC88994dab11eadc8", - "WitnetPriceFeeds": "0x9999999d139bdBFbF25923ba39F63bBFc7593400", - "WitnetPriceRouter": "0xA8767A6EA3099De344499B35f725A38E3cD15562", - "WitnetRandomness": "0x0123456fbBC59E181D76B6Fe8771953d1953B51a", - "WitnetRequestBoard": "0x777777772C24e6CD34B464D1d71616C444254537", - "WitnetRequestFactory": "0x1111111FDE7dC956E3d7922Bc779D9E2349Afb63", - "WitnetErrorsLib": "0x9F026F081b5E1f60d583CE380f30A0a4eF0AB97a", - "WitnetEncodingLib": "", - "WitnetPriceFeedsLib": "0x69891cE36F6dFbef4A7BdD0E95A15CBA916f206b", - "WitnetBytecodesImplementation": "", - "WitnetPriceFeedsImplementation": "0xd8875D7D3087DEec0103d47d4cE0C4a5414874E1", - "WitnetRandomnessImplementation": "0x9597b5708CDB58fF057ca494574951Fc3d9163f7", - "WitnetRandomnessImplementationv079": "0x4874cb1732eE1167A006E0Ab047D940ACF04D771", - "WitnetRequestBoardImplementation": "0xF58115533e681295CC1F07A135539E72c5116855", - "WitnetRequestFactoryImplementation": "0x6F68A4d58cEd8e094b42511350527Ed628ACB970" - } - }, - "kava": { - "kava.testnet": { - "WitnetProxy": "0x705E076F3387cFd59708D8D8508CECe3e1C65C87", - "Create2Factory": "0xDe312a6f7fA35320E8DD109c8ea42e82806DC45b", - "WitnetBytecodes": "0x0000000e3a3d22d7510B36BdC88994dab11eadc8", - "WitnetPriceFeeds": "0x9999999d139bdBFbF25923ba39F63bBFc7593400", - "WitnetPriceRouter": "0xB4B2E2e00e9d6E5490d55623E4F403EC84c6D33f", - "WitnetRandomness": "0x0123456fbBC59E181D76B6Fe8771953d1953B51a", - "WitnetRequestBoard": "0x58D8ECe142c60f5707594a7C1D90e46eAE5AF431", - "WitnetRequestFactory": "0x1111111FDE7dC956E3d7922Bc779D9E2349Afb63", - "WitnetErrorsLib": "0xa45206cC3Ae76630Cc4D47A730590Ff9B6d8Ee54", - "WitnetEncodingLib": "", - "WitnetPriceFeedsLib": "0xBfFA2ec6225390C517A1bEB83b27a171C6734294", - "WitnetBytecodesImplementation": "", - "WitnetPriceFeedsImplementation": "0x6bF6F65Ad0859e9Ee869DAD252a29c9daAa27449", - "WitnetRandomnessImplementation": "0xA9cC3101735b248964e90fA8506219A9CF0b1091", - "WitnetRandomnessImplementationV061": "0xeD074DA2A76FD2Ca90C1508930b4FB4420e413B0", - "WitnetRequestBoardImplementation": "0x8684d396366C21AA01B120F69df2070f840aC134", - "WitnetRequestFactoryImplementation": "0x60768ce66aF2f3957e7280c6CfC4ab9c575a7FCF" - }, - "kava.mainnet": { - "WitnetLib": "0x1D9c4a8f8B7b5F9B8e2641D81927f8F8Cc7fF079", - "WitnetPriceRouter": "0xD39D4d972C7E166856c4eb29E54D3548B4597F53", - "WitnetRandomness": "0x1ebD93231a7fE551E1d6405404Df34909eff4c2C", - "WitnetRequestBoard": "0xd653fbd7c736838289262F0F41A458f35393C88a" - } - }, - "kcc": { - "kcc.testnet": { - "WitnetProxy": "0xf6d52770453166de85B6B6260Cf22196bC460E88", - "Create2Factory": "0xDe312a6f7fA35320E8DD109c8ea42e82806DC45b", - "WitnetBytecodes": "0x0000000e3a3d22d7510B36BdC88994dab11eadc8", - "WitnetPriceFeeds": "0x9999999d139bdBFbF25923ba39F63bBFc7593400", - "WitnetPriceRouter": "0xba7CF62498340fa3734EC51Ca8A69928F0d9E03a", - "WitnetRandomness": "0x0123456fbBC59E181D76B6Fe8771953d1953B51a", - "WitnetRequestBoard": "0x58D8ECe142c60f5707594a7C1D90e46eAE5AF431", - "WitnetRequestFactory": "0x1111111FDE7dC956E3d7922Bc779D9E2349Afb63", - "WitnetErrorsLib": "0xB5447342cA17A40e59d410b340ba412E22e36201", - "WitnetEncodingLib": "", - "WitnetPriceFeedsLib": "0x65772461641A4A6E8B10c81bae1a132E04e77262", - "WitnetBytecodesImplementation": "", - "WitnetPriceFeedsImplementation": "0x4874cb1732eE1167A006E0Ab047D940ACF04D771", - "WitnetRandomnessImplementation": "0x98DbB216138aA6a0b3ff2ae9bBdeC254398E5B2E", - "WitnetRandomnessImplementationV061": "0x76c72518060952FAec3f90666F047e39E3333f7E", - "WitnetRequestBoardImplementation": "0xeF262eCBF9c61A0e71688D90d8fe75B0C3a48901", - "WitnetRequestFactoryImplementation": "0x4374a050f808d1FF18bCcf73270daE3EdF8D0865" - }, - "kcc.mainnet": { - "WitnetLib": "0x1D9c4a8f8B7b5F9B8e2641D81927f8F8Cc7fF079", - "WitnetPriceRouter": "0xD39D4d972C7E166856c4eb29E54D3548B4597F53", - "WitnetRandomness": "0x1ebd93231a7fe551e1d6405404df34909eff4c2c", - "WitnetRequestBoard": "0xd653fbd7c736838289262F0F41A458f35393C88a" - } - }, - "klaytn": { - "klaytn.testnet": { - "WitnetProxy": "0xB5447342cA17A40e59d410b340ba412E22e36201", - "Create2Factory": "0xDe312a6f7fA35320E8DD109c8ea42e82806DC45b", - "WitnetBytecodes": "0x0000000e3a3d22d7510B36BdC88994dab11eadc8", - "WitnetPriceFeeds": "0x9999999d139bdBFbF25923ba39F63bBFc7593400", - "WitnetPriceRouter": "0xeD074DA2A76FD2Ca90C1508930b4FB4420e413B0", - "WitnetRandomness": "0x0123456fbBC59E181D76B6Fe8771953d1953B51a", - "WitnetRequestBoard": "0x58D8ECe142c60f5707594a7C1D90e46eAE5AF431", - "WitnetRequestFactory": "0x1111111FDE7dC956E3d7922Bc779D9E2349Afb63", - "WitnetErrorsLib": "0xc71A87657b13A370594967A04b4301a3AcEAF007", - "WitnetEncodingLib": "", - "WitnetPriceFeedsLib": "0x65772461641A4A6E8B10c81bae1a132E04e77262", - "WitnetBytecodesImplementation": "", - "WitnetPriceFeedsImplementation": "0xBfFA2ec6225390C517A1bEB83b27a171C6734294", - "WitnetRandomnessImplementation": "0xd6d4B24219751A7725ce972E68B1067Ee57CC85a", - "WitnetRandomnessImplementationV061": "0xB4B2E2e00e9d6E5490d55623E4F403EC84c6D33f", - "WitnetRequestBoardImplementation": "0x1f35F6d6BE5Bd574b2B00Ac2Dc0BeCAfcc04Ed51", - "WitnetRequestFactoryImplementation": "0xeDA4f244FEe1D6a3EA0fB2c0Fc6b7D1c49fEF01D" - }, - "klaytn.mainnet": { - "WitnetLib": "0x1D9c4a8f8B7b5F9B8e2641D81927f8F8Cc7fF079", - "WitnetPriceRouter": "0xD39D4d972C7E166856c4eb29E54D3548B4597F53", - "WitnetRandomness": "0x1ebD93231a7fE551E1d6405404Df34909eff4c2C", - "WitnetRequestBoard": "0xd653fbd7c736838289262F0F41A458f35393C88a" - } - }, - "mantle": { - "mantle.testnet": { - "WitnetProxy": "0xBfFA2ec6225390C517A1bEB83b27a171C6734294", - "Create2Factory": "0xDe312a6f7fA35320E8DD109c8ea42e82806DC45b", - "WitnetErrorsLib": "0x1b91eAB33362f10A5F803Fe3f0d181F42caFaac3", - "WitnetEncodingLib": "", - "WitnetPriceFeedsLib": "0x6bF6F65Ad0859e9Ee869DAD252a29c9daAa27449", - "WitnetBytecodes": "0x0000000e3a3d22d7510B36BdC88994dab11eadc8", - "WitnetPriceFeeds": "0x9999999d139bdBFbF25923ba39F63bBFc7593400", - "WitnetPriceRouter": "0x9f9bAB64229680E170835BC9cC1c96F2C63f7d16", - "WitnetRandomness": "0x0123456fbBC59E181D76B6Fe8771953d1953B51a", - "WitnetRequestBoard": "0x777777772C24e6CD34B464D1d71616C444254537", - "WitnetRequestFactory": "0x1111111FDE7dC956E3d7922Bc779D9E2349Afb63", - "WitnetBytecodesImplementation": "", - "WitnetPriceFeedsImplementation": "0xB4f1f8E27799256ec95C5b5A8d2A5722Bd542E69", - "WitnetRandomnessImplementation": "0x620e20d91C9b0e11ecAE439E7b85138DA2a1003F", - "WitnetRequestBoardImplementation": "0xAa3BE012baab697c1AEAC34A96bb16aa381FA7F7", - "WitnetRequestFactoryImplementation": "0xb5F3c9Dc6Ca7C1078cE5c51c1cE030D6BEEd57E2" - }, - "mantle.mainnet": { - "WitnetProxy": "0x0Dd81412825b9C3960195ab47F14dFa9Fd70e36e", - "Create2Factory": "0xDe312a6f7fA35320E8DD109c8ea42e82806DC45b", - "WitnetErrorsLib": "0x1225A47bC743199dFef9FEEf065b3B76695AaaaC", - "WitnetEncodingLib": "", - "WitnetPriceFeedsLib": "0xe33bD10fb2f1C5F4c6eF4259aAd4cE8A5868c222", - "WitnetBytecodes": "0x0000000e3a3d22d7510B36BdC88994dab11eadc8", - "WitnetPriceFeeds": "0x9999999d139bdBFbF25923ba39F63bBFc7593400", - "WitnetPriceRouter": "0x0d13c6058DDE86da77565ED6038C065Af71e9208", - "WitnetRandomness": "0x0123456fbBC59E181D76B6Fe8771953d1953B51a", - "WitnetRequestBoard": "0x777777772C24e6CD34B464D1d71616C444254537", - "WitnetRequestFactory": "0x1111111FDE7dC956E3d7922Bc779D9E2349Afb63", - "WitnetBytecodesImplementation": "", - "WitnetPriceFeedsImplementation": "0x4756097b9184327713D07b3ac4C2a898468220B1", - "WitnetRandomnessImplementation": "0x92a68143Ee3C2527C2B07e4354efAF89fd75a359", - "WitnetRequestBoardImplementation": "0x3eA2fa27D997A938925299f91e49215218Ec4f7d", - "WitnetRequestFactoryImplementation": "0xc42656C501623859565C6d080a7Feb1f2B72b55a" - } - }, - "meter": { - "meter.testnet": { - "WitnetProxy": "0xc6BdB5fd0113358Aaa6e9B56D6bA3A689cAbf65C", - "Create2Factory": "0x2d9dD590b8ebfEe76285f4398dC718D687A4B3e2", - "WitnetBytecodes": "0x1C116937844d705C4b0252C5340D4281C5D8D555", - "WitnetPriceFeeds": "0x7BBA94e4f3a596AD0E528e51d49CaD789Bd6a22D", - "WitnetPriceRouter": "0xBbDB82a16d7b66bb076879f766042b914F1C7572", - "WitnetRandomness": "0x8D416B786Ae7F5c583df36a6952E53834BDFf386", - "WitnetRequestBoard": "0xF99883aa51Fb76E37De6aC37854230d2337D2752", - "WitnetRequestFactory": "0x693cC8829Cb9AC14F75E6EbE5878652817C9e6a4", - "WitnetErrorsLib": "0x34AD22616E4FfED3EB1e9580C9D7156E1bF8ea7C", - "WitnetEncodingLib": "", - "WitnetPriceFeedsLib": "0xaB7FEec38465EA6E1Cf216E188F3Bd11355824dc", - "WitnetBytecodesImplementation": "", - "WitnetPriceFeedsImplementation": "0xD62848a74c0d08BA233D625d8691ea5Fee7d7719", - "WitnetRandomnessImplementation": "0xde9988f1397C0a7D4887707ec8A2Ea265D4E0572", - "WitnetRandomnessImplementationV061": "0xa254632ae454bae18ff0221c2040aa387f044f0e", - "WitnetRequestBoardImplementation": "0x7a624e7742F7A26f7BddDde06Ad7d9e7A6804298", - "WitnetRequestFactoryImplementation": "0xf1fb7170cB8832213Fb4C506f883bca0a910861D" - }, - "meter.mainnet": { - "WitnetLib": "0x60507Ef497EC61d407cD6Fa1c65FE820620bfA88", - "WitnetPriceRouter": "0xA0Ea8C99159843afdAE9eD092E8eaec0368e8A20", - "WitnetRandomness": "0xE189B1D26dAAB45cd344452f29Db8E93B5C7FaF1", - "WitnetRequestBoard": "0x4e645446799776B9670D18E1ecBCad059987eaCa" - } - }, - "metis": { - "metis.goerli": { - "WitnetProxy": "0x1b91eAB33362f10A5F803Fe3f0d181F42caFaac3", - "Create2Factory": "0xDe312a6f7fA35320E8DD109c8ea42e82806DC45b", - "WitnetBytecodes": "0x0000000e3a3d22d7510B36BdC88994dab11eadc8", - "WitnetPriceFeeds": "0x9999999d139bdBFbF25923ba39F63bBFc7593400", - "WitnetPriceRouter": "0xBfFA2ec6225390C517A1bEB83b27a171C6734294", - "WitnetRandomness": "0x0123456fbBC59E181D76B6Fe8771953d1953B51a", - "WitnetRequestBoard": "0x777777772C24e6CD34B464D1d71616C444254537", - "WitnetRequestFactory": "0x1111111FDE7dC956E3d7922Bc779D9E2349Afb63", - "WitnetErrorsLib": "0xc229345B9B95515C69A64842182e37cAdB52A00d", - "WitnetEncodingLib": "", - "WitnetPriceFeedsLib": "0x4a0264714E368A6888c5D755F47Bd924549Fd625", - "WitnetBytecodesImplementation": "", - "WitnetPriceFeedsImplementation": "0x88a456C0Bd557DDA942FBc1DB86C0E35c529A6AE", - "WitnetRandomnessImplementation": "0x4326d5b067EC4Bb5c2F71909E278Def8e4906B19", - "WitnetRandomnessImplementationV079": "0x7A6C2Aad6b4b08De09477D0F663b8f90b0db9662", - "WitnetRequestBoardImplementation": "0x7833F9B08F4236D77ec6287d667F533bc2F1c1EE", - "WitnetRequestFactoryImplementation": "0x07024BBdFbE0b7560A0f5B49745A372e15954d08" - }, - "metis.mainnet": { - "WitnetLib": "0x1D9c4a8f8B7b5F9B8e2641D81927f8F8Cc7fF079", - "WitnetPriceRouter": "0xD39D4d972C7E166856c4eb29E54D3548B4597F53", - "WitnetRandomness": "0xB280e3B785f615C000A8BeBb55C35eCD2376F2eb", - "WitnetRequestBoard": "0xd653fbd7c736838289262F0F41A458f35393C88a" - } - }, - "moonbeam": { - "moonbeam.moonbase": { - "WitnetProxy": "0x6bF6F65Ad0859e9Ee869DAD252a29c9daAa27449", - "Create2Factory": "0xDe312a6f7fA35320E8DD109c8ea42e82806DC45b", - "WitnetBytecodes": "0x0000000e3a3d22d7510B36BdC88994dab11eadc8", - "WitnetPriceFeeds": "0x9999999d139bdBFbF25923ba39F63bBFc7593400", - "WitnetPriceRouter": "0x56834Ff8D4b27db647Da97CA3bd8540f7fA0e89D", - "WitnetRandomness": "0x0123456fbBC59E181D76B6Fe8771953d1953B51a", - "WitnetRequestBoard": "0x02Cd4089679EAA9431a88170fd784e7dE78A2425", - "WitnetRequestFactory": "0x1111111FDE7dC956E3d7922Bc779D9E2349Afb63", - "WitnetErrorsLib": "0x2163DBCBdbBeC066EF8d8Adab75Af8b0B9A5cfAA", - "WitnetEncodingLib": "", - "WitnetPriceFeedsLib": "0x6f0da7F65Aaa090C48B371ADEfA1997e4e3cE39a", - "WitnetBytecodesImplementation": "", - "WitnetPriceFeedsImplementation": "0x2F0912fa566B5B3215e746Dc108d85fDd4A8113A", - "WitnetRandomnessImplementation": "0xcf9F6DD90221d5A23a6c4E2252bF690acdf6eedC", - "WitnetRandomnessImplementationv079": "0x65772461641A4A6E8B10c81bae1a132E04e77262", - "WitnetRequestBoardImplementation": "0xCA9e7861643febcEa7C657eA8F012645D6acceC4", - "WitnetRequestFactoryImplementation": "0x6395d83C9Aa803498980A5ab78217785d4db7bE7" - }, - "moonbeam.moonriver": { - "WitnetLib": "0x1D9c4a8f8B7b5F9B8e2641D81927f8F8Cc7fF079", - "WitnetPriceRouter": "0xE22f48DDdcb34BD34489fE224d7fFC1b0a361D87", - "WitnetRandomness": "0xD39D4d972C7E166856c4eb29E54D3548B4597F53", - "WitnetRequestBoard": "0xd653fbd7c736838289262F0F41A458f35393C88a" - }, - "moonbeam.mainnet": { - "WitnetLib": "0x1D9c4a8f8B7b5F9B8e2641D81927f8F8Cc7fF079", - "WitnetPriceRouter": "0xD39D4d972C7E166856c4eb29E54D3548B4597F53", - "WitnetRandomness": "0x1ebD93231a7fE551E1d6405404Df34909eff4c2C", - "WitnetRequestBoard": "0xd653fbd7c736838289262F0F41A458f35393C88a" - } - }, - "okxchain": { - "okxchain.testnet": { - "WitnetProxy": "0x1b91eAB33362f10A5F803Fe3f0d181F42caFaac3", - "Create2Factory": "0xDe312a6f7fA35320E8DD109c8ea42e82806DC45b", - "WitnetBytecodes": "0x0000000e3a3d22d7510B36BdC88994dab11eadc8", - "WitnetPriceFeeds": "0x9999999d139bdBFbF25923ba39F63bBFc7593400", - "WitnetPriceRouter": "0xB4B2E2e00e9d6E5490d55623E4F403EC84c6D33f", - "WitnetRandomness": "0x0123456fbBC59E181D76B6Fe8771953d1953B51a", - "WitnetRequestBoard": "0x58D8ECe142c60f5707594a7C1D90e46eAE5AF431", - "WitnetRequestFactory": "0x1111111FDE7dC956E3d7922Bc779D9E2349Afb63", - "WitnetErrorsLib": "0xf6d52770453166de85B6B6260Cf22196bC460E88", - "WitnetEncodingLib": "", - "WitnetPriceFeedsLib": "0x6dc0E2AC80550F901cd4d5F5a4C48333A0ca97Ee", - "WitnetBytecodesImplementation": "", - "WitnetPriceFeedsImplementation": "0x7A6C2Aad6b4b08De09477D0F663b8f90b0db9662", - "WitnetRandomnessImplementation": "0x078EE90E16e2e5332EDaA87da19d2743cD8C64DD", - "WitnetRandomnessImplementationV061": "0xeD074DA2A76FD2Ca90C1508930b4FB4420e413B0", - "WitnetRequestBoardImplementation": "0x20f4B1793bb81FFa357E1705AD954BdC232Edc00", - "WitnetRequestFactoryImplementation": "0x364E2b91a4C7563288C3ccF7256BA172935CC550" - }, - "okxchain.mainnet": { - "WitnetLib": "0x1D9c4a8f8B7b5F9B8e2641D81927f8F8Cc7fF079", - "WitnetPriceRouter": "0xD39D4d972C7E166856c4eb29E54D3548B4597F53", - "WitnetRandomness": "0x1ebD93231a7fE551E1d6405404Df34909eff4c2C", - "WitnetRequestBoard": "0xd653fbd7c736838289262F0F41A458f35393C88a" - } - }, - "optimism": { - "optimism.goerli": { - "WitnetProxy": "0x1b91eAB33362f10A5F803Fe3f0d181F42caFaac3", - "Create2Factory": "0xDe312a6f7fA35320E8DD109c8ea42e82806DC45b", - "WitnetBytecodes": "0x0000000e3a3d22d7510B36BdC88994dab11eadc8", - "WitnetPriceFeeds": "0x9999999d139bdBFbF25923ba39F63bBFc7593400", - "WitnetPriceRouter": "0xD9465D38f50f364b3263Cb219e58d4dB2D584530", - "WitnetRandomness": "0x0123456fbBC59E181D76B6Fe8771953d1953B51a", - "WitnetRequestBoard": "0x0985FDe9f424fe4f5AC516F66bAf5591e18aCBEb", - "WitnetRequestFactory": "0x1111111FDE7dC956E3d7922Bc779D9E2349Afb63", - "WitnetErrorsLib": "0xf6d52770453166de85B6B6260Cf22196bC460E88", - "WitnetEncodingLib": "", - "WitnetPriceFeedsLib": "0x6dc0E2AC80550F901cd4d5F5a4C48333A0ca97Ee", - "WitnetBytecodesImplementation": "", - "WitnetPriceFeedsImplementation": "0x7A6C2Aad6b4b08De09477D0F663b8f90b0db9662", - "WitnetRandomnessImplementation": "0x12E5FBdaB02cC2336114353CA7BE9e2cc8E4Cc25", - "WitnetRandomnessImplementationV061": "0x9E943Ab1FD0D35B3BaDe31AA78D60C485EA1a604", - "WitnetRequestBoardImplementation": "0xAa3BE012baab697c1AEAC34A96bb16aa381FA7F7", - "WitnetRequestFactoryImplementation": "0x364E2b91a4C7563288C3ccF7256BA172935CC550" - }, - "optimism.mainnet": { - "WitnetLib": "0x1D9c4a8f8B7b5F9B8e2641D81927f8F8Cc7fF079", - "WitnetPriceRouter": "0xD39D4d972C7E166856c4eb29E54D3548B4597F53", - "WitnetRandomness": "0x1ebD93231a7fE551E1d6405404Df34909eff4c2C", - "WitnetRequestBoard": "0xd653fbd7c736838289262F0F41A458f35393C88a" - } - }, - "polygon": { - "polygon.goerli": { - "Create2Factory": "0xDe312a6f7fA35320E8DD109c8ea42e82806DC45b", - "WitnetProxy": "0xF9bC9c1d66e4B28F56069c98A8c5373ec0200a25", - "WitnetBytecodes": "0x0000000e3a3d22d7510B36BdC88994dab11eadc8", - "WitnetPriceFeeds": "0x9999999d139bdBFbF25923ba39F63bBFc7593400", - "WitnetPriceRouter": "0x6d5544ca5b35bf2e7a78ace4E7B8d191fe5C9FAb", - "WitnetRandomness": "0x0123456fbBC59E181D76B6Fe8771953d1953B51a", - "WitnetRequestBoard": "0x58D8ECe142c60f5707594a7C1D90e46eAE5AF431", - "WitnetRequestFactory": "0x1111111FDE7dC956E3d7922Bc779D9E2349Afb63", - "WitnetErrorsLib": "0xA7389B84D6ABC46b40e88aAD2bbDAf9921649E9E", - "WitnetEncodingLib": "", - "WitnetPriceFeedsLib": "0xA149B0ED1D7d506AAB4B48275B9F761336aD916A", - "WitnetBytecodesImplementation": "", - "WitnetPriceFeedsImplementation": "0x632147c657743906F332EB05E5C775B738254e1b", - "WitnetRandomnessImplementation": "0xD7C67eA4BFB2e85b5a8a07E295c640F2d1811e41", - "WitnetRandomnessImplementationv079": "0x24Cc52D0603F161E16c3DB29Da4c2bCc07d17C4b", - "WitnetRequestBoardImplementation": "0x2bD210b8193780A9A74A2864E6Eb007745244092", - "WitnetRequestFactoryImplementation": "0x5Acb0fEf96A307660c6B2fBdB271af12Dcdb3E68" - }, - "polygon.mainnet": { - "Create2Factory": "0xDe312a6f7fA35320E8DD109c8ea42e82806DC45b", - "WitnetProxy": "0x0Dd81412825b9C3960195ab47F14dFa9Fd70e36e", - "WitnetBytecodes": "0x0000000e3a3d22d7510B36BdC88994dab11eadc8", - "WitnetPriceFeeds": "0x9999999d139bdBFbF25923ba39F63bBFc7593400", - "WitnetPriceRouter": "0x3806311c7138ddF2bAF2C2093ff3633E5A73AbD4", - "WitnetRandomness": "0x0123456fbBC59E181D76B6Fe8771953d1953B51a", - "WitnetRequestBoard": "0xd653fbd7c736838289262F0F41A458f35393C88a", - "WitnetRequestFactory": "0x1111111FDE7dC956E3d7922Bc779D9E2349Afb63", - "WitnetErrorsLib": "0x1225A47bC743199dFef9FEEf065b3B76695AaaaC", - "WitnetEncodingLib": "", - "WitnetPriceFeedsLib": "0xa239729c399c9eBae7fdc188A1Dbb2c4a06Cd4Bb", - "WitnetBytecodesImplementation": "", - "WitnetPriceFeedsImplementation": "0xf56E739C436EA6e65A17DBfaC9D7E57062D19422", - "WitnetRandomnessImplementation": "0xF1Aba51c5097487a62DA9c72fb9Aa7B0c98676C1", - "WitnetRandomnessImplementationv061": "0xc8c0d4dB2D7801D6E2A863934597cFD31689f7D5", - "WitnetRequestBoardImplementation": "0xF395CEeb77cE9cDc44Fd276bE5Ff307B1902D3f7", - "WitnetRequestFactoryImplementation": "0xc42656C501623859565C6d080a7Feb1f2B72b55a" - }, - "polygon.zkevm.goerli": { - "WitnetProxy": "0xd0f725Bf11bA75D291506d396FbcbeCAb5384e95", - "Create2Factory": "0xDe312a6f7fA35320E8DD109c8ea42e82806DC45b", - "WitnetBytecodes": "0x0000000e3a3d22d7510B36BdC88994dab11eadc8", - "WitnetPriceFeeds": "0x9999999d139bdBFbF25923ba39F63bBFc7593400", - "WitnetPriceRouter": "0xc2462eE5d9F8C70f3E0C4CE5881dFFF291Ff2205", - "WitnetRandomness": "0x0123456fbBC59E181D76B6Fe8771953d1953B51a", - "WitnetRandomnessV079": "0x88888885966F8F77cC6E797aE263C4d091e44A55", - "WitnetRequestBoard": "0x777777772C24e6CD34B464D1d71616C444254537", - "WitnetRequestFactory": "0x1111111FDE7dC956E3d7922Bc779D9E2349Afb63", - "WitnetErrorsLib": "0x07024BBdFbE0b7560A0f5B49745A372e15954d08", - "WitnetEncodingLib": "0x6D198FC7F1573E3bf4AEd1f9307fff6b2A05e38e", - "WitnetPriceFeedsLib": "0xFB2A291CaE095a63f50846a63aE729506A3D1C40", - "WitnetBytecodesImplementation": "0xda5223Df6c769B91C50517C9C0b1563F618A89e4", - "WitnetPriceFeedsImplementation": "0xA14a1fD9b1C6023f87f3A7E97DbdFdf1a9413D0A", - "WitnetRandomnessImplementation": "0x89A0EF4eDEEfA128931b353bdf494Bad97a3D448", - "WitnetRandomnessImplementationV079": "0x3f189fAc162d3CC6d84EF72c8177afAd8f3DBeE1", - "WitnetRequestBoardImplementation": "0x49030E216d49Fbf443CBe3692De5A6B97AEcFFCA", - "WitnetRequestFactoryImplementation": "0xB740E58D185558FF4FaaBf430fc87a6801208f38" - }, - "polygon.zkevm.mainnet": { - "WitnetProxy": "0x1225A47bC743199dFef9FEEf065b3B76695AaaaC", - "Create2Factory": "0xDe312a6f7fA35320E8DD109c8ea42e82806DC45b", - "WitnetBytecodes": "0x0000000e3a3d22d7510B36BdC88994dab11eadc8", - "WitnetPriceFeeds": "0x9999999d139bdBFbF25923ba39F63bBFc7593400", - "WitnetPriceRouter": "0xb99FA0430C73E7B82604Aa99d351d6aFdCe46A16", - "WitnetRandomness": "0x0123456fbBC59E181D76B6Fe8771953d1953B51a", - "WitnetRequestBoard": "0x777777772C24e6CD34B464D1d71616C444254537", - "WitnetRequestFactory": "0x1111111FDE7dC956E3d7922Bc779D9E2349Afb63", - "WitnetErrorsLib": "0x30e7D86b3DcdC0CC90509b1F7C27eA8e5481FAc5", - "WitnetEncodingLib": "0x9a83a23066766991E6cA113eB425fFe806f62ecF", - "WitnetPriceFeedsLib": "0x0d13c6058DDE86da77565ED6038C065Af71e9208", - "WitnetBytecodesImplementation": "0xD038E50cD189BF94CC0393C19606688A38D63D77", - "WitnetPriceFeedsImplementation": "0xe936a946FA591eCed937996Ef3df5c89d59f4dbb", - "WitnetRandomnessImplementation": "0x4756097b9184327713D07b3ac4C2a898468220B1", - "WitnetRequestBoardImplementation": "0x217C32Cf5755aB281809f29F21c107cD0E4652B3", - "WitnetRequestFactoryImplementation": "0x5FB499336aee67EC1183F49A8265CC3E2599C2ae" - } - }, - "reef": { - "reef.testnet": { - "WitnetProxy": "", - "Create2Factory": "", - "WitnetBytecodes": "", - "WitnetPriceFeeds": "", - "WitnetPriceRouter": "", - "WitnetRandomness": "", - "WitnetRequestBoard": "", - "WitnetRequestFactory": "", - "WitnetRequestRandomness": "", - "WitnetErrorsLib": "", - "WitnetEncodingLib": "", - "WitnetBytecodesImplementation": "", - "WitnetPriceFeedsImplementation": "", - "WitnetRandomnessImplementation": "", - "WitnetRequestBoardImplementation": "", - "WitnetRequestFactoryImplementation": "" - }, - "reef.mainnet": { - "WitnetParserLib": "0xD3e5A6F4653C5D596d16c947cfA30973C5aa9f34", - "WitnetPriceRouter": "0xa22AbF47Fd1eDDf7C0967C9d7fF06FB3c42B26E2", - "WitnetRandomness": "0x03e82c280ae03af908edb250d3d187db0018e501", - "WitnetRequestBoard": "0x61E11e5f496936Ef7f9600f6D1E81b1E7c12b172" - } - }, - "scroll": { - "scroll.sepolia": { - "WitnetProxy": "0x1b91eAB33362f10A5F803Fe3f0d181F42caFaac3", - "Create2Factory": "0xDe312a6f7fA35320E8DD109c8ea42e82806DC45b", - "WitnetBytecodes": "0x0000000e3a3d22d7510B36BdC88994dab11eadc8", - "WitnetPriceFeeds": "0x9999999d139bdBFbF25923ba39F63bBFc7593400", - "WitnetPriceRouter": "0xdC101573cB42EB7006Ad6C7E08ce8C91fEAcB62C", - "WitnetRandomness": "0x0123456fbBC59E181D76B6Fe8771953d1953B51a", - "WitnetRequestBoard": "0x777777772C24e6CD34B464D1d71616C444254537", - "WitnetRequestFactory": "0x1111111FDE7dC956E3d7922Bc779D9E2349Afb63", - "WitnetErrorsLib": "0xf6d52770453166de85B6B6260Cf22196bC460E88", - "WitnetEncodingLib": "0xB5447342cA17A40e59d410b340ba412E22e36201", - "WitnetPriceFeedsLib": "0xBfFA2ec6225390C517A1bEB83b27a171C6734294", - "WitnetBytecodesImplementation": "0x705E076F3387cFd59708D8D8508CECe3e1C65C87", - "WitnetPriceFeedsImplementation": "0x6bF6F65Ad0859e9Ee869DAD252a29c9daAa27449", - "WitnetRandomnessImplementation": "0x7A6C2Aad6b4b08De09477D0F663b8f90b0db9662", - "WitnetRequestBoardImplementation": "0x60768ce66aF2f3957e7280c6CfC4ab9c575a7FCF", - "WitnetRequestFactoryImplementation": "0x4374a050f808d1FF18bCcf73270daE3EdF8D0865" - }, - "scroll.mainnet": { - "WitnetProxy": "0x0Dd81412825b9C3960195ab47F14dFa9Fd70e36e", - "Create2Factory": "0xDe312a6f7fA35320E8DD109c8ea42e82806DC45b", - "WitnetBytecodes": "0x0000000e3a3d22d7510B36BdC88994dab11eadc8", - "WitnetPriceFeeds": "0x9999999d139bdBFbF25923ba39F63bBFc7593400", - "WitnetPriceRouter": "0x0d13c6058DDE86da77565ED6038C065Af71e9208", - "WitnetRandomness": "0x0123456fbBC59E181D76B6Fe8771953d1953B51a", - "WitnetRequestBoard": "0x777777772C24e6CD34B464D1d71616C444254537", - "WitnetRequestFactory": "0x1111111FDE7dC956E3d7922Bc779D9E2349Afb63", - "WitnetErrorsLib": "0x1225A47bC743199dFef9FEEf065b3B76695AaaaC", - "WitnetEncodingLib": "0x30e7D86b3DcdC0CC90509b1F7C27eA8e5481FAc5", - "WitnetPriceFeedsLib": "0xe33bD10fb2f1C5F4c6eF4259aAd4cE8A5868c222", - "WitnetBytecodesImplementation": "0x5832e99368877a63dd1c2cea941C2b43E1F6b16A", - "WitnetPriceFeedsImplementation": "0x4756097b9184327713D07b3ac4C2a898468220B1", - "WitnetRandomnessImplementation": "0x92a68143Ee3C2527C2B07e4354efAF89fd75a359", - "WitnetRequestBoardImplementation": "0x0e4F5763f417BB13AF759da4d36af50d13F02730", - "WitnetRequestFactoryImplementation": "0xc42656C501623859565C6d080a7Feb1f2B72b55a" - } - }, - "syscoin": { - "syscoin.testnet": { - "WitnetProxy": "", - "Create2Factory": "", - "WitnetBytecodes": "", - "WitnetPriceFeeds": "", - "WitnetPriceRouter": "0x9E943Ab1FD0D35B3BaDe31AA78D60C485EA1a604", - "WitnetRandomness": "0x56834Ff8D4b27db647Da97CA3bd8540f7fA0e89D", - "WitnetRequestBoard": "0x58D8ECe142c60f5707594a7C1D90e46eAE5AF431", - "WitnetRequestFactory": "", - "WitnetErrorsLib": "", - "WitnetEncodingLib": "", - "WitnetPriceFeedsLib": "", - "WitnetBytecodesImplementation": "", - "WitnetPriceFeedsImplementation": "", - "WitnetRequestBoardImplementation": "", - "WitnetRequestFactoryImplementation": "" - }, - "syscoin.mainnet": { - "WitnetLib": "0x1D9c4a8f8B7b5F9B8e2641D81927f8F8Cc7fF079", - "WitnetPriceRouter": "0xE22f48DDdcb34BD34489fE224d7fFC1b0a361D87", - "WitnetRandomness": "0xD39D4d972C7E166856c4eb29E54D3548B4597F53", - "WitnetRequestBoard": "0xd653fbd7c736838289262F0F41A458f35393C88a" - }, - "syscoin.rollux.testnet": { - "WitnetProxy": "0x60768ce66aF2f3957e7280c6CfC4ab9c575a7FCF", - "Create2Factory": "0xDe312a6f7fA35320E8DD109c8ea42e82806DC45b", - "WitnetErrorsLib": "0x1b91eAB33362f10A5F803Fe3f0d181F42caFaac3", - "WitnetEncodingLib": "", - "WitnetPriceFeedsLib": "0xBfFA2ec6225390C517A1bEB83b27a171C6734294", - "WitnetBytecodes": "0x0000000e3a3d22d7510B36BdC88994dab11eadc8", - "WitnetPriceFeeds": "0x9999999d139bdBFbF25923ba39F63bBFc7593400", - "WitnetPriceRouter": "0x4874cb1732eE1167A006E0Ab047D940ACF04D771", - "WitnetRandomness": "0x0123456fbBC59E181D76B6Fe8771953d1953B51a", - "WitnetRequestBoard": "0x777777772C24e6CD34B464D1d71616C444254537", - "WitnetRequestFactory": "0x1111111FDE7dC956E3d7922Bc779D9E2349Afb63", - "WitnetBytecodesImplementation": "", - "WitnetPriceFeedsImplementation": "0xdC101573cB42EB7006Ad6C7E08ce8C91fEAcB62C", - "WitnetRandomnessImplementation": "0x6dc0E2AC80550F901cd4d5F5a4C48333A0ca97Ee", - "WitnetRequestBoardImplementation": "0x9f9bAB64229680E170835BC9cC1c96F2C63f7d16", - "WitnetRequestFactoryImplementation": "0x4743325168af9195Aa5b25e491E9bE87d87E7F93" - } - }, - "ultron": { - "ultron.testnet": { - "WitnetProxy": "0x4374a050f808d1FF18bCcf73270daE3EdF8D0865", - "Create2Factory": "0xDe312a6f7fA35320E8DD109c8ea42e82806DC45b", - "WitnetBytecodes": "0x0000000e3a3d22d7510B36BdC88994dab11eadc8", - "WitnetPriceFeeds": "0x9999999d139bdBFbF25923ba39F63bBFc7593400", - "WitnetPriceRouter": "0xB4B2E2e00e9d6E5490d55623E4F403EC84c6D33f", - "WitnetRandomness": "0x0123456fbBC59E181D76B6Fe8771953d1953B51a", - "WitnetRequestBoard": "0x58D8ECe142c60f5707594a7C1D90e46eAE5AF431", - "WitnetRequestFactory": "0x1111111FDE7dC956E3d7922Bc779D9E2349Afb63", - "WitnetErrorsLib": "0xeDA4f244FEe1D6a3EA0fB2c0Fc6b7D1c49fEF01D", - "WitnetEncodingLib": "", - "WitnetPriceFeedsLib": "0x9f9bAB64229680E170835BC9cC1c96F2C63f7d16", - "WitnetBytecodesImplementation": "", - "WitnetPriceFeedsImplementation": "0x50AA08187D2F648Dd428784AF6489c3F12e942CC", - "WitnetRandomnessImplementation": "0x07024BBdFbE0b7560A0f5B49745A372e15954d08", - "WitnetRandomnessImplementationV061": "0xeD074DA2A76FD2Ca90C1508930b4FB4420e413B0", - "WitnetRequestBoardImplementation": "0x88a456C0Bd557DDA942FBc1DB86C0E35c529A6AE", - "WitnetRequestFactoryImplementation": "0x4874cb1732eE1167A006E0Ab047D940ACF04D771" - }, - "ultron.mainnet": { - "WitnetParserLib": "0x1D9c4a8f8B7b5F9B8e2641D81927f8F8Cc7fF079", - "WitnetPriceRouter": "0xD39D4d972C7E166856c4eb29E54D3548B4597F53", - "WitnetRandomness": "0x1ebD93231a7fE551E1d6405404Df34909eff4c2C", - "WitnetRequestBoard": "0xd653fbd7c736838289262F0F41A458f35393C88a" - } - } -} \ No newline at end of file diff --git a/migrations/witnet.salts.js b/migrations/witnet.salts.js deleted file mode 100644 index 5a2cd75f5..000000000 --- a/migrations/witnet.salts.js +++ /dev/null @@ -1,22 +0,0 @@ -module.exports = { - WitnetBytecodes: { - salt: 61396704, // => solc-0.8.17: 0x0000000e3a3d22d7510B36BdC88994dab11eadc8 - gas: 1000000, - }, - WitnetPriceFeeds: { - salt: 125920098, // => solc-0.8.17: 0x9999999d139bdBFbF25923ba39F63bBFc7593400 - gas: 1000000, - }, - WitnetRandomness: { - salt: 332121398, // => solc-0.8.17: 0x0123456fbBC59E181D76B6Fe8771953d1953B51a - gas: 1000000, - }, - WitnetRequestBoard: { - salt: 198789840, // => solc-0-8.17: 0x777777772C24e6CD34B464D1d71616C444254537 - gas: 1000000, - }, - WitnetRequestFactory: { - salt: 20377356, // => solc-0.8.17: 0x1111111FDE7dC956E3d7922Bc779D9E2349Afb63 - gas: 1000000, - }, -} diff --git a/migrations/witnet.settings.js b/migrations/witnet.settings.js deleted file mode 100644 index 8ff8e66cf..000000000 --- a/migrations/witnet.settings.js +++ /dev/null @@ -1,752 +0,0 @@ -module.exports = { - artifacts: { - default: { - WitnetBytecodes: "WitnetBytecodesDefault", - WitnetPriceFeeds: "WitnetPriceFeedsUpgradable", - WitnetRandomness: "WitnetRandomnessProxiable", - WitnetRequestBoard: "WitnetRequestBoardTrustableDefault", - WitnetRequestFactory: "WitnetRequestFactoryDefault", - }, - boba: { - WitnetRequestBoard: "WitnetRequestBoardTrustableOvm2", - }, - conflux: { - WitnetRequestFactory: "WitnetRequestFactoryCfxCore", - }, - mantle: { - WitnetRequestBoard: "WitnetRequestBoardTrustableOvm2", - }, - optimism: { - WitnetRequestBoard: "WitnetRequestBoardTrustableOvm2", - }, - "polygon.zkevm.goerli": { - WitnetBytecodes: "WitnetBytecodesNoSha256", - }, - "polygon.zkevm.mainnet": { - WitnetBytecodes: "WitnetBytecodesNoSha256", - }, - reef: { - WitnetRequestBoard: "WitnetRequestBoardTrustableReef", - }, - scroll: { - WitnetBytecodes: "WitnetBytecodesNoSha256", - }, - "syscoin.rollux.testnet": { - WitnetRequestBoard: "WitnetRequestBoardTrustableOvm2", - }, - }, - compilers: { - default: { - solc: { - version: "0.8.17", - settings: { - optimizer: { - enabled: true, - runs: 200, - }, - }, - }, - }, - }, - constructorParams: { - default: { - WitnetRequestBoard: [ - /* _reportResultGasLimit */ 133000, - ], - }, - avalanche: { - WitnetRequestBoard: [ - /* _reportResultGasLimit */ 155000, - ], - }, - celo: { - WitnetRequestBoard: [ - /* _reportResultGasLimit */ 114000, - ], - }, - conflux: { - WitnetRequestBoard: [ - /* _reportResultGasLimit */ 78500, - ], - }, - "conflux.espace.testnet": { - WitnetRequestBoard: [ - /* _reportResultGasLimit */ 225000, - ], - }, - "conflux.espace.mainnet": { - WitnetRequestBoard: [ - /* _reportResultGasLimit */ 225000, - ], - }, - cronos: { - WitnetRequestBoard: [ - /* _reportResultGasLimit */ 137500, - ], - }, - dogechain: { - WitnetRequestBoard: [ - /* _reportResultGasLimit */ 85000, - ], - }, - harmony: { - WitnetRequestBoard: [ - /* _reportResultGasLimit */ 530000, - ], - }, - hsc: { - WitnetRequestBoard: [ - /* _reportResultGasLimit */ 85000, - ], - }, - kcc: { - WitnetRequestBoard: [ - /* _reportResultGasLimit */ 92500, - ], - }, - klaytn: { - WitnetRequestBoard: [ - /* _reportResultGasLimit */ 105000, - ], - }, - meter: { - WitnetRequestBoard: [ - /* _reportResultGasLimit */ 85000, - ], - }, - metis: { - WitnetRequestBoard: [ - /* _reportResultGasLimit */ 134800, - ], - }, - moonbeam: { - WitnetRequestBoard: [ - /* _reportResultGasLimit */ 115000, - ], - }, - okxchain: { - WitnetRequestBoard: [ - /* _reportResultGasLimit */ 145000, - ], - }, - optimism: { - WitnetRequestBoard: [ - /* _reportResultGasLimit */ 135000, - ], - }, - reef: { - WitnetRequestBoard: [ - /* _reportResultGasLimit */ "0x3100A1CAC7EF19DC", - ], - }, - ultron: { - WitnetRequestBoard: [ - /* _reportResultGasLimit */ 83949, - ], - }, - }, - networks: { - default: { - "ethereum.goerli": { - network_id: 5, - host: "localhost", - port: 8545, - skipDryRun: true, - verify: { - apiUrl: "https://api-goerli.etherscan.io/", - browserURL: "https://goerli.etherscan.io/", - }, - }, - "ethereum.kovan": { - network_id: 42, - host: "localhost", - port: 8542, - skipDryRun: true, - }, - "ethereum.mainnet": { - network_id: 1, - host: "localhost", - port: 9545, - skipDryRun: true, - }, - "ethereum.rinkeby": { - network_id: 4, - host: "localhost", - port: 8544, - skipDryRun: true, - }, - "ethereum.ropsten": { - network_id: 3, - host: "localhost", - port: 8543, - }, - "ethereum.sepolia": { - network_id: 11155111, - host: "localhost", - port: 8506, - skipDryRun: true, - verify: { - apiUrl: "https://api-sepolia.etherscan.io/api", - browserURL: "https://sepolia.etherscan.io/", - }, - }, - }, - arbitrum: { - "arbitrum.goerli": { - network_id: 421613, - host: "localhost", - port: 8517, - skipDryRun: true, - verify: { - apiUrl: "https://api-goerli.arbiscan.io/", - browserURL: "https://goerli.arbiscan.io/", - }, - }, - "arbitrum.one": { - network_id: 42161, - host: "localhost", - port: 9517, - skipDryRun: true, - verify: { - apiUrl: "https://api.arbiscan.io/api", - browserURL: "https://arbiscan.io/", - }, - }, - }, - avalanche: { - "avalanche.mainnet": { - network_id: 43114, - host: "localhost", - port: 9533, - skipDryRun: true, - gasPrice: 75 * 10 ** 9, - }, - "avalanche.testnet": { - network_id: 43113, - host: "localhost", - port: 8533, - skipDryRun: true, - gasPrice: 30 * 10 ** 9, - verify: { - apiKey: "MY_API_KEY", - apiUrl: "https://api-testnet.snowtrace.io/", - browserURL: "https://testnet.snowtrace.io/", - }, - }, - }, - boba: { - "boba.bnb.testnet": { - network_id: 9728, - host: "localhost", - port: 8510, - skipDryRun: true, - verify: { - apiUrl: "https://api.routescan.io/v2/network/testnet/evm/2888/etherscan", - browserURL: "https://boba.testnet.routescan.io/", - }, - }, - "boba.bnb.mainnet": { - network_id: 56288, - host: "localhost", - port: 9510, - skipDryRun: true, - verify: { - apiUrl: "https://blockexplorer.bnb.boba.network/api", - browserURL: "https://blockexplorer.bnb.boba.network/", - apiKey: "MY_API_KEY", - }, - }, - "boba.ethereum.mainnet": { - network_id: 288, - host: "localhost", - port: 9539, - skipDryRun: true, - verify: { - apiUrl: "https://api.routescan.io/v2/network/mainnet/evm/all/etherscan", - browserURL: "https://bobascan.com/address/", - apiKey: "MY_API_KEY", - }, - }, - "boba.ethereum.goerli": { - network_id: 2888, - host: "localhost", - port: 8515, - skipDryRun: true, - verify: { - apiUrl: "https://api.routescan.io/v2/network/testnet/evm/2888/etherscan", - browserURL: "https://boba.testnet.routescan.io/", - }, - }, - }, - celo: { - "celo.alfajores": { - network_id: 44787, - host: "localhost", - port: 8538, - skipDryRun: true, - verify: { - apiKey: "MY_API_KEY", - apiUrl: "https://explorer.celo.org/alfajores/api", - browserURL: "https://explorer.celo.org/alfajores/", - }, - }, - "celo.mainnet": { - network_id: 42220, - host: "localhost", - port: 9538, - skipDryRun: true, - verify: { - apiUrl: "https://explorer.celo.org/mainnet/api", - browserURL: "https://explorer.celo.org/mainnet/", - }, - }, - }, - conflux: { - "conflux.core.testnet": { - host: "localhost", - port: 8540, - network_id: 1, - gasPrice: 10, - skipDryRun: true, - }, - "conflux.core.mainnet": { - host: "localhost", - port: 9540, - network_id: 1029, - gasPrice: 10, - skipDryRun: true, - }, - "conflux.espace.testnet": { - host: "localhost", - port: 8529, - network_id: 71, - skipDryRun: true, - networkCheckTimeout: 999999, - gas: 15000000, - }, - "conflux.espace.mainnet": { - host: "localhost", - port: 9529, - network_id: 1030, - skipDryRun: true, - networkCheckTimeout: 999999, - gas: 15000000, - }, - }, - cronos: { - "cronos.testnet": { - host: "localhost", - port: 8530, - network_id: 338, - skipDryRun: true, - verify: { - apiUrl: "https://cronos.org/explorer/testnet3/api", - browserURL: "https://cronos.org/explorer/testnet3", - }, - }, - "cronos.mainnet": { - host: "localhost", - port: 9530, - network_id: 25, - skipDryRun: true, - }, - }, - cube: { - "cube.testnet": { - host: "localhost", - port: 8522, - network_id: 1819, - skipDryRun: true, - }, - "cube.mainnet": { - host: "localhost", - port: 9522, - network_id: 1818, - skipDryRun: true, - gas: 6000000, - gasPrice: 250 * 10 ** 9, - }, - }, - dogechain: { - "dogechain.testnet": { - host: "localhost", - port: 8519, - network_id: 568, - skipDryRun: true, - gas: 6000000, - verify: { - apiKey: "MY_API_KEY", - apiUrl: "http://explorer-testnet.dogechain.dog/api", - browserURL: "https://explorer-testnet.dogechain.dog/", - }, - }, - "dogechain.mainnet": { - host: "localhost", - port: 9519, - network_id: 2000, - skipDryRun: true, - }, - }, - elastos: { - "elastos.testnet": { - host: "localhost", - port: 8513, - network_id: 21, - skipDryRun: true, - verify: { - apiKey: "MY_API_KEY", - apiUrl: "https://esc-testnet.elastos.io/api", - browserURL: "https://esc-testnet.elastos.io/address", - }, - }, - "elastos.mainnet": { - host: "localhost", - port: 9513, - network_id: 20, - skipDryRun: true, - verify: { - apiUrl: "https://esc.elastos.io/api", - browserURL: "https://esc.elastos.io/address", - }, - }, - }, - fuse: { - "fuse.testnet": { - host: "localhost", - port: 8511, - network_id: 123, - skipDryRun: true, - verify: { - apiUrl: "https://explorer.fusespark.io/api", - browserURL: "https://explorer.fusespark.io/address", - apiKey: "MY_API_KEY", - }, - }, - }, - gnosis: { - "gnosis.testnet": { - host: "localhost", - port: 8509, - network_id: 10200, - skipDryRun: true, - verify: { - apiUrl: "https://gnosis-chiado.blockscout.com/api", - browserURL: "https://gnosis-chiado.blockscout.com/address", - apiKey: "MY_API_KEY", - }, - }, - }, - harmony: { - "harmony.testnet#0": { - host: "localhost", - port: 8534, - network_id: 1666700000, - skipDryRun: true, - }, - }, - hsc: { - "hsc.testnet": { - host: "localhost", - port: 8524, - network_id: 170, - skipDryRun: true, - }, - "hsc.mainnet": { - host: "localhost", - port: 9524, - network_id: 70, - skipDryRun: true, - }, - }, - kava: { - "kava.testnet": { - host: "localhost", - port: 8526, - network_id: 2221, - skipDryRun: true, - verify: { - apiKey: "MY_API_KEY", - apiUrl: "https://explorer.testnet.kava.io/api", - browserURL: "https://explorer.testnet.kava.io/", - }, - }, - "kava.mainnet": { - host: "localhost", - port: 9526, - network_id: 2222, - skipDryRun: true, - }, - }, - kcc: { - "kcc.testnet": { - host: "localhost", - port: 8537, - network_id: 322, - gasPrice: 10 ** 10, - skipDryRun: true, - verify: { - apiKey: "MY_API_KEY", - apiUrl: "https://scan-testnet.kcc.network/api", - browserURL: "https://scan-testnet.kcc.network/", - }, - }, - "kcc.mainnet": { - host: "localhost", - port: 9537, - network_id: 321, - gasPrice: 10 ** 10, - skipDryRun: true, - }, - }, - klaytn: { - "klaytn.testnet": { - host: "localhost", - port: 8527, - network_id: 1001, - skipDryRun: true, - gasPrice: 0, - }, - "klaytn.mainnet": { - host: "localhost", - port: 9527, - network_id: 8217, - skipDrynRun: true, - gasPrice: 0, - }, - }, - mantle: { - "mantle.testnet": { - host: "localhost", - port: 8508, - network_id: 5001, - skipDryRun: true, - verify: { - apiKey: "MY_API_KEY", - apiUrl: "https://explorer.testnet.mantle.xyz/api", - explorerUrl: "https://explorer.testnet.mantle.xyz/address", - }, - }, - "mantle.mainnet": { - host: "localhost", - port: 9508, - network_id: 5000, - skipDryRun: true, - verify: { - apiKey: "MY_API_KEY", - apiUrl: "https://explorer.mantle.xyz/api", - explorerUrl: "https://explorer.mantle.xyz/address", - }, - }, - }, - metis: { - "metis.mainnet": { - host: "localhost", - port: 9536, - network_id: 1088, - skipDryRun: true, - }, - "metis.goerli": { - host: "localhost", - port: 8536, - network_id: 599, - skipDryRun: true, - verify: { - apiKey: "MY_API_KEY", - apiUrl: "https://goerli.explorer.metisdevops.link/api", - explorerUrl: "https://goerli.explorer.metisdevops.link/address", - }, - }, - }, - meter: { - "meter.testnet": { - host: "localhost", - port: 8523, - network_id: 83, - skipDryRun: true, - }, - "meter.mainnet": { - host: "localhost", - port: 9523, - network_id: 82, - skipDryRun: true, - }, - }, - moonbeam: { - "moonbeam.mainnet": { - host: "localhost", - port: 9531, - network_id: 1284, - skipDryRun: true, - }, - "moonbeam.moonriver": { - host: "localhost", - port: 7531, - network_id: 1285, - skipDrynRun: true, - }, - "moonbeam.moonbase": { - host: "localhost", - port: 8531, - network_id: 1287, - skipDryRun: true, - gasPrice: 3 * 10 ** 9, - }, - }, - okxchain: { - "okxchain.testnet": { - host: "localhost", - port: 8528, - network_id: 65, - skipDryRun: true, - }, - "okxchain.mainnet": { - host: "localhost", - port: 9528, - network_id: 66, - skipDryRun: true, - }, - }, - optimism: { - "optimism.goerli": { - host: "localhost", - port: 8520, - network_id: 420, - skipDryRun: true, - verify: { - apiKey: "MY_API_KEY", - apiUrl: "https://optimism-goerli.blockscout.com/api", - explorerUrl: "https://optimism-goerli.blockscout.com/", - }, - }, - "optimism.mainnet": { - host: "localhost", - port: 9520, - network_id: 10, - skipDryRun: true, - }, - }, - polygon: { - "polygon.goerli": { - host: "localhost", - port: 8535, - network_id: 80001, - skipDryRun: true, - }, - "polygon.mainnet": { - host: "localhost", - port: 9535, - network_id: 137, - skipDryRun: true, - }, - "polygon.zkevm.goerli": { - host: "localhost", - port: 8512, - network_id: 1442, - skipDryRun: true, - verify: { - apiUrl: "https://api-testnet-zkevm.polygonscan.com/api", - explorerUrl: "https://testnet-zkevm.polygonscan.com/address", - }, - }, - "polygon.zkevm.mainnet": { - host: "localhost", - port: 9512, - network_id: 1101, - skipDryRun: true, - verify: { - apiUrl: "https://api-zkevm.polygonscan.com/api", - explorerUrl: "https://zkevm.polygonscan.com/address/", - }, - }, - }, - reef: { - "reef.testnet": { - host: "localhost", - port: 8532, - network_id: 13939, - skipDryRun: true, - }, - "reef.mainnet": { - host: "localhost", - port: 9532, - network_id: 13939, - skipDryRun: true, - }, - }, - scroll: { - "scroll.sepolia": { - host: "localhost", - port: 8514, - network_id: 534351, - skipDryRun: true, - verify: { - apiUrl: "http://api-sepolia.scrollscan.io/api", - explorerUrl: "https://sepolia.scrollscan.io/", - }, - }, - "scroll.mainnet": { - host: "localhost", - port: 9514, - network_id: 534352, - skipDryRun: true, - verify: { - apiUrl: "https://api.scrollscan.com/api", - explorerUrl: "https://scrollscan.com/address", - }, - }, - }, - smartbch: { - "smartbch.amber": { - host: "localhost", - port: 8525, - network_id: 10001, - skipDryRun: true, - }, - "smartbch.mainnet": { - host: "localhost", - port: 9525, - network_id: 10000, - skipDryRun: true, - }, - }, - syscoin: { - "syscoin.testnet": { - host: "localhost", - port: 8521, - network_id: 5700, - skipDryRun: true, - }, - "syscoin.mainnet": { - host: "localhost", - port: 9521, - network_id: 57, - skipDryRun: true, - }, - "syscoin.rollux.testnet": { - host: "localhost", - port: 8507, - network_id: 57000, - skipDryRun: true, - verify: { - apiKey: "abc", - apiUrl: "https://rollux.tanenbaum.io/api", - explorerUrl: "https://rollux.tanenbaum.io/address/", - }, - }, - }, - ultron: { - "ultron.testnet": { - host: "localhost", - port: 8516, - network_id: 1230, - skipDryRun: true, - }, - "ultron.mainnet": { - host: "localhost", - port: 9516, - network_id: 1231, - skipDryRun: true, - }, - }, - }, -} diff --git a/package.json b/package.json index fb87efad1..4e22037ff 100644 --- a/package.json +++ b/package.json @@ -1,68 +1,88 @@ { "name": "witnet-solidity-bridge", - "version": "0.7.16", + "version": "2.0.1", "description": "Witnet Solidity Bridge contracts for EVM-compatible chains", - "main": "", + "author": "Witnet Foundation ", + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/witnet/witnet-solidity-bridge/tree/2.0.x" + }, + "type": "commonjs", + "keywords": [ + "bridge", + "witnet", + "ethereum" + ], + "exports": { + ".": "./src/index.js", + "./assets": "./src/index.js", + "./utils": "./src/utils.js" + }, + "files": [ + "artifacts", + "build/contracts", + "contracts", + "migrations/*.json", + "settings", + "src" + ], "scripts": { "addresses": "node ./scripts/addresses.js 2>&1", - "clean": "npm run clean:build && npm run clean:flattened", + "clean": "pnpm run clean:build && pnpm run clean:flattened", "clean:build": "node ./scripts/clean.js build", "clean:flattened": "node ./scripts/clean.js flattened", - "compile": "truffle compile --all --network", - "console": "truffle console", + "compile": "npx truffle compile --all", + "console": "npx truffle console", "coverage": "solidity-coverage", "flatten": "node ./scripts/flatten.js 2>&1", - "flatten:all": "npm run clean && npm run flatten:core && npm run flatten:apps && npm run flatten:libs && npm run flatten:proxy", - "flatten:apps": "npm run flatten contracts/impls/apps/", - "flatten:core": "npm run flatten contracts/impls/core/", - "flatten:libs": "npm run flatten contracts/libs/WitnetErrorsLib.sol && npm run flatten contracts/libs/WitnetEncodingLib.sol && npm run flatten contracts/libs/WitnetPriceFeedsLib.sol", - "flatten:proxy": "npm run flatten contracts/impls/WitnetProxy.sol", + "flatten:all": "pnpm run clean && pnpm run flatten:core && pnpm run flatten:apps && pnpm run flatten:libs && pnpm run flatten:proxy", + "flatten:apps": "pnpm run flatten contracts/core/apps/", + "flatten:core": "pnpm run flatten contracts/core/core/", + "flatten:libs": "pnpm run flatten contracts/libs/WitnetErrorsLib.sol && pnpm run flatten contracts/libs/WitnetEncodingLib.sol && pnpm run flatten contracts/libs/WitnetPriceFeedsLib.sol", + "flatten:proxy": "pnpm run flatten contracts/core/WitnetProxy.sol", "fmt:js": "eslint \"**/*.js\"", "fmt:sol": "solhint --max-warnings 0 \"contracts/**/*.sol\" && solhint \"test/**/*.sol\" && solhint \"flattened/**/*.sol\"", "fmt!:js": "eslint \"**/*.js\" --fix", "fmt!:sol": "solhint --max-warnings 0 \"contracts/**/*.sol\" --fix && solhint \"test/**/*.sol\" --fix && solhint \"flattened/**/*.sol\"", - "fmt!": "npm run fmt!:js && npm run fmt!:sol", - "fmt": "npm run fmt:js && npm run fmt:sol", - "migrate": "node ./scripts/migrate.js 2>&1", + "fmt!": "pnpm run fmt!:js && pnpm run fmt!:sol", + "fmt": "pnpm run fmt:js && pnpm run fmt:sol", + "migrate": "npx truffle migrate --network", "networks": "node ./scripts/networks.js 2>&1", - "ops:rng:sla": "truffle migrate --migrations_directory ./migrations/ops/rng/sla --network", - "test": "npm run clean && truffle test" + "ops:rng:sla": "npx truffle migrate --migrations_directory ./migrations/ops/rng/sla --network", + "prepare": "npx truffle compile --all && npx hardhat compile --force && node ./scripts/prepare.js", + "test": "pnpm run clean && npx truffle test", + "verify:core": "node ./scripts/verify-core.js 2>&1", + "verify:libs": "node ./scripts/verify-libs.js 2>&1", + "verify:impls": "node ./scripts/verify-impls.js 2>&1" }, - "author": "Witnet Foundation ", - "repository": { - "type": "git", - "url": "https://github.com/witnet/witnet-solidity-bridge.git" - }, - "keywords": [ - "bridge", - "witnet", - "ethereum" - ], - "license": "MIT", "dependencies": { - "@openzeppelin/contracts": "4.8.0", - "@openzeppelin/contracts-upgradeable": "4.8.0", - "ado-contracts": "1.0.0", - "lodash": "4.17.21" + "dotenv": "^16.4.4", + "lodash.merge": "^4.6.2", + "proper-lockfile": "^4.1.2" }, "devDependencies": { + "@nomicfoundation/hardhat-verify": "^2.0.4", + "@openzeppelin/contracts": "^5.0.1", + "@openzeppelin/contracts-upgradeable": "^5.0.1", "@openzeppelin/test-helpers": "~0.5.16", - "chai": "4.3.6", + "ado-contracts": "1.0.0", + "bn.js": "^4.11.0", "custom-error-test-helper": "^1.0.6", - "dotenv": "8.2.0", - "eslint": "~8.31.0", - "eslint-config-standard": "~17.0.0", - "eslint-plugin-import": "~2.26.0", - "eslint-plugin-n": "~15.6.0", - "eslint-plugin-promise": "~6.1.1", - "eth-create2": "~1.0.1", - "eth-gas-reporter": "0.2.25", - "js-sha256": "0.9.0", - "solhint": "3.3.7", - "solidity-coverage": "0.7.16", - "truffle": "~5.11.5", - "truffle-assertions": "0.9.2", - "truffle-flattener": "~1.6.0", - "truffle-plugin-verify": "~0.6.2" + "eslint": "^8.56.0", + "eslint-config-standard": "^17.1.0", + "eslint-plugin-import": "^2.29.1", + "eslint-plugin-n": "^16.6.2", + "eslint-plugin-promise": "^6.1.1", + "eth-gas-reporter": "^0.2.27", + "eth-helpers": "^1.3.0", + "hardhat": "^2.19.5", + "nanoassert": "^2.0.0", + "sha3-wasm": "^1.0.0", + "solhint": "^4.1.1", + "truffle": "^5.11.5", + "truffle-assertions": "^0.9.2", + "truffle-flattener": "^1.6.0", + "truffle-plugin-verify": "^0.6.7" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml new file mode 100644 index 000000000..ae3089b63 --- /dev/null +++ b/pnpm-lock.yaml @@ -0,0 +1,9913 @@ +lockfileVersion: 5.4 + +specifiers: + '@nomicfoundation/hardhat-verify': ^2.0.4 + '@openzeppelin/contracts': ^5.0.1 + '@openzeppelin/contracts-upgradeable': ^5.0.1 + '@openzeppelin/test-helpers': ~0.5.16 + ado-contracts: 1.0.0 + bn.js: ^4.11.0 + custom-error-test-helper: ^1.0.6 + dotenv: ^16.4.4 + eslint: ^8.56.0 + eslint-config-standard: ^17.1.0 + eslint-plugin-import: ^2.29.1 + eslint-plugin-n: ^16.6.2 + eslint-plugin-promise: ^6.1.1 + eth-gas-reporter: ^0.2.27 + eth-helpers: ^1.3.0 + hardhat: ^2.19.5 + lodash.merge: ^4.6.2 + nanoassert: ^2.0.0 + proper-lockfile: ^4.1.2 + sha3-wasm: ^1.0.0 + solhint: ^4.1.1 + truffle: ^5.11.5 + truffle-assertions: ^0.9.2 + truffle-flattener: ^1.6.0 + truffle-plugin-verify: ^0.6.7 + witnet-toolkit: ../witnet-utils + +dependencies: + dotenv: 16.4.4 + lodash.merge: 4.6.2 + proper-lockfile: 4.1.2 + +devDependencies: + '@nomicfoundation/hardhat-verify': 2.0.4_hardhat@2.19.5 + '@openzeppelin/contracts': 5.0.1 + '@openzeppelin/contracts-upgradeable': 5.0.1_qffjc7vved4cgcgrp7e6uufd2e + '@openzeppelin/test-helpers': 0.5.16_bn.js@4.12.0 + ado-contracts: 1.0.0 + bn.js: 4.12.0 + custom-error-test-helper: 1.0.6 + eslint: 8.56.0 + eslint-config-standard: 17.1.0_ot4howdeavqht6h5s42eunnfxi + eslint-plugin-import: 2.29.1_eslint@8.56.0 + eslint-plugin-n: 16.6.2_eslint@8.56.0 + eslint-plugin-promise: 6.1.1_eslint@8.56.0 + eth-gas-reporter: 0.2.27 + eth-helpers: 1.3.1 + hardhat: 2.19.5 + nanoassert: 2.0.0 + sha3-wasm: 1.0.0 + solhint: 4.1.1 + truffle: 5.11.5 + truffle-assertions: 0.9.2 + truffle-flattener: 1.6.0 + truffle-plugin-verify: 0.6.7 + witnet-toolkit: link:../witnet-utils + +packages: + + /@aashutoshrathi/word-wrap/1.2.6: + resolution: {integrity: sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==} + engines: {node: '>=0.10.0'} + dev: true + + /@apollo/protobufjs/1.2.6: + resolution: {integrity: sha512-Wqo1oSHNUj/jxmsVp4iR3I480p6qdqHikn38lKrFhfzcDJ7lwd7Ck7cHRl4JE81tWNArl77xhnG/OkZhxKBYOw==} + hasBin: true + requiresBuild: true + dependencies: + '@protobufjs/aspromise': 1.1.2 + '@protobufjs/base64': 1.1.2 + '@protobufjs/codegen': 2.0.4 + '@protobufjs/eventemitter': 1.1.0 + '@protobufjs/fetch': 1.1.0 + '@protobufjs/float': 1.0.2 + '@protobufjs/inquire': 1.1.0 + '@protobufjs/path': 1.1.2 + '@protobufjs/pool': 1.1.0 + '@protobufjs/utf8': 1.1.0 + '@types/long': 4.0.2 + '@types/node': 10.17.60 + long: 4.0.0 + dev: true + optional: true + + /@apollo/protobufjs/1.2.7: + resolution: {integrity: sha512-Lahx5zntHPZia35myYDBRuF58tlwPskwHc5CWBZC/4bMKB6siTBWwtMrkqXcsNwQiFSzSx5hKdRPUmemrEp3Gg==} + hasBin: true + requiresBuild: true + dependencies: + '@protobufjs/aspromise': 1.1.2 + '@protobufjs/base64': 1.1.2 + '@protobufjs/codegen': 2.0.4 + '@protobufjs/eventemitter': 1.1.0 + '@protobufjs/fetch': 1.1.0 + '@protobufjs/float': 1.0.2 + '@protobufjs/inquire': 1.1.0 + '@protobufjs/path': 1.1.2 + '@protobufjs/pool': 1.1.0 + '@protobufjs/utf8': 1.1.0 + '@types/long': 4.0.2 + long: 4.0.0 + dev: true + optional: true + + /@apollo/usage-reporting-protobuf/4.1.1: + resolution: {integrity: sha512-u40dIUePHaSKVshcedO7Wp+mPiZsaU6xjv9J+VyxpoU/zL6Jle+9zWeG98tr/+SZ0nZ4OXhrbb8SNr0rAPpIDA==} + dependencies: + '@apollo/protobufjs': 1.2.7 + dev: true + optional: true + + /@apollo/utils.dropunuseddefinitions/1.1.0_graphql@15.8.0: + resolution: {integrity: sha512-jU1XjMr6ec9pPoL+BFWzEPW7VHHulVdGKMkPAMiCigpVIT11VmCbnij0bWob8uS3ODJ65tZLYKAh/55vLw2rbg==} + engines: {node: '>=12.13.0'} + peerDependencies: + graphql: 14.x || 15.x || 16.x + dependencies: + graphql: 15.8.0 + dev: true + optional: true + + /@apollo/utils.keyvaluecache/1.0.2: + resolution: {integrity: sha512-p7PVdLPMnPzmXSQVEsy27cYEjVON+SH/Wb7COyW3rQN8+wJgT1nv9jZouYtztWW8ZgTkii5T6tC9qfoDREd4mg==} + dependencies: + '@apollo/utils.logger': 1.0.1 + lru-cache: 7.13.1 + dev: true + optional: true + + /@apollo/utils.logger/1.0.1: + resolution: {integrity: sha512-XdlzoY7fYNK4OIcvMD2G94RoFZbzTQaNP0jozmqqMudmaGo2I/2Jx71xlDJ801mWA/mbYRihyaw6KJii7k5RVA==} + dev: true + optional: true + + /@apollo/utils.printwithreducedwhitespace/1.1.0_graphql@15.8.0: + resolution: {integrity: sha512-GfFSkAv3n1toDZ4V6u2d7L4xMwLA+lv+6hqXicMN9KELSJ9yy9RzuEXaX73c/Ry+GzRsBy/fdSUGayGqdHfT2Q==} + engines: {node: '>=12.13.0'} + peerDependencies: + graphql: 14.x || 15.x || 16.x + dependencies: + graphql: 15.8.0 + dev: true + optional: true + + /@apollo/utils.removealiases/1.0.0_graphql@15.8.0: + resolution: {integrity: sha512-6cM8sEOJW2LaGjL/0vHV0GtRaSekrPQR4DiywaApQlL9EdROASZU5PsQibe2MWeZCOhNrPRuHh4wDMwPsWTn8A==} + engines: {node: '>=12.13.0'} + peerDependencies: + graphql: 14.x || 15.x || 16.x + dependencies: + graphql: 15.8.0 + dev: true + optional: true + + /@apollo/utils.sortast/1.1.0_graphql@15.8.0: + resolution: {integrity: sha512-VPlTsmUnOwzPK5yGZENN069y6uUHgeiSlpEhRnLFYwYNoJHsuJq2vXVwIaSmts015WTPa2fpz1inkLYByeuRQA==} + engines: {node: '>=12.13.0'} + peerDependencies: + graphql: 14.x || 15.x || 16.x + dependencies: + graphql: 15.8.0 + lodash.sortby: 4.7.0 + dev: true + optional: true + + /@apollo/utils.stripsensitiveliterals/1.2.0_graphql@15.8.0: + resolution: {integrity: sha512-E41rDUzkz/cdikM5147d8nfCFVKovXxKBcjvLEQ7bjZm/cg9zEcXvS6vFY8ugTubI3fn6zoqo0CyU8zT+BGP9w==} + engines: {node: '>=12.13.0'} + peerDependencies: + graphql: 14.x || 15.x || 16.x + dependencies: + graphql: 15.8.0 + dev: true + optional: true + + /@apollo/utils.usagereporting/1.0.1_graphql@15.8.0: + resolution: {integrity: sha512-6dk+0hZlnDbahDBB2mP/PZ5ybrtCJdLMbeNJD+TJpKyZmSY6bA3SjI8Cr2EM9QA+AdziywuWg+SgbWUF3/zQqQ==} + engines: {node: '>=12.13.0'} + peerDependencies: + graphql: 14.x || 15.x || 16.x + dependencies: + '@apollo/usage-reporting-protobuf': 4.1.1 + '@apollo/utils.dropunuseddefinitions': 1.1.0_graphql@15.8.0 + '@apollo/utils.printwithreducedwhitespace': 1.1.0_graphql@15.8.0 + '@apollo/utils.removealiases': 1.0.0_graphql@15.8.0 + '@apollo/utils.sortast': 1.1.0_graphql@15.8.0 + '@apollo/utils.stripsensitiveliterals': 1.2.0_graphql@15.8.0 + graphql: 15.8.0 + dev: true + optional: true + + /@apollographql/apollo-tools/0.5.4_graphql@15.8.0: + resolution: {integrity: sha512-shM3q7rUbNyXVVRkQJQseXv6bnYM3BUma/eZhwXR4xsuM+bqWnJKvW7SAfRjP7LuSCocrexa5AXhjjawNHrIlw==} + engines: {node: '>=8', npm: '>=6'} + peerDependencies: + graphql: ^14.2.1 || ^15.0.0 || ^16.0.0 + dependencies: + graphql: 15.8.0 + dev: true + optional: true + + /@apollographql/graphql-playground-html/1.6.29: + resolution: {integrity: sha512-xCcXpoz52rI4ksJSdOCxeOCn2DLocxwHf9dVT/Q90Pte1LX+LY+91SFtJF3KXVHH8kEin+g1KKCQPKBjZJfWNA==} + dependencies: + xss: 1.0.14 + dev: true + optional: true + + /@babel/code-frame/7.23.5: + resolution: {integrity: sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/highlight': 7.23.4 + chalk: 2.4.2 + dev: true + + /@babel/helper-validator-identifier/7.22.20: + resolution: {integrity: sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==} + engines: {node: '>=6.9.0'} + dev: true + + /@babel/highlight/7.23.4: + resolution: {integrity: sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/helper-validator-identifier': 7.22.20 + chalk: 2.4.2 + js-tokens: 4.0.0 + dev: true + + /@babel/runtime/7.23.9: + resolution: {integrity: sha512-0CX6F+BI2s9dkUqr08KFrAIZgNFj75rdBU/DjCyYLIaV/quFjkk6T+EJ2LkZHyZTbEV4L5p97mNkUsHl2wLFAw==} + engines: {node: '>=6.9.0'} + dependencies: + regenerator-runtime: 0.14.1 + dev: true + + /@chainsafe/as-sha256/0.3.1: + resolution: {integrity: sha512-hldFFYuf49ed7DAakWVXSJODuq3pzJEguD8tQ7h+sGkM18vja+OFoJI9krnGmgzyuZC2ETX0NOIcCTy31v2Mtg==} + dev: true + + /@chainsafe/persistent-merkle-tree/0.4.2: + resolution: {integrity: sha512-lLO3ihKPngXLTus/L7WHKaw9PnNJWizlOF1H9NNzHP6Xvh82vzg9F2bzkXhYIFshMZ2gTCEz8tq6STe7r5NDfQ==} + dependencies: + '@chainsafe/as-sha256': 0.3.1 + dev: true + + /@chainsafe/persistent-merkle-tree/0.5.0: + resolution: {integrity: sha512-l0V1b5clxA3iwQLXP40zYjyZYospQLZXzBVIhhr9kDg/1qHZfzzHw0jj4VPBijfYCArZDlPkRi1wZaV2POKeuw==} + dependencies: + '@chainsafe/as-sha256': 0.3.1 + dev: true + + /@chainsafe/ssz/0.10.2: + resolution: {integrity: sha512-/NL3Lh8K+0q7A3LsiFq09YXS9fPE+ead2rr7vM2QK8PLzrNsw3uqrif9bpRX5UxgeRjM+vYi+boCM3+GM4ovXg==} + dependencies: + '@chainsafe/as-sha256': 0.3.1 + '@chainsafe/persistent-merkle-tree': 0.5.0 + dev: true + + /@chainsafe/ssz/0.9.4: + resolution: {integrity: sha512-77Qtg2N1ayqs4Bg/wvnWfg5Bta7iy7IRh8XqXh7oNMeP2HBbBwx8m6yTpA8p0EHItWPEBkgZd5S5/LSlp3GXuQ==} + dependencies: + '@chainsafe/as-sha256': 0.3.1 + '@chainsafe/persistent-merkle-tree': 0.4.2 + case: 1.6.3 + dev: true + + /@ensdomains/address-encoder/0.1.9: + resolution: {integrity: sha512-E2d2gP4uxJQnDu2Kfg1tHNspefzbLT8Tyjrm5sEuim32UkU2sm5xL4VXtgc2X33fmPEw9+jUMpGs4veMbf+PYg==} + dependencies: + bech32: 1.1.4 + blakejs: 1.2.1 + bn.js: 4.12.0 + bs58: 4.0.1 + crypto-addr-codec: 0.1.8 + nano-base32: 1.0.1 + ripemd160: 2.0.2 + dev: true + + /@ensdomains/ens/0.4.5: + resolution: {integrity: sha512-JSvpj1iNMFjK6K+uVl4unqMoa9rf5jopb8cya5UGBWz23Nw8hSNT7efgUx4BTlAPAgpNlEioUfeTyQ6J9ZvTVw==} + deprecated: Please use @ensdomains/ens-contracts + dependencies: + bluebird: 3.7.2 + eth-ens-namehash: 2.0.8 + solc: 0.4.26 + testrpc: 0.0.1 + web3-utils: 1.10.4 + dev: true + + /@ensdomains/ensjs/2.1.0: + resolution: {integrity: sha512-GRbGPT8Z/OJMDuxs75U/jUNEC0tbL0aj7/L/QQznGYKm/tiasp+ndLOaoULy9kKJFC0TBByqfFliEHDgoLhyog==} + dependencies: + '@babel/runtime': 7.23.9 + '@ensdomains/address-encoder': 0.1.9 + '@ensdomains/ens': 0.4.5 + '@ensdomains/resolver': 0.2.4 + content-hash: 2.5.2 + eth-ens-namehash: 2.0.8 + ethers: 5.7.2 + js-sha3: 0.8.0 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + dev: true + + /@ensdomains/resolver/0.2.4: + resolution: {integrity: sha512-bvaTH34PMCbv6anRa9I/0zjLJgY4EuznbEMgbV77JBCQ9KNC46rzi0avuxpOfu+xDjPEtSFGqVEOr5GlUSGudA==} + deprecated: Please use @ensdomains/ens-contracts + dev: true + + /@eslint-community/eslint-utils/4.4.0_eslint@8.56.0: + resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 + dependencies: + eslint: 8.56.0 + eslint-visitor-keys: 3.4.3 + dev: true + + /@eslint-community/regexpp/4.10.0: + resolution: {integrity: sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==} + engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} + dev: true + + /@eslint/eslintrc/2.1.4: + resolution: {integrity: sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dependencies: + ajv: 6.12.6 + debug: 4.3.4 + espree: 9.6.1 + globals: 13.24.0 + ignore: 5.3.1 + import-fresh: 3.3.0 + js-yaml: 4.1.0 + minimatch: 3.1.2 + strip-json-comments: 3.1.1 + transitivePeerDependencies: + - supports-color + dev: true + + /@eslint/js/8.56.0: + resolution: {integrity: sha512-gMsVel9D7f2HLkBma9VbtzZRehRogVRfbr++f06nL2vnCGCNlzOD+/MUov/F4p8myyAHspEhVobgjpX64q5m6A==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dev: true + + /@ethereumjs/common/2.5.0: + resolution: {integrity: sha512-DEHjW6e38o+JmB/NO3GZBpW4lpaiBpkFgXF6jLcJ6gETBYpEyaA5nTimsWBUJR3Vmtm/didUEbNjajskugZORg==} + dependencies: + crc-32: 1.2.2 + ethereumjs-util: 7.1.5 + dev: true + + /@ethereumjs/common/2.6.5: + resolution: {integrity: sha512-lRyVQOeCDaIVtgfbowla32pzeDv2Obr8oR8Put5RdUBNRGr1VGPGQNGP6elWIpgK3YdpzqTOh4GyUGOureVeeA==} + dependencies: + crc-32: 1.2.2 + ethereumjs-util: 7.1.5 + dev: true + + /@ethereumjs/rlp/4.0.1: + resolution: {integrity: sha512-tqsQiBQDQdmPWE1xkkBq4rlSW5QZpLOUJ5RJh2/9fug+q9tnUhuZoVLk7s0scUIKTOzEtR72DFBXI4WiZcMpvw==} + engines: {node: '>=14'} + hasBin: true + dev: true + + /@ethereumjs/tx/3.3.2: + resolution: {integrity: sha512-6AaJhwg4ucmwTvw/1qLaZUX5miWrwZ4nLOUsKyb/HtzS3BMw/CasKhdi1ims9mBKeK9sOJCH4qGKOBGyJCeeog==} + dependencies: + '@ethereumjs/common': 2.5.0 + ethereumjs-util: 7.1.5 + dev: true + + /@ethereumjs/tx/3.5.2: + resolution: {integrity: sha512-gQDNJWKrSDGu2w7w0PzVXVBNMzb7wwdDOmOqczmhNjqFxFuIbhVJDwiGEnxFNC2/b8ifcZzY7MLcluizohRzNw==} + dependencies: + '@ethereumjs/common': 2.6.5 + ethereumjs-util: 7.1.5 + dev: true + + /@ethereumjs/util/8.0.2: + resolution: {integrity: sha512-b1Fcxmq+ckCdoLPhVIBkTcH8szigMapPuEmD8EDakvtI5Na5rzmX1sBW73YQqaPc7iUxGCAzZP1LrFQ7aEMugA==} + engines: {node: '>=14'} + dependencies: + '@ethereumjs/rlp': 4.0.1 + async: 3.2.5 + ethereum-cryptography: 1.2.0 + dev: true + + /@ethereumjs/util/8.1.0: + resolution: {integrity: sha512-zQ0IqbdX8FZ9aw11vP+dZkKDkS+kgIvQPHnSAXzP9pLu+Rfu3D3XEeLbicvoXJTYnhZiPmsZUxgdzXwNKxRPbA==} + engines: {node: '>=14'} + dependencies: + '@ethereumjs/rlp': 4.0.1 + ethereum-cryptography: 2.1.3 + micro-ftch: 0.3.1 + dev: true + + /@ethersproject/abi/5.7.0: + resolution: {integrity: sha512-351ktp42TiRcYB3H1OP8yajPeAQstMW/yCFokj/AthP9bLHzQFPlOrxOcwYEDkUAICmOHljvN4K39OMTMUa9RA==} + dependencies: + '@ethersproject/address': 5.7.0 + '@ethersproject/bignumber': 5.7.0 + '@ethersproject/bytes': 5.7.0 + '@ethersproject/constants': 5.7.0 + '@ethersproject/hash': 5.7.0 + '@ethersproject/keccak256': 5.7.0 + '@ethersproject/logger': 5.7.0 + '@ethersproject/properties': 5.7.0 + '@ethersproject/strings': 5.7.0 + dev: true + + /@ethersproject/abstract-provider/5.7.0: + resolution: {integrity: sha512-R41c9UkchKCpAqStMYUpdunjo3pkEvZC3FAwZn5S5MGbXoMQOHIdHItezTETxAO5bevtMApSyEhn9+CHcDsWBw==} + dependencies: + '@ethersproject/bignumber': 5.7.0 + '@ethersproject/bytes': 5.7.0 + '@ethersproject/logger': 5.7.0 + '@ethersproject/networks': 5.7.1 + '@ethersproject/properties': 5.7.0 + '@ethersproject/transactions': 5.7.0 + '@ethersproject/web': 5.7.1 + dev: true + + /@ethersproject/abstract-signer/5.7.0: + resolution: {integrity: sha512-a16V8bq1/Cz+TGCkE2OPMTOUDLS3grCpdjoJCYNnVBbdYEMSgKrU0+B90s8b6H+ByYTBZN7a3g76jdIJi7UfKQ==} + dependencies: + '@ethersproject/abstract-provider': 5.7.0 + '@ethersproject/bignumber': 5.7.0 + '@ethersproject/bytes': 5.7.0 + '@ethersproject/logger': 5.7.0 + '@ethersproject/properties': 5.7.0 + dev: true + + /@ethersproject/address/5.7.0: + resolution: {integrity: sha512-9wYhYt7aghVGo758POM5nqcOMaE168Q6aRLJZwUmiqSrAungkG74gSSeKEIR7ukixesdRZGPgVqme6vmxs1fkA==} + dependencies: + '@ethersproject/bignumber': 5.7.0 + '@ethersproject/bytes': 5.7.0 + '@ethersproject/keccak256': 5.7.0 + '@ethersproject/logger': 5.7.0 + '@ethersproject/rlp': 5.7.0 + dev: true + + /@ethersproject/base64/5.7.0: + resolution: {integrity: sha512-Dr8tcHt2mEbsZr/mwTPIQAf3Ai0Bks/7gTw9dSqk1mQvhW3XvRlmDJr/4n+wg1JmCl16NZue17CDh8xb/vZ0sQ==} + dependencies: + '@ethersproject/bytes': 5.7.0 + dev: true + + /@ethersproject/basex/5.7.0: + resolution: {integrity: sha512-ywlh43GwZLv2Voc2gQVTKBoVQ1mti3d8HK5aMxsfu/nRDnMmNqaSJ3r3n85HBByT8OpoY96SXM1FogC533T4zw==} + dependencies: + '@ethersproject/bytes': 5.7.0 + '@ethersproject/properties': 5.7.0 + dev: true + + /@ethersproject/bignumber/5.7.0: + resolution: {integrity: sha512-n1CAdIHRWjSucQO3MC1zPSVgV/6dy/fjL9pMrPP9peL+QxEg9wOsVqwD4+818B6LUEtaXzVHQiuivzRoxPxUGw==} + dependencies: + '@ethersproject/bytes': 5.7.0 + '@ethersproject/logger': 5.7.0 + bn.js: 5.2.1 + dev: true + + /@ethersproject/bytes/5.7.0: + resolution: {integrity: sha512-nsbxwgFXWh9NyYWo+U8atvmMsSdKJprTcICAkvbBffT75qDocbuggBU0SJiVK2MuTrp0q+xvLkTnGMPK1+uA9A==} + dependencies: + '@ethersproject/logger': 5.7.0 + dev: true + + /@ethersproject/constants/5.7.0: + resolution: {integrity: sha512-DHI+y5dBNvkpYUMiRQyxRBYBefZkJfo70VUkUAsRjcPs47muV9evftfZ0PJVCXYbAiCgght0DtcF9srFQmIgWA==} + dependencies: + '@ethersproject/bignumber': 5.7.0 + dev: true + + /@ethersproject/contracts/5.7.0: + resolution: {integrity: sha512-5GJbzEU3X+d33CdfPhcyS+z8MzsTrBGk/sc+G+59+tPa9yFkl6HQ9D6L0QMgNTA9q8dT0XKxxkyp883XsQvbbg==} + dependencies: + '@ethersproject/abi': 5.7.0 + '@ethersproject/abstract-provider': 5.7.0 + '@ethersproject/abstract-signer': 5.7.0 + '@ethersproject/address': 5.7.0 + '@ethersproject/bignumber': 5.7.0 + '@ethersproject/bytes': 5.7.0 + '@ethersproject/constants': 5.7.0 + '@ethersproject/logger': 5.7.0 + '@ethersproject/properties': 5.7.0 + '@ethersproject/transactions': 5.7.0 + dev: true + + /@ethersproject/hash/5.7.0: + resolution: {integrity: sha512-qX5WrQfnah1EFnO5zJv1v46a8HW0+E5xuBBDTwMFZLuVTx0tbU2kkx15NqdjxecrLGatQN9FGQKpb1FKdHCt+g==} + dependencies: + '@ethersproject/abstract-signer': 5.7.0 + '@ethersproject/address': 5.7.0 + '@ethersproject/base64': 5.7.0 + '@ethersproject/bignumber': 5.7.0 + '@ethersproject/bytes': 5.7.0 + '@ethersproject/keccak256': 5.7.0 + '@ethersproject/logger': 5.7.0 + '@ethersproject/properties': 5.7.0 + '@ethersproject/strings': 5.7.0 + dev: true + + /@ethersproject/hdnode/5.7.0: + resolution: {integrity: sha512-OmyYo9EENBPPf4ERhR7oj6uAtUAhYGqOnIS+jE5pTXvdKBS99ikzq1E7Iv0ZQZ5V36Lqx1qZLeak0Ra16qpeOg==} + dependencies: + '@ethersproject/abstract-signer': 5.7.0 + '@ethersproject/basex': 5.7.0 + '@ethersproject/bignumber': 5.7.0 + '@ethersproject/bytes': 5.7.0 + '@ethersproject/logger': 5.7.0 + '@ethersproject/pbkdf2': 5.7.0 + '@ethersproject/properties': 5.7.0 + '@ethersproject/sha2': 5.7.0 + '@ethersproject/signing-key': 5.7.0 + '@ethersproject/strings': 5.7.0 + '@ethersproject/transactions': 5.7.0 + '@ethersproject/wordlists': 5.7.0 + dev: true + + /@ethersproject/json-wallets/5.7.0: + resolution: {integrity: sha512-8oee5Xgu6+RKgJTkvEMl2wDgSPSAQ9MB/3JYjFV9jlKvcYHUXZC+cQp0njgmxdHkYWn8s6/IqIZYm0YWCjO/0g==} + dependencies: + '@ethersproject/abstract-signer': 5.7.0 + '@ethersproject/address': 5.7.0 + '@ethersproject/bytes': 5.7.0 + '@ethersproject/hdnode': 5.7.0 + '@ethersproject/keccak256': 5.7.0 + '@ethersproject/logger': 5.7.0 + '@ethersproject/pbkdf2': 5.7.0 + '@ethersproject/properties': 5.7.0 + '@ethersproject/random': 5.7.0 + '@ethersproject/strings': 5.7.0 + '@ethersproject/transactions': 5.7.0 + aes-js: 3.0.0 + scrypt-js: 3.0.1 + dev: true + + /@ethersproject/keccak256/5.7.0: + resolution: {integrity: sha512-2UcPboeL/iW+pSg6vZ6ydF8tCnv3Iu/8tUmLLzWWGzxWKFFqOBQFLo6uLUv6BDrLgCDfN28RJ/wtByx+jZ4KBg==} + dependencies: + '@ethersproject/bytes': 5.7.0 + js-sha3: 0.8.0 + dev: true + + /@ethersproject/logger/5.7.0: + resolution: {integrity: sha512-0odtFdXu/XHtjQXJYA3u9G0G8btm0ND5Cu8M7i5vhEcE8/HmF4Lbdqanwyv4uQTr2tx6b7fQRmgLrsnpQlmnig==} + dev: true + + /@ethersproject/networks/5.7.1: + resolution: {integrity: sha512-n/MufjFYv3yFcUyfhnXotyDlNdFb7onmkSy8aQERi2PjNcnWQ66xXxa3XlS8nCcA8aJKJjIIMNJTC7tu80GwpQ==} + dependencies: + '@ethersproject/logger': 5.7.0 + dev: true + + /@ethersproject/pbkdf2/5.7.0: + resolution: {integrity: sha512-oR/dBRZR6GTyaofd86DehG72hY6NpAjhabkhxgr3X2FpJtJuodEl2auADWBZfhDHgVCbu3/H/Ocq2uC6dpNjjw==} + dependencies: + '@ethersproject/bytes': 5.7.0 + '@ethersproject/sha2': 5.7.0 + dev: true + + /@ethersproject/properties/5.7.0: + resolution: {integrity: sha512-J87jy8suntrAkIZtecpxEPxY//szqr1mlBaYlQ0r4RCaiD2hjheqF9s1LVE8vVuJCXisjIP+JgtK/Do54ej4Sw==} + dependencies: + '@ethersproject/logger': 5.7.0 + dev: true + + /@ethersproject/providers/5.7.2: + resolution: {integrity: sha512-g34EWZ1WWAVgr4aptGlVBF8mhl3VWjv+8hoAnzStu8Ah22VHBsuGzP17eb6xDVRzw895G4W7vvx60lFFur/1Rg==} + dependencies: + '@ethersproject/abstract-provider': 5.7.0 + '@ethersproject/abstract-signer': 5.7.0 + '@ethersproject/address': 5.7.0 + '@ethersproject/base64': 5.7.0 + '@ethersproject/basex': 5.7.0 + '@ethersproject/bignumber': 5.7.0 + '@ethersproject/bytes': 5.7.0 + '@ethersproject/constants': 5.7.0 + '@ethersproject/hash': 5.7.0 + '@ethersproject/logger': 5.7.0 + '@ethersproject/networks': 5.7.1 + '@ethersproject/properties': 5.7.0 + '@ethersproject/random': 5.7.0 + '@ethersproject/rlp': 5.7.0 + '@ethersproject/sha2': 5.7.0 + '@ethersproject/strings': 5.7.0 + '@ethersproject/transactions': 5.7.0 + '@ethersproject/web': 5.7.1 + bech32: 1.1.4 + ws: 7.4.6 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + dev: true + + /@ethersproject/random/5.7.0: + resolution: {integrity: sha512-19WjScqRA8IIeWclFme75VMXSBvi4e6InrUNuaR4s5pTF2qNhcGdCUwdxUVGtDDqC00sDLCO93jPQoDUH4HVmQ==} + dependencies: + '@ethersproject/bytes': 5.7.0 + '@ethersproject/logger': 5.7.0 + dev: true + + /@ethersproject/rlp/5.7.0: + resolution: {integrity: sha512-rBxzX2vK8mVF7b0Tol44t5Tb8gomOHkj5guL+HhzQ1yBh/ydjGnpw6at+X6Iw0Kp3OzzzkcKp8N9r0W4kYSs9w==} + dependencies: + '@ethersproject/bytes': 5.7.0 + '@ethersproject/logger': 5.7.0 + dev: true + + /@ethersproject/sha2/5.7.0: + resolution: {integrity: sha512-gKlH42riwb3KYp0reLsFTokByAKoJdgFCwI+CCiX/k+Jm2mbNs6oOaCjYQSlI1+XBVejwH2KrmCbMAT/GnRDQw==} + dependencies: + '@ethersproject/bytes': 5.7.0 + '@ethersproject/logger': 5.7.0 + hash.js: 1.1.7 + dev: true + + /@ethersproject/signing-key/5.7.0: + resolution: {integrity: sha512-MZdy2nL3wO0u7gkB4nA/pEf8lu1TlFswPNmy8AiYkfKTdO6eXBJyUdmHO/ehm/htHw9K/qF8ujnTyUAD+Ry54Q==} + dependencies: + '@ethersproject/bytes': 5.7.0 + '@ethersproject/logger': 5.7.0 + '@ethersproject/properties': 5.7.0 + bn.js: 5.2.1 + elliptic: 6.5.4 + hash.js: 1.1.7 + dev: true + + /@ethersproject/solidity/5.7.0: + resolution: {integrity: sha512-HmabMd2Dt/raavyaGukF4XxizWKhKQ24DoLtdNbBmNKUOPqwjsKQSdV9GQtj9CBEea9DlzETlVER1gYeXXBGaA==} + dependencies: + '@ethersproject/bignumber': 5.7.0 + '@ethersproject/bytes': 5.7.0 + '@ethersproject/keccak256': 5.7.0 + '@ethersproject/logger': 5.7.0 + '@ethersproject/sha2': 5.7.0 + '@ethersproject/strings': 5.7.0 + dev: true + + /@ethersproject/strings/5.7.0: + resolution: {integrity: sha512-/9nu+lj0YswRNSH0NXYqrh8775XNyEdUQAuf3f+SmOrnVewcJ5SBNAjF7lpgehKi4abvNNXyf+HX86czCdJ8Mg==} + dependencies: + '@ethersproject/bytes': 5.7.0 + '@ethersproject/constants': 5.7.0 + '@ethersproject/logger': 5.7.0 + dev: true + + /@ethersproject/transactions/5.7.0: + resolution: {integrity: sha512-kmcNicCp1lp8qanMTC3RIikGgoJ80ztTyvtsFvCYpSCfkjhD0jZ2LOrnbcuxuToLIUYYf+4XwD1rP+B/erDIhQ==} + dependencies: + '@ethersproject/address': 5.7.0 + '@ethersproject/bignumber': 5.7.0 + '@ethersproject/bytes': 5.7.0 + '@ethersproject/constants': 5.7.0 + '@ethersproject/keccak256': 5.7.0 + '@ethersproject/logger': 5.7.0 + '@ethersproject/properties': 5.7.0 + '@ethersproject/rlp': 5.7.0 + '@ethersproject/signing-key': 5.7.0 + dev: true + + /@ethersproject/units/5.7.0: + resolution: {integrity: sha512-pD3xLMy3SJu9kG5xDGI7+xhTEmGXlEqXU4OfNapmfnxLVY4EMSSRp7j1k7eezutBPH7RBN/7QPnwR7hzNlEFeg==} + dependencies: + '@ethersproject/bignumber': 5.7.0 + '@ethersproject/constants': 5.7.0 + '@ethersproject/logger': 5.7.0 + dev: true + + /@ethersproject/wallet/5.7.0: + resolution: {integrity: sha512-MhmXlJXEJFBFVKrDLB4ZdDzxcBxQ3rLyCkhNqVu3CDYvR97E+8r01UgrI+TI99Le+aYm/in/0vp86guJuM7FCA==} + dependencies: + '@ethersproject/abstract-provider': 5.7.0 + '@ethersproject/abstract-signer': 5.7.0 + '@ethersproject/address': 5.7.0 + '@ethersproject/bignumber': 5.7.0 + '@ethersproject/bytes': 5.7.0 + '@ethersproject/hash': 5.7.0 + '@ethersproject/hdnode': 5.7.0 + '@ethersproject/json-wallets': 5.7.0 + '@ethersproject/keccak256': 5.7.0 + '@ethersproject/logger': 5.7.0 + '@ethersproject/properties': 5.7.0 + '@ethersproject/random': 5.7.0 + '@ethersproject/signing-key': 5.7.0 + '@ethersproject/transactions': 5.7.0 + '@ethersproject/wordlists': 5.7.0 + dev: true + + /@ethersproject/web/5.7.1: + resolution: {integrity: sha512-Gueu8lSvyjBWL4cYsWsjh6MtMwM0+H4HvqFPZfB6dV8ctbP9zFAO73VG1cMWae0FLPCtz0peKPpZY8/ugJJX2w==} + dependencies: + '@ethersproject/base64': 5.7.0 + '@ethersproject/bytes': 5.7.0 + '@ethersproject/logger': 5.7.0 + '@ethersproject/properties': 5.7.0 + '@ethersproject/strings': 5.7.0 + dev: true + + /@ethersproject/wordlists/5.7.0: + resolution: {integrity: sha512-S2TFNJNfHWVHNE6cNDjbVlZ6MgE17MIxMbMg2zv3wn+3XSJGosL1m9ZVv3GXCf/2ymSsQ+hRI5IzoMJTG6aoVA==} + dependencies: + '@ethersproject/bytes': 5.7.0 + '@ethersproject/hash': 5.7.0 + '@ethersproject/logger': 5.7.0 + '@ethersproject/properties': 5.7.0 + '@ethersproject/strings': 5.7.0 + dev: true + + /@fastify/busboy/2.1.0: + resolution: {integrity: sha512-+KpH+QxZU7O4675t3mnkQKcZZg56u+K/Ct2K+N2AZYNVK8kyeo/bI18tI8aPm3tvNNRyTWfj6s5tnGNlcbQRsA==} + engines: {node: '>=14'} + dev: true + + /@ganache/console.log/0.3.0: + resolution: {integrity: sha512-cRkjY3gn1zxPxy+PKK/xl12p3KbGwXeS7oGTkXFeey4bhQgd5QBa/+HNMVPflT2BcWLZ91Ir+CRRiRekeyHUWQ==} + dependencies: + '@ethereumjs/util': 8.0.2 + '@ganache/utils': 0.3.0 + dev: true + + /@ganache/utils/0.3.0: + resolution: {integrity: sha512-cxoG8KQxkYPl71BPdKZihjVKqN2AE7WLXjU65BVOQ5jEYrUH3CWSxA9v7CCUJj4e0HoXFpVFIZ+1HRkiBKKiKg==} + dependencies: + emittery: 0.10.0 + keccak: 3.0.1 + seedrandom: 3.0.5 + optionalDependencies: + '@trufflesuite/bigint-buffer': 1.1.9 + dev: true + + /@graphql-tools/batch-execute/8.5.1_graphql@15.8.0: + resolution: {integrity: sha512-hRVDduX0UDEneVyEWtc2nu5H2PxpfSfM/riUlgZvo/a/nG475uyehxR5cFGvTEPEQUKY3vGIlqvtRigzqTfCew==} + peerDependencies: + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 + dependencies: + '@graphql-tools/utils': 8.9.0_graphql@15.8.0 + dataloader: 2.1.0 + graphql: 15.8.0 + tslib: 2.4.1 + value-or-promise: 1.0.11 + dev: true + optional: true + + /@graphql-tools/delegate/8.8.1_graphql@15.8.0: + resolution: {integrity: sha512-NDcg3GEQmdEHlnF7QS8b4lM1PSF+DKeFcIlLEfZFBvVq84791UtJcDj8734sIHLukmyuAxXMfA1qLd2l4lZqzA==} + peerDependencies: + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 + dependencies: + '@graphql-tools/batch-execute': 8.5.1_graphql@15.8.0 + '@graphql-tools/schema': 8.5.1_graphql@15.8.0 + '@graphql-tools/utils': 8.9.0_graphql@15.8.0 + dataloader: 2.1.0 + graphql: 15.8.0 + tslib: 2.4.1 + value-or-promise: 1.0.11 + dev: true + optional: true + + /@graphql-tools/merge/8.3.1_graphql@15.8.0: + resolution: {integrity: sha512-BMm99mqdNZbEYeTPK3it9r9S6rsZsQKtlqJsSBknAclXq2pGEfOxjcIZi+kBSkHZKPKCRrYDd5vY0+rUmIHVLg==} + peerDependencies: + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 + dependencies: + '@graphql-tools/utils': 8.9.0_graphql@15.8.0 + graphql: 15.8.0 + tslib: 2.6.2 + dev: true + optional: true + + /@graphql-tools/merge/8.4.2_graphql@15.8.0: + resolution: {integrity: sha512-XbrHAaj8yDuINph+sAfuq3QCZ/tKblrTLOpirK0+CAgNlZUCHs0Fa+xtMUURgwCVThLle1AF7svJCxFizygLsw==} + peerDependencies: + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 + dependencies: + '@graphql-tools/utils': 9.2.1_graphql@15.8.0 + graphql: 15.8.0 + tslib: 2.6.2 + dev: true + optional: true + + /@graphql-tools/mock/8.7.20_graphql@15.8.0: + resolution: {integrity: sha512-ljcHSJWjC/ZyzpXd5cfNhPI7YljRVvabKHPzKjEs5ElxWu2cdlLGvyNYepApXDsM/OJG/2xuhGM+9GWu5gEAPQ==} + peerDependencies: + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 + dependencies: + '@graphql-tools/schema': 9.0.19_graphql@15.8.0 + '@graphql-tools/utils': 9.2.1_graphql@15.8.0 + fast-json-stable-stringify: 2.1.0 + graphql: 15.8.0 + tslib: 2.6.2 + dev: true + optional: true + + /@graphql-tools/schema/8.5.1_graphql@15.8.0: + resolution: {integrity: sha512-0Esilsh0P/qYcB5DKQpiKeQs/jevzIadNTaT0jeWklPMwNbT7yMX4EqZany7mbeRRlSRwMzNzL5olyFdffHBZg==} + peerDependencies: + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 + dependencies: + '@graphql-tools/merge': 8.3.1_graphql@15.8.0 + '@graphql-tools/utils': 8.9.0_graphql@15.8.0 + graphql: 15.8.0 + tslib: 2.6.2 + value-or-promise: 1.0.11 + dev: true + optional: true + + /@graphql-tools/schema/9.0.19_graphql@15.8.0: + resolution: {integrity: sha512-oBRPoNBtCkk0zbUsyP4GaIzCt8C0aCI4ycIRUL67KK5pOHljKLBBtGT+Jr6hkzA74C8Gco8bpZPe7aWFjiaK2w==} + peerDependencies: + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 + dependencies: + '@graphql-tools/merge': 8.4.2_graphql@15.8.0 + '@graphql-tools/utils': 9.2.1_graphql@15.8.0 + graphql: 15.8.0 + tslib: 2.6.2 + value-or-promise: 1.0.12 + dev: true + optional: true + + /@graphql-tools/utils/8.9.0_graphql@15.8.0: + resolution: {integrity: sha512-pjJIWH0XOVnYGXCqej8g/u/tsfV4LvLlj0eATKQu5zwnxd/TiTHq7Cg313qUPTFFHZ3PP5wJ15chYVtLDwaymg==} + peerDependencies: + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 + dependencies: + graphql: 15.8.0 + tslib: 2.4.1 + dev: true + optional: true + + /@graphql-tools/utils/9.2.1_graphql@15.8.0: + resolution: {integrity: sha512-WUw506Ql6xzmOORlriNrD6Ugx+HjVgYxt9KCXD9mHAak+eaXSwuGGPyE60hy9xaDEoXKBsG7SkG69ybitaVl6A==} + peerDependencies: + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 + dependencies: + '@graphql-typed-document-node/core': 3.2.0_graphql@15.8.0 + graphql: 15.8.0 + tslib: 2.6.2 + dev: true + optional: true + + /@graphql-typed-document-node/core/3.2.0_graphql@15.8.0: + resolution: {integrity: sha512-mB9oAsNCm9aM3/SOv4YtBMqZbYj10R7dkq8byBqxGY/ncFwhf2oQzMV+LCRlWoDSEBJ3COiR1yeDvMtsoOsuFQ==} + peerDependencies: + graphql: ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 + dependencies: + graphql: 15.8.0 + dev: true + optional: true + + /@humanwhocodes/config-array/0.11.14: + resolution: {integrity: sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==} + engines: {node: '>=10.10.0'} + dependencies: + '@humanwhocodes/object-schema': 2.0.2 + debug: 4.3.4 + minimatch: 3.1.2 + transitivePeerDependencies: + - supports-color + dev: true + + /@humanwhocodes/module-importer/1.0.1: + resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} + engines: {node: '>=12.22'} + dev: true + + /@humanwhocodes/object-schema/2.0.2: + resolution: {integrity: sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw==} + dev: true + + /@josephg/resolvable/1.0.1: + resolution: {integrity: sha512-CtzORUwWTTOTqfVtHaKRJ0I1kNQd1bpn3sUh8I3nJDVY+5/M/Oe1DnEWzPQvqq/xPIIkzzzIP7mfCoAjFRvDhg==} + dev: true + optional: true + + /@metamask/eth-sig-util/4.0.1: + resolution: {integrity: sha512-tghyZKLHZjcdlDqCA3gNZmLeR0XvOE9U1qoQO9ohyAZT6Pya+H9vkBPcsyXytmYLNgVoin7CKCmweo/R43V+tQ==} + engines: {node: '>=12.0.0'} + dependencies: + ethereumjs-abi: 0.6.8 + ethereumjs-util: 6.2.1 + ethjs-util: 0.1.6 + tweetnacl: 1.0.3 + tweetnacl-util: 0.15.1 + dev: true + + /@noble/curves/1.3.0: + resolution: {integrity: sha512-t01iSXPuN+Eqzb4eBX0S5oubSqXbK/xXa1Ne18Hj8f9pStxztHCE2gfboSp/dZRLSqfuLpRK2nDXDK+W9puocA==} + dependencies: + '@noble/hashes': 1.3.3 + dev: true + + /@noble/hashes/1.2.0: + resolution: {integrity: sha512-FZfhjEDbT5GRswV3C6uvLPHMiVD6lQBmpoX5+eSiPaMTXte/IKqI5dykDxzZB/WBeK/CDuQRBWarPdi3FNY2zQ==} + dev: true + + /@noble/hashes/1.3.3: + resolution: {integrity: sha512-V7/fPHgl+jsVPXqqeOzT8egNj2iBIVt+ECeMMG8TdcnTikP3oaBtUVqpT/gYCR68aEBJSF+XbYUxStjbFMqIIA==} + engines: {node: '>= 16'} + dev: true + + /@noble/secp256k1/1.7.1: + resolution: {integrity: sha512-hOUk6AyBFmqVrv7k5WAw/LpszxVbj9gGN4JRkIX52fdFAj1UA61KXmZDvqVEm+pOyec3+fIeZB02LYa/pWOArw==} + dev: true + + /@nodelib/fs.scandir/2.1.5: + resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} + engines: {node: '>= 8'} + dependencies: + '@nodelib/fs.stat': 2.0.5 + run-parallel: 1.2.0 + dev: true + + /@nodelib/fs.stat/2.0.5: + resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} + engines: {node: '>= 8'} + dev: true + + /@nodelib/fs.walk/1.2.8: + resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} + engines: {node: '>= 8'} + dependencies: + '@nodelib/fs.scandir': 2.1.5 + fastq: 1.17.1 + dev: true + + /@nomicfoundation/ethereumjs-block/5.0.2: + resolution: {integrity: sha512-hSe6CuHI4SsSiWWjHDIzWhSiAVpzMUcDRpWYzN0T9l8/Rz7xNn3elwVOJ/tAyS0LqL6vitUD78Uk7lQDXZun7Q==} + engines: {node: '>=14'} + dependencies: + '@nomicfoundation/ethereumjs-common': 4.0.2 + '@nomicfoundation/ethereumjs-rlp': 5.0.2 + '@nomicfoundation/ethereumjs-trie': 6.0.2 + '@nomicfoundation/ethereumjs-tx': 5.0.2 + '@nomicfoundation/ethereumjs-util': 9.0.2 + ethereum-cryptography: 0.1.3 + ethers: 5.7.2 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + dev: true + + /@nomicfoundation/ethereumjs-blockchain/7.0.2: + resolution: {integrity: sha512-8UUsSXJs+MFfIIAKdh3cG16iNmWzWC/91P40sazNvrqhhdR/RtGDlFk2iFTGbBAZPs2+klZVzhRX8m2wvuvz3w==} + engines: {node: '>=14'} + dependencies: + '@nomicfoundation/ethereumjs-block': 5.0.2 + '@nomicfoundation/ethereumjs-common': 4.0.2 + '@nomicfoundation/ethereumjs-ethash': 3.0.2 + '@nomicfoundation/ethereumjs-rlp': 5.0.2 + '@nomicfoundation/ethereumjs-trie': 6.0.2 + '@nomicfoundation/ethereumjs-tx': 5.0.2 + '@nomicfoundation/ethereumjs-util': 9.0.2 + abstract-level: 1.0.4 + debug: 4.3.4 + ethereum-cryptography: 0.1.3 + level: 8.0.1 + lru-cache: 5.1.1 + memory-level: 1.0.0 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + dev: true + + /@nomicfoundation/ethereumjs-common/4.0.2: + resolution: {integrity: sha512-I2WGP3HMGsOoycSdOTSqIaES0ughQTueOsddJ36aYVpI3SN8YSusgRFLwzDJwRFVIYDKx/iJz0sQ5kBHVgdDwg==} + dependencies: + '@nomicfoundation/ethereumjs-util': 9.0.2 + crc-32: 1.2.2 + dev: true + + /@nomicfoundation/ethereumjs-ethash/3.0.2: + resolution: {integrity: sha512-8PfoOQCcIcO9Pylq0Buijuq/O73tmMVURK0OqdjhwqcGHYC2PwhbajDh7GZ55ekB0Px197ajK3PQhpKoiI/UPg==} + engines: {node: '>=14'} + dependencies: + '@nomicfoundation/ethereumjs-block': 5.0.2 + '@nomicfoundation/ethereumjs-rlp': 5.0.2 + '@nomicfoundation/ethereumjs-util': 9.0.2 + abstract-level: 1.0.4 + bigint-crypto-utils: 3.3.0 + ethereum-cryptography: 0.1.3 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + dev: true + + /@nomicfoundation/ethereumjs-evm/2.0.2: + resolution: {integrity: sha512-rBLcUaUfANJxyOx9HIdMX6uXGin6lANCulIm/pjMgRqfiCRMZie3WKYxTSd8ZE/d+qT+zTedBF4+VHTdTSePmQ==} + engines: {node: '>=14'} + dependencies: + '@ethersproject/providers': 5.7.2 + '@nomicfoundation/ethereumjs-common': 4.0.2 + '@nomicfoundation/ethereumjs-tx': 5.0.2 + '@nomicfoundation/ethereumjs-util': 9.0.2 + debug: 4.3.4 + ethereum-cryptography: 0.1.3 + mcl-wasm: 0.7.9 + rustbn.js: 0.2.0 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + dev: true + + /@nomicfoundation/ethereumjs-rlp/5.0.2: + resolution: {integrity: sha512-QwmemBc+MMsHJ1P1QvPl8R8p2aPvvVcKBbvHnQOKBpBztEo0omN0eaob6FeZS/e3y9NSe+mfu3nNFBHszqkjTA==} + engines: {node: '>=14'} + hasBin: true + dev: true + + /@nomicfoundation/ethereumjs-statemanager/2.0.2: + resolution: {integrity: sha512-dlKy5dIXLuDubx8Z74sipciZnJTRSV/uHG48RSijhgm1V7eXYFC567xgKtsKiVZB1ViTP9iFL4B6Je0xD6X2OA==} + dependencies: + '@nomicfoundation/ethereumjs-common': 4.0.2 + '@nomicfoundation/ethereumjs-rlp': 5.0.2 + debug: 4.3.4 + ethereum-cryptography: 0.1.3 + ethers: 5.7.2 + js-sdsl: 4.4.2 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + dev: true + + /@nomicfoundation/ethereumjs-trie/6.0.2: + resolution: {integrity: sha512-yw8vg9hBeLYk4YNg5MrSJ5H55TLOv2FSWUTROtDtTMMmDGROsAu+0tBjiNGTnKRi400M6cEzoFfa89Fc5k8NTQ==} + engines: {node: '>=14'} + dependencies: + '@nomicfoundation/ethereumjs-rlp': 5.0.2 + '@nomicfoundation/ethereumjs-util': 9.0.2 + '@types/readable-stream': 2.3.15 + ethereum-cryptography: 0.1.3 + readable-stream: 3.6.2 + dev: true + + /@nomicfoundation/ethereumjs-tx/5.0.2: + resolution: {integrity: sha512-T+l4/MmTp7VhJeNloMkM+lPU3YMUaXdcXgTGCf8+ZFvV9NYZTRLFekRwlG6/JMmVfIfbrW+dRRJ9A6H5Q/Z64g==} + engines: {node: '>=14'} + dependencies: + '@chainsafe/ssz': 0.9.4 + '@ethersproject/providers': 5.7.2 + '@nomicfoundation/ethereumjs-common': 4.0.2 + '@nomicfoundation/ethereumjs-rlp': 5.0.2 + '@nomicfoundation/ethereumjs-util': 9.0.2 + ethereum-cryptography: 0.1.3 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + dev: true + + /@nomicfoundation/ethereumjs-util/9.0.2: + resolution: {integrity: sha512-4Wu9D3LykbSBWZo8nJCnzVIYGvGCuyiYLIJa9XXNVt1q1jUzHdB+sJvx95VGCpPkCT+IbLecW6yfzy3E1bQrwQ==} + engines: {node: '>=14'} + dependencies: + '@chainsafe/ssz': 0.10.2 + '@nomicfoundation/ethereumjs-rlp': 5.0.2 + ethereum-cryptography: 0.1.3 + dev: true + + /@nomicfoundation/ethereumjs-vm/7.0.2: + resolution: {integrity: sha512-Bj3KZT64j54Tcwr7Qm/0jkeZXJMfdcAtRBedou+Hx0dPOSIgqaIr0vvLwP65TpHbak2DmAq+KJbW2KNtIoFwvA==} + engines: {node: '>=14'} + dependencies: + '@nomicfoundation/ethereumjs-block': 5.0.2 + '@nomicfoundation/ethereumjs-blockchain': 7.0.2 + '@nomicfoundation/ethereumjs-common': 4.0.2 + '@nomicfoundation/ethereumjs-evm': 2.0.2 + '@nomicfoundation/ethereumjs-rlp': 5.0.2 + '@nomicfoundation/ethereumjs-statemanager': 2.0.2 + '@nomicfoundation/ethereumjs-trie': 6.0.2 + '@nomicfoundation/ethereumjs-tx': 5.0.2 + '@nomicfoundation/ethereumjs-util': 9.0.2 + debug: 4.3.4 + ethereum-cryptography: 0.1.3 + mcl-wasm: 0.7.9 + rustbn.js: 0.2.0 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + dev: true + + /@nomicfoundation/hardhat-verify/2.0.4_hardhat@2.19.5: + resolution: {integrity: sha512-B8ZjhOrmbbRWqJi65jvQblzjsfYktjqj2vmOm+oc2Vu8drZbT2cjeSCRHZKbS7lOtfW78aJZSFvw+zRLCiABJA==} + peerDependencies: + hardhat: ^2.0.4 + dependencies: + '@ethersproject/abi': 5.7.0 + '@ethersproject/address': 5.7.0 + cbor: 8.1.0 + chalk: 2.4.2 + debug: 4.3.4 + hardhat: 2.19.5 + lodash.clonedeep: 4.5.0 + semver: 6.3.1 + table: 6.8.1 + undici: 5.28.3 + transitivePeerDependencies: + - supports-color + dev: true + + /@nomicfoundation/solidity-analyzer-darwin-arm64/0.1.1: + resolution: {integrity: sha512-KcTodaQw8ivDZyF+D76FokN/HdpgGpfjc/gFCImdLUyqB6eSWVaZPazMbeAjmfhx3R0zm/NYVzxwAokFKgrc0w==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@nomicfoundation/solidity-analyzer-darwin-x64/0.1.1: + resolution: {integrity: sha512-XhQG4BaJE6cIbjAVtzGOGbK3sn1BO9W29uhk9J8y8fZF1DYz0Doj8QDMfpMu+A6TjPDs61lbsmeYodIDnfveSA==} + engines: {node: '>= 10'} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@nomicfoundation/solidity-analyzer-freebsd-x64/0.1.1: + resolution: {integrity: sha512-GHF1VKRdHW3G8CndkwdaeLkVBi5A9u2jwtlS7SLhBc8b5U/GcoL39Q+1CSO3hYqePNP+eV5YI7Zgm0ea6kMHoA==} + engines: {node: '>= 10'} + cpu: [x64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true + + /@nomicfoundation/solidity-analyzer-linux-arm64-gnu/0.1.1: + resolution: {integrity: sha512-g4Cv2fO37ZsUENQ2vwPnZc2zRenHyAxHcyBjKcjaSmmkKrFr64yvzeNO8S3GBFCo90rfochLs99wFVGT/0owpg==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@nomicfoundation/solidity-analyzer-linux-arm64-musl/0.1.1: + resolution: {integrity: sha512-WJ3CE5Oek25OGE3WwzK7oaopY8xMw9Lhb0mlYuJl/maZVo+WtP36XoQTb7bW/i8aAdHW5Z+BqrHMux23pvxG3w==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@nomicfoundation/solidity-analyzer-linux-x64-gnu/0.1.1: + resolution: {integrity: sha512-5WN7leSr5fkUBBjE4f3wKENUy9HQStu7HmWqbtknfXkkil+eNWiBV275IOlpXku7v3uLsXTOKpnnGHJYI2qsdA==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@nomicfoundation/solidity-analyzer-linux-x64-musl/0.1.1: + resolution: {integrity: sha512-KdYMkJOq0SYPQMmErv/63CwGwMm5XHenEna9X9aB8mQmhDBrYrlAOSsIPgFCUSL0hjxE3xHP65/EPXR/InD2+w==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@nomicfoundation/solidity-analyzer-win32-arm64-msvc/0.1.1: + resolution: {integrity: sha512-VFZASBfl4qiBYwW5xeY20exWhmv6ww9sWu/krWSesv3q5hA0o1JuzmPHR4LPN6SUZj5vcqci0O6JOL8BPw+APg==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@nomicfoundation/solidity-analyzer-win32-ia32-msvc/0.1.1: + resolution: {integrity: sha512-JnFkYuyCSA70j6Si6cS1A9Gh1aHTEb8kOTBApp/c7NRTFGNMH8eaInKlyuuiIbvYFhlXW4LicqyYuWNNq9hkpQ==} + engines: {node: '>= 10'} + cpu: [ia32] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@nomicfoundation/solidity-analyzer-win32-x64-msvc/0.1.1: + resolution: {integrity: sha512-HrVJr6+WjIXGnw3Q9u6KQcbZCtk0caVWhCdFADySvRyUxJ8PnzlaP+MhwNE8oyT8OZ6ejHBRrrgjSqDCFXGirw==} + engines: {node: '>= 10'} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@nomicfoundation/solidity-analyzer/0.1.1: + resolution: {integrity: sha512-1LMtXj1puAxyFusBgUIy5pZk3073cNXYnXUpuNKFghHbIit/xZgbk0AokpUADbNm3gyD6bFWl3LRFh3dhVdREg==} + engines: {node: '>= 12'} + optionalDependencies: + '@nomicfoundation/solidity-analyzer-darwin-arm64': 0.1.1 + '@nomicfoundation/solidity-analyzer-darwin-x64': 0.1.1 + '@nomicfoundation/solidity-analyzer-freebsd-x64': 0.1.1 + '@nomicfoundation/solidity-analyzer-linux-arm64-gnu': 0.1.1 + '@nomicfoundation/solidity-analyzer-linux-arm64-musl': 0.1.1 + '@nomicfoundation/solidity-analyzer-linux-x64-gnu': 0.1.1 + '@nomicfoundation/solidity-analyzer-linux-x64-musl': 0.1.1 + '@nomicfoundation/solidity-analyzer-win32-arm64-msvc': 0.1.1 + '@nomicfoundation/solidity-analyzer-win32-ia32-msvc': 0.1.1 + '@nomicfoundation/solidity-analyzer-win32-x64-msvc': 0.1.1 + dev: true + + /@openzeppelin/contract-loader/0.6.3: + resolution: {integrity: sha512-cOFIjBjwbGgZhDZsitNgJl0Ye1rd5yu/Yx5LMgeq3u0ZYzldm4uObzHDFq4gjDdoypvyORjjJa3BlFA7eAnVIg==} + dependencies: + find-up: 4.1.0 + fs-extra: 8.1.0 + dev: true + + /@openzeppelin/contracts-upgradeable/5.0.1_qffjc7vved4cgcgrp7e6uufd2e: + resolution: {integrity: sha512-MvaLoPnVcoZr/qqZP+4cl9piuR4gg0iIGgxVSZ/AL1iId3M6IdEHzz9Naw5Lirl4KKBI6ciTVnX07yL4dOMIJg==} + peerDependencies: + '@openzeppelin/contracts': 5.0.1 + dependencies: + '@openzeppelin/contracts': 5.0.1 + dev: true + + /@openzeppelin/contracts/4.9.5: + resolution: {integrity: sha512-ZK+W5mVhRppff9BE6YdR8CC52C8zAvsVAiWhEtQ5+oNxFE6h1WdeWo+FJSF8KKvtxxVYZ7MTP/5KoVpAU3aSWg==} + dev: true + + /@openzeppelin/contracts/5.0.1: + resolution: {integrity: sha512-yQJaT5HDp9hYOOp4jTYxMsR02gdFZFXhewX5HW9Jo4fsqSVqqyIO/xTHdWDaKX5a3pv1txmf076Lziz+sO7L1w==} + dev: true + + /@openzeppelin/test-helpers/0.5.16_bn.js@4.12.0: + resolution: {integrity: sha512-T1EvspSfH1qQO/sgGlskLfYVBbqzJR23SZzYl/6B2JnT4EhThcI85UpvDk0BkLWKaDScQTabGHt4GzHW+3SfZg==} + dependencies: + '@openzeppelin/contract-loader': 0.6.3 + '@truffle/contract': 4.6.31 + ansi-colors: 3.2.4 + chai: 4.4.1 + chai-bn: 0.2.2_bn.js@4.12.0+chai@4.4.1 + ethjs-abi: 0.2.1 + lodash.flatten: 4.4.0 + semver: 5.7.2 + web3: 1.10.4 + web3-utils: 1.10.4 + transitivePeerDependencies: + - bn.js + - bufferutil + - encoding + - supports-color + - utf-8-validate + dev: true + + /@pnpm/config.env-replace/1.1.0: + resolution: {integrity: sha512-htyl8TWnKL7K/ESFa1oW2UB5lVDxuF5DpM7tBi6Hu2LNL3mWkIzNLG6N4zoCUP1lCKNxWy/3iu8mS8MvToGd6w==} + engines: {node: '>=12.22.0'} + dev: true + + /@pnpm/network.ca-file/1.0.2: + resolution: {integrity: sha512-YcPQ8a0jwYU9bTdJDpXjMi7Brhkr1mXsXrUJvjqM2mQDgkRiz8jFaQGOdaLxgjtUfQgZhKy/O3cG/YwmgKaxLA==} + engines: {node: '>=12.22.0'} + dependencies: + graceful-fs: 4.2.10 + dev: true + + /@pnpm/npm-conf/2.2.2: + resolution: {integrity: sha512-UA91GwWPhFExt3IizW6bOeY/pQ0BkuNwKjk9iQW9KqxluGCrg4VenZ0/L+2Y0+ZOtme72EVvg6v0zo3AMQRCeA==} + engines: {node: '>=12'} + dependencies: + '@pnpm/config.env-replace': 1.1.0 + '@pnpm/network.ca-file': 1.0.2 + config-chain: 1.1.13 + dev: true + + /@protobufjs/aspromise/1.1.2: + resolution: {integrity: sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==} + dev: true + optional: true + + /@protobufjs/base64/1.1.2: + resolution: {integrity: sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==} + dev: true + optional: true + + /@protobufjs/codegen/2.0.4: + resolution: {integrity: sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==} + dev: true + optional: true + + /@protobufjs/eventemitter/1.1.0: + resolution: {integrity: sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==} + dev: true + optional: true + + /@protobufjs/fetch/1.1.0: + resolution: {integrity: sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==} + dependencies: + '@protobufjs/aspromise': 1.1.2 + '@protobufjs/inquire': 1.1.0 + dev: true + optional: true + + /@protobufjs/float/1.0.2: + resolution: {integrity: sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==} + dev: true + optional: true + + /@protobufjs/inquire/1.1.0: + resolution: {integrity: sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==} + dev: true + optional: true + + /@protobufjs/path/1.1.2: + resolution: {integrity: sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==} + dev: true + optional: true + + /@protobufjs/pool/1.1.0: + resolution: {integrity: sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==} + dev: true + optional: true + + /@protobufjs/utf8/1.1.0: + resolution: {integrity: sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==} + dev: true + optional: true + + /@redux-saga/core/1.3.0: + resolution: {integrity: sha512-L+i+qIGuyWn7CIg7k1MteHGfttKPmxwZR5E7OsGikCL2LzYA0RERlaUY00Y3P3ZV2EYgrsYlBrGs6cJP5OKKqA==} + dependencies: + '@babel/runtime': 7.23.9 + '@redux-saga/deferred': 1.2.1 + '@redux-saga/delay-p': 1.2.1 + '@redux-saga/is': 1.1.3 + '@redux-saga/symbols': 1.1.3 + '@redux-saga/types': 1.2.1 + typescript-tuple: 2.2.1 + dev: true + + /@redux-saga/deferred/1.2.1: + resolution: {integrity: sha512-cmin3IuuzMdfQjA0lG4B+jX+9HdTgHZZ+6u3jRAOwGUxy77GSlTi4Qp2d6PM1PUoTmQUR5aijlA39scWWPF31g==} + dev: true + + /@redux-saga/delay-p/1.2.1: + resolution: {integrity: sha512-MdiDxZdvb1m+Y0s4/hgdcAXntpUytr9g0hpcOO1XFVyyzkrDu3SKPgBFOtHn7lhu7n24ZKIAT1qtKyQjHqRd+w==} + dependencies: + '@redux-saga/symbols': 1.1.3 + dev: true + + /@redux-saga/is/1.1.3: + resolution: {integrity: sha512-naXrkETG1jLRfVfhOx/ZdLj0EyAzHYbgJWkXbB3qFliPcHKiWbv/ULQryOAEKyjrhiclmr6AMdgsXFyx7/yE6Q==} + dependencies: + '@redux-saga/symbols': 1.1.3 + '@redux-saga/types': 1.2.1 + dev: true + + /@redux-saga/symbols/1.1.3: + resolution: {integrity: sha512-hCx6ZvU4QAEUojETnX8EVg4ubNLBFl1Lps4j2tX7o45x/2qg37m3c6v+kSp8xjDJY+2tJw4QB3j8o8dsl1FDXg==} + dev: true + + /@redux-saga/types/1.2.1: + resolution: {integrity: sha512-1dgmkh+3so0+LlBWRhGA33ua4MYr7tUOj+a9Si28vUi0IUFNbff1T3sgpeDJI/LaC75bBYnQ0A3wXjn0OrRNBA==} + dev: true + + /@resolver-engine/core/0.2.1: + resolution: {integrity: sha512-nsLQHmPJ77QuifqsIvqjaF5B9aHnDzJjp73Q1z6apY3e9nqYrx4Dtowhpsf7Jwftg/XzVDEMQC+OzUBNTS+S1A==} + dependencies: + debug: 3.2.7 + request: 2.88.2 + transitivePeerDependencies: + - supports-color + dev: true + + /@resolver-engine/fs/0.2.1: + resolution: {integrity: sha512-7kJInM1Qo2LJcKyDhuYzh9ZWd+mal/fynfL9BNjWOiTcOpX+jNfqb/UmGUqros5pceBITlWGqS4lU709yHFUbg==} + dependencies: + '@resolver-engine/core': 0.2.1 + debug: 3.2.7 + transitivePeerDependencies: + - supports-color + dev: true + + /@resolver-engine/imports-fs/0.2.2: + resolution: {integrity: sha512-gFCgMvCwyppjwq0UzIjde/WI+yDs3oatJhozG9xdjJdewwtd7LiF0T5i9lrHAUtqrQbqoFE4E+ZMRVHWpWHpKQ==} + dependencies: + '@resolver-engine/fs': 0.2.1 + '@resolver-engine/imports': 0.2.2 + debug: 3.2.7 + transitivePeerDependencies: + - supports-color + dev: true + + /@resolver-engine/imports/0.2.2: + resolution: {integrity: sha512-u5/HUkvo8q34AA+hnxxqqXGfby5swnH0Myw91o3Sm2TETJlNKXibFGSKBavAH+wvWdBi4Z5gS2Odu0PowgVOUg==} + dependencies: + '@resolver-engine/core': 0.2.1 + debug: 3.2.7 + hosted-git-info: 2.8.9 + transitivePeerDependencies: + - supports-color + dev: true + + /@scure/base/1.1.5: + resolution: {integrity: sha512-Brj9FiG2W1MRQSTB212YVPRrcbjkv48FoZi/u4l/zds/ieRrqsh7aUf6CLwkAq61oKXr/ZlTzlY66gLIj3TFTQ==} + dev: true + + /@scure/bip32/1.1.5: + resolution: {integrity: sha512-XyNh1rB0SkEqd3tXcXMi+Xe1fvg+kUIcoRIEujP1Jgv7DqW2r9lg3Ah0NkFaCs9sTkQAQA8kw7xiRXzENi9Rtw==} + dependencies: + '@noble/hashes': 1.2.0 + '@noble/secp256k1': 1.7.1 + '@scure/base': 1.1.5 + dev: true + + /@scure/bip32/1.3.3: + resolution: {integrity: sha512-LJaN3HwRbfQK0X1xFSi0Q9amqOgzQnnDngIt+ZlsBC3Bm7/nE7K0kwshZHyaru79yIVRv/e1mQAjZyuZG6jOFQ==} + dependencies: + '@noble/curves': 1.3.0 + '@noble/hashes': 1.3.3 + '@scure/base': 1.1.5 + dev: true + + /@scure/bip39/1.1.1: + resolution: {integrity: sha512-t+wDck2rVkh65Hmv280fYdVdY25J9YeEUIgn2LG1WM6gxFkGzcksoDiUkWVpVp3Oex9xGC68JU2dSbUfwZ2jPg==} + dependencies: + '@noble/hashes': 1.2.0 + '@scure/base': 1.1.5 + dev: true + + /@scure/bip39/1.2.2: + resolution: {integrity: sha512-HYf9TUXG80beW+hGAt3TRM8wU6pQoYur9iNypTROm42dorCGmLnFe3eWjz3gOq6G62H2WRh0FCzAR1PI+29zIA==} + dependencies: + '@noble/hashes': 1.3.3 + '@scure/base': 1.1.5 + dev: true + + /@sentry/core/5.30.0: + resolution: {integrity: sha512-TmfrII8w1PQZSZgPpUESqjB+jC6MvZJZdLtE/0hZ+SrnKhW3x5WlYLvTXZpcWePYBku7rl2wn1RZu6uT0qCTeg==} + engines: {node: '>=6'} + dependencies: + '@sentry/hub': 5.30.0 + '@sentry/minimal': 5.30.0 + '@sentry/types': 5.30.0 + '@sentry/utils': 5.30.0 + tslib: 1.14.1 + dev: true + + /@sentry/hub/5.30.0: + resolution: {integrity: sha512-2tYrGnzb1gKz2EkMDQcfLrDTvmGcQPuWxLnJKXJvYTQDGLlEvi2tWz1VIHjunmOvJrB5aIQLhm+dcMRwFZDCqQ==} + engines: {node: '>=6'} + dependencies: + '@sentry/types': 5.30.0 + '@sentry/utils': 5.30.0 + tslib: 1.14.1 + dev: true + + /@sentry/minimal/5.30.0: + resolution: {integrity: sha512-BwWb/owZKtkDX+Sc4zCSTNcvZUq7YcH3uAVlmh/gtR9rmUvbzAA3ewLuB3myi4wWRAMEtny6+J/FN/x+2wn9Xw==} + engines: {node: '>=6'} + dependencies: + '@sentry/hub': 5.30.0 + '@sentry/types': 5.30.0 + tslib: 1.14.1 + dev: true + + /@sentry/node/5.30.0: + resolution: {integrity: sha512-Br5oyVBF0fZo6ZS9bxbJZG4ApAjRqAnqFFurMVJJdunNb80brh7a5Qva2kjhm+U6r9NJAB5OmDyPkA1Qnt+QVg==} + engines: {node: '>=6'} + dependencies: + '@sentry/core': 5.30.0 + '@sentry/hub': 5.30.0 + '@sentry/tracing': 5.30.0 + '@sentry/types': 5.30.0 + '@sentry/utils': 5.30.0 + cookie: 0.4.2 + https-proxy-agent: 5.0.1 + lru_map: 0.3.3 + tslib: 1.14.1 + transitivePeerDependencies: + - supports-color + dev: true + + /@sentry/tracing/5.30.0: + resolution: {integrity: sha512-dUFowCr0AIMwiLD7Fs314Mdzcug+gBVo/+NCMyDw8tFxJkwWAKl7Qa2OZxLQ0ZHjakcj1hNKfCQJ9rhyfOl4Aw==} + engines: {node: '>=6'} + dependencies: + '@sentry/hub': 5.30.0 + '@sentry/minimal': 5.30.0 + '@sentry/types': 5.30.0 + '@sentry/utils': 5.30.0 + tslib: 1.14.1 + dev: true + + /@sentry/types/5.30.0: + resolution: {integrity: sha512-R8xOqlSTZ+htqrfteCWU5Nk0CDN5ApUTvrlvBuiH1DyP6czDZ4ktbZB0hAgBlVcK0U+qpD3ag3Tqqpa5Q67rPw==} + engines: {node: '>=6'} + dev: true + + /@sentry/utils/5.30.0: + resolution: {integrity: sha512-zaYmoH0NWWtvnJjC9/CBseXMtKHm/tm40sz3YfJRxeQjyzRqNQPgivpd9R/oDJCYj999mzdW382p/qi2ypjLww==} + engines: {node: '>=6'} + dependencies: + '@sentry/types': 5.30.0 + tslib: 1.14.1 + dev: true + + /@sindresorhus/is/4.6.0: + resolution: {integrity: sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==} + engines: {node: '>=10'} + dev: true + + /@sindresorhus/is/5.6.0: + resolution: {integrity: sha512-TV7t8GKYaJWsn00tFDqBw8+Uqmr8A0fRU1tvTQhyZzGv0sJCGRQL3JGMI3ucuKo3XIZdUP+Lx7/gh2t3lewy7g==} + engines: {node: '>=14.16'} + dev: true + + /@solidity-parser/parser/0.14.5: + resolution: {integrity: sha512-6dKnHZn7fg/iQATVEzqyUOyEidbn05q7YA2mQ9hC0MMXhhV3/JrsxmFSYZAcr7j1yUP700LLhTruvJ3MiQmjJg==} + dependencies: + antlr4ts: 0.5.0-alpha.4 + dev: true + + /@solidity-parser/parser/0.16.2: + resolution: {integrity: sha512-PI9NfoA3P8XK2VBkK5oIfRgKDsicwDZfkVq9ZTBCQYGOP1N2owgY2dyLGyU5/J/hQs8KRk55kdmvTLjy3Mu3vg==} + dependencies: + antlr4ts: 0.5.0-alpha.4 + dev: true + + /@solidity-parser/parser/0.17.0: + resolution: {integrity: sha512-Nko8R0/kUo391jsEHHxrGM07QFdnPGvlmox4rmH0kNiNAashItAilhy4Mv4pK5gQmW5f4sXAF58fwJbmlkGcVw==} + dev: true + optional: true + + /@szmarczak/http-timer/4.0.6: + resolution: {integrity: sha512-4BAffykYOgO+5nzBWYwE3W90sBgLJoUPRWWcL8wlyiM8IB8ipJz3UMJ9KXQd1RKQXpKp8Tutn80HZtWsu2u76w==} + engines: {node: '>=10'} + dependencies: + defer-to-connect: 2.0.1 + dev: true + + /@szmarczak/http-timer/5.0.1: + resolution: {integrity: sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw==} + engines: {node: '>=14.16'} + dependencies: + defer-to-connect: 2.0.1 + dev: true + + /@truffle/abi-utils/1.0.3: + resolution: {integrity: sha512-AWhs01HCShaVKjml7Z4AbVREr/u4oiWxCcoR7Cktm0mEvtT04pvnxW5xB/cI4znRkrbPdFQlFt67kgrAjesYkw==} + engines: {node: ^16.20 || ^18.16 || >=20} + dependencies: + change-case: 3.0.2 + fast-check: 3.1.1 + web3-utils: 1.10.0 + dev: true + + /@truffle/blockchain-utils/0.1.9: + resolution: {integrity: sha512-RHfumgbIVo68Rv9ofDYfynjnYZIfP/f1vZy4RoqkfYAO+fqfc58PDRzB1WAGq2U6GPuOnipOJxQhnqNnffORZg==} + engines: {node: ^16.20 || ^18.16 || >=20} + dev: true + + /@truffle/code-utils/3.0.4: + resolution: {integrity: sha512-MWK3TMisIFaBpSjK7tt1GoQan7DQDBqT2iSsdQOGD74C7r9NMwsIdnL2EYoB/DPcEJ7B8yP4grlG2fQTrPF96g==} + engines: {node: ^16.20 || ^18.16 || >=20} + dependencies: + cbor: 5.2.0 + dev: true + + /@truffle/codec/0.17.3: + resolution: {integrity: sha512-Ko/+dsnntNyrJa57jUD9u4qx9nQby+H4GsUO6yjiCPSX0TQnEHK08XWqBSg0WdmCH2+h0y1nr2CXSx8gbZapxg==} + engines: {node: ^16.20 || ^18.16 || >=20} + dependencies: + '@truffle/abi-utils': 1.0.3 + '@truffle/compile-common': 0.9.8 + big.js: 6.2.1 + bn.js: 5.2.1 + cbor: 5.2.0 + debug: 4.3.4 + lodash: 4.17.21 + semver: 7.6.0 + utf8: 3.0.0 + web3-utils: 1.10.0 + transitivePeerDependencies: + - supports-color + dev: true + + /@truffle/compile-common/0.9.8: + resolution: {integrity: sha512-DTpiyo32t/YhLI1spn84D3MHYHrnoVqO+Gp7ZHrYNwDs86mAxtNiH5lsVzSb8cPgiqlvNsRCU9nm9R0YmKMTBQ==} + engines: {node: ^16.20 || ^18.16 || >=20} + dependencies: + '@truffle/error': 0.2.2 + colors: 1.4.0 + dev: true + + /@truffle/compile-solidity/6.0.79: + resolution: {integrity: sha512-sdKYTrXwNr70p17MOzkV277ayNA7evECPFRGTvi6qDea697EXTqq694coH1ffmSjArhrqpinMMenF1v421A/AA==} + engines: {node: ^16.20 || ^18.16 || >=20} + dependencies: + '@truffle/compile-common': 0.9.8 + '@truffle/config': 1.3.61 + '@truffle/contract-sources': 0.2.1 + '@truffle/expect': 0.1.7 + '@truffle/profiler': 0.1.53 + axios: 1.5.0_debug@4.3.4 + axios-retry: 3.9.1 + debug: 4.3.4 + fs-extra: 9.1.0 + iter-tools: 7.5.3 + lodash: 4.17.21 + node-abort-controller: 3.1.1 + original-require: 1.0.1 + require-from-string: 2.0.2 + semver: 7.6.0 + solc: 0.8.21_debug@4.3.4 + transitivePeerDependencies: + - bufferutil + - encoding + - supports-color + - utf-8-validate + dev: true + + /@truffle/config/1.3.61: + resolution: {integrity: sha512-L4uyG47V+k0NrSoVJ9D+hp2jcMstihW1QlNuXiu5g3mU24BjrozlJT34DFkczh/TtRceLjdrQJKA8WJCMICutw==} + engines: {node: ^16.20 || ^18.16 || >=20} + dependencies: + '@truffle/error': 0.2.2 + '@truffle/events': 0.1.25 + '@truffle/provider': 0.3.13 + conf: 10.2.0 + debug: 4.3.4 + find-up: 2.1.0 + lodash: 4.17.21 + original-require: 1.0.1 + transitivePeerDependencies: + - bufferutil + - encoding + - supports-color + - utf-8-validate + dev: true + + /@truffle/contract-schema/3.4.16: + resolution: {integrity: sha512-g0WNYR/J327DqtJPI70ubS19K1Fth/1wxt2jFqLsPmz5cGZVjCwuhiie+LfBde4/Mc9QR8G+L3wtmT5cyoBxAg==} + engines: {node: ^16.20 || ^18.16 || >=20} + dependencies: + ajv: 6.12.6 + debug: 4.3.4 + transitivePeerDependencies: + - supports-color + dev: true + + /@truffle/contract-sources/0.2.1: + resolution: {integrity: sha512-C7l+lySN2V327s0CAX52mN4h3ag1WpIn6l45hsB92GKhY1t5h5txPUXvuKamQpalQWCTLfMS4+YbtN0AxPxCug==} + engines: {node: ^16.20 || ^18.16 || >=20} + dependencies: + debug: 4.3.4 + glob: 7.2.3 + transitivePeerDependencies: + - supports-color + dev: true + + /@truffle/contract/4.6.31: + resolution: {integrity: sha512-s+oHDpXASnZosiCdzu+X1Tx5mUJUs1L1CYXIcgRmzMghzqJkaUFmR6NpNo7nJYliYbO+O9/aW8oCKqQ7rCHfmQ==} + engines: {node: ^16.20 || ^18.16 || >=20} + dependencies: + '@ensdomains/ensjs': 2.1.0 + '@truffle/blockchain-utils': 0.1.9 + '@truffle/contract-schema': 3.4.16 + '@truffle/debug-utils': 6.0.57 + '@truffle/error': 0.2.2 + '@truffle/interface-adapter': 0.5.37 + bignumber.js: 7.2.1 + debug: 4.3.4 + ethers: 4.0.49 + web3: 1.10.0 + web3-core-helpers: 1.10.0 + web3-core-promievent: 1.10.0 + web3-eth-abi: 1.10.0 + web3-utils: 1.10.0 + transitivePeerDependencies: + - bufferutil + - encoding + - supports-color + - utf-8-validate + dev: true + + /@truffle/dashboard-message-bus-client/0.1.12: + resolution: {integrity: sha512-pI9G0La9tTstb2J2wxUZIMx6H+ZF0XBlsGN3HBkffr4edT0oT12WMCK9GxmKE22Q5VnpXl7wGjatRSEx0C9qDQ==} + engines: {node: ^16.20 || ^18.16 || >=20} + dependencies: + '@truffle/dashboard-message-bus-common': 0.1.7 + '@truffle/promise-tracker': 0.1.7 + axios: 1.5.0_debug@4.3.4 + debug: 4.3.4 + delay: 5.0.0 + isomorphic-ws: 4.0.1_ws@7.5.9 + node-abort-controller: 3.1.1 + tiny-typed-emitter: 2.1.0 + ws: 7.5.9 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + dev: true + + /@truffle/dashboard-message-bus-common/0.1.7: + resolution: {integrity: sha512-jN7q8LBmwQRldSzT/YJE33mnDLrp3EFFDuZyLwtQGInlfcRTXcr5yPY42jxr3Ln19dQe2Chx3I6dWtDByeKLIQ==} + engines: {node: ^16.20 || ^18.16 || >=20} + dev: true + + /@truffle/db-loader/0.2.36: + resolution: {integrity: sha512-Cm8uVc2eoihquMOSZm8UOuGGUvBo+/GHkxRoPAZ5pftOpSlRAug0okVOp6ETj1BujgLJ02izU/qdrwSGWwGR9A==} + engines: {node: ^16.20 || ^18.16 || >=20} + optionalDependencies: + '@truffle/db': 2.0.36 + transitivePeerDependencies: + - bufferutil + - encoding + - supports-color + - utf-8-validate + dev: true + + /@truffle/db/2.0.36: + resolution: {integrity: sha512-PpUjOXZgf9Gy8RlP8bJhl5pjJRkghZUcCiGOsS0YbCCI//PGDDoKmS+3QUjXWhiMwTeld3gfUV2ip4p2hMbyVA==} + engines: {node: ^16.20 || ^18.16 || >=20} + requiresBuild: true + dependencies: + '@graphql-tools/delegate': 8.8.1_graphql@15.8.0 + '@graphql-tools/schema': 8.5.1_graphql@15.8.0 + '@truffle/abi-utils': 1.0.3 + '@truffle/code-utils': 3.0.4 + '@truffle/config': 1.3.61 + abstract-leveldown: 7.2.0 + apollo-server: 3.13.0_graphql@15.8.0 + debug: 4.3.4 + fs-extra: 9.1.0 + graphql: 15.8.0 + graphql-tag: 2.12.6_graphql@15.8.0 + json-stable-stringify: 1.1.1 + pascal-case: 2.0.1 + pluralize: 8.0.0 + pouchdb: 7.3.0 + pouchdb-adapter-memory: 7.3.1 + pouchdb-debug: 7.2.1 + pouchdb-find: 7.3.1 + web3-utils: 1.10.0 + transitivePeerDependencies: + - bufferutil + - encoding + - supports-color + - utf-8-validate + dev: true + optional: true + + /@truffle/debug-utils/6.0.57: + resolution: {integrity: sha512-Q6oI7zLaeNLB69ixjwZk2UZEWBY6b2OD1sjLMGDKBGR7GaHYiw96GLR2PFgPH1uwEeLmV4N78LYaQCrDsHbNeA==} + engines: {node: ^16.20 || ^18.16 || >=20} + dependencies: + '@truffle/codec': 0.17.3 + '@trufflesuite/chromafi': 3.0.0 + bn.js: 5.2.1 + chalk: 2.4.2 + debug: 4.3.4 + highlightjs-solidity: 2.0.6 + transitivePeerDependencies: + - supports-color + dev: true + + /@truffle/debugger/12.1.5: + resolution: {integrity: sha512-m6FQoddmptcXZkO+OABcz4Ka7YDLAPW9/GhnTSqYonlaOeV7g5dMzybhHq6whaQet34rhNteomep7JpskKW9Mw==} + engines: {node: ^16.20 || ^18.16 || >=20} + dependencies: + '@ensdomains/ensjs': 2.1.0 + '@truffle/abi-utils': 1.0.3 + '@truffle/codec': 0.17.3 + '@truffle/source-map-utils': 1.3.119 + bn.js: 5.2.1 + debug: 4.3.4 + json-pointer: 0.6.2 + json-stable-stringify: 1.1.1 + lodash: 4.17.21 + redux: 3.7.2 + redux-saga: 1.0.0 + reselect-tree: 1.3.7 + semver: 7.6.0 + web3: 1.10.0 + web3-eth-abi: 1.10.0 + transitivePeerDependencies: + - bufferutil + - encoding + - supports-color + - utf-8-validate + dev: true + + /@truffle/error/0.2.2: + resolution: {integrity: sha512-TqbzJ0O8DHh34cu8gDujnYl4dUl6o2DE4PR6iokbybvnIm/L2xl6+Gv1VC+YJS45xfH83Yo3/Zyg/9Oq8/xZWg==} + engines: {node: ^16.20 || ^18.16 || >=20} + dev: true + + /@truffle/events/0.1.25: + resolution: {integrity: sha512-5elJxNXPVuXDMOoIcCVox0sz95ovRhRbte/H9ht18vyOvtualb4bTjwYyRoWw6Y7j0pom0tPI3OLZWqCdKQNdA==} + engines: {node: ^16.20 || ^18.16 || >=20} + dependencies: + '@truffle/dashboard-message-bus-client': 0.1.12 + '@truffle/spinners': 0.2.5 + debug: 4.3.4 + emittery: 0.4.1 + web3-utils: 1.10.0 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + dev: true + + /@truffle/expect/0.1.7: + resolution: {integrity: sha512-YWLdtIDA2Xl7RdkmurQw2KCV/b59KJJ2Csm4GYNPAsnngvVOH6qvHjqm1JNyDzBN7AzqT+Tb3s8RdD+EZC3HJw==} + engines: {node: ^16.20 || ^18.16 || >=20} + dev: true + + /@truffle/interface-adapter/0.5.37: + resolution: {integrity: sha512-lPH9MDgU+7sNDlJSClwyOwPCfuOimqsCx0HfGkznL3mcFRymc1pukAR1k17zn7ErHqBwJjiKAZ6Ri72KkS+IWw==} + engines: {node: ^16.20 || ^18.16 || >=20} + dependencies: + bn.js: 5.2.1 + ethers: 4.0.49 + web3: 1.10.0 + transitivePeerDependencies: + - bufferutil + - encoding + - supports-color + - utf-8-validate + dev: true + + /@truffle/profiler/0.1.53: + resolution: {integrity: sha512-3+wfDaa0JdHlZpjJaNjgsi6vJfeq4osPz146uNYhDH5ilnDGAG1OMrjnuCbkpG3/oXycKsUZFMnVtkbCbbaISw==} + engines: {node: ^16.20 || ^18.16 || >=20} + dependencies: + '@truffle/contract-sources': 0.2.1 + '@truffle/expect': 0.1.7 + debug: 4.3.4 + transitivePeerDependencies: + - supports-color + dev: true + + /@truffle/promise-tracker/0.1.7: + resolution: {integrity: sha512-NiPXNJvdei8MRZRUjEZoL0Y7TPDR1TaeCfGUgB3md6Q7TBiqSKo2p5OT36JO106B2j57SLmXOiDn8fLb+u2sjA==} + engines: {node: ^16.20 || ^18.16 || >=20} + dev: true + + /@truffle/provider/0.3.13: + resolution: {integrity: sha512-W9yZO0ZUwA0LhFvf7+NNNXVSCOd4x5pTbFiXUVURjyqp7f4YooLAqnlLPSpV+6qwIwThc+86CeLlOiFslYdDIA==} + engines: {node: ^16.20 || ^18.16 || >=20} + dependencies: + '@truffle/error': 0.2.2 + '@truffle/interface-adapter': 0.5.37 + debug: 4.3.4 + web3: 1.10.0 + transitivePeerDependencies: + - bufferutil + - encoding + - supports-color + - utf-8-validate + dev: true + + /@truffle/provisioner/0.2.84: + resolution: {integrity: sha512-zgDeSq+ZAcgtKSDlShtn1bsJWTRgeOdTTVzthjXMJisKnRQChkOAp7ehIr0RoIp5o2T1IVxYILAk7IPYDHNzuQ==} + engines: {node: ^16.20 || ^18.16 || >=20} + dependencies: + '@truffle/config': 1.3.61 + transitivePeerDependencies: + - bufferutil + - encoding + - supports-color + - utf-8-validate + dev: true + + /@truffle/resolver/9.0.53: + resolution: {integrity: sha512-jYqHIucs6yMCOpKFwnvcW6cfpn/WEWJQ8FN0EUhf0r0HMz9TjG9HnabBZSvfMBFPAmKklGR/GI0GESWf3alpXQ==} + engines: {node: ^16.20 || ^18.16 || >=20} + dependencies: + '@ganache/console.log': 0.3.0 + '@truffle/compile-solidity': 6.0.79 + '@truffle/contract': 4.6.31 + '@truffle/contract-sources': 0.2.1 + '@truffle/expect': 0.1.7 + '@truffle/provisioner': 0.2.84 + abi-to-sol: 0.7.1 + debug: 4.3.4 + detect-installed: 2.0.4 + fs-extra: 9.1.0 + get-installed-path: 4.0.8 + glob: 7.2.3 + web3-utils: 1.10.0 + transitivePeerDependencies: + - bufferutil + - encoding + - supports-color + - utf-8-validate + dev: true + + /@truffle/source-map-utils/1.3.119: + resolution: {integrity: sha512-TFYi3XvanY8WZBOfBwDHQe9HfZUXJ2ejnmFNjsq1//sbM4fUNWjeNshGqkWGxfKPh3OAzXgD4iTnPG3YeXM8YQ==} + engines: {node: ^16.20 || ^18.16 || >=20} + dependencies: + '@truffle/code-utils': 3.0.4 + '@truffle/codec': 0.17.3 + debug: 4.3.4 + json-pointer: 0.6.2 + node-interval-tree: 1.3.3 + web3-utils: 1.10.0 + transitivePeerDependencies: + - supports-color + dev: true + + /@truffle/spinners/0.2.5: + resolution: {integrity: sha512-emYyLEuoY62MQV/RNjyVIuTPEjMyIA0WiYMG2N3yfh8OSjD/TC0HRc2oyDWtVkNNox/5D2tH2m5fFB8HOt80FQ==} + engines: {node: ^16.20 || ^18.16 || >=20} + dependencies: + '@trufflesuite/spinnies': 0.1.1 + dev: true + + /@trufflesuite/bigint-buffer/1.1.10: + resolution: {integrity: sha512-pYIQC5EcMmID74t26GCC67946mgTJFiLXOT/BYozgrd4UEY2JHEGLhWi9cMiQCt5BSqFEvKkCHNnoj82SRjiEw==} + engines: {node: '>= 14.0.0'} + requiresBuild: true + dependencies: + node-gyp-build: 4.4.0 + dev: true + + /@trufflesuite/bigint-buffer/1.1.9: + resolution: {integrity: sha512-bdM5cEGCOhDSwminryHJbRmXc1x7dPKg6Pqns3qyTwFlxsqUgxE29lsERS3PlIW1HTjoIGMUqsk1zQQwST1Yxw==} + engines: {node: '>= 10.0.0'} + requiresBuild: true + dependencies: + node-gyp-build: 4.3.0 + dev: true + optional: true + + /@trufflesuite/chromafi/3.0.0: + resolution: {integrity: sha512-oqWcOqn8nT1bwlPPfidfzS55vqcIDdpfzo3HbU9EnUmcSTX+I8z0UyUFI3tZQjByVJulbzxHxUGS3ZJPwK/GPQ==} + dependencies: + camelcase: 4.1.0 + chalk: 2.4.2 + cheerio: 1.0.0-rc.12 + detect-indent: 5.0.0 + highlight.js: 10.7.3 + lodash.merge: 4.6.2 + strip-ansi: 4.0.0 + strip-indent: 2.0.0 + dev: true + + /@trufflesuite/spinnies/0.1.1: + resolution: {integrity: sha512-jltEtmFJj6xmQqr85gP8OqBHCEiId+zw+uAsb3DyLLRD17O6sySW6Afa2Z/jpzSafj+32ssDfLJ+c0of1NLqcA==} + dependencies: + chalk: 4.1.2 + cli-cursor: 3.1.0 + strip-ansi: 6.0.1 + dev: true + + /@trufflesuite/uws-js-unofficial/20.30.0-unofficial.0: + resolution: {integrity: sha512-r5X0aOQcuT6pLwTRLD+mPnAM/nlKtvIK4Z+My++A8tTOR0qTjNRx8UB8jzRj3D+p9PMAp5LnpCUUGmz7/TppwA==} + dependencies: + ws: 8.13.0_2adebc2xdjqbcvbjxkodkhadp4 + optionalDependencies: + bufferutil: 4.0.7 + utf-8-validate: 6.0.3 + dev: true + + /@types/accepts/1.3.7: + resolution: {integrity: sha512-Pay9fq2lM2wXPWbteBsRAGiWH2hig4ZE2asK+mm7kUzlxRTfL961rj89I6zV/E3PcIkDqyuBEcMxFT7rccugeQ==} + dependencies: + '@types/node': 20.11.17 + dev: true + optional: true + + /@types/bn.js/4.11.6: + resolution: {integrity: sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg==} + dependencies: + '@types/node': 20.11.17 + dev: true + + /@types/bn.js/5.1.5: + resolution: {integrity: sha512-V46N0zwKRF5Q00AZ6hWtN0T8gGmDUaUzLWQvHFo5yThtVwK/VCenFY3wXVbOvNfajEpsTfQM4IN9k/d6gUVX3A==} + dependencies: + '@types/node': 20.11.17 + dev: true + + /@types/body-parser/1.19.2: + resolution: {integrity: sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==} + dependencies: + '@types/connect': 3.4.38 + '@types/node': 20.11.17 + dev: true + optional: true + + /@types/body-parser/1.19.5: + resolution: {integrity: sha512-fB3Zu92ucau0iQ0JMCFQE7b/dv8Ot07NI3KaZIkIUNXq82k4eBAqUaneXfleGY9JWskeS9y+u0nXMyspcuQrCg==} + dependencies: + '@types/connect': 3.4.38 + '@types/node': 20.11.17 + dev: true + optional: true + + /@types/cacheable-request/6.0.3: + resolution: {integrity: sha512-IQ3EbTzGxIigb1I3qPZc1rWJnH0BmSKv5QYTalEwweFvyBDLSAe24zP0le/hyi7ecGfZVlIVAg4BZqb8WBwKqw==} + dependencies: + '@types/http-cache-semantics': 4.0.4 + '@types/keyv': 3.1.4 + '@types/node': 12.20.55 + '@types/responselike': 1.0.3 + dev: true + + /@types/concat-stream/1.6.1: + resolution: {integrity: sha512-eHE4cQPoj6ngxBZMvVf6Hw7Mh4jMW4U9lpGmS5GBPB9RYxlFg+CHaVN7ErNY4W9XfLIEn20b4VDYaIrbq0q4uA==} + dependencies: + '@types/node': 8.10.66 + dev: true + + /@types/connect/3.4.38: + resolution: {integrity: sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==} + dependencies: + '@types/node': 20.11.17 + dev: true + optional: true + + /@types/cors/2.8.12: + resolution: {integrity: sha512-vt+kDhq/M2ayberEtJcIN/hxXy1Pk+59g2FV/ZQceeaTyCtCucjL2Q7FXlFjtWn4n15KCr1NE2lNNFhp0lEThw==} + dev: true + optional: true + + /@types/express-serve-static-core/4.17.31: + resolution: {integrity: sha512-DxMhY+NAsTwMMFHBTtJFNp5qiHKJ7TeqOo23zVEM9alT1Ml27Q3xcTH0xwxn7Q0BbMcVEJOs/7aQtUWupUQN3Q==} + dependencies: + '@types/node': 20.11.17 + '@types/qs': 6.9.11 + '@types/range-parser': 1.2.7 + dev: true + optional: true + + /@types/express-serve-static-core/4.17.43: + resolution: {integrity: sha512-oaYtiBirUOPQGSWNGPWnzyAFJ0BP3cwvN4oWZQY+zUBwpVIGsKUkpBpSztp74drYcjavs7SKFZ4DX1V2QeN8rg==} + dependencies: + '@types/node': 20.11.17 + '@types/qs': 6.9.11 + '@types/range-parser': 1.2.7 + '@types/send': 0.17.4 + dev: true + optional: true + + /@types/express/4.17.14: + resolution: {integrity: sha512-TEbt+vaPFQ+xpxFLFssxUDXj5cWCxZJjIcB7Yg0k0GMHGtgtQgpvx/MUQUeAkNbA9AAGrwkAsoeItdTgS7FMyg==} + dependencies: + '@types/body-parser': 1.19.5 + '@types/express-serve-static-core': 4.17.43 + '@types/qs': 6.9.11 + '@types/serve-static': 1.15.5 + dev: true + optional: true + + /@types/form-data/0.0.33: + resolution: {integrity: sha512-8BSvG1kGm83cyJITQMZSulnl6QV8jqAGreJsc5tPu1Jq0vTSOiY/k24Wx82JRpWwZSqrala6sd5rWi6aNXvqcw==} + dependencies: + '@types/node': 8.10.66 + dev: true + + /@types/http-cache-semantics/4.0.4: + resolution: {integrity: sha512-1m0bIFVc7eJWyve9S0RnuRgcQqF/Xd5QsUZAZeQFr1Q3/p9JWoQQEqmVy+DPTNpGXwhgIetAoYF8JSc33q29QA==} + dev: true + + /@types/http-errors/2.0.4: + resolution: {integrity: sha512-D0CFMMtydbJAegzOyHjtiKPLlvnm3iTZyZRSZoLq2mRhDdmLfIWOCYPfQJ4cu2erKghU++QvjcUjp/5h7hESpA==} + dev: true + optional: true + + /@types/json5/0.0.29: + resolution: {integrity: sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==} + dev: true + + /@types/keyv/3.1.4: + resolution: {integrity: sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==} + dependencies: + '@types/node': 12.20.55 + dev: true + + /@types/long/4.0.2: + resolution: {integrity: sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA==} + dev: true + optional: true + + /@types/lru-cache/5.1.1: + resolution: {integrity: sha512-ssE3Vlrys7sdIzs5LOxCzTVMsU7i9oa/IaW92wF32JFb3CVczqOkru2xspuKczHEbG3nvmPY7IFqVmGGHdNbYw==} + dev: true + + /@types/mime/1.3.5: + resolution: {integrity: sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==} + dev: true + optional: true + + /@types/mime/3.0.4: + resolution: {integrity: sha512-iJt33IQnVRkqeqC7PzBHPTC6fDlRNRW8vjrgqtScAhrmMwe8c4Eo7+fUGTa+XdWrpEgpyKWMYmi2dIwMAYRzPw==} + dev: true + optional: true + + /@types/node/10.17.60: + resolution: {integrity: sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw==} + dev: true + + /@types/node/12.20.55: + resolution: {integrity: sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==} + dev: true + + /@types/node/20.11.17: + resolution: {integrity: sha512-QmgQZGWu1Yw9TDyAP9ZzpFJKynYNeOvwMJmaxABfieQoVoiVOS6MN1WSpqpRcbeA5+RW82kraAVxCCJg+780Qw==} + dependencies: + undici-types: 5.26.5 + dev: true + + /@types/node/8.10.66: + resolution: {integrity: sha512-tktOkFUA4kXx2hhhrB8bIFb5TbwzS4uOhKEmwiD+NoiL0qtP2OQ9mFldbgD4dV1djrlBYP6eBuQZiWjuHUpqFw==} + dev: true + + /@types/pbkdf2/3.1.2: + resolution: {integrity: sha512-uRwJqmiXmh9++aSu1VNEn3iIxWOhd8AHXNSdlaLfdAAdSTY9jYVeGWnzejM3dvrkbqE3/hyQkQQ29IFATEGlew==} + dependencies: + '@types/node': 20.11.17 + dev: true + + /@types/qs/6.9.11: + resolution: {integrity: sha512-oGk0gmhnEJK4Yyk+oI7EfXsLayXatCWPHary1MtcmbAifkobT9cM9yutG/hZKIseOU0MqbIwQ/u2nn/Gb+ltuQ==} + dev: true + + /@types/range-parser/1.2.7: + resolution: {integrity: sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==} + dev: true + optional: true + + /@types/readable-stream/2.3.15: + resolution: {integrity: sha512-oM5JSKQCcICF1wvGgmecmHldZ48OZamtMxcGGVICOJA8o8cahXC1zEVAif8iwoc5j8etxFaRFnf095+CDsuoFQ==} + dependencies: + '@types/node': 20.11.17 + safe-buffer: 5.1.2 + dev: true + + /@types/responselike/1.0.3: + resolution: {integrity: sha512-H/+L+UkTV33uf49PH5pCAUBVPNj2nDBXTN+qS1dOwyyg24l3CcicicCA7ca+HMvJBZcFgl5r8e+RR6elsb4Lyw==} + dependencies: + '@types/node': 12.20.55 + dev: true + + /@types/secp256k1/4.0.6: + resolution: {integrity: sha512-hHxJU6PAEUn0TP4S/ZOzuTUvJWuZ6eIKeNKb5RBpODvSl6hp1Wrw4s7ATY50rklRCScUDpHzVA/DQdSjJ3UoYQ==} + dependencies: + '@types/node': 20.11.17 + dev: true + + /@types/seedrandom/3.0.1: + resolution: {integrity: sha512-giB9gzDeiCeloIXDgzFBCgjj1k4WxcDrZtGl6h1IqmUPlxF+Nx8Ve+96QCyDZ/HseB/uvDsKbpib9hU5cU53pw==} + dev: true + + /@types/send/0.17.4: + resolution: {integrity: sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==} + dependencies: + '@types/mime': 1.3.5 + '@types/node': 20.11.17 + dev: true + optional: true + + /@types/serve-static/1.15.5: + resolution: {integrity: sha512-PDRk21MnK70hja/YF8AHfC7yIsiQHn1rcXx7ijCFBX/k+XQJhQT/gw3xekXKJvx+5SXaMMS8oqQy09Mzvz2TuQ==} + dependencies: + '@types/http-errors': 2.0.4 + '@types/mime': 3.0.4 + '@types/node': 20.11.17 + dev: true + optional: true + + /@ungap/structured-clone/1.2.0: + resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} + dev: true + + /abi-to-sol/0.7.1: + resolution: {integrity: sha512-GcpyiHA+sTbmSEAbBWsXS5iO3WBGuqhsiBo3WH9VHthNFF/k438mXFJtS/SUxtm8HmbCMv/BnxokUX6w4y2eFg==} + hasBin: true + dependencies: + '@truffle/abi-utils': 1.0.3 + '@truffle/contract-schema': 3.4.16 + ajv: 6.12.6 + better-ajv-errors: 0.8.2_ajv@6.12.6 + neodoc: 2.0.2 + semver: 7.6.0 + source-map-support: 0.5.21 + optionalDependencies: + prettier: 2.8.8 + prettier-plugin-solidity: 1.3.1_prettier@2.8.8 + transitivePeerDependencies: + - supports-color + dev: true + + /abort-controller/3.0.0: + resolution: {integrity: sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==} + engines: {node: '>=6.5'} + dependencies: + event-target-shim: 5.0.1 + dev: true + optional: true + + /abortcontroller-polyfill/1.7.5: + resolution: {integrity: sha512-JMJ5soJWP18htbbxJjG7bG6yuI6pRhgJ0scHHTfkUjf6wjP912xZWvM+A4sJK3gqd9E8fcPbDnOefbA9Th/FIQ==} + dev: true + + /abstract-level/1.0.3: + resolution: {integrity: sha512-t6jv+xHy+VYwc4xqZMn2Pa9DjcdzvzZmQGRjTFc8spIbRGHgBrEKbPq+rYXc7CCo0lxgYvSgKVg9qZAhpVQSjA==} + engines: {node: '>=12'} + dependencies: + buffer: 6.0.3 + catering: 2.1.1 + is-buffer: 2.0.5 + level-supports: 4.0.1 + level-transcoder: 1.0.1 + module-error: 1.0.2 + queue-microtask: 1.2.3 + dev: true + + /abstract-level/1.0.4: + resolution: {integrity: sha512-eUP/6pbXBkMbXFdx4IH2fVgvB7M0JvR7/lIL33zcs0IBcwjdzSSl31TOJsaCzmKSSDF9h8QYSOJux4Nd4YJqFg==} + engines: {node: '>=12'} + dependencies: + buffer: 6.0.3 + catering: 2.1.1 + is-buffer: 2.0.5 + level-supports: 4.0.1 + level-transcoder: 1.0.1 + module-error: 1.0.2 + queue-microtask: 1.2.3 + dev: true + + /abstract-leveldown/2.7.2: + resolution: {integrity: sha512-+OVvxH2rHVEhWLdbudP6p0+dNMXu8JA1CbhP19T8paTYAcX7oJ4OVjT+ZUVpv7mITxXHqDMej+GdqXBmXkw09w==} + dependencies: + xtend: 4.0.2 + dev: true + optional: true + + /abstract-leveldown/6.2.3: + resolution: {integrity: sha512-BsLm5vFMRUrrLeCcRc+G0t2qOaTzpoJQLOubq2XM72eNpjF5UdU5o/5NvlNhx95XHcAvcl8OMXr4mlg/fRgUXQ==} + engines: {node: '>=6'} + dependencies: + buffer: 5.7.1 + immediate: 3.3.0 + level-concat-iterator: 2.0.1 + level-supports: 1.0.1 + xtend: 4.0.2 + dev: true + optional: true + + /abstract-leveldown/7.2.0: + resolution: {integrity: sha512-DnhQwcFEaYsvYDnACLZhMmCWd3rkOeEvglpa4q5i/5Jlm3UIsWaxVzuXvDLFCSCWRO3yy2/+V/G7FusFgejnfQ==} + engines: {node: '>=10'} + dependencies: + buffer: 6.0.3 + catering: 2.1.1 + is-buffer: 2.0.5 + level-concat-iterator: 3.1.0 + level-supports: 2.1.0 + queue-microtask: 1.2.3 + dev: true + + /accepts/1.3.8: + resolution: {integrity: sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==} + engines: {node: '>= 0.6'} + dependencies: + mime-types: 2.1.35 + negotiator: 0.6.3 + dev: true + + /acorn-jsx/5.3.2_acorn@8.11.3: + resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} + peerDependencies: + acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 + dependencies: + acorn: 8.11.3 + dev: true + + /acorn/8.11.3: + resolution: {integrity: sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==} + engines: {node: '>=0.4.0'} + hasBin: true + dev: true + + /adm-zip/0.4.16: + resolution: {integrity: sha512-TFi4HBKSGfIKsK5YCkKaaFG2m4PEDyViZmEwof3MTIgzimHLto6muaHVpbrljdIvIrFZzEq/p4nafOeLcYegrg==} + engines: {node: '>=0.3.0'} + dev: true + + /ado-contracts/1.0.0: + resolution: {integrity: sha512-tLJdlGed3Fcwih4m9yNaI3+PqfxKarbLBR2OavM8RiPX8zo5TrLUZ6akrqkK+BFBInhaxONnMKsWiHj4QNPdCw==} + dependencies: + '@openzeppelin/contracts': 4.9.5 + dev: true + + /aes-js/3.0.0: + resolution: {integrity: sha512-H7wUZRn8WpTq9jocdxQ2c8x2sKo9ZVmzfRE13GiNJXfp7NcKYEdvl3vspKjXox6RIG2VtaRe4JFvxG4rqp2Zuw==} + dev: true + + /agent-base/6.0.2: + resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} + engines: {node: '>= 6.0.0'} + dependencies: + debug: 4.3.4 + transitivePeerDependencies: + - supports-color + dev: true + + /aggregate-error/3.1.0: + resolution: {integrity: sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==} + engines: {node: '>=8'} + dependencies: + clean-stack: 2.2.0 + indent-string: 4.0.0 + dev: true + + /ajv-formats/2.1.1: + resolution: {integrity: sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==} + peerDependenciesMeta: + ajv: + optional: true + dependencies: + ajv: 8.12.0 + dev: true + + /ajv/6.12.6: + resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==} + dependencies: + fast-deep-equal: 3.1.3 + fast-json-stable-stringify: 2.1.0 + json-schema-traverse: 0.4.1 + uri-js: 4.4.1 + dev: true + + /ajv/8.12.0: + resolution: {integrity: sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==} + dependencies: + fast-deep-equal: 3.1.3 + json-schema-traverse: 1.0.0 + require-from-string: 2.0.2 + uri-js: 4.4.1 + dev: true + + /ansi-align/3.0.1: + resolution: {integrity: sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w==} + dependencies: + string-width: 4.2.3 + dev: true + + /ansi-colors/3.2.4: + resolution: {integrity: sha512-hHUXGagefjN2iRrID63xckIvotOXOojhQKWIPUZ4mNUZ9nLZW+7FMNoE1lOkEhNWYsx/7ysGIuJYCiMAA9FnrA==} + engines: {node: '>=6'} + dev: true + + /ansi-colors/4.1.1: + resolution: {integrity: sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==} + engines: {node: '>=6'} + dev: true + + /ansi-colors/4.1.3: + resolution: {integrity: sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==} + engines: {node: '>=6'} + dev: true + + /ansi-escapes/4.3.2: + resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} + engines: {node: '>=8'} + dependencies: + type-fest: 0.21.3 + dev: true + + /ansi-regex/2.1.1: + resolution: {integrity: sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==} + engines: {node: '>=0.10.0'} + dev: true + + /ansi-regex/3.0.1: + resolution: {integrity: sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==} + engines: {node: '>=4'} + dev: true + + /ansi-regex/5.0.1: + resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} + engines: {node: '>=8'} + dev: true + + /ansi-styles/3.2.1: + resolution: {integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==} + engines: {node: '>=4'} + dependencies: + color-convert: 1.9.3 + dev: true + + /ansi-styles/4.3.0: + resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} + engines: {node: '>=8'} + dependencies: + color-convert: 2.0.1 + dev: true + + /antlr4/4.13.1: + resolution: {integrity: sha512-kiXTspaRYvnIArgE97z5YVVf/cDVQABr3abFRR6mE7yesLMkgu4ujuyV/sgxafQ8wgve0DJQUJ38Z8tkgA2izA==} + engines: {node: '>=16'} + dev: true + + /antlr4ts/0.5.0-alpha.4: + resolution: {integrity: sha512-WPQDt1B74OfPv/IMS2ekXAKkTZIHl88uMetg6q3OTqgFxZ/dxDXI0EWLyZid/1Pe6hTftyg5N7gel5wNAGxXyQ==} + dev: true + + /anymatch/3.1.3: + resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} + engines: {node: '>= 8'} + dependencies: + normalize-path: 3.0.0 + picomatch: 2.3.1 + dev: true + + /apollo-datasource/3.3.2: + resolution: {integrity: sha512-L5TiS8E2Hn/Yz7SSnWIVbZw0ZfEIXZCa5VUiVxD9P53JvSrf4aStvsFDlGWPvpIdCR+aly2CfoB79B9/JjKFqg==} + engines: {node: '>=12.0'} + deprecated: The `apollo-datasource` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023 and October 22nd 2024, respectively). See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details. + dependencies: + '@apollo/utils.keyvaluecache': 1.0.2 + apollo-server-env: 4.2.1 + transitivePeerDependencies: + - encoding + dev: true + optional: true + + /apollo-reporting-protobuf/3.4.0: + resolution: {integrity: sha512-h0u3EbC/9RpihWOmcSsvTW2O6RXVaD/mPEjfrPkxRPTEPWqncsgOoRJw+wih4OqfH3PvTJvoEIf4LwKrUaqWog==} + deprecated: The `apollo-reporting-protobuf` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023 and October 22nd 2024, respectively). This package's functionality is now found in the `@apollo/usage-reporting-protobuf` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details. + dependencies: + '@apollo/protobufjs': 1.2.6 + dev: true + optional: true + + /apollo-server-core/3.13.0_graphql@15.8.0: + resolution: {integrity: sha512-v/g6DR6KuHn9DYSdtQijz8dLOkP78I5JSVJzPkARhDbhpH74QNwrQ2PP2URAPPEDJ2EeZNQDX8PvbYkAKqg+kg==} + engines: {node: '>=12.0'} + peerDependencies: + graphql: ^15.3.0 || ^16.0.0 + dependencies: + '@apollo/utils.keyvaluecache': 1.0.2 + '@apollo/utils.logger': 1.0.1 + '@apollo/utils.usagereporting': 1.0.1_graphql@15.8.0 + '@apollographql/apollo-tools': 0.5.4_graphql@15.8.0 + '@apollographql/graphql-playground-html': 1.6.29 + '@graphql-tools/mock': 8.7.20_graphql@15.8.0 + '@graphql-tools/schema': 8.5.1_graphql@15.8.0 + '@josephg/resolvable': 1.0.1 + apollo-datasource: 3.3.2 + apollo-reporting-protobuf: 3.4.0 + apollo-server-env: 4.2.1 + apollo-server-errors: 3.3.1_graphql@15.8.0 + apollo-server-plugin-base: 3.7.2_graphql@15.8.0 + apollo-server-types: 3.8.0_graphql@15.8.0 + async-retry: 1.3.3 + fast-json-stable-stringify: 2.1.0 + graphql: 15.8.0 + graphql-tag: 2.12.6_graphql@15.8.0 + loglevel: 1.9.1 + lru-cache: 6.0.0 + node-abort-controller: 3.1.1 + sha.js: 2.4.11 + uuid: 9.0.1 + whatwg-mimetype: 3.0.0 + transitivePeerDependencies: + - encoding + dev: true + optional: true + + /apollo-server-env/4.2.1: + resolution: {integrity: sha512-vm/7c7ld+zFMxibzqZ7SSa5tBENc4B0uye9LTfjJwGoQFY5xsUPH5FpO5j0bMUDZ8YYNbrF9SNtzc5Cngcr90g==} + engines: {node: '>=12.0'} + deprecated: The `apollo-server-env` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023 and October 22nd 2024, respectively). This package's functionality is now found in the `@apollo/utils.fetcher` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details. + dependencies: + node-fetch: 2.7.0 + transitivePeerDependencies: + - encoding + dev: true + optional: true + + /apollo-server-errors/3.3.1_graphql@15.8.0: + resolution: {integrity: sha512-xnZJ5QWs6FixHICXHxUfm+ZWqqxrNuPlQ+kj5m6RtEgIpekOPssH/SD9gf2B4HuWV0QozorrygwZnux8POvyPA==} + engines: {node: '>=12.0'} + deprecated: The `apollo-server-errors` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023 and October 22nd 2024, respectively). This package's functionality is now found in the `@apollo/server` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details. + peerDependencies: + graphql: ^15.3.0 || ^16.0.0 + dependencies: + graphql: 15.8.0 + dev: true + optional: true + + /apollo-server-express/3.13.0_4mq2c443wwzwcb6dpxnwkfvrzm: + resolution: {integrity: sha512-iSxICNbDUyebOuM8EKb3xOrpIwOQgKxGbR2diSr4HP3IW8T3njKFOoMce50vr+moOCe1ev8BnLcw9SNbuUtf7g==} + engines: {node: '>=12.0'} + peerDependencies: + express: ^4.17.1 + graphql: ^15.3.0 || ^16.0.0 + dependencies: + '@types/accepts': 1.3.7 + '@types/body-parser': 1.19.2 + '@types/cors': 2.8.12 + '@types/express': 4.17.14 + '@types/express-serve-static-core': 4.17.31 + accepts: 1.3.8 + apollo-server-core: 3.13.0_graphql@15.8.0 + apollo-server-types: 3.8.0_graphql@15.8.0 + body-parser: 1.20.2 + cors: 2.8.5 + express: 4.18.2 + graphql: 15.8.0 + parseurl: 1.3.3 + transitivePeerDependencies: + - encoding + - supports-color + dev: true + optional: true + + /apollo-server-plugin-base/3.7.2_graphql@15.8.0: + resolution: {integrity: sha512-wE8dwGDvBOGehSsPTRZ8P/33Jan6/PmL0y0aN/1Z5a5GcbFhDaaJCjK5cav6npbbGL2DPKK0r6MPXi3k3N45aw==} + engines: {node: '>=12.0'} + deprecated: The `apollo-server-plugin-base` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023 and October 22nd 2024, respectively). This package's functionality is now found in the `@apollo/server` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details. + peerDependencies: + graphql: ^15.3.0 || ^16.0.0 + dependencies: + apollo-server-types: 3.8.0_graphql@15.8.0 + graphql: 15.8.0 + transitivePeerDependencies: + - encoding + dev: true + optional: true + + /apollo-server-types/3.8.0_graphql@15.8.0: + resolution: {integrity: sha512-ZI/8rTE4ww8BHktsVpb91Sdq7Cb71rdSkXELSwdSR0eXu600/sY+1UXhTWdiJvk+Eq5ljqoHLwLbY2+Clq2b9A==} + engines: {node: '>=12.0'} + deprecated: The `apollo-server-types` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023 and October 22nd 2024, respectively). This package's functionality is now found in the `@apollo/server` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details. + peerDependencies: + graphql: ^15.3.0 || ^16.0.0 + dependencies: + '@apollo/utils.keyvaluecache': 1.0.2 + '@apollo/utils.logger': 1.0.1 + apollo-reporting-protobuf: 3.4.0 + apollo-server-env: 4.2.1 + graphql: 15.8.0 + transitivePeerDependencies: + - encoding + dev: true + optional: true + + /apollo-server/3.13.0_graphql@15.8.0: + resolution: {integrity: sha512-hgT/MswNB5G1r+oBhggVX4Fjw53CFLqG15yB5sN+OrYkCVWF5YwPbJWHfSWa7699JMEXJGaoVfFzcvLZK0UlDg==} + peerDependencies: + graphql: ^15.3.0 || ^16.0.0 + dependencies: + '@types/express': 4.17.14 + apollo-server-core: 3.13.0_graphql@15.8.0 + apollo-server-express: 3.13.0_4mq2c443wwzwcb6dpxnwkfvrzm + express: 4.18.2 + graphql: 15.8.0 + transitivePeerDependencies: + - encoding + - supports-color + dev: true + optional: true + + /app-module-path/2.2.0: + resolution: {integrity: sha512-gkco+qxENJV+8vFcDiiFhuoSvRXb2a/QPqpSoWhVz829VNJfOTnELbBmPmNKFxf3xdNnw4DWCkzkDaavcX/1YQ==} + dev: true + + /argparse/2.0.1: + resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} + dev: true + + /argsarray/0.0.1: + resolution: {integrity: sha512-u96dg2GcAKtpTrBdDoFIM7PjcBA+6rSP0OR94MOReNRyUECL6MtQt5XXmRr4qrftYaef9+l5hcpO5te7sML1Cg==} + dev: true + optional: true + + /array-buffer-byte-length/1.0.1: + resolution: {integrity: sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + is-array-buffer: 3.0.4 + dev: true + + /array-flatten/1.1.1: + resolution: {integrity: sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==} + dev: true + + /array-includes/3.1.7: + resolution: {integrity: sha512-dlcsNBIiWhPkHdOEEKnehA+RNUWDc4UqFtnIXU4uuYDPtA4LDkr7qip2p0VvFAEXNDr0yWZ9PJyIRiGjRLQzwQ==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + define-properties: 1.2.1 + es-abstract: 1.22.4 + get-intrinsic: 1.2.4 + is-string: 1.0.7 + dev: true + + /array.prototype.filter/1.0.3: + resolution: {integrity: sha512-VizNcj/RGJiUyQBgzwxzE5oHdeuXY5hSbbmKMlphj1cy1Vl7Pn2asCGbSrru6hSQjmCzqTBPVWAF/whmEOVHbw==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + define-properties: 1.2.1 + es-abstract: 1.22.4 + es-array-method-boxes-properly: 1.0.0 + is-string: 1.0.7 + dev: true + + /array.prototype.findlastindex/1.2.4: + resolution: {integrity: sha512-hzvSHUshSpCflDR1QMUBLHGHP1VIEBegT4pix9H/Z92Xw3ySoy6c2qh7lJWTJnRJ8JCZ9bJNCgTyYaJGcJu6xQ==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + define-properties: 1.2.1 + es-abstract: 1.22.4 + es-errors: 1.3.0 + es-shim-unscopables: 1.0.2 + dev: true + + /array.prototype.flat/1.3.2: + resolution: {integrity: sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + define-properties: 1.2.1 + es-abstract: 1.22.4 + es-shim-unscopables: 1.0.2 + dev: true + + /array.prototype.flatmap/1.3.2: + resolution: {integrity: sha512-Ewyx0c9PmpcsByhSW4r+9zDU7sGjFc86qf/kKtuSCRdhfbk0SNLLkaT5qvcHnRGgc5NP/ly/y+qkXkqONX54CQ==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + define-properties: 1.2.1 + es-abstract: 1.22.4 + es-shim-unscopables: 1.0.2 + dev: true + + /arraybuffer.prototype.slice/1.0.3: + resolution: {integrity: sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A==} + engines: {node: '>= 0.4'} + dependencies: + array-buffer-byte-length: 1.0.1 + call-bind: 1.0.7 + define-properties: 1.2.1 + es-abstract: 1.22.4 + es-errors: 1.3.0 + get-intrinsic: 1.2.4 + is-array-buffer: 3.0.4 + is-shared-array-buffer: 1.0.2 + dev: true + + /asap/2.0.6: + resolution: {integrity: sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==} + dev: true + + /asn1/0.2.6: + resolution: {integrity: sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==} + dependencies: + safer-buffer: 2.1.2 + dev: true + + /assert-plus/1.0.0: + resolution: {integrity: sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==} + engines: {node: '>=0.8'} + dev: true + + /assertion-error/1.1.0: + resolution: {integrity: sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==} + dev: true + + /ast-parents/0.0.1: + resolution: {integrity: sha512-XHusKxKz3zoYk1ic8Un640joHbFMhbqneyoZfoKnEGtf2ey9Uh/IdpcQplODdO/kENaMIWsD0nJm4+wX3UNLHA==} + dev: true + + /astral-regex/2.0.0: + resolution: {integrity: sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==} + engines: {node: '>=8'} + dev: true + + /async-eventemitter/0.2.4: + resolution: {integrity: sha512-pd20BwL7Yt1zwDFy+8MX8F1+WCT8aQeKj0kQnTrH9WaeRETlRamVhD0JtRPmrV4GfOJ2F9CvdQkZeZhnh2TuHw==} + dependencies: + async: 2.6.4 + dev: true + + /async-limiter/1.0.1: + resolution: {integrity: sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==} + dev: true + + /async-retry/1.3.3: + resolution: {integrity: sha512-wfr/jstw9xNi/0teMHrRW7dsz3Lt5ARhYNZ2ewpadnhaIp5mbALhOAP+EAdsC7t4Z6wqsDVv9+W6gm1Dk9mEyw==} + dependencies: + retry: 0.13.1 + dev: true + optional: true + + /async/2.6.4: + resolution: {integrity: sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==} + dependencies: + lodash: 4.17.21 + dev: true + + /async/3.2.5: + resolution: {integrity: sha512-baNZyqaaLhyLVKm/DlvdW051MSgO6b8eVfIezl9E5PqWxFgzLm/wQntEW4zOytVburDEr0JlALEpdOFwvErLsg==} + dev: true + + /asynckit/0.4.0: + resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} + dev: true + + /at-least-node/1.0.0: + resolution: {integrity: sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==} + engines: {node: '>= 4.0.0'} + dev: true + + /atomically/1.7.0: + resolution: {integrity: sha512-Xcz9l0z7y9yQ9rdDaxlmaI4uJHf/T8g9hOEzJcsEqX2SjCj4J20uK7+ldkDHMbpJDK76wF7xEIgxc/vSlsfw5w==} + engines: {node: '>=10.12.0'} + dev: true + + /available-typed-arrays/1.0.6: + resolution: {integrity: sha512-j1QzY8iPNPG4o4xmO3ptzpRxTciqD3MgEHtifP/YnJpIo58Xu+ne4BejlbkuaLfXn/nz6HFiw29bLpj2PNMdGg==} + engines: {node: '>= 0.4'} + dev: true + + /aws-sign2/0.7.0: + resolution: {integrity: sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA==} + dev: true + + /aws4/1.12.0: + resolution: {integrity: sha512-NmWvPnx0F1SfrQbYwOi7OeaNGokp9XhzNioJ/CSBs8Qa4vxug81mhJEAVZwxXuBmYB5KDRfMq/F3RR0BIU7sWg==} + dev: true + + /axios-retry/3.9.1: + resolution: {integrity: sha512-8PJDLJv7qTTMMwdnbMvrLYuvB47M81wRtxQmEdV5w4rgbTXTt+vtPkXwajOfOdSyv/wZICJOC+/UhXH4aQ/R+w==} + dependencies: + '@babel/runtime': 7.23.9 + is-retry-allowed: 2.2.0 + dev: true + + /axios/0.26.1: + resolution: {integrity: sha512-fPwcX4EvnSHuInCMItEhAGnaSEXRBjtzh9fOtsE6E1G6p7vl7edEeZe11QHf18+6+9gR5PbKV/sGKNaD8YaMeA==} + dependencies: + follow-redirects: 1.15.5 + transitivePeerDependencies: + - debug + dev: true + + /axios/1.5.0_debug@4.3.4: + resolution: {integrity: sha512-D4DdjDo5CY50Qms0qGQTTw6Q44jl7zRwY7bthds06pUGfChBCTcQs+N743eFWGEd6pRTMd6A+I87aWyFV5wiZQ==} + dependencies: + follow-redirects: 1.15.5 + form-data: 4.0.0 + proxy-from-env: 1.1.0 + transitivePeerDependencies: + - debug + dev: true + + /axios/1.6.7: + resolution: {integrity: sha512-/hDJGff6/c7u0hDkvkGxR/oy6CbCs8ziCsC7SqmhjfozqiJGc8Z11wrv9z9lYfY4K8l+H9TpjcMDX0xOZmx+RA==} + dependencies: + follow-redirects: 1.15.5 + form-data: 4.0.0 + proxy-from-env: 1.1.0 + transitivePeerDependencies: + - debug + dev: true + + /balanced-match/1.0.2: + resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} + dev: true + + /base-x/3.0.9: + resolution: {integrity: sha512-H7JU6iBHTal1gp56aKoaa//YUxEaAOUiydvrV/pILqIHXTtqxSkATOnDA2u+jZ/61sD+L/412+7kzXRtWukhpQ==} + dependencies: + safe-buffer: 5.2.1 + dev: true + + /base64-js/1.5.1: + resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} + dev: true + + /bcrypt-pbkdf/1.0.2: + resolution: {integrity: sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==} + dependencies: + tweetnacl: 0.14.5 + dev: true + + /bech32/1.1.4: + resolution: {integrity: sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ==} + dev: true + + /better-ajv-errors/0.8.2_ajv@6.12.6: + resolution: {integrity: sha512-FnODTBJSQSHmJXDLPiC7ca0dC4S1HSTPv1+Hg2sm/C71i3Dj0l1jcUEaq/3OQ6MmnUveshTsUvUj65pDSr3Qow==} + peerDependencies: + ajv: 4.11.8 - 8 + dependencies: + '@babel/code-frame': 7.23.5 + '@babel/runtime': 7.23.9 + ajv: 6.12.6 + chalk: 2.4.2 + core-js: 3.36.0 + json-to-ast: 2.1.0 + jsonpointer: 5.0.1 + leven: 3.1.0 + dev: true + + /big-integer/1.6.36: + resolution: {integrity: sha512-t70bfa7HYEA1D9idDbmuv7YbsbVkQ+Hp+8KFSul4aE5e/i1bjCNIRYJZlA8Q8p0r9T8cF/RVvwUgRA//FydEyg==} + engines: {node: '>=0.6'} + dev: true + + /big.js/6.2.1: + resolution: {integrity: sha512-bCtHMwL9LeDIozFn+oNhhFoq+yQ3BNdnsLSASUxLciOb1vgvpHsIO1dsENiGMgbb4SkP5TrzWzRiLddn8ahVOQ==} + dev: true + + /bigint-crypto-utils/3.3.0: + resolution: {integrity: sha512-jOTSb+drvEDxEq6OuUybOAv/xxoh3cuYRUIPyu8sSHQNKM303UQ2R1DAo45o1AkcIXw6fzbaFI1+xGGdaXs2lg==} + engines: {node: '>=14.0.0'} + dev: true + + /bignumber.js/7.2.1: + resolution: {integrity: sha512-S4XzBk5sMB+Rcb/LNcpzXr57VRTxgAvaAEDAl1AwRx27j00hT84O6OkteE7u8UB3NuaaygCRrEpqox4uDOrbdQ==} + dev: true + + /bignumber.js/9.1.2: + resolution: {integrity: sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug==} + dev: true + + /binary-extensions/2.2.0: + resolution: {integrity: sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==} + engines: {node: '>=8'} + dev: true + + /blakejs/1.2.1: + resolution: {integrity: sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ==} + dev: true + + /bluebird/3.7.2: + resolution: {integrity: sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==} + dev: true + + /bn.js/4.11.6: + resolution: {integrity: sha512-XWwnNNFCuuSQ0m3r3C4LE3EiORltHd9M05pq6FOlVeiophzRbMo50Sbz1ehl8K3Z+jw9+vmgnXefY1hz8X+2wA==} + dev: true + + /bn.js/4.12.0: + resolution: {integrity: sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==} + dev: true + + /bn.js/5.2.1: + resolution: {integrity: sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==} + dev: true + + /body-parser/1.20.1: + resolution: {integrity: sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==} + engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16} + dependencies: + bytes: 3.1.2 + content-type: 1.0.5 + debug: 2.6.9 + depd: 2.0.0 + destroy: 1.2.0 + http-errors: 2.0.0 + iconv-lite: 0.4.24 + on-finished: 2.4.1 + qs: 6.11.0 + raw-body: 2.5.1 + type-is: 1.6.18 + unpipe: 1.0.0 + transitivePeerDependencies: + - supports-color + dev: true + + /body-parser/1.20.2: + resolution: {integrity: sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==} + engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16} + dependencies: + bytes: 3.1.2 + content-type: 1.0.5 + debug: 2.6.9 + depd: 2.0.0 + destroy: 1.2.0 + http-errors: 2.0.0 + iconv-lite: 0.4.24 + on-finished: 2.4.1 + qs: 6.11.0 + raw-body: 2.5.2 + type-is: 1.6.18 + unpipe: 1.0.0 + transitivePeerDependencies: + - supports-color + dev: true + + /boolbase/1.0.0: + resolution: {integrity: sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==} + dev: true + + /boxen/5.1.2: + resolution: {integrity: sha512-9gYgQKXx+1nP8mP7CzFyaUARhg7D3n1dF/FnErWmu9l6JvGpNUN278h0aSb+QjoiKSWG+iZ3uHrcqk0qrY9RQQ==} + engines: {node: '>=10'} + dependencies: + ansi-align: 3.0.1 + camelcase: 6.3.0 + chalk: 4.1.2 + cli-boxes: 2.2.1 + string-width: 4.2.3 + type-fest: 0.20.2 + widest-line: 3.1.0 + wrap-ansi: 7.0.0 + dev: true + + /brace-expansion/1.1.11: + resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} + dependencies: + balanced-match: 1.0.2 + concat-map: 0.0.1 + dev: true + + /brace-expansion/2.0.1: + resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==} + dependencies: + balanced-match: 1.0.2 + dev: true + + /braces/3.0.2: + resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==} + engines: {node: '>=8'} + dependencies: + fill-range: 7.0.1 + dev: true + + /brorand/1.1.0: + resolution: {integrity: sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==} + dev: true + + /browser-level/1.0.1: + resolution: {integrity: sha512-XECYKJ+Dbzw0lbydyQuJzwNXtOpbMSq737qxJN11sIRTErOMShvDpbzTlgju7orJKvx4epULolZAuJGLzCmWRQ==} + dependencies: + abstract-level: 1.0.4 + catering: 2.1.1 + module-error: 1.0.2 + run-parallel-limit: 1.1.0 + dev: true + + /browser-stdout/1.3.1: + resolution: {integrity: sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==} + dev: true + + /browserify-aes/1.2.0: + resolution: {integrity: sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==} + dependencies: + buffer-xor: 1.0.3 + cipher-base: 1.0.4 + create-hash: 1.2.0 + evp_bytestokey: 1.0.3 + inherits: 2.0.4 + safe-buffer: 5.2.1 + dev: true + + /bs58/4.0.1: + resolution: {integrity: sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==} + dependencies: + base-x: 3.0.9 + dev: true + + /bs58check/2.1.2: + resolution: {integrity: sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA==} + dependencies: + bs58: 4.0.1 + create-hash: 1.2.0 + safe-buffer: 5.2.1 + dev: true + + /buffer-from/1.1.2: + resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} + dev: true + + /buffer-to-arraybuffer/0.0.5: + resolution: {integrity: sha512-3dthu5CYiVB1DEJp61FtApNnNndTckcqe4pFcLdvHtrpG+kcyekCJKg4MRiDcFW7A6AODnXB9U4dwQiCW5kzJQ==} + dev: true + + /buffer-xor/1.0.3: + resolution: {integrity: sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ==} + dev: true + + /buffer/5.7.1: + resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==} + dependencies: + base64-js: 1.5.1 + ieee754: 1.2.1 + dev: true + + /buffer/6.0.3: + resolution: {integrity: sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==} + dependencies: + base64-js: 1.5.1 + ieee754: 1.2.1 + dev: true + + /bufferutil/4.0.5: + resolution: {integrity: sha512-HTm14iMQKK2FjFLRTM5lAVcyaUzOnqbPtesFIvREgXpJHdQm8bWS+GkQgIkfaBYRHuCnea7w8UVNfwiAQhlr9A==} + engines: {node: '>=6.14.2'} + requiresBuild: true + dependencies: + node-gyp-build: 4.8.0 + dev: true + optional: true + + /bufferutil/4.0.7: + resolution: {integrity: sha512-kukuqc39WOHtdxtw4UScxF/WVnMFVSQVKhtx3AjZJzhd0RGZZldcrfSEbVsWWe6KNH253574cq5F+wpv0G9pJw==} + engines: {node: '>=6.14.2'} + requiresBuild: true + dependencies: + node-gyp-build: 4.8.0 + dev: true + + /bufferutil/4.0.8: + resolution: {integrity: sha512-4T53u4PdgsXqKaIctwF8ifXlRTTmEPJ8iEPWFdGZvcf7sbwYo6FKFEX9eNNAnzFZ7EzJAQ3CJeOtCRA4rDp7Pw==} + engines: {node: '>=6.14.2'} + requiresBuild: true + dependencies: + node-gyp-build: 4.8.0 + dev: true + + /builtin-modules/3.3.0: + resolution: {integrity: sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==} + engines: {node: '>=6'} + dev: true + + /builtins/5.0.1: + resolution: {integrity: sha512-qwVpFEHNfhYJIzNRBvd2C1kyo6jz3ZSMPyyuR47OPdiKWlbYnZNyDWuyR175qDnAJLiCo5fBBqPb3RiXgWlkOQ==} + dependencies: + semver: 7.6.0 + dev: true + + /bytes/3.1.2: + resolution: {integrity: sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==} + engines: {node: '>= 0.8'} + dev: true + + /cacheable-lookup/5.0.4: + resolution: {integrity: sha512-2/kNscPhpcxrOigMZzbiWF7dz8ilhb/nIHU3EyZiXWXpeq/au8qJ8VhdftMkty3n7Gj6HIGalQG8oiBNB3AJgA==} + engines: {node: '>=10.6.0'} + dev: true + + /cacheable-lookup/6.1.0: + resolution: {integrity: sha512-KJ/Dmo1lDDhmW2XDPMo+9oiy/CeqosPguPCrgcVzKyZrL6pM1gU2GmPY/xo6OQPTUaA/c0kwHuywB4E6nmT9ww==} + engines: {node: '>=10.6.0'} + dev: true + + /cacheable-lookup/7.0.0: + resolution: {integrity: sha512-+qJyx4xiKra8mZrcwhjMRMUhD5NR1R8esPkzIYxX96JiecFoxAXFuz/GpR3+ev4PE1WamHip78wV0vcmPQtp8w==} + engines: {node: '>=14.16'} + dev: true + + /cacheable-request/10.2.14: + resolution: {integrity: sha512-zkDT5WAF4hSSoUgyfg5tFIxz8XQK+25W/TLVojJTMKBaxevLBBtLxgqguAuVQB8PVW79FVjHcU+GJ9tVbDZ9mQ==} + engines: {node: '>=14.16'} + dependencies: + '@types/http-cache-semantics': 4.0.4 + get-stream: 6.0.1 + http-cache-semantics: 4.1.1 + keyv: 4.5.4 + mimic-response: 4.0.0 + normalize-url: 8.0.0 + responselike: 3.0.0 + dev: true + + /cacheable-request/7.0.4: + resolution: {integrity: sha512-v+p6ongsrp0yTGbJXjgxPow2+DL93DASP4kXCDKb8/bwRtt9OEF3whggkkDkGNzgcWy2XaF4a8nZglC7uElscg==} + engines: {node: '>=8'} + dependencies: + clone-response: 1.0.3 + get-stream: 5.2.0 + http-cache-semantics: 4.1.1 + keyv: 4.5.4 + lowercase-keys: 2.0.0 + normalize-url: 6.1.0 + responselike: 2.0.1 + dev: true + + /call-bind/1.0.7: + resolution: {integrity: sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==} + engines: {node: '>= 0.4'} + dependencies: + es-define-property: 1.0.0 + es-errors: 1.3.0 + function-bind: 1.1.2 + get-intrinsic: 1.2.4 + set-function-length: 1.2.1 + dev: true + + /callsites/3.1.0: + resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} + engines: {node: '>=6'} + dev: true + + /camel-case/3.0.0: + resolution: {integrity: sha512-+MbKztAYHXPr1jNTSKQF52VpcFjwY5RkR7fxksV8Doo4KAYc5Fl4UJRgthBbTmEx8C54DqahhbLJkDwjI3PI/w==} + dependencies: + no-case: 2.3.2 + upper-case: 1.1.3 + dev: true + + /camelcase/3.0.0: + resolution: {integrity: sha512-4nhGqUkc4BqbBBB4Q6zLuD7lzzrHYrjKGeYaEji/3tFR5VdJu9v+LilhGIVe8wxEJPPOeWo7eg8dwY13TZ1BNg==} + engines: {node: '>=0.10.0'} + dev: true + + /camelcase/4.1.0: + resolution: {integrity: sha512-FxAv7HpHrXbh3aPo4o2qxHay2lkLY3x5Mw3KeE4KQE8ysVfziWeRZDwcjauvwBSGEC/nXUPzZy8zeh4HokqOnw==} + engines: {node: '>=4'} + dev: true + + /camelcase/6.3.0: + resolution: {integrity: sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==} + engines: {node: '>=10'} + dev: true + + /case/1.6.3: + resolution: {integrity: sha512-mzDSXIPaFwVDvZAHqZ9VlbyF4yyXRuX6IvB06WvPYkqJVO24kX1PPhv9bfpKNFZyxYFmmgo03HUiD8iklmJYRQ==} + engines: {node: '>= 0.8.0'} + dev: true + + /caseless/0.12.0: + resolution: {integrity: sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==} + dev: true + + /catering/2.1.1: + resolution: {integrity: sha512-K7Qy8O9p76sL3/3m7/zLKbRkyOlSZAgzEaLhyj2mXS8PsCud2Eo4hAb8aLtZqHh0QGqLcb9dlJSu6lHRVENm1w==} + engines: {node: '>=6'} + dev: true + + /cbor/5.2.0: + resolution: {integrity: sha512-5IMhi9e1QU76ppa5/ajP1BmMWZ2FHkhAhjeVKQ/EFCgYSEaeVaoGtL7cxJskf9oCCk+XjzaIdc3IuU/dbA/o2A==} + engines: {node: '>=6.0.0'} + dependencies: + bignumber.js: 9.1.2 + nofilter: 1.0.4 + dev: true + + /cbor/8.1.0: + resolution: {integrity: sha512-DwGjNW9omn6EwP70aXsn7FQJx5kO12tX0bZkaTjzdVFM6/7nhA4t0EENocKGx6D2Bch9PE2KzCUf5SceBdeijg==} + engines: {node: '>=12.19'} + dependencies: + nofilter: 3.1.0 + dev: true + + /chai-bn/0.2.2_bn.js@4.12.0+chai@4.4.1: + resolution: {integrity: sha512-MzjelH0p8vWn65QKmEq/DLBG1Hle4WeyqT79ANhXZhn/UxRWO0OogkAxi5oGGtfzwU9bZR8mvbvYdoqNVWQwFg==} + peerDependencies: + bn.js: ^4.11.0 + chai: ^4.0.0 + dependencies: + bn.js: 4.12.0 + chai: 4.4.1 + dev: true + + /chai/4.4.1: + resolution: {integrity: sha512-13sOfMv2+DWduEU+/xbun3LScLoqN17nBeTLUsmDfKdoiC1fr0n9PU4guu4AhRcOVFk/sW8LyZWHuhWtQZiF+g==} + engines: {node: '>=4'} + dependencies: + assertion-error: 1.1.0 + check-error: 1.0.3 + deep-eql: 4.1.3 + get-func-name: 2.0.2 + loupe: 2.3.7 + pathval: 1.1.1 + type-detect: 4.0.8 + dev: true + + /chalk/2.4.2: + resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==} + engines: {node: '>=4'} + dependencies: + ansi-styles: 3.2.1 + escape-string-regexp: 1.0.5 + supports-color: 5.5.0 + dev: true + + /chalk/4.1.2: + resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} + engines: {node: '>=10'} + dependencies: + ansi-styles: 4.3.0 + supports-color: 7.2.0 + dev: true + + /change-case/3.0.2: + resolution: {integrity: sha512-Mww+SLF6MZ0U6kdg11algyKd5BARbyM4TbFBepwowYSR5ClfQGCGtxNXgykpN0uF/bstWeaGDT4JWaDh8zWAHA==} + dependencies: + camel-case: 3.0.0 + constant-case: 2.0.0 + dot-case: 2.1.1 + header-case: 1.0.1 + is-lower-case: 1.1.3 + is-upper-case: 1.1.2 + lower-case: 1.1.4 + lower-case-first: 1.0.2 + no-case: 2.3.2 + param-case: 2.1.1 + pascal-case: 2.0.1 + path-case: 2.1.1 + sentence-case: 2.1.1 + snake-case: 2.1.0 + swap-case: 1.1.2 + title-case: 2.1.1 + upper-case: 1.1.3 + upper-case-first: 1.1.2 + dev: true + + /charenc/0.0.2: + resolution: {integrity: sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA==} + dev: true + + /check-error/1.0.3: + resolution: {integrity: sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==} + dependencies: + get-func-name: 2.0.2 + dev: true + + /cheerio-select/2.1.0: + resolution: {integrity: sha512-9v9kG0LvzrlcungtnJtpGNxY+fzECQKhK4EGJX2vByejiMX84MFNQw4UxPJl3bFbTMw+Dfs37XaIkCwTZfLh4g==} + dependencies: + boolbase: 1.0.0 + css-select: 5.1.0 + css-what: 6.1.0 + domelementtype: 2.3.0 + domhandler: 5.0.3 + domutils: 3.1.0 + dev: true + + /cheerio/1.0.0-rc.12: + resolution: {integrity: sha512-VqR8m68vM46BNnuZ5NtnGBKIE/DfN0cRIzg9n40EIq9NOv90ayxLBXA8fXC5gquFRGJSTRqBq25Jt2ECLR431Q==} + engines: {node: '>= 6'} + dependencies: + cheerio-select: 2.1.0 + dom-serializer: 2.0.0 + domhandler: 5.0.3 + domutils: 3.1.0 + htmlparser2: 8.0.2 + parse5: 7.1.2 + parse5-htmlparser2-tree-adapter: 7.0.0 + dev: true + + /chokidar/3.5.3: + resolution: {integrity: sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==} + engines: {node: '>= 8.10.0'} + dependencies: + anymatch: 3.1.3 + braces: 3.0.2 + glob-parent: 5.1.2 + is-binary-path: 2.1.0 + is-glob: 4.0.3 + normalize-path: 3.0.0 + readdirp: 3.6.0 + optionalDependencies: + fsevents: 2.3.3 + dev: true + + /chokidar/3.6.0: + resolution: {integrity: sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==} + engines: {node: '>= 8.10.0'} + dependencies: + anymatch: 3.1.3 + braces: 3.0.2 + glob-parent: 5.1.2 + is-binary-path: 2.1.0 + is-glob: 4.0.3 + normalize-path: 3.0.0 + readdirp: 3.6.0 + optionalDependencies: + fsevents: 2.3.3 + dev: true + + /chownr/1.1.4: + resolution: {integrity: sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==} + dev: true + + /ci-info/2.0.0: + resolution: {integrity: sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==} + dev: true + + /cids/0.7.5: + resolution: {integrity: sha512-zT7mPeghoWAu+ppn8+BS1tQ5qGmbMfB4AregnQjA/qHY3GC1m1ptI9GkWNlgeu38r7CuRdXB47uY2XgAYt6QVA==} + engines: {node: '>=4.0.0', npm: '>=3.0.0'} + deprecated: This module has been superseded by the multiformats module + dependencies: + buffer: 5.7.1 + class-is: 1.1.0 + multibase: 0.6.1 + multicodec: 1.0.4 + multihashes: 0.4.21 + dev: true + + /cipher-base/1.0.4: + resolution: {integrity: sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==} + dependencies: + inherits: 2.0.4 + safe-buffer: 5.2.1 + dev: true + + /circular/1.0.5: + resolution: {integrity: sha512-n4Sspha+wxUl5zeA3JYp1zFCjsLz2VfXIe2gRKNQBrIX+7iPdGcCGZOF8W8IULtllZ/aejXtySfdFFt1wy/3JQ==} + dev: true + + /class-is/1.1.0: + resolution: {integrity: sha512-rhjH9AG1fvabIDoGRVH587413LPjTZgmDF9fOFCbFJQV4yuocX1mHxxvXI4g3cGwbVY9wAYIoKlg1N79frJKQw==} + dev: true + + /classic-level/1.4.1: + resolution: {integrity: sha512-qGx/KJl3bvtOHrGau2WklEZuXhS3zme+jf+fsu6Ej7W7IP/C49v7KNlWIsT1jZu0YnfzSIYDGcEWpCa1wKGWXQ==} + engines: {node: '>=12'} + requiresBuild: true + dependencies: + abstract-level: 1.0.4 + catering: 2.1.1 + module-error: 1.0.2 + napi-macros: 2.2.2 + node-gyp-build: 4.8.0 + dev: true + + /clean-stack/2.2.0: + resolution: {integrity: sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==} + engines: {node: '>=6'} + dev: true + + /cli-boxes/2.2.1: + resolution: {integrity: sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw==} + engines: {node: '>=6'} + dev: true + + /cli-cursor/3.1.0: + resolution: {integrity: sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==} + engines: {node: '>=8'} + dependencies: + restore-cursor: 3.1.0 + dev: true + + /cli-logger/0.5.40: + resolution: {integrity: sha512-piXVCa0TLm/+A7xdVEhw7t4OSrsmJaZIekWcoGrVMY1bHtLJTXgiNzgHlKT0EVHQ14sCKWorQJazU7UWgZhXOQ==} + dependencies: + circular: 1.0.5 + cli-util: 1.1.27 + dev: true + + /cli-regexp/0.1.2: + resolution: {integrity: sha512-L++cAQ5g0Nu6aV56B3uaR+c7jEGSAa4WApY1ZN7XiD8niJ5jRfXE/qvMwgz3uZBG0rft4hJS75Vpz2F3mSm4Mg==} + dev: true + + /cli-table3/0.5.1: + resolution: {integrity: sha512-7Qg2Jrep1S/+Q3EceiZtQcDPWxhAvBw+ERf1162v4sikJrvojMHFqXt8QIVha8UlH9rgU0BeWPytZ9/TzYqlUw==} + engines: {node: '>=6'} + dependencies: + object-assign: 4.1.1 + string-width: 2.1.1 + optionalDependencies: + colors: 1.4.0 + dev: true + + /cli-util/1.1.27: + resolution: {integrity: sha512-Z6+zI0kIrqf9Oi+PmUm8J9AELp8bTf2vCLYseudYtdOPNJvzpNiExO95aHIm477IbPdu/8SE9Wvc/M1kJl4Anw==} + dependencies: + cli-regexp: 0.1.2 + dev: true + + /cliui/3.2.0: + resolution: {integrity: sha512-0yayqDxWQbqk3ojkYqUKqaAQ6AfNKeKWRNA8kR0WXzAsdHpP4BIaOmMAG87JGuO6qcobyW4GjxHd9PmhEd+T9w==} + dependencies: + string-width: 1.0.2 + strip-ansi: 3.0.1 + wrap-ansi: 2.1.0 + dev: true + + /cliui/7.0.4: + resolution: {integrity: sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==} + dependencies: + string-width: 4.2.3 + strip-ansi: 6.0.1 + wrap-ansi: 7.0.0 + dev: true + + /clone-buffer/1.0.0: + resolution: {integrity: sha512-KLLTJWrvwIP+OPfMn0x2PheDEP20RPUcGXj/ERegTgdmPEZylALQldygiqrPPu8P45uNuPs7ckmReLY6v/iA5g==} + engines: {node: '>= 0.10'} + dev: true + optional: true + + /clone-response/1.0.3: + resolution: {integrity: sha512-ROoL94jJH2dUVML2Y/5PEDNaSHgeOdSDicUyS7izcF63G6sTc/FTjLub4b8Il9S8S0beOfYt0TaA5qvFK+w0wA==} + dependencies: + mimic-response: 1.0.1 + dev: true + + /code-error-fragment/0.0.230: + resolution: {integrity: sha512-cadkfKp6932H8UkhzE/gcUqhRMNf8jHzkAN7+5Myabswaghu4xABTgPHDCjW+dBAJxj/SpkTYokpzDqY4pCzQw==} + engines: {node: '>= 4'} + dev: true + + /code-point-at/1.1.0: + resolution: {integrity: sha512-RpAVKQA5T63xEj6/giIbUEtZwJ4UFIc3ZtvEkiaUERylqe8xb5IvqcgOurZLahv93CLKfxcw5YI+DZcUBRyLXA==} + engines: {node: '>=0.10.0'} + dev: true + + /color-convert/1.9.3: + resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==} + dependencies: + color-name: 1.1.3 + dev: true + + /color-convert/2.0.1: + resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} + engines: {node: '>=7.0.0'} + dependencies: + color-name: 1.1.4 + dev: true + + /color-name/1.1.3: + resolution: {integrity: sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==} + dev: true + + /color-name/1.1.4: + resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} + dev: true + + /colors/1.4.0: + resolution: {integrity: sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==} + engines: {node: '>=0.1.90'} + dev: true + + /combined-stream/1.0.8: + resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} + engines: {node: '>= 0.8'} + dependencies: + delayed-stream: 1.0.0 + dev: true + + /command-exists/1.2.9: + resolution: {integrity: sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w==} + dev: true + + /commander/10.0.1: + resolution: {integrity: sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==} + engines: {node: '>=14'} + dev: true + + /commander/2.20.3: + resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==} + dev: true + optional: true + + /commander/3.0.2: + resolution: {integrity: sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow==} + dev: true + + /commander/8.3.0: + resolution: {integrity: sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==} + engines: {node: '>= 12'} + dev: true + + /concat-map/0.0.1: + resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} + dev: true + + /concat-stream/1.6.2: + resolution: {integrity: sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==} + engines: {'0': node >= 0.8} + dependencies: + buffer-from: 1.1.2 + inherits: 2.0.4 + readable-stream: 2.3.8 + typedarray: 0.0.6 + dev: true + + /conf/10.2.0: + resolution: {integrity: sha512-8fLl9F04EJqjSqH+QjITQfJF8BrOVaYr1jewVgSRAEWePfxT0sku4w2hrGQ60BC/TNLGQ2pgxNlTbWQmMPFvXg==} + engines: {node: '>=12'} + dependencies: + ajv: 8.12.0 + ajv-formats: 2.1.1 + atomically: 1.7.0 + debounce-fn: 4.0.0 + dot-prop: 6.0.1 + env-paths: 2.2.1 + json-schema-typed: 7.0.3 + onetime: 5.1.2 + pkg-up: 3.1.0 + semver: 7.6.0 + dev: true + + /config-chain/1.1.13: + resolution: {integrity: sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ==} + dependencies: + ini: 1.3.8 + proto-list: 1.2.4 + dev: true + + /constant-case/2.0.0: + resolution: {integrity: sha512-eS0N9WwmjTqrOmR3o83F5vW8Z+9R1HnVz3xmzT2PMFug9ly+Au/fxRWlEBSb6LcZwspSsEn9Xs1uw9YgzAg1EQ==} + dependencies: + snake-case: 2.1.0 + upper-case: 1.1.3 + dev: true + + /content-disposition/0.5.4: + resolution: {integrity: sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==} + engines: {node: '>= 0.6'} + dependencies: + safe-buffer: 5.2.1 + dev: true + + /content-hash/2.5.2: + resolution: {integrity: sha512-FvIQKy0S1JaWV10sMsA7TRx8bpU+pqPkhbsfvOJAdjRXvYxEckAwQWGwtRjiaJfh+E0DvcWUGqcdjwMGFjsSdw==} + dependencies: + cids: 0.7.5 + multicodec: 0.5.7 + multihashes: 0.4.21 + dev: true + + /content-type/1.0.5: + resolution: {integrity: sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==} + engines: {node: '>= 0.6'} + dev: true + + /cookie-signature/1.0.6: + resolution: {integrity: sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==} + dev: true + + /cookie/0.4.2: + resolution: {integrity: sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==} + engines: {node: '>= 0.6'} + dev: true + + /cookie/0.5.0: + resolution: {integrity: sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==} + engines: {node: '>= 0.6'} + dev: true + + /core-js/3.36.0: + resolution: {integrity: sha512-mt7+TUBbTFg5+GngsAxeKBTl5/VS0guFeJacYge9OmHb+m058UwwIm41SE9T4Den7ClatV57B6TYTuJ0CX1MAw==} + requiresBuild: true + dev: true + + /core-util-is/1.0.2: + resolution: {integrity: sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==} + dev: true + + /core-util-is/1.0.3: + resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==} + dev: true + + /cors/2.8.5: + resolution: {integrity: sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==} + engines: {node: '>= 0.10'} + dependencies: + object-assign: 4.1.1 + vary: 1.1.2 + dev: true + + /cosmiconfig/8.3.6: + resolution: {integrity: sha512-kcZ6+W5QzcJ3P1Mt+83OUv/oHFqZHIx8DuxG6eZ5RGMERoLqp4BuGjhHLYGK+Kf5XVkQvqBSmAy/nGWN3qDgEA==} + engines: {node: '>=14'} + peerDependencies: + typescript: '>=4.9.5' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + import-fresh: 3.3.0 + js-yaml: 4.1.0 + parse-json: 5.2.0 + path-type: 4.0.0 + dev: true + + /crc-32/1.2.2: + resolution: {integrity: sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==} + engines: {node: '>=0.8'} + hasBin: true + dev: true + + /create-hash/1.2.0: + resolution: {integrity: sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==} + dependencies: + cipher-base: 1.0.4 + inherits: 2.0.4 + md5.js: 1.3.5 + ripemd160: 2.0.2 + sha.js: 2.4.11 + dev: true + + /create-hmac/1.1.7: + resolution: {integrity: sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==} + dependencies: + cipher-base: 1.0.4 + create-hash: 1.2.0 + inherits: 2.0.4 + ripemd160: 2.0.2 + safe-buffer: 5.2.1 + sha.js: 2.4.11 + dev: true + + /cross-fetch/3.1.8: + resolution: {integrity: sha512-cvA+JwZoU0Xq+h6WkMvAUqPEYy92Obet6UdKLfW60qn99ftItKjB5T+BkyWOFWe2pUyfQ+IJHmpOTznqk1M6Kg==} + dependencies: + node-fetch: 2.7.0 + transitivePeerDependencies: + - encoding + dev: true + + /cross-fetch/4.0.0: + resolution: {integrity: sha512-e4a5N8lVvuLgAWgnCrLr2PP0YyDOTHa9H/Rj54dirp61qXnNq46m82bRhNqIA5VccJtWBvPTFRV3TtvHUKPB1g==} + dependencies: + node-fetch: 2.7.0 + transitivePeerDependencies: + - encoding + dev: true + + /cross-spawn/7.0.3: + resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} + engines: {node: '>= 8'} + dependencies: + path-key: 3.1.1 + shebang-command: 2.0.0 + which: 2.0.2 + dev: true + + /crypt/0.0.2: + resolution: {integrity: sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow==} + dev: true + + /crypto-addr-codec/0.1.8: + resolution: {integrity: sha512-GqAK90iLLgP3FvhNmHbpT3wR6dEdaM8hZyZtLX29SPardh3OA13RFLHDR6sntGCgRWOfiHqW6sIyohpNqOtV/g==} + dependencies: + base-x: 3.0.9 + big-integer: 1.6.36 + blakejs: 1.2.1 + bs58: 4.0.1 + ripemd160-min: 0.0.6 + safe-buffer: 5.2.1 + sha3: 2.1.4 + dev: true + + /css-select/5.1.0: + resolution: {integrity: sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==} + dependencies: + boolbase: 1.0.0 + css-what: 6.1.0 + domhandler: 5.0.3 + domutils: 3.1.0 + nth-check: 2.1.1 + dev: true + + /css-what/6.1.0: + resolution: {integrity: sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==} + engines: {node: '>= 6'} + dev: true + + /cssfilter/0.0.10: + resolution: {integrity: sha512-FAaLDaplstoRsDR8XGYH51znUN0UY7nMc6Z9/fvE8EXGwvJE9hu7W2vHwx1+bd6gCYnln9nLbzxFTrcO9YQDZw==} + dev: true + optional: true + + /custom-error-test-helper/1.0.6: + resolution: {integrity: sha512-mtSur97B5c2Nxx0HS7VQtVl9FMNl/Xf13RxTWwfMLIKnNVror/e43ll6VWjs+J5gP2E6AZn5+Z0AqTNF5UXIcw==} + dependencies: + '@ethersproject/abi': 5.7.0 + '@ethersproject/bytes': 5.7.0 + '@ethersproject/solidity': 5.7.0 + chai: 4.4.1 + dev: true + + /d/1.0.1: + resolution: {integrity: sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==} + dependencies: + es5-ext: 0.10.62 + type: 1.2.0 + dev: true + + /dashdash/1.14.1: + resolution: {integrity: sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g==} + engines: {node: '>=0.10'} + dependencies: + assert-plus: 1.0.0 + dev: true + + /dataloader/2.1.0: + resolution: {integrity: sha512-qTcEYLen3r7ojZNgVUaRggOI+KM7jrKxXeSHhogh/TWxYMeONEMqY+hmkobiYQozsGIyg9OYVzO4ZIfoB4I0pQ==} + dev: true + optional: true + + /debounce-fn/4.0.0: + resolution: {integrity: sha512-8pYCQiL9Xdcg0UPSD3d+0KMlOjp+KGU5EPwYddgzQ7DATsg4fuUDjQtsYLmWjnk2obnNHgV3vE2Y4jejSOJVBQ==} + engines: {node: '>=10'} + dependencies: + mimic-fn: 3.1.0 + dev: true + + /debug/2.6.9: + resolution: {integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + dependencies: + ms: 2.0.0 + dev: true + + /debug/3.1.0: + resolution: {integrity: sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + dependencies: + ms: 2.0.0 + dev: true + optional: true + + /debug/3.2.7: + resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + dependencies: + ms: 2.1.3 + dev: true + + /debug/4.3.4: + resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + dependencies: + ms: 2.1.2 + dev: true + + /debug/4.3.4_supports-color@8.1.1: + resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + dependencies: + ms: 2.1.2 + supports-color: 8.1.1 + dev: true + + /decamelize/1.2.0: + resolution: {integrity: sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==} + engines: {node: '>=0.10.0'} + dev: true + + /decamelize/4.0.0: + resolution: {integrity: sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==} + engines: {node: '>=10'} + dev: true + + /decode-uri-component/0.2.2: + resolution: {integrity: sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==} + engines: {node: '>=0.10'} + dev: true + + /decompress-response/3.3.0: + resolution: {integrity: sha512-BzRPQuY1ip+qDonAOz42gRm/pg9F768C+npV/4JOsxRC2sq+Rlk+Q4ZCAsOhnIaMrgarILY+RMUIvMmmX1qAEA==} + engines: {node: '>=4'} + dependencies: + mimic-response: 1.0.1 + dev: true + + /decompress-response/6.0.0: + resolution: {integrity: sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==} + engines: {node: '>=10'} + dependencies: + mimic-response: 3.1.0 + dev: true + + /deep-eql/4.1.3: + resolution: {integrity: sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==} + engines: {node: '>=6'} + dependencies: + type-detect: 4.0.8 + dev: true + + /deep-extend/0.6.0: + resolution: {integrity: sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==} + engines: {node: '>=4.0.0'} + dev: true + + /deep-is/0.1.4: + resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} + dev: true + + /defer-to-connect/2.0.1: + resolution: {integrity: sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg==} + engines: {node: '>=10'} + dev: true + + /deferred-leveldown/5.3.0: + resolution: {integrity: sha512-a59VOT+oDy7vtAbLRCZwWgxu2BaCfd5Hk7wxJd48ei7I+nsg8Orlb9CLG0PMZienk9BSUKgeAqkO2+Lw+1+Ukw==} + engines: {node: '>=6'} + dependencies: + abstract-leveldown: 6.2.3 + inherits: 2.0.4 + dev: true + optional: true + + /define-data-property/1.1.4: + resolution: {integrity: sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==} + engines: {node: '>= 0.4'} + dependencies: + es-define-property: 1.0.0 + es-errors: 1.3.0 + gopd: 1.0.1 + dev: true + + /define-properties/1.2.1: + resolution: {integrity: sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==} + engines: {node: '>= 0.4'} + dependencies: + define-data-property: 1.1.4 + has-property-descriptors: 1.0.2 + object-keys: 1.1.1 + dev: true + + /delay/5.0.0: + resolution: {integrity: sha512-ReEBKkIfe4ya47wlPYf/gu5ib6yUG0/Aez0JQZQz94kiWtRQvZIQbTiehsnwHvLSWJnQdhVeqYue7Id1dKr0qw==} + engines: {node: '>=10'} + dev: true + + /delayed-stream/1.0.0: + resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} + engines: {node: '>=0.4.0'} + dev: true + + /depd/2.0.0: + resolution: {integrity: sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==} + engines: {node: '>= 0.8'} + dev: true + + /destroy/1.2.0: + resolution: {integrity: sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==} + engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16} + dev: true + + /detect-indent/5.0.0: + resolution: {integrity: sha512-rlpvsxUtM0PQvy9iZe640/IWwWYyBsTApREbA1pHOpmOUIl9MkP/U4z7vTtg4Oaojvqhxt7sdufnT0EzGaR31g==} + engines: {node: '>=4'} + dev: true + + /detect-installed/2.0.4: + resolution: {integrity: sha512-IpGo06Ff/rMGTKjFvVPbY9aE4mRT2XP3eYHC/ZS25LKDr2h8Gbv74Ez2q/qd7IYDqD9ZjI/VGedHNXsbKZ/Eig==} + engines: {node: '>=4', npm: '>=2'} + dependencies: + get-installed-path: 2.1.1 + dev: true + + /diff/5.0.0: + resolution: {integrity: sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==} + engines: {node: '>=0.3.1'} + dev: true + + /doctrine/2.1.0: + resolution: {integrity: sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==} + engines: {node: '>=0.10.0'} + dependencies: + esutils: 2.0.3 + dev: true + + /doctrine/3.0.0: + resolution: {integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==} + engines: {node: '>=6.0.0'} + dependencies: + esutils: 2.0.3 + dev: true + + /dom-serializer/2.0.0: + resolution: {integrity: sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==} + dependencies: + domelementtype: 2.3.0 + domhandler: 5.0.3 + entities: 4.5.0 + dev: true + + /dom-walk/0.1.2: + resolution: {integrity: sha512-6QvTW9mrGeIegrFXdtQi9pk7O/nSK6lSdXW2eqUspN5LWD7UTji2Fqw5V2YLjBpHEoU9Xl/eUWNpDeZvoyOv2w==} + dev: true + + /domelementtype/2.3.0: + resolution: {integrity: sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==} + dev: true + + /domhandler/5.0.3: + resolution: {integrity: sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==} + engines: {node: '>= 4'} + dependencies: + domelementtype: 2.3.0 + dev: true + + /domutils/3.1.0: + resolution: {integrity: sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==} + dependencies: + dom-serializer: 2.0.0 + domelementtype: 2.3.0 + domhandler: 5.0.3 + dev: true + + /dot-case/2.1.1: + resolution: {integrity: sha512-HnM6ZlFqcajLsyudHq7LeeLDr2rFAVYtDv/hV5qchQEidSck8j9OPUsXY9KwJv/lHMtYlX4DjRQqwFYa+0r8Ug==} + dependencies: + no-case: 2.3.2 + dev: true + + /dot-prop/6.0.1: + resolution: {integrity: sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA==} + engines: {node: '>=10'} + dependencies: + is-obj: 2.0.0 + dev: true + + /dotenv/16.4.4: + resolution: {integrity: sha512-XvPXc8XAQThSjAbY6cQ/9PcBXmFoWuw1sQ3b8HqUCR6ziGXjkTi//kB9SWa2UwqlgdAIuRqAa/9hVljzPehbYg==} + engines: {node: '>=12'} + dev: false + + /double-ended-queue/2.1.0-0: + resolution: {integrity: sha512-+BNfZ+deCo8hMNpDqDnvT+c0XpJ5cUa6mqYq89bho2Ifze4URTqRkcwR399hWoTrTkbZ/XJYDgP6rc7pRgffEQ==} + dev: true + optional: true + + /ecc-jsbn/0.1.2: + resolution: {integrity: sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw==} + dependencies: + jsbn: 0.1.1 + safer-buffer: 2.1.2 + dev: true + + /ee-first/1.1.1: + resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} + dev: true + + /elliptic/6.5.4: + resolution: {integrity: sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==} + dependencies: + bn.js: 4.12.0 + brorand: 1.1.0 + hash.js: 1.1.7 + hmac-drbg: 1.0.1 + inherits: 2.0.4 + minimalistic-assert: 1.0.1 + minimalistic-crypto-utils: 1.0.1 + dev: true + + /emittery/0.10.0: + resolution: {integrity: sha512-AGvFfs+d0JKCJQ4o01ASQLGPmSCxgfU9RFXvzPvZdjKK8oscynksuJhWrSTSw7j7Ep/sZct5b5ZhYCi8S/t0HQ==} + engines: {node: '>=12'} + dev: true + + /emittery/0.4.1: + resolution: {integrity: sha512-r4eRSeStEGf6M5SKdrQhhLK5bOwOBxQhIE3YSTnZE3GpKiLfnnhE+tPtrJE79+eDJgm39BM6LSoI8SCx4HbwlQ==} + engines: {node: '>=6'} + dev: true + + /emoji-regex/8.0.0: + resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} + dev: true + + /encodeurl/1.0.2: + resolution: {integrity: sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==} + engines: {node: '>= 0.8'} + dev: true + + /encoding-down/6.3.0: + resolution: {integrity: sha512-QKrV0iKR6MZVJV08QY0wp1e7vF6QbhnbQhb07bwpEyuz4uZiZgPlEGdkCROuFkUwdxlFaiPIhjyarH1ee/3vhw==} + engines: {node: '>=6'} + dependencies: + abstract-leveldown: 6.2.3 + inherits: 2.0.4 + level-codec: 9.0.2 + level-errors: 2.0.1 + dev: true + optional: true + + /end-of-stream/1.4.4: + resolution: {integrity: sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==} + dependencies: + once: 1.4.0 + dev: true + + /end-stream/0.1.0: + resolution: {integrity: sha512-Brl10T8kYnc75IepKizW6Y9liyW8ikz1B7n/xoHrJxoVSSjoqPn30sb7XVFfQERK4QfUMYRGs9dhWwtt2eu6uA==} + dependencies: + write-stream: 0.4.3 + dev: true + optional: true + + /enquirer/2.4.1: + resolution: {integrity: sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ==} + engines: {node: '>=8.6'} + dependencies: + ansi-colors: 4.1.3 + strip-ansi: 6.0.1 + dev: true + + /entities/4.5.0: + resolution: {integrity: sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==} + engines: {node: '>=0.12'} + dev: true + + /env-paths/2.2.1: + resolution: {integrity: sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==} + engines: {node: '>=6'} + dev: true + + /errno/0.1.8: + resolution: {integrity: sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A==} + hasBin: true + dependencies: + prr: 1.0.1 + dev: true + optional: true + + /error-ex/1.3.2: + resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==} + dependencies: + is-arrayish: 0.2.1 + dev: true + + /es-abstract/1.22.4: + resolution: {integrity: sha512-vZYJlk2u6qHYxBOTjAeg7qUxHdNfih64Uu2J8QqWgXZ2cri0ZpJAkzDUK/q593+mvKwlxyaxr6F1Q+3LKoQRgg==} + engines: {node: '>= 0.4'} + dependencies: + array-buffer-byte-length: 1.0.1 + arraybuffer.prototype.slice: 1.0.3 + available-typed-arrays: 1.0.6 + call-bind: 1.0.7 + es-define-property: 1.0.0 + es-errors: 1.3.0 + es-set-tostringtag: 2.0.2 + es-to-primitive: 1.2.1 + function.prototype.name: 1.1.6 + get-intrinsic: 1.2.4 + get-symbol-description: 1.0.2 + globalthis: 1.0.3 + gopd: 1.0.1 + has-property-descriptors: 1.0.2 + has-proto: 1.0.1 + has-symbols: 1.0.3 + hasown: 2.0.1 + internal-slot: 1.0.7 + is-array-buffer: 3.0.4 + is-callable: 1.2.7 + is-negative-zero: 2.0.2 + is-regex: 1.1.4 + is-shared-array-buffer: 1.0.2 + is-string: 1.0.7 + is-typed-array: 1.1.13 + is-weakref: 1.0.2 + object-inspect: 1.13.1 + object-keys: 1.1.1 + object.assign: 4.1.5 + regexp.prototype.flags: 1.5.2 + safe-array-concat: 1.1.0 + safe-regex-test: 1.0.3 + string.prototype.trim: 1.2.8 + string.prototype.trimend: 1.0.7 + string.prototype.trimstart: 1.0.7 + typed-array-buffer: 1.0.1 + typed-array-byte-length: 1.0.0 + typed-array-byte-offset: 1.0.1 + typed-array-length: 1.0.4 + unbox-primitive: 1.0.2 + which-typed-array: 1.1.14 + dev: true + + /es-array-method-boxes-properly/1.0.0: + resolution: {integrity: sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA==} + dev: true + + /es-define-property/1.0.0: + resolution: {integrity: sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==} + engines: {node: '>= 0.4'} + dependencies: + get-intrinsic: 1.2.4 + dev: true + + /es-errors/1.3.0: + resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} + engines: {node: '>= 0.4'} + dev: true + + /es-set-tostringtag/2.0.2: + resolution: {integrity: sha512-BuDyupZt65P9D2D2vA/zqcI3G5xRsklm5N3xCwuiy+/vKy8i0ifdsQP1sLgO4tZDSCaQUSnmC48khknGMV3D2Q==} + engines: {node: '>= 0.4'} + dependencies: + get-intrinsic: 1.2.4 + has-tostringtag: 1.0.2 + hasown: 2.0.1 + dev: true + + /es-shim-unscopables/1.0.2: + resolution: {integrity: sha512-J3yBRXCzDu4ULnQwxyToo/OjdMx6akgVC7K6few0a7F/0wLtmKKN7I73AH5T2836UuXRqN7Qg+IIUw/+YJksRw==} + dependencies: + hasown: 2.0.1 + dev: true + + /es-to-primitive/1.2.1: + resolution: {integrity: sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==} + engines: {node: '>= 0.4'} + dependencies: + is-callable: 1.2.7 + is-date-object: 1.0.5 + is-symbol: 1.0.4 + dev: true + + /es5-ext/0.10.62: + resolution: {integrity: sha512-BHLqn0klhEpnOKSrzn/Xsz2UIW8j+cGmo9JLzr8BiUapV8hPL9+FliFqjwr9ngW7jWdnxv6eO+/LqyhJVqgrjA==} + engines: {node: '>=0.10'} + requiresBuild: true + dependencies: + es6-iterator: 2.0.3 + es6-symbol: 3.1.3 + next-tick: 1.1.0 + dev: true + + /es6-iterator/2.0.3: + resolution: {integrity: sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g==} + dependencies: + d: 1.0.1 + es5-ext: 0.10.62 + es6-symbol: 3.1.3 + dev: true + + /es6-promise/4.2.8: + resolution: {integrity: sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==} + dev: true + + /es6-symbol/3.1.3: + resolution: {integrity: sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==} + dependencies: + d: 1.0.1 + ext: 1.7.0 + dev: true + + /escalade/3.1.2: + resolution: {integrity: sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==} + engines: {node: '>=6'} + dev: true + + /escape-html/1.0.3: + resolution: {integrity: sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==} + dev: true + + /escape-string-regexp/1.0.5: + resolution: {integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==} + engines: {node: '>=0.8.0'} + dev: true + + /escape-string-regexp/4.0.0: + resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} + engines: {node: '>=10'} + dev: true + + /eslint-compat-utils/0.1.2_eslint@8.56.0: + resolution: {integrity: sha512-Jia4JDldWnFNIru1Ehx1H5s9/yxiRHY/TimCuUc0jNexew3cF1gI6CYZil1ociakfWO3rRqFjl1mskBblB3RYg==} + engines: {node: '>=12'} + peerDependencies: + eslint: '>=6.0.0' + dependencies: + eslint: 8.56.0 + dev: true + + /eslint-config-standard/17.1.0_ot4howdeavqht6h5s42eunnfxi: + resolution: {integrity: sha512-IwHwmaBNtDK4zDHQukFDW5u/aTb8+meQWZvNFWkiGmbWjD6bqyuSSBxxXKkCftCUzc1zwCH2m/baCNDLGmuO5Q==} + engines: {node: '>=12.0.0'} + peerDependencies: + eslint: ^8.0.1 + eslint-plugin-import: ^2.25.2 + eslint-plugin-n: '^15.0.0 || ^16.0.0 ' + eslint-plugin-promise: ^6.0.0 + dependencies: + eslint: 8.56.0 + eslint-plugin-import: 2.29.1_eslint@8.56.0 + eslint-plugin-n: 16.6.2_eslint@8.56.0 + eslint-plugin-promise: 6.1.1_eslint@8.56.0 + dev: true + + /eslint-import-resolver-node/0.3.9: + resolution: {integrity: sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==} + dependencies: + debug: 3.2.7 + is-core-module: 2.13.1 + resolve: 1.22.8 + transitivePeerDependencies: + - supports-color + dev: true + + /eslint-module-utils/2.8.0_rzg3ygvhoewmy7caurhnki56y4: + resolution: {integrity: sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==} + engines: {node: '>=4'} + peerDependencies: + '@typescript-eslint/parser': '*' + eslint: '*' + eslint-import-resolver-node: '*' + eslint-import-resolver-typescript: '*' + eslint-import-resolver-webpack: '*' + peerDependenciesMeta: + '@typescript-eslint/parser': + optional: true + eslint: + optional: true + eslint-import-resolver-node: + optional: true + eslint-import-resolver-typescript: + optional: true + eslint-import-resolver-webpack: + optional: true + dependencies: + debug: 3.2.7 + eslint: 8.56.0 + eslint-import-resolver-node: 0.3.9 + transitivePeerDependencies: + - supports-color + dev: true + + /eslint-plugin-es-x/7.5.0_eslint@8.56.0: + resolution: {integrity: sha512-ODswlDSO0HJDzXU0XvgZ3lF3lS3XAZEossh15Q2UHjwrJggWeBoKqqEsLTZLXl+dh5eOAozG0zRcYtuE35oTuQ==} + engines: {node: ^14.18.0 || >=16.0.0} + peerDependencies: + eslint: '>=8' + dependencies: + '@eslint-community/eslint-utils': 4.4.0_eslint@8.56.0 + '@eslint-community/regexpp': 4.10.0 + eslint: 8.56.0 + eslint-compat-utils: 0.1.2_eslint@8.56.0 + dev: true + + /eslint-plugin-import/2.29.1_eslint@8.56.0: + resolution: {integrity: sha512-BbPC0cuExzhiMo4Ff1BTVwHpjjv28C5R+btTOGaCRC7UEz801up0JadwkeSk5Ued6TG34uaczuVuH6qyy5YUxw==} + engines: {node: '>=4'} + peerDependencies: + '@typescript-eslint/parser': '*' + eslint: ^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 + peerDependenciesMeta: + '@typescript-eslint/parser': + optional: true + dependencies: + array-includes: 3.1.7 + array.prototype.findlastindex: 1.2.4 + array.prototype.flat: 1.3.2 + array.prototype.flatmap: 1.3.2 + debug: 3.2.7 + doctrine: 2.1.0 + eslint: 8.56.0 + eslint-import-resolver-node: 0.3.9 + eslint-module-utils: 2.8.0_rzg3ygvhoewmy7caurhnki56y4 + hasown: 2.0.1 + is-core-module: 2.13.1 + is-glob: 4.0.3 + minimatch: 3.1.2 + object.fromentries: 2.0.7 + object.groupby: 1.0.2 + object.values: 1.1.7 + semver: 6.3.1 + tsconfig-paths: 3.15.0 + transitivePeerDependencies: + - eslint-import-resolver-typescript + - eslint-import-resolver-webpack + - supports-color + dev: true + + /eslint-plugin-n/16.6.2_eslint@8.56.0: + resolution: {integrity: sha512-6TyDmZ1HXoFQXnhCTUjVFULReoBPOAjpuiKELMkeP40yffI/1ZRO+d9ug/VC6fqISo2WkuIBk3cvuRPALaWlOQ==} + engines: {node: '>=16.0.0'} + peerDependencies: + eslint: '>=7.0.0' + dependencies: + '@eslint-community/eslint-utils': 4.4.0_eslint@8.56.0 + builtins: 5.0.1 + eslint: 8.56.0 + eslint-plugin-es-x: 7.5.0_eslint@8.56.0 + get-tsconfig: 4.7.2 + globals: 13.24.0 + ignore: 5.3.1 + is-builtin-module: 3.2.1 + is-core-module: 2.13.1 + minimatch: 3.1.2 + resolve: 1.22.8 + semver: 7.6.0 + dev: true + + /eslint-plugin-promise/6.1.1_eslint@8.56.0: + resolution: {integrity: sha512-tjqWDwVZQo7UIPMeDReOpUgHCmCiH+ePnVT+5zVapL0uuHnegBUs2smM13CzOs2Xb5+MHMRFTs9v24yjba4Oig==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: ^7.0.0 || ^8.0.0 + dependencies: + eslint: 8.56.0 + dev: true + + /eslint-scope/7.2.2: + resolution: {integrity: sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dependencies: + esrecurse: 4.3.0 + estraverse: 5.3.0 + dev: true + + /eslint-visitor-keys/3.4.3: + resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dev: true + + /eslint/8.56.0: + resolution: {integrity: sha512-Go19xM6T9puCOWntie1/P997aXxFsOi37JIHRWI514Hc6ZnaHGKY9xFhrU65RT6CcBEzZoGG1e6Nq+DT04ZtZQ==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + hasBin: true + dependencies: + '@eslint-community/eslint-utils': 4.4.0_eslint@8.56.0 + '@eslint-community/regexpp': 4.10.0 + '@eslint/eslintrc': 2.1.4 + '@eslint/js': 8.56.0 + '@humanwhocodes/config-array': 0.11.14 + '@humanwhocodes/module-importer': 1.0.1 + '@nodelib/fs.walk': 1.2.8 + '@ungap/structured-clone': 1.2.0 + ajv: 6.12.6 + chalk: 4.1.2 + cross-spawn: 7.0.3 + debug: 4.3.4 + doctrine: 3.0.0 + escape-string-regexp: 4.0.0 + eslint-scope: 7.2.2 + eslint-visitor-keys: 3.4.3 + espree: 9.6.1 + esquery: 1.5.0 + esutils: 2.0.3 + fast-deep-equal: 3.1.3 + file-entry-cache: 6.0.1 + find-up: 5.0.0 + glob-parent: 6.0.2 + globals: 13.24.0 + graphemer: 1.4.0 + ignore: 5.3.1 + imurmurhash: 0.1.4 + is-glob: 4.0.3 + is-path-inside: 3.0.3 + js-yaml: 4.1.0 + json-stable-stringify-without-jsonify: 1.0.1 + levn: 0.4.1 + lodash.merge: 4.6.2 + minimatch: 3.1.2 + natural-compare: 1.4.0 + optionator: 0.9.3 + strip-ansi: 6.0.1 + text-table: 0.2.0 + transitivePeerDependencies: + - supports-color + dev: true + + /espree/9.6.1: + resolution: {integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dependencies: + acorn: 8.11.3 + acorn-jsx: 5.3.2_acorn@8.11.3 + eslint-visitor-keys: 3.4.3 + dev: true + + /esquery/1.5.0: + resolution: {integrity: sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==} + engines: {node: '>=0.10'} + dependencies: + estraverse: 5.3.0 + dev: true + + /esrecurse/4.3.0: + resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==} + engines: {node: '>=4.0'} + dependencies: + estraverse: 5.3.0 + dev: true + + /estraverse/5.3.0: + resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} + engines: {node: '>=4.0'} + dev: true + + /esutils/2.0.3: + resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} + engines: {node: '>=0.10.0'} + dev: true + + /etag/1.8.1: + resolution: {integrity: sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==} + engines: {node: '>= 0.6'} + dev: true + + /eth-ens-namehash/2.0.8: + resolution: {integrity: sha512-VWEI1+KJfz4Km//dadyvBBoBeSQ0MHTXPvr8UIXiLW6IanxvAV+DmlZAijZwAyggqGUfwQBeHf7tc9wzc1piSw==} + dependencies: + idna-uts46-hx: 2.3.1 + js-sha3: 0.5.7 + dev: true + + /eth-gas-reporter/0.2.27: + resolution: {integrity: sha512-femhvoAM7wL0GcI8ozTdxfuBtBFJ9qsyIAsmKVjlWAHUbdnnXHt+lKzz/kmldM5lA9jLuNHGwuIxorNpLbR1Zw==} + peerDependencies: + '@codechecks/client': ^0.1.0 + peerDependenciesMeta: + '@codechecks/client': + optional: true + dependencies: + '@solidity-parser/parser': 0.14.5 + axios: 1.6.7 + cli-table3: 0.5.1 + colors: 1.4.0 + ethereum-cryptography: 1.2.0 + ethers: 5.7.2 + fs-readdir-recursive: 1.1.0 + lodash: 4.17.21 + markdown-table: 1.1.3 + mocha: 10.3.0 + req-cwd: 2.0.0 + sha1: 1.1.1 + sync-request: 6.1.0 + transitivePeerDependencies: + - bufferutil + - debug + - utf-8-validate + dev: true + + /eth-helpers/1.3.1: + resolution: {integrity: sha512-iEcqhro1pqnZbnE3te0KDargTadc1J4zAiV0J1dwBDPo5nbHYBMxPDLQFA+0sMKUxe7cjHtMger6/75ukN3P5A==} + dependencies: + nanoassert: 2.0.0 + dev: true + + /eth-lib/0.1.29: + resolution: {integrity: sha512-bfttrr3/7gG4E02HoWTDUcDDslN003OlOoBxk9virpAZQ1ja/jDgwkWB8QfJF7ojuEowrqy+lzp9VcJG7/k5bQ==} + dependencies: + bn.js: 4.12.0 + elliptic: 6.5.4 + nano-json-stream-parser: 0.1.2 + servify: 0.1.12 + ws: 3.3.3 + xhr-request-promise: 0.1.3 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + dev: true + + /eth-lib/0.2.8: + resolution: {integrity: sha512-ArJ7x1WcWOlSpzdoTBX8vkwlkSQ85CjjifSZtV4co64vWxSV8geWfPI9x4SVYu3DSxnX4yWFVTtGL+j9DUFLNw==} + dependencies: + bn.js: 4.12.0 + elliptic: 6.5.4 + xhr-request-promise: 0.1.3 + dev: true + + /ethereum-bloom-filters/1.0.10: + resolution: {integrity: sha512-rxJ5OFN3RwjQxDcFP2Z5+Q9ho4eIdEmSc2ht0fCu8Se9nbXjZ7/031uXoUYJ87KHCOdVeiUuwSnoS7hmYAGVHA==} + dependencies: + js-sha3: 0.8.0 + dev: true + + /ethereum-cryptography/0.1.3: + resolution: {integrity: sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==} + dependencies: + '@types/pbkdf2': 3.1.2 + '@types/secp256k1': 4.0.6 + blakejs: 1.2.1 + browserify-aes: 1.2.0 + bs58check: 2.1.2 + create-hash: 1.2.0 + create-hmac: 1.1.7 + hash.js: 1.1.7 + keccak: 3.0.4 + pbkdf2: 3.1.2 + randombytes: 2.1.0 + safe-buffer: 5.2.1 + scrypt-js: 3.0.1 + secp256k1: 4.0.3 + setimmediate: 1.0.5 + dev: true + + /ethereum-cryptography/1.2.0: + resolution: {integrity: sha512-6yFQC9b5ug6/17CQpCyE3k9eKBMdhyVjzUy1WkiuY/E4vj/SXDBbCw8QEIaXqf0Mf2SnY6RmpDcwlUmBSS0EJw==} + dependencies: + '@noble/hashes': 1.2.0 + '@noble/secp256k1': 1.7.1 + '@scure/bip32': 1.1.5 + '@scure/bip39': 1.1.1 + dev: true + + /ethereum-cryptography/2.1.3: + resolution: {integrity: sha512-BlwbIL7/P45W8FGW2r7LGuvoEZ+7PWsniMvQ4p5s2xCyw9tmaDlpfsN9HjAucbF+t/qpVHwZUisgfK24TCW8aA==} + dependencies: + '@noble/curves': 1.3.0 + '@noble/hashes': 1.3.3 + '@scure/bip32': 1.3.3 + '@scure/bip39': 1.2.2 + dev: true + + /ethereumjs-abi/0.6.8: + resolution: {integrity: sha512-Tx0r/iXI6r+lRsdvkFDlut0N08jWMnKRZ6Gkq+Nmw75lZe4e6o3EkSnkaBP5NF6+m5PTGAr9JP43N3LyeoglsA==} + dependencies: + bn.js: 4.12.0 + ethereumjs-util: 6.2.1 + dev: true + + /ethereumjs-util/6.2.1: + resolution: {integrity: sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==} + dependencies: + '@types/bn.js': 4.11.6 + bn.js: 4.12.0 + create-hash: 1.2.0 + elliptic: 6.5.4 + ethereum-cryptography: 0.1.3 + ethjs-util: 0.1.6 + rlp: 2.2.7 + dev: true + + /ethereumjs-util/7.1.5: + resolution: {integrity: sha512-SDl5kKrQAudFBUe5OJM9Ac6WmMyYmXX/6sTmLZ3ffG2eY6ZIGBes3pEDxNN6V72WyOw4CPD5RomKdsa8DAAwLg==} + engines: {node: '>=10.0.0'} + dependencies: + '@types/bn.js': 5.1.5 + bn.js: 5.2.1 + create-hash: 1.2.0 + ethereum-cryptography: 0.1.3 + rlp: 2.2.7 + dev: true + + /ethers/4.0.49: + resolution: {integrity: sha512-kPltTvWiyu+OktYy1IStSO16i2e7cS9D9OxZ81q2UUaiNPVrm/RTcbxamCXF9VUSKzJIdJV68EAIhTEVBalRWg==} + dependencies: + aes-js: 3.0.0 + bn.js: 4.12.0 + elliptic: 6.5.4 + hash.js: 1.1.3 + js-sha3: 0.5.7 + scrypt-js: 2.0.4 + setimmediate: 1.0.4 + uuid: 2.0.1 + xmlhttprequest: 1.8.0 + dev: true + + /ethers/5.7.2: + resolution: {integrity: sha512-wswUsmWo1aOK8rR7DIKiWSw9DbLWe6x98Jrn8wcTflTVvaXhAMaB5zGAXy0GYQEQp9iO1iSHWVyARQm11zUtyg==} + dependencies: + '@ethersproject/abi': 5.7.0 + '@ethersproject/abstract-provider': 5.7.0 + '@ethersproject/abstract-signer': 5.7.0 + '@ethersproject/address': 5.7.0 + '@ethersproject/base64': 5.7.0 + '@ethersproject/basex': 5.7.0 + '@ethersproject/bignumber': 5.7.0 + '@ethersproject/bytes': 5.7.0 + '@ethersproject/constants': 5.7.0 + '@ethersproject/contracts': 5.7.0 + '@ethersproject/hash': 5.7.0 + '@ethersproject/hdnode': 5.7.0 + '@ethersproject/json-wallets': 5.7.0 + '@ethersproject/keccak256': 5.7.0 + '@ethersproject/logger': 5.7.0 + '@ethersproject/networks': 5.7.1 + '@ethersproject/pbkdf2': 5.7.0 + '@ethersproject/properties': 5.7.0 + '@ethersproject/providers': 5.7.2 + '@ethersproject/random': 5.7.0 + '@ethersproject/rlp': 5.7.0 + '@ethersproject/sha2': 5.7.0 + '@ethersproject/signing-key': 5.7.0 + '@ethersproject/solidity': 5.7.0 + '@ethersproject/strings': 5.7.0 + '@ethersproject/transactions': 5.7.0 + '@ethersproject/units': 5.7.0 + '@ethersproject/wallet': 5.7.0 + '@ethersproject/web': 5.7.1 + '@ethersproject/wordlists': 5.7.0 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + dev: true + + /ethjs-abi/0.2.1: + resolution: {integrity: sha512-g2AULSDYI6nEJyJaEVEXtTimRY2aPC2fi7ddSy0W+LXvEVL8Fe1y76o43ecbgdUKwZD+xsmEgX1yJr1Ia3r1IA==} + engines: {node: '>=6.5.0', npm: '>=3'} + dependencies: + bn.js: 4.11.6 + js-sha3: 0.5.5 + number-to-bn: 1.7.0 + dev: true + + /ethjs-unit/0.1.6: + resolution: {integrity: sha512-/Sn9Y0oKl0uqQuvgFk/zQgR7aw1g36qX/jzSQ5lSwlO0GigPymk4eGQfeNTD03w1dPOqfz8V77Cy43jH56pagw==} + engines: {node: '>=6.5.0', npm: '>=3'} + dependencies: + bn.js: 4.11.6 + number-to-bn: 1.7.0 + dev: true + + /ethjs-util/0.1.6: + resolution: {integrity: sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w==} + engines: {node: '>=6.5.0', npm: '>=3'} + dependencies: + is-hex-prefixed: 1.0.0 + strip-hex-prefix: 1.0.0 + dev: true + + /event-target-shim/5.0.1: + resolution: {integrity: sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==} + engines: {node: '>=6'} + dev: true + optional: true + + /eventemitter3/4.0.4: + resolution: {integrity: sha512-rlaVLnVxtxvoyLsQQFBx53YmXHDxRIzzTLbdfxqi4yocpSjAxXwkU0cScM5JgSKMqEhrZpnvQ2D9gjylR0AimQ==} + dev: true + + /evp_bytestokey/1.0.3: + resolution: {integrity: sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==} + dependencies: + md5.js: 1.3.5 + safe-buffer: 5.2.1 + dev: true + + /expand-tilde/2.0.2: + resolution: {integrity: sha512-A5EmesHW6rfnZ9ysHQjPdJRni0SRar0tjtG5MNtm9n5TUvsYU8oozprtRD4AqHxcZWWlVuAmQo2nWKfN9oyjTw==} + engines: {node: '>=0.10.0'} + dependencies: + homedir-polyfill: 1.0.3 + dev: true + + /express/4.18.2: + resolution: {integrity: sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==} + engines: {node: '>= 0.10.0'} + dependencies: + accepts: 1.3.8 + array-flatten: 1.1.1 + body-parser: 1.20.1 + content-disposition: 0.5.4 + content-type: 1.0.5 + cookie: 0.5.0 + cookie-signature: 1.0.6 + debug: 2.6.9 + depd: 2.0.0 + encodeurl: 1.0.2 + escape-html: 1.0.3 + etag: 1.8.1 + finalhandler: 1.2.0 + fresh: 0.5.2 + http-errors: 2.0.0 + merge-descriptors: 1.0.1 + methods: 1.1.2 + on-finished: 2.4.1 + parseurl: 1.3.3 + path-to-regexp: 0.1.7 + proxy-addr: 2.0.7 + qs: 6.11.0 + range-parser: 1.2.1 + safe-buffer: 5.2.1 + send: 0.18.0 + serve-static: 1.15.0 + setprototypeof: 1.2.0 + statuses: 2.0.1 + type-is: 1.6.18 + utils-merge: 1.0.1 + vary: 1.1.2 + transitivePeerDependencies: + - supports-color + dev: true + + /ext/1.7.0: + resolution: {integrity: sha512-6hxeJYaL110a9b5TEJSj0gojyHQAmA2ch5Os+ySCiA1QGdS697XWY1pzsrSjqA9LDEEgdB/KypIlR59RcLuHYw==} + dependencies: + type: 2.7.2 + dev: true + + /extend/3.0.2: + resolution: {integrity: sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==} + dev: true + + /extsprintf/1.3.0: + resolution: {integrity: sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g==} + engines: {'0': node >=0.6.0} + dev: true + + /fast-check/3.1.1: + resolution: {integrity: sha512-3vtXinVyuUKCKFKYcwXhGE6NtGWkqF8Yh3rvMZNzmwz8EPrgoc/v4pDdLHyLnCyCI5MZpZZkDEwFyXyEONOxpA==} + engines: {node: '>=8.0.0'} + dependencies: + pure-rand: 5.0.5 + dev: true + + /fast-deep-equal/3.1.3: + resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} + dev: true + + /fast-diff/1.3.0: + resolution: {integrity: sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==} + dev: true + + /fast-json-stable-stringify/2.1.0: + resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} + dev: true + + /fast-levenshtein/2.0.6: + resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} + dev: true + + /fastq/1.17.1: + resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} + dependencies: + reusify: 1.0.4 + dev: true + + /fetch-cookie/0.11.0: + resolution: {integrity: sha512-BQm7iZLFhMWFy5CZ/162sAGjBfdNWb7a8LEqqnzsHFhxT/X/SVj/z2t2nu3aJvjlbQkrAlTUApplPRjWyH4mhA==} + engines: {node: '>=8'} + dependencies: + tough-cookie: 4.1.3 + dev: true + optional: true + + /file-entry-cache/6.0.1: + resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==} + engines: {node: ^10.12.0 || >=12.0.0} + dependencies: + flat-cache: 3.2.0 + dev: true + + /fill-range/7.0.1: + resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==} + engines: {node: '>=8'} + dependencies: + to-regex-range: 5.0.1 + dev: true + + /finalhandler/1.2.0: + resolution: {integrity: sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==} + engines: {node: '>= 0.8'} + dependencies: + debug: 2.6.9 + encodeurl: 1.0.2 + escape-html: 1.0.3 + on-finished: 2.4.1 + parseurl: 1.3.3 + statuses: 2.0.1 + unpipe: 1.0.0 + transitivePeerDependencies: + - supports-color + dev: true + + /find-up/1.1.2: + resolution: {integrity: sha512-jvElSjyuo4EMQGoTwo1uJU5pQMwTW5lS1x05zzfJuTIyLR3zwO27LYrxNg+dlvKpGOuGy/MzBdXh80g0ve5+HA==} + engines: {node: '>=0.10.0'} + dependencies: + path-exists: 2.1.0 + pinkie-promise: 2.0.1 + dev: true + + /find-up/2.1.0: + resolution: {integrity: sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ==} + engines: {node: '>=4'} + dependencies: + locate-path: 2.0.0 + dev: true + + /find-up/3.0.0: + resolution: {integrity: sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==} + engines: {node: '>=6'} + dependencies: + locate-path: 3.0.0 + dev: true + + /find-up/4.1.0: + resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==} + engines: {node: '>=8'} + dependencies: + locate-path: 5.0.0 + path-exists: 4.0.0 + dev: true + + /find-up/5.0.0: + resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==} + engines: {node: '>=10'} + dependencies: + locate-path: 6.0.0 + path-exists: 4.0.0 + dev: true + + /flat-cache/3.2.0: + resolution: {integrity: sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==} + engines: {node: ^10.12.0 || >=12.0.0} + dependencies: + flatted: 3.2.9 + keyv: 4.5.4 + rimraf: 3.0.2 + dev: true + + /flat/5.0.2: + resolution: {integrity: sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==} + hasBin: true + dev: true + + /flatted/3.2.9: + resolution: {integrity: sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==} + dev: true + + /follow-redirects/1.15.5: + resolution: {integrity: sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==} + engines: {node: '>=4.0'} + peerDependencies: + debug: '*' + peerDependenciesMeta: + debug: + optional: true + dev: true + + /for-each/0.3.3: + resolution: {integrity: sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==} + dependencies: + is-callable: 1.2.7 + dev: true + + /foreach/2.0.6: + resolution: {integrity: sha512-k6GAGDyqLe9JaebCsFCoudPPWfihKu8pylYXRlqP1J7ms39iPoTtk2fviNglIeQEwdh0bQeKJ01ZPyuyQvKzwg==} + dev: true + + /forever-agent/0.6.1: + resolution: {integrity: sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==} + dev: true + + /form-data-encoder/1.7.1: + resolution: {integrity: sha512-EFRDrsMm/kyqbTQocNvRXMLjc7Es2Vk+IQFx/YW7hkUH1eBl4J1fqiP34l74Yt0pFLCNpc06fkbVk00008mzjg==} + dev: true + + /form-data-encoder/2.1.4: + resolution: {integrity: sha512-yDYSgNMraqvnxiEXO4hi88+YZxaHC6QKzb5N84iRCTDeRO7ZALpir/lVmf/uXUhnwUr2O4HU8s/n6x+yNjQkHw==} + engines: {node: '>= 14.17'} + dev: true + + /form-data/2.3.3: + resolution: {integrity: sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==} + engines: {node: '>= 0.12'} + dependencies: + asynckit: 0.4.0 + combined-stream: 1.0.8 + mime-types: 2.1.35 + dev: true + + /form-data/2.5.1: + resolution: {integrity: sha512-m21N3WOmEEURgk6B9GLOE4RuWOFf28Lhh9qGYeNlGq4VDXUlJy2th2slBNU8Gp8EzloYZOibZJ7t5ecIrFSjVA==} + engines: {node: '>= 0.12'} + dependencies: + asynckit: 0.4.0 + combined-stream: 1.0.8 + mime-types: 2.1.35 + dev: true + + /form-data/4.0.0: + resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} + engines: {node: '>= 6'} + dependencies: + asynckit: 0.4.0 + combined-stream: 1.0.8 + mime-types: 2.1.35 + dev: true + + /forwarded/0.2.0: + resolution: {integrity: sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==} + engines: {node: '>= 0.6'} + dev: true + + /fp-ts/1.19.3: + resolution: {integrity: sha512-H5KQDspykdHuztLTg+ajGN0Z2qUjcEf3Ybxc6hLt0k7/zPkn29XnKnxlBPyW2XIddWrGaJBzBl4VLYOtk39yZg==} + dev: true + + /fresh/0.5.2: + resolution: {integrity: sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==} + engines: {node: '>= 0.6'} + dev: true + + /fs-extra/0.30.0: + resolution: {integrity: sha512-UvSPKyhMn6LEd/WpUaV9C9t3zATuqoqfWc3QdPhPLb58prN9tqYPlPWi8Krxi44loBoUzlobqZ3+8tGpxxSzwA==} + dependencies: + graceful-fs: 4.2.11 + jsonfile: 2.4.0 + klaw: 1.3.1 + path-is-absolute: 1.0.1 + rimraf: 2.7.1 + dev: true + + /fs-extra/4.0.3: + resolution: {integrity: sha512-q6rbdDd1o2mAnQreO7YADIxf/Whx4AHBiRf6d+/cVT8h44ss+lHgxf1FemcqDnQt9X3ct4McHr+JMGlYSsK7Cg==} + dependencies: + graceful-fs: 4.2.11 + jsonfile: 4.0.0 + universalify: 0.1.2 + dev: true + + /fs-extra/7.0.1: + resolution: {integrity: sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==} + engines: {node: '>=6 <7 || >=8'} + dependencies: + graceful-fs: 4.2.11 + jsonfile: 4.0.0 + universalify: 0.1.2 + dev: true + + /fs-extra/8.1.0: + resolution: {integrity: sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==} + engines: {node: '>=6 <7 || >=8'} + dependencies: + graceful-fs: 4.2.11 + jsonfile: 4.0.0 + universalify: 0.1.2 + dev: true + + /fs-extra/9.1.0: + resolution: {integrity: sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==} + engines: {node: '>=10'} + dependencies: + at-least-node: 1.0.0 + graceful-fs: 4.2.11 + jsonfile: 6.1.0 + universalify: 2.0.1 + dev: true + + /fs-minipass/1.2.7: + resolution: {integrity: sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA==} + dependencies: + minipass: 2.9.0 + dev: true + + /fs-readdir-recursive/1.1.0: + resolution: {integrity: sha512-GNanXlVr2pf02+sPN40XN8HG+ePaNcvM0q5mZBd668Obwb0yD5GiUbZOFgwn8kGMY6I3mdyDJzieUy3PTYyTRA==} + dev: true + + /fs.realpath/1.0.0: + resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} + dev: true + + /fsevents/2.3.3: + resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} + engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /function-bind/1.1.2: + resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} + dev: true + + /function.prototype.name/1.1.6: + resolution: {integrity: sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + define-properties: 1.2.1 + es-abstract: 1.22.4 + functions-have-names: 1.2.3 + dev: true + + /functional-red-black-tree/1.0.1: + resolution: {integrity: sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==} + dev: true + + /functions-have-names/1.2.3: + resolution: {integrity: sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==} + dev: true + + /ganache/7.9.1: + resolution: {integrity: sha512-Tqhd4J3cpiLeYTD6ek/zlchSB107IVPMIm4ypyg+xz1sdkeALUnYYZnmY4Bdjqj3i6QwtlZPCu7U4qKy7HlWTA==} + hasBin: true + dependencies: + '@trufflesuite/bigint-buffer': 1.1.10 + '@trufflesuite/uws-js-unofficial': 20.30.0-unofficial.0 + '@types/bn.js': 5.1.5 + '@types/lru-cache': 5.1.1 + '@types/seedrandom': 3.0.1 + abstract-level: 1.0.3 + abstract-leveldown: 7.2.0 + async-eventemitter: 0.2.4 + emittery: 0.10.0 + keccak: 3.0.2 + leveldown: 6.1.0 + secp256k1: 4.0.3 + optionalDependencies: + bufferutil: 4.0.5 + utf-8-validate: 5.0.7 + dev: true + bundledDependencies: + - '@trufflesuite/bigint-buffer' + - keccak + - leveldown + - secp256k1 + + /get-caller-file/1.0.3: + resolution: {integrity: sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==} + dev: true + + /get-caller-file/2.0.5: + resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} + engines: {node: 6.* || 8.* || >= 10.*} + dev: true + + /get-func-name/2.0.2: + resolution: {integrity: sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==} + dev: true + + /get-installed-path/2.1.1: + resolution: {integrity: sha512-Qkn9eq6tW5/q9BDVdMpB8tOHljX9OSP0jRC5TRNVA4qRc839t4g8KQaR8t0Uv0EFVL0MlyG7m/ofjEgAROtYsA==} + dependencies: + global-modules: 1.0.0 + dev: true + + /get-installed-path/4.0.8: + resolution: {integrity: sha512-PmANK1xElIHlHH2tXfOoTnSDUjX1X3GvKK6ZyLbUnSCCn1pADwu67eVWttuPzJWrXDDT2MfO6uAaKILOFfitmA==} + engines: {node: '>=6', npm: '>=5', yarn: '>=1'} + dependencies: + global-modules: 1.0.0 + dev: true + + /get-intrinsic/1.2.4: + resolution: {integrity: sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==} + engines: {node: '>= 0.4'} + dependencies: + es-errors: 1.3.0 + function-bind: 1.1.2 + has-proto: 1.0.1 + has-symbols: 1.0.3 + hasown: 2.0.1 + dev: true + + /get-port/3.2.0: + resolution: {integrity: sha512-x5UJKlgeUiNT8nyo/AcnwLnZuZNcSjSw0kogRB+Whd1fjjFq4B1hySFxSFWWSn4mIBzg3sRNUDFYc4g5gjPoLg==} + engines: {node: '>=4'} + dev: true + + /get-stream/5.2.0: + resolution: {integrity: sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==} + engines: {node: '>=8'} + dependencies: + pump: 3.0.0 + dev: true + + /get-stream/6.0.1: + resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} + engines: {node: '>=10'} + dev: true + + /get-symbol-description/1.0.2: + resolution: {integrity: sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + es-errors: 1.3.0 + get-intrinsic: 1.2.4 + dev: true + + /get-tsconfig/4.7.2: + resolution: {integrity: sha512-wuMsz4leaj5hbGgg4IvDU0bqJagpftG5l5cXIAvo8uZrqn0NJqwtfupTN00VnkQJPcIRrxYrm1Ue24btpCha2A==} + dependencies: + resolve-pkg-maps: 1.0.0 + dev: true + + /getpass/0.1.7: + resolution: {integrity: sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==} + dependencies: + assert-plus: 1.0.0 + dev: true + + /glob-parent/5.1.2: + resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} + engines: {node: '>= 6'} + dependencies: + is-glob: 4.0.3 + dev: true + + /glob-parent/6.0.2: + resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==} + engines: {node: '>=10.13.0'} + dependencies: + is-glob: 4.0.3 + dev: true + + /glob/7.2.0: + resolution: {integrity: sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==} + dependencies: + fs.realpath: 1.0.0 + inflight: 1.0.6 + inherits: 2.0.4 + minimatch: 3.1.2 + once: 1.4.0 + path-is-absolute: 1.0.1 + dev: true + + /glob/7.2.3: + resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} + dependencies: + fs.realpath: 1.0.0 + inflight: 1.0.6 + inherits: 2.0.4 + minimatch: 3.1.2 + once: 1.4.0 + path-is-absolute: 1.0.1 + dev: true + + /glob/8.1.0: + resolution: {integrity: sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==} + engines: {node: '>=12'} + dependencies: + fs.realpath: 1.0.0 + inflight: 1.0.6 + inherits: 2.0.4 + minimatch: 5.1.6 + once: 1.4.0 + dev: true + + /global-modules/1.0.0: + resolution: {integrity: sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==} + engines: {node: '>=0.10.0'} + dependencies: + global-prefix: 1.0.2 + is-windows: 1.0.2 + resolve-dir: 1.0.1 + dev: true + + /global-prefix/1.0.2: + resolution: {integrity: sha512-5lsx1NUDHtSjfg0eHlmYvZKv8/nVqX4ckFbM+FrGcQ+04KWcWFo9P5MxPZYSzUvyzmdTbI7Eix8Q4IbELDqzKg==} + engines: {node: '>=0.10.0'} + dependencies: + expand-tilde: 2.0.2 + homedir-polyfill: 1.0.3 + ini: 1.3.8 + is-windows: 1.0.2 + which: 1.3.1 + dev: true + + /global/4.4.0: + resolution: {integrity: sha512-wv/LAoHdRE3BeTGz53FAamhGlPLhlssK45usmGFThIi4XqnBmjKQ16u+RNbP7WvigRZDxUsM0J3gcQ5yicaL0w==} + dependencies: + min-document: 2.19.0 + process: 0.11.10 + dev: true + + /globals/13.24.0: + resolution: {integrity: sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==} + engines: {node: '>=8'} + dependencies: + type-fest: 0.20.2 + dev: true + + /globalthis/1.0.3: + resolution: {integrity: sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==} + engines: {node: '>= 0.4'} + dependencies: + define-properties: 1.2.1 + dev: true + + /gopd/1.0.1: + resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==} + dependencies: + get-intrinsic: 1.2.4 + dev: true + + /got/11.8.6: + resolution: {integrity: sha512-6tfZ91bOr7bOXnK7PRDCGBLa1H4U080YHNaAQ2KsMGlLEzRbk44nsZF2E1IeRc3vtJHPVbKCYgdFbaGO2ljd8g==} + engines: {node: '>=10.19.0'} + dependencies: + '@sindresorhus/is': 4.6.0 + '@szmarczak/http-timer': 4.0.6 + '@types/cacheable-request': 6.0.3 + '@types/responselike': 1.0.3 + cacheable-lookup: 5.0.4 + cacheable-request: 7.0.4 + decompress-response: 6.0.0 + http2-wrapper: 1.0.3 + lowercase-keys: 2.0.0 + p-cancelable: 2.1.1 + responselike: 2.0.1 + dev: true + + /got/12.1.0: + resolution: {integrity: sha512-hBv2ty9QN2RdbJJMK3hesmSkFTjVIHyIDDbssCKnSmq62edGgImJWD10Eb1k77TiV1bxloxqcFAVK8+9pkhOig==} + engines: {node: '>=14.16'} + dependencies: + '@sindresorhus/is': 4.6.0 + '@szmarczak/http-timer': 5.0.1 + '@types/cacheable-request': 6.0.3 + '@types/responselike': 1.0.3 + cacheable-lookup: 6.1.0 + cacheable-request: 7.0.4 + decompress-response: 6.0.0 + form-data-encoder: 1.7.1 + get-stream: 6.0.1 + http2-wrapper: 2.2.1 + lowercase-keys: 3.0.0 + p-cancelable: 3.0.0 + responselike: 2.0.1 + dev: true + + /got/12.6.1: + resolution: {integrity: sha512-mThBblvlAF1d4O5oqyvN+ZxLAYwIJK7bpMxgYqPD9okW0C3qm5FFn7k811QrcuEBwaogR3ngOFoCfs6mRv7teQ==} + engines: {node: '>=14.16'} + dependencies: + '@sindresorhus/is': 5.6.0 + '@szmarczak/http-timer': 5.0.1 + cacheable-lookup: 7.0.0 + cacheable-request: 10.2.14 + decompress-response: 6.0.0 + form-data-encoder: 2.1.4 + get-stream: 6.0.1 + http2-wrapper: 2.2.1 + lowercase-keys: 3.0.0 + p-cancelable: 3.0.0 + responselike: 3.0.0 + dev: true + + /graceful-fs/4.2.10: + resolution: {integrity: sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==} + dev: true + + /graceful-fs/4.2.11: + resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} + + /grapheme-splitter/1.0.4: + resolution: {integrity: sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==} + dev: true + + /graphemer/1.4.0: + resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} + dev: true + + /graphql-tag/2.12.6_graphql@15.8.0: + resolution: {integrity: sha512-FdSNcu2QQcWnM2VNvSCCDCVS5PpPqpzgFT8+GXzqJuoDd0CBncxCY278u4mhRO7tMgo2JjgJA5aZ+nWSQ/Z+xg==} + engines: {node: '>=10'} + peerDependencies: + graphql: ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 + dependencies: + graphql: 15.8.0 + tslib: 2.6.2 + dev: true + optional: true + + /graphql/15.8.0: + resolution: {integrity: sha512-5gghUc24tP9HRznNpV2+FIoq3xKkj5dTQqf4v0CpdPbFVwFkWoxOM+o+2OC9ZSvjEMTjfmG9QT+gcvggTwW1zw==} + engines: {node: '>= 10.x'} + dev: true + optional: true + + /har-schema/2.0.0: + resolution: {integrity: sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q==} + engines: {node: '>=4'} + dev: true + + /har-validator/5.1.5: + resolution: {integrity: sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==} + engines: {node: '>=6'} + deprecated: this library is no longer supported + dependencies: + ajv: 6.12.6 + har-schema: 2.0.0 + dev: true + + /hardhat/2.19.5: + resolution: {integrity: sha512-vx8R7zWCYVgM56vA6o0Wqx2bIIptkN4TMs9QwDqZVNGRhMzBfzqUeEYbp+69gxWp1neg2V2nYQUaaUv7aom1kw==} + hasBin: true + peerDependencies: + ts-node: '*' + typescript: '*' + peerDependenciesMeta: + ts-node: + optional: true + typescript: + optional: true + dependencies: + '@ethersproject/abi': 5.7.0 + '@metamask/eth-sig-util': 4.0.1 + '@nomicfoundation/ethereumjs-block': 5.0.2 + '@nomicfoundation/ethereumjs-blockchain': 7.0.2 + '@nomicfoundation/ethereumjs-common': 4.0.2 + '@nomicfoundation/ethereumjs-evm': 2.0.2 + '@nomicfoundation/ethereumjs-rlp': 5.0.2 + '@nomicfoundation/ethereumjs-statemanager': 2.0.2 + '@nomicfoundation/ethereumjs-trie': 6.0.2 + '@nomicfoundation/ethereumjs-tx': 5.0.2 + '@nomicfoundation/ethereumjs-util': 9.0.2 + '@nomicfoundation/ethereumjs-vm': 7.0.2 + '@nomicfoundation/solidity-analyzer': 0.1.1 + '@sentry/node': 5.30.0 + '@types/bn.js': 5.1.5 + '@types/lru-cache': 5.1.1 + adm-zip: 0.4.16 + aggregate-error: 3.1.0 + ansi-escapes: 4.3.2 + boxen: 5.1.2 + chalk: 2.4.2 + chokidar: 3.6.0 + ci-info: 2.0.0 + debug: 4.3.4 + enquirer: 2.4.1 + env-paths: 2.2.1 + ethereum-cryptography: 1.2.0 + ethereumjs-abi: 0.6.8 + find-up: 2.1.0 + fp-ts: 1.19.3 + fs-extra: 7.0.1 + glob: 7.2.0 + immutable: 4.3.5 + io-ts: 1.10.4 + keccak: 3.0.4 + lodash: 4.17.21 + mnemonist: 0.38.5 + mocha: 10.3.0 + p-map: 4.0.0 + raw-body: 2.5.2 + resolve: 1.17.0 + semver: 6.3.1 + solc: 0.7.3_debug@4.3.4 + source-map-support: 0.5.21 + stacktrace-parser: 0.1.10 + tsort: 0.0.1 + undici: 5.28.3 + uuid: 8.3.2 + ws: 7.5.9 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + dev: true + + /has-bigints/1.0.2: + resolution: {integrity: sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==} + dev: true + + /has-flag/3.0.0: + resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==} + engines: {node: '>=4'} + dev: true + + /has-flag/4.0.0: + resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} + engines: {node: '>=8'} + dev: true + + /has-property-descriptors/1.0.2: + resolution: {integrity: sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==} + dependencies: + es-define-property: 1.0.0 + dev: true + + /has-proto/1.0.1: + resolution: {integrity: sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==} + engines: {node: '>= 0.4'} + dev: true + + /has-symbols/1.0.3: + resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} + engines: {node: '>= 0.4'} + dev: true + + /has-tostringtag/1.0.2: + resolution: {integrity: sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==} + engines: {node: '>= 0.4'} + dependencies: + has-symbols: 1.0.3 + dev: true + + /hash-base/3.1.0: + resolution: {integrity: sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==} + engines: {node: '>=4'} + dependencies: + inherits: 2.0.4 + readable-stream: 3.6.2 + safe-buffer: 5.2.1 + dev: true + + /hash.js/1.1.3: + resolution: {integrity: sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA==} + dependencies: + inherits: 2.0.4 + minimalistic-assert: 1.0.1 + dev: true + + /hash.js/1.1.7: + resolution: {integrity: sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==} + dependencies: + inherits: 2.0.4 + minimalistic-assert: 1.0.1 + dev: true + + /hasown/2.0.1: + resolution: {integrity: sha512-1/th4MHjnwncwXsIW6QMzlvYL9kG5e/CpVvLRZe4XPa8TOUNbCELqmvhDmnkNsAjwaG4+I8gJJL0JBvTTLO9qA==} + engines: {node: '>= 0.4'} + dependencies: + function-bind: 1.1.2 + dev: true + + /he/1.2.0: + resolution: {integrity: sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==} + hasBin: true + dev: true + + /header-case/1.0.1: + resolution: {integrity: sha512-i0q9mkOeSuhXw6bGgiQCCBgY/jlZuV/7dZXyZ9c6LcBrqwvT8eT719E9uxE5LiZftdl+z81Ugbg/VvXV4OJOeQ==} + dependencies: + no-case: 2.3.2 + upper-case: 1.1.3 + dev: true + + /highlight.js/10.7.3: + resolution: {integrity: sha512-tzcUFauisWKNHaRkN4Wjl/ZA07gENAjFl3J/c480dprkGTg5EQstgaNFqBfUqCq54kZRIEcreTsAgF/m2quD7A==} + dev: true + + /highlightjs-solidity/2.0.6: + resolution: {integrity: sha512-DySXWfQghjm2l6a/flF+cteroJqD4gI8GSdL4PtvxZSsAHie8m3yVe2JFoRg03ROKT6hp2Lc/BxXkqerNmtQYg==} + dev: true + + /hmac-drbg/1.0.1: + resolution: {integrity: sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==} + dependencies: + hash.js: 1.1.7 + minimalistic-assert: 1.0.1 + minimalistic-crypto-utils: 1.0.1 + dev: true + + /homedir-polyfill/1.0.3: + resolution: {integrity: sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==} + engines: {node: '>=0.10.0'} + dependencies: + parse-passwd: 1.0.0 + dev: true + + /hosted-git-info/2.8.9: + resolution: {integrity: sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==} + dev: true + + /htmlparser2/8.0.2: + resolution: {integrity: sha512-GYdjWKDkbRLkZ5geuHs5NY1puJ+PXwP7+fHPRz06Eirsb9ugf6d8kkXav6ADhcODhFFPMIXyxkxSuMf3D6NCFA==} + dependencies: + domelementtype: 2.3.0 + domhandler: 5.0.3 + domutils: 3.1.0 + entities: 4.5.0 + dev: true + + /http-basic/8.1.3: + resolution: {integrity: sha512-/EcDMwJZh3mABI2NhGfHOGOeOZITqfkEO4p/xK+l3NpyncIHUQBoMvCSF/b5GqvKtySC2srL/GGG3+EtlqlmCw==} + engines: {node: '>=6.0.0'} + dependencies: + caseless: 0.12.0 + concat-stream: 1.6.2 + http-response-object: 3.0.2 + parse-cache-control: 1.0.1 + dev: true + + /http-cache-semantics/4.1.1: + resolution: {integrity: sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==} + dev: true + + /http-errors/2.0.0: + resolution: {integrity: sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==} + engines: {node: '>= 0.8'} + dependencies: + depd: 2.0.0 + inherits: 2.0.4 + setprototypeof: 1.2.0 + statuses: 2.0.1 + toidentifier: 1.0.1 + dev: true + + /http-https/1.0.0: + resolution: {integrity: sha512-o0PWwVCSp3O0wS6FvNr6xfBCHgt0m1tvPLFOCc2iFDKTRAXhB7m8klDf7ErowFH8POa6dVdGatKU5I1YYwzUyg==} + dev: true + + /http-response-object/3.0.2: + resolution: {integrity: sha512-bqX0XTF6fnXSQcEJ2Iuyr75yVakyjIDCqroJQ/aHfSdlM743Cwqoi2nDYMzLGWUcuTWGWy8AAvOKXTfiv6q9RA==} + dependencies: + '@types/node': 10.17.60 + dev: true + + /http-signature/1.2.0: + resolution: {integrity: sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ==} + engines: {node: '>=0.8', npm: '>=1.3.7'} + dependencies: + assert-plus: 1.0.0 + jsprim: 1.4.2 + sshpk: 1.18.0 + dev: true + + /http2-wrapper/1.0.3: + resolution: {integrity: sha512-V+23sDMr12Wnz7iTcDeJr3O6AIxlnvT/bmaAAAP/Xda35C90p9599p0F1eHR/N1KILWSoWVAiOMFjBBXaXSMxg==} + engines: {node: '>=10.19.0'} + dependencies: + quick-lru: 5.1.1 + resolve-alpn: 1.2.1 + dev: true + + /http2-wrapper/2.2.1: + resolution: {integrity: sha512-V5nVw1PAOgfI3Lmeaj2Exmeg7fenjhRUgz1lPSezy1CuhPYbgQtbQj4jZfEAEMlaL+vupsvhjqCyjzob0yxsmQ==} + engines: {node: '>=10.19.0'} + dependencies: + quick-lru: 5.1.1 + resolve-alpn: 1.2.1 + dev: true + + /https-proxy-agent/5.0.1: + resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==} + engines: {node: '>= 6'} + dependencies: + agent-base: 6.0.2 + debug: 4.3.4 + transitivePeerDependencies: + - supports-color + dev: true + + /iconv-lite/0.4.24: + resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} + engines: {node: '>=0.10.0'} + dependencies: + safer-buffer: 2.1.2 + dev: true + + /idna-uts46-hx/2.3.1: + resolution: {integrity: sha512-PWoF9Keq6laYdIRwwCdhTPl60xRqAloYNMQLiyUnG42VjT53oW07BXIRM+NK7eQjzXjAk2gUvX9caRxlnF9TAA==} + engines: {node: '>=4.0.0'} + dependencies: + punycode: 2.1.0 + dev: true + + /ieee754/1.2.1: + resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} + dev: true + + /ignore/5.3.1: + resolution: {integrity: sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==} + engines: {node: '>= 4'} + dev: true + + /immediate/3.3.0: + resolution: {integrity: sha512-HR7EVodfFUdQCTIeySw+WDRFJlPcLOJbXfwwZ7Oom6tjsvZ3bOkCDJHehQC3nxJrv7+f9XecwazynjU8e4Vw3Q==} + dev: true + optional: true + + /immutable/4.3.5: + resolution: {integrity: sha512-8eabxkth9gZatlwl5TBuJnCsoTADlL6ftEr7A4qgdaTsPyreilDSnUk57SO+jfKcNtxPa22U5KK6DSeAYhpBJw==} + dev: true + + /import-fresh/3.3.0: + resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==} + engines: {node: '>=6'} + dependencies: + parent-module: 1.0.1 + resolve-from: 4.0.0 + dev: true + + /imurmurhash/0.1.4: + resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} + engines: {node: '>=0.8.19'} + dev: true + + /indent-string/4.0.0: + resolution: {integrity: sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==} + engines: {node: '>=8'} + dev: true + + /inflight/1.0.6: + resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} + dependencies: + once: 1.4.0 + wrappy: 1.0.2 + dev: true + + /inherits/2.0.4: + resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} + dev: true + + /ini/1.3.8: + resolution: {integrity: sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==} + dev: true + + /internal-slot/1.0.7: + resolution: {integrity: sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==} + engines: {node: '>= 0.4'} + dependencies: + es-errors: 1.3.0 + hasown: 2.0.1 + side-channel: 1.0.5 + dev: true + + /invert-kv/1.0.0: + resolution: {integrity: sha512-xgs2NH9AE66ucSq4cNG1nhSFghr5l6tdL15Pk+jl46bmmBapgoaY/AacXyaDznAqmGL99TiLSQgO/XazFSKYeQ==} + engines: {node: '>=0.10.0'} + dev: true + + /io-ts/1.10.4: + resolution: {integrity: sha512-b23PteSnYXSONJ6JQXRAlvJhuw8KOtkqa87W4wDtvMrud/DTJd5X+NpOOI+O/zZwVq6v0VLAaJ+1EDViKEuN9g==} + dependencies: + fp-ts: 1.19.3 + dev: true + + /ipaddr.js/1.9.1: + resolution: {integrity: sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==} + engines: {node: '>= 0.10'} + dev: true + + /is-arguments/1.1.1: + resolution: {integrity: sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + has-tostringtag: 1.0.2 + dev: true + + /is-array-buffer/3.0.4: + resolution: {integrity: sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + get-intrinsic: 1.2.4 + dev: true + + /is-arrayish/0.2.1: + resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==} + dev: true + + /is-bigint/1.0.4: + resolution: {integrity: sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==} + dependencies: + has-bigints: 1.0.2 + dev: true + + /is-binary-path/2.1.0: + resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==} + engines: {node: '>=8'} + dependencies: + binary-extensions: 2.2.0 + dev: true + + /is-boolean-object/1.1.2: + resolution: {integrity: sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + has-tostringtag: 1.0.2 + dev: true + + /is-buffer/2.0.5: + resolution: {integrity: sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==} + engines: {node: '>=4'} + dev: true + + /is-builtin-module/3.2.1: + resolution: {integrity: sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A==} + engines: {node: '>=6'} + dependencies: + builtin-modules: 3.3.0 + dev: true + + /is-callable/1.2.7: + resolution: {integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==} + engines: {node: '>= 0.4'} + dev: true + + /is-core-module/2.13.1: + resolution: {integrity: sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==} + dependencies: + hasown: 2.0.1 + dev: true + + /is-date-object/1.0.5: + resolution: {integrity: sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==} + engines: {node: '>= 0.4'} + dependencies: + has-tostringtag: 1.0.2 + dev: true + + /is-extglob/2.1.1: + resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} + engines: {node: '>=0.10.0'} + dev: true + + /is-fullwidth-code-point/1.0.0: + resolution: {integrity: sha512-1pqUqRjkhPJ9miNq9SwMfdvi6lBJcd6eFxvfaivQhaH3SgisfiuudvFntdKOmxuee/77l+FPjKrQjWvmPjWrRw==} + engines: {node: '>=0.10.0'} + dependencies: + number-is-nan: 1.0.1 + dev: true + + /is-fullwidth-code-point/2.0.0: + resolution: {integrity: sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==} + engines: {node: '>=4'} + dev: true + + /is-fullwidth-code-point/3.0.0: + resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} + engines: {node: '>=8'} + dev: true + + /is-function/1.0.2: + resolution: {integrity: sha512-lw7DUp0aWXYg+CBCN+JKkcE0Q2RayZnSvnZBlwgxHBQhqt5pZNVy4Ri7H9GmmXkdu7LUthszM+Tor1u/2iBcpQ==} + dev: true + + /is-generator-function/1.0.10: + resolution: {integrity: sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==} + engines: {node: '>= 0.4'} + dependencies: + has-tostringtag: 1.0.2 + dev: true + + /is-glob/4.0.3: + resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} + engines: {node: '>=0.10.0'} + dependencies: + is-extglob: 2.1.1 + dev: true + + /is-hex-prefixed/1.0.0: + resolution: {integrity: sha512-WvtOiug1VFrE9v1Cydwm+FnXd3+w9GaeVUss5W4v/SLy3UW00vP+6iNF2SdnfiBoLy4bTqVdkftNGTUeOFVsbA==} + engines: {node: '>=6.5.0', npm: '>=3'} + dev: true + + /is-lower-case/1.1.3: + resolution: {integrity: sha512-+5A1e/WJpLLXZEDlgz4G//WYSHyQBD32qa4Jd3Lw06qQlv3fJHnp3YIHjTQSGzHMgzmVKz2ZP3rBxTHkPw/lxA==} + dependencies: + lower-case: 1.1.4 + dev: true + + /is-negative-zero/2.0.2: + resolution: {integrity: sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==} + engines: {node: '>= 0.4'} + dev: true + + /is-number-object/1.0.7: + resolution: {integrity: sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==} + engines: {node: '>= 0.4'} + dependencies: + has-tostringtag: 1.0.2 + dev: true + + /is-number/7.0.0: + resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} + engines: {node: '>=0.12.0'} + dev: true + + /is-obj/2.0.0: + resolution: {integrity: sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==} + engines: {node: '>=8'} + dev: true + + /is-path-inside/3.0.3: + resolution: {integrity: sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==} + engines: {node: '>=8'} + dev: true + + /is-plain-obj/2.1.0: + resolution: {integrity: sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==} + engines: {node: '>=8'} + dev: true + + /is-regex/1.1.4: + resolution: {integrity: sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + has-tostringtag: 1.0.2 + dev: true + + /is-retry-allowed/2.2.0: + resolution: {integrity: sha512-XVm7LOeLpTW4jV19QSH38vkswxoLud8sQ57YwJVTPWdiaI9I8keEhGFpBlslyVsgdQy4Opg8QOLb8YRgsyZiQg==} + engines: {node: '>=10'} + dev: true + + /is-shared-array-buffer/1.0.2: + resolution: {integrity: sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==} + dependencies: + call-bind: 1.0.7 + dev: true + + /is-string/1.0.7: + resolution: {integrity: sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==} + engines: {node: '>= 0.4'} + dependencies: + has-tostringtag: 1.0.2 + dev: true + + /is-symbol/1.0.4: + resolution: {integrity: sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==} + engines: {node: '>= 0.4'} + dependencies: + has-symbols: 1.0.3 + dev: true + + /is-typed-array/1.1.13: + resolution: {integrity: sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==} + engines: {node: '>= 0.4'} + dependencies: + which-typed-array: 1.1.14 + dev: true + + /is-typedarray/1.0.0: + resolution: {integrity: sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==} + dev: true + + /is-unicode-supported/0.1.0: + resolution: {integrity: sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==} + engines: {node: '>=10'} + dev: true + + /is-upper-case/1.1.2: + resolution: {integrity: sha512-GQYSJMgfeAmVwh9ixyk888l7OIhNAGKtY6QA+IrWlu9MDTCaXmeozOZ2S9Knj7bQwBO/H6J2kb+pbyTUiMNbsw==} + dependencies: + upper-case: 1.1.3 + dev: true + + /is-utf8/0.2.1: + resolution: {integrity: sha512-rMYPYvCzsXywIsldgLaSoPlw5PfoB/ssr7hY4pLfcodrA5M/eArza1a9VmTiNIBNMjOGr1Ow9mTyU2o69U6U9Q==} + dev: true + + /is-weakref/1.0.2: + resolution: {integrity: sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==} + dependencies: + call-bind: 1.0.7 + dev: true + + /is-windows/1.0.2: + resolution: {integrity: sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==} + engines: {node: '>=0.10.0'} + dev: true + + /isarray/0.0.1: + resolution: {integrity: sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==} + dev: true + optional: true + + /isarray/1.0.0: + resolution: {integrity: sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==} + dev: true + + /isarray/2.0.5: + resolution: {integrity: sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==} + dev: true + + /isexe/2.0.0: + resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} + dev: true + + /isomorphic-ws/4.0.1_ws@7.5.9: + resolution: {integrity: sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w==} + peerDependencies: + ws: '*' + dependencies: + ws: 7.5.9 + dev: true + + /isstream/0.1.2: + resolution: {integrity: sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==} + dev: true + + /iter-tools/7.5.3: + resolution: {integrity: sha512-iEcHpgM9cn6tsI5MewqxyEega9KPbIDytQTEnu6c0MtlQQhQFofssYuRqxCarZgUdzliepRZPwwwflE4wAIjaA==} + dependencies: + '@babel/runtime': 7.23.9 + dev: true + + /js-sdsl/4.4.2: + resolution: {integrity: sha512-dwXFwByc/ajSV6m5bcKAPwe4yDDF6D614pxmIi5odytzxRlwqF6nwoiCek80Ixc7Cvma5awClxrzFtxCQvcM8w==} + dev: true + + /js-sha3/0.5.5: + resolution: {integrity: sha512-yLLwn44IVeunwjpDVTDZmQeVbB0h+dZpY2eO68B/Zik8hu6dH+rKeLxwua79GGIvW6xr8NBAcrtiUbYrTjEFTA==} + dev: true + + /js-sha3/0.5.7: + resolution: {integrity: sha512-GII20kjaPX0zJ8wzkTbNDYMY7msuZcTWk8S5UOh6806Jq/wz1J8/bnr8uGU0DAUmYDjj2Mr4X1cW8v/GLYnR+g==} + dev: true + + /js-sha3/0.8.0: + resolution: {integrity: sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==} + dev: true + + /js-tokens/4.0.0: + resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} + dev: true + + /js-yaml/4.1.0: + resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} + hasBin: true + dependencies: + argparse: 2.0.1 + dev: true + + /jsbn/0.1.1: + resolution: {integrity: sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==} + dev: true + + /json-buffer/3.0.1: + resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==} + dev: true + + /json-parse-even-better-errors/2.3.1: + resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==} + dev: true + + /json-pointer/0.6.2: + resolution: {integrity: sha512-vLWcKbOaXlO+jvRy4qNd+TI1QUPZzfJj1tpJ3vAXDych5XJf93ftpUKe5pKCrzyIIwgBJcOcCVRUfqQP25afBw==} + dependencies: + foreach: 2.0.6 + dev: true + + /json-schema-traverse/0.4.1: + resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} + dev: true + + /json-schema-traverse/1.0.0: + resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==} + dev: true + + /json-schema-typed/7.0.3: + resolution: {integrity: sha512-7DE8mpG+/fVw+dTpjbxnx47TaMnDfOI1jwft9g1VybltZCduyRQPJPvc+zzKY9WPHxhPWczyFuYa6I8Mw4iU5A==} + dev: true + + /json-schema/0.4.0: + resolution: {integrity: sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==} + dev: true + + /json-stable-stringify-without-jsonify/1.0.1: + resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} + dev: true + + /json-stable-stringify/1.1.1: + resolution: {integrity: sha512-SU/971Kt5qVQfJpyDveVhQ/vya+5hvrjClFOcr8c0Fq5aODJjMwutrOfCU+eCnVD5gpx1Q3fEqkyom77zH1iIg==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + isarray: 2.0.5 + jsonify: 0.0.1 + object-keys: 1.1.1 + dev: true + + /json-stringify-safe/5.0.1: + resolution: {integrity: sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==} + dev: true + + /json-to-ast/2.1.0: + resolution: {integrity: sha512-W9Lq347r8tA1DfMvAGn9QNcgYm4Wm7Yc+k8e6vezpMnRT+NHbtlxgNBXRVjXe9YM6eTn6+p/MKOlV/aABJcSnQ==} + engines: {node: '>= 4'} + dependencies: + code-error-fragment: 0.0.230 + grapheme-splitter: 1.0.4 + dev: true + + /json5/1.0.2: + resolution: {integrity: sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==} + hasBin: true + dependencies: + minimist: 1.2.8 + dev: true + + /jsonfile/2.4.0: + resolution: {integrity: sha512-PKllAqbgLgxHaj8TElYymKCAgrASebJrWpTnEkOaTowt23VKXXN0sUeriJ+eh7y6ufb/CC5ap11pz71/cM0hUw==} + optionalDependencies: + graceful-fs: 4.2.11 + dev: true + + /jsonfile/4.0.0: + resolution: {integrity: sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==} + optionalDependencies: + graceful-fs: 4.2.11 + dev: true + + /jsonfile/6.1.0: + resolution: {integrity: sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==} + dependencies: + universalify: 2.0.1 + optionalDependencies: + graceful-fs: 4.2.11 + dev: true + + /jsonify/0.0.1: + resolution: {integrity: sha512-2/Ki0GcmuqSrgFyelQq9M05y7PS0mEwuIzrf3f1fPqkVDVRvZrPZtVSMHxdgo8Aq0sxAOb/cr2aqqA3LeWHVPg==} + dev: true + + /jsonpointer/5.0.1: + resolution: {integrity: sha512-p/nXbhSEcu3pZRdkW1OfJhpsVtW1gd4Wa1fnQc9YLiTfAjn0312eMKimbdIQzuZl9aa9xUGaRlP9T/CJE/ditQ==} + engines: {node: '>=0.10.0'} + dev: true + + /jsprim/1.4.2: + resolution: {integrity: sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==} + engines: {node: '>=0.6.0'} + dependencies: + assert-plus: 1.0.0 + extsprintf: 1.3.0 + json-schema: 0.4.0 + verror: 1.10.0 + dev: true + + /keccak/3.0.1: + resolution: {integrity: sha512-epq90L9jlFWCW7+pQa6JOnKn2Xgl2mtI664seYR6MHskvI9agt7AnDqmAlp9TqU4/caMYbA08Hi5DMZAl5zdkA==} + engines: {node: '>=10.0.0'} + requiresBuild: true + dependencies: + node-addon-api: 2.0.2 + node-gyp-build: 4.8.0 + dev: true + + /keccak/3.0.2: + resolution: {integrity: sha512-PyKKjkH53wDMLGrvmRGSNWgmSxZOUqbnXwKL9tmgbFYA1iAYqW21kfR7mZXV0MlESiefxQQE9X9fTa3X+2MPDQ==} + engines: {node: '>=10.0.0'} + requiresBuild: true + dependencies: + node-addon-api: 2.0.2 + node-gyp-build: 4.8.0 + readable-stream: 3.6.2 + dev: true + + /keccak/3.0.4: + resolution: {integrity: sha512-3vKuW0jV8J3XNTzvfyicFR5qvxrSAGl7KIhvgOu5cmWwM7tZRj3fMbj/pfIf4be7aznbc+prBWGjywox/g2Y6Q==} + engines: {node: '>=10.0.0'} + requiresBuild: true + dependencies: + node-addon-api: 2.0.2 + node-gyp-build: 4.8.0 + readable-stream: 3.6.2 + dev: true + + /keyv/4.5.4: + resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==} + dependencies: + json-buffer: 3.0.1 + dev: true + + /klaw/1.3.1: + resolution: {integrity: sha512-TED5xi9gGQjGpNnvRWknrwAB1eL5GciPfVFOt3Vk1OJCVDQbzuSfrF3hkUQKlsgKrG1F+0t5W0m+Fje1jIt8rw==} + optionalDependencies: + graceful-fs: 4.2.11 + dev: true + + /latest-version/7.0.0: + resolution: {integrity: sha512-KvNT4XqAMzdcL6ka6Tl3i2lYeFDgXNCuIX+xNx6ZMVR1dFq+idXd9FLKNMOIx0t9mJ9/HudyX4oZWXZQ0UJHeg==} + engines: {node: '>=14.16'} + dependencies: + package-json: 8.1.1 + dev: true + + /lcid/1.0.0: + resolution: {integrity: sha512-YiGkH6EnGrDGqLMITnGjXtGmNtjoXw9SVUzcaos8RBi7Ps0VBylkq+vOcY9QE5poLasPCR849ucFUkl0UzUyOw==} + engines: {node: '>=0.10.0'} + dependencies: + invert-kv: 1.0.0 + dev: true + + /level-codec/9.0.2: + resolution: {integrity: sha512-UyIwNb1lJBChJnGfjmO0OR+ezh2iVu1Kas3nvBS/BzGnx79dv6g7unpKIDNPMhfdTEGoc7mC8uAu51XEtX+FHQ==} + engines: {node: '>=6'} + dependencies: + buffer: 5.7.1 + dev: true + optional: true + + /level-concat-iterator/2.0.1: + resolution: {integrity: sha512-OTKKOqeav2QWcERMJR7IS9CUo1sHnke2C0gkSmcR7QuEtFNLLzHQAvnMw8ykvEcv0Qtkg0p7FOwP1v9e5Smdcw==} + engines: {node: '>=6'} + dev: true + optional: true + + /level-concat-iterator/3.1.0: + resolution: {integrity: sha512-BWRCMHBxbIqPxJ8vHOvKUsaO0v1sLYZtjN3K2iZJsRBYtp+ONsY6Jfi6hy9K3+zolgQRryhIn2NRZjZnWJ9NmQ==} + engines: {node: '>=10'} + dependencies: + catering: 2.1.1 + dev: true + + /level-errors/2.0.1: + resolution: {integrity: sha512-UVprBJXite4gPS+3VznfgDSU8PTRuVX0NXwoWW50KLxd2yw4Y1t2JUR5In1itQnudZqRMT9DlAM3Q//9NCjCFw==} + engines: {node: '>=6'} + dependencies: + errno: 0.1.8 + dev: true + optional: true + + /level-iterator-stream/4.0.2: + resolution: {integrity: sha512-ZSthfEqzGSOMWoUGhTXdX9jv26d32XJuHz/5YnuHZzH6wldfWMOVwI9TBtKcya4BKTyTt3XVA0A3cF3q5CY30Q==} + engines: {node: '>=6'} + dependencies: + inherits: 2.0.4 + readable-stream: 3.6.2 + xtend: 4.0.2 + dev: true + optional: true + + /level-js/5.0.2: + resolution: {integrity: sha512-SnBIDo2pdO5VXh02ZmtAyPP6/+6YTJg2ibLtl9C34pWvmtMEmRTWpra+qO/hifkUtBTOtfx6S9vLDjBsBK4gRg==} + dependencies: + abstract-leveldown: 6.2.3 + buffer: 5.7.1 + inherits: 2.0.4 + ltgt: 2.2.1 + dev: true + optional: true + + /level-packager/5.1.1: + resolution: {integrity: sha512-HMwMaQPlTC1IlcwT3+swhqf/NUO+ZhXVz6TY1zZIIZlIR0YSn8GtAAWmIvKjNY16ZkEg/JcpAuQskxsXqC0yOQ==} + engines: {node: '>=6'} + dependencies: + encoding-down: 6.3.0 + levelup: 4.4.0 + dev: true + optional: true + + /level-supports/1.0.1: + resolution: {integrity: sha512-rXM7GYnW8gsl1vedTJIbzOrRv85c/2uCMpiiCzO2fndd06U/kUXEEU9evYn4zFggBOg36IsBW8LzqIpETwwQzg==} + engines: {node: '>=6'} + dependencies: + xtend: 4.0.2 + dev: true + optional: true + + /level-supports/2.1.0: + resolution: {integrity: sha512-E486g1NCjW5cF78KGPrMDRBYzPuueMZ6VBXHT6gC7A8UYWGiM14fGgp+s/L1oFfDWSPV/+SFkYCmZ0SiESkRKA==} + engines: {node: '>=10'} + dev: true + + /level-supports/4.0.1: + resolution: {integrity: sha512-PbXpve8rKeNcZ9C1mUicC9auIYFyGpkV9/i6g76tLgANwWhtG2v7I4xNBUlkn3lE2/dZF3Pi0ygYGtLc4RXXdA==} + engines: {node: '>=12'} + dev: true + + /level-transcoder/1.0.1: + resolution: {integrity: sha512-t7bFwFtsQeD8cl8NIoQ2iwxA0CL/9IFw7/9gAjOonH0PWTTiRfY7Hq+Ejbsxh86tXobDQ6IOiddjNYIfOBs06w==} + engines: {node: '>=12'} + dependencies: + buffer: 6.0.3 + module-error: 1.0.2 + dev: true + + /level-write-stream/1.0.0: + resolution: {integrity: sha512-bBNKOEOMl8msO+uIM9YX/gUO6ckokZ/4pCwTm/lwvs46x6Xs8Zy0sn3Vh37eDqse4mhy4fOMIb/JsSM2nyQFtw==} + dependencies: + end-stream: 0.1.0 + dev: true + optional: true + + /level/6.0.1: + resolution: {integrity: sha512-psRSqJZCsC/irNhfHzrVZbmPYXDcEYhA5TVNwr+V92jF44rbf86hqGp8fiT702FyiArScYIlPSBTDUASCVNSpw==} + engines: {node: '>=8.6.0'} + dependencies: + level-js: 5.0.2 + level-packager: 5.1.1 + leveldown: 5.6.0 + dev: true + optional: true + + /level/8.0.1: + resolution: {integrity: sha512-oPBGkheysuw7DmzFQYyFe8NAia5jFLAgEnkgWnK3OXAuJr8qFT+xBQIwokAZPME2bhPFzS8hlYcL16m8UZrtwQ==} + engines: {node: '>=12'} + dependencies: + abstract-level: 1.0.4 + browser-level: 1.0.1 + classic-level: 1.4.1 + dev: true + + /leveldown/5.6.0: + resolution: {integrity: sha512-iB8O/7Db9lPaITU1aA2txU/cBEXAt4vWwKQRrrWuS6XDgbP4QZGj9BL2aNbwb002atoQ/lIotJkfyzz+ygQnUQ==} + engines: {node: '>=8.6.0'} + requiresBuild: true + dependencies: + abstract-leveldown: 6.2.3 + napi-macros: 2.0.0 + node-gyp-build: 4.1.1 + dev: true + optional: true + + /leveldown/6.1.0: + resolution: {integrity: sha512-8C7oJDT44JXxh04aSSsfcMI8YiaGRhOFI9/pMEL7nWJLVsWajDPTRxsSHTM2WcTVY5nXM+SuRHzPPi0GbnDX+w==} + engines: {node: '>=10.12.0'} + requiresBuild: true + dependencies: + abstract-leveldown: 7.2.0 + napi-macros: 2.0.0 + node-gyp-build: 4.8.0 + dev: true + + /levelup/4.4.0: + resolution: {integrity: sha512-94++VFO3qN95cM/d6eBXvd894oJE0w3cInq9USsyQzzoJxmiYzPAocNcuGCPGGjoXqDVJcr3C1jzt1TSjyaiLQ==} + engines: {node: '>=6'} + dependencies: + deferred-leveldown: 5.3.0 + level-errors: 2.0.1 + level-iterator-stream: 4.0.2 + level-supports: 1.0.1 + xtend: 4.0.2 + dev: true + optional: true + + /leven/3.1.0: + resolution: {integrity: sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==} + engines: {node: '>=6'} + dev: true + + /levn/0.4.1: + resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==} + engines: {node: '>= 0.8.0'} + dependencies: + prelude-ls: 1.2.1 + type-check: 0.4.0 + dev: true + + /lines-and-columns/1.2.4: + resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} + dev: true + + /load-json-file/1.1.0: + resolution: {integrity: sha512-cy7ZdNRXdablkXYNI049pthVeXFurRyb9+hA/dZzerZ0pGTx42z+y+ssxBaVV2l70t1muq5IdKhn4UtcoGUY9A==} + engines: {node: '>=0.10.0'} + dependencies: + graceful-fs: 4.2.11 + parse-json: 2.2.0 + pify: 2.3.0 + pinkie-promise: 2.0.1 + strip-bom: 2.0.0 + dev: true + + /locate-path/2.0.0: + resolution: {integrity: sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA==} + engines: {node: '>=4'} + dependencies: + p-locate: 2.0.0 + path-exists: 3.0.0 + dev: true + + /locate-path/3.0.0: + resolution: {integrity: sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==} + engines: {node: '>=6'} + dependencies: + p-locate: 3.0.0 + path-exists: 3.0.0 + dev: true + + /locate-path/5.0.0: + resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==} + engines: {node: '>=8'} + dependencies: + p-locate: 4.1.0 + dev: true + + /locate-path/6.0.0: + resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} + engines: {node: '>=10'} + dependencies: + p-locate: 5.0.0 + dev: true + + /lodash-es/4.17.21: + resolution: {integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==} + dev: true + + /lodash.assign/4.2.0: + resolution: {integrity: sha512-hFuH8TY+Yji7Eja3mGiuAxBqLagejScbG8GbG0j6o9vzn0YL14My+ktnqtZgFTosKymC9/44wP6s7xyuLfnClw==} + dev: true + + /lodash.clonedeep/4.5.0: + resolution: {integrity: sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ==} + dev: true + + /lodash.flatten/4.4.0: + resolution: {integrity: sha512-C5N2Z3DgnnKr0LOpv/hKCgKdb7ZZwafIrsesve6lmzvZIRZRGaZ/l6Q8+2W7NaT+ZwO3fFlSCzCzrDCFdJfZ4g==} + dev: true + + /lodash.isequal/4.5.0: + resolution: {integrity: sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==} + dev: true + + /lodash.merge/4.6.2: + resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==} + + /lodash.sortby/4.7.0: + resolution: {integrity: sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA==} + dev: true + optional: true + + /lodash.truncate/4.4.2: + resolution: {integrity: sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw==} + dev: true + + /lodash/4.17.21: + resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} + dev: true + + /log-symbols/4.1.0: + resolution: {integrity: sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==} + engines: {node: '>=10'} + dependencies: + chalk: 4.1.2 + is-unicode-supported: 0.1.0 + dev: true + + /loglevel/1.9.1: + resolution: {integrity: sha512-hP3I3kCrDIMuRwAwHltphhDM1r8i55H33GgqjXbrisuJhF4kRhW1dNuxsRklp4bXl8DSdLaNLuiL4A/LWRfxvg==} + engines: {node: '>= 0.6.0'} + dev: true + optional: true + + /long/4.0.0: + resolution: {integrity: sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==} + dev: true + optional: true + + /loose-envify/1.4.0: + resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} + hasBin: true + dependencies: + js-tokens: 4.0.0 + dev: true + + /loupe/2.3.7: + resolution: {integrity: sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==} + dependencies: + get-func-name: 2.0.2 + dev: true + + /lower-case-first/1.0.2: + resolution: {integrity: sha512-UuxaYakO7XeONbKrZf5FEgkantPf5DUqDayzP5VXZrtRPdH86s4kN47I8B3TW10S4QKiE3ziHNf3kRN//okHjA==} + dependencies: + lower-case: 1.1.4 + dev: true + + /lower-case/1.1.4: + resolution: {integrity: sha512-2Fgx1Ycm599x+WGpIYwJOvsjmXFzTSc34IwDWALRA/8AopUKAVPwfJ+h5+f85BCp0PWmmJcWzEpxOpoXycMpdA==} + dev: true + + /lowercase-keys/2.0.0: + resolution: {integrity: sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==} + engines: {node: '>=8'} + dev: true + + /lowercase-keys/3.0.0: + resolution: {integrity: sha512-ozCC6gdQ+glXOQsveKD0YsDy8DSQFjDTz4zyzEHNV5+JP5D62LmfDZ6o1cycFx9ouG940M5dE8C8CTewdj2YWQ==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + dev: true + + /lru-cache/5.1.1: + resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==} + dependencies: + yallist: 3.1.1 + dev: true + + /lru-cache/6.0.0: + resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==} + engines: {node: '>=10'} + dependencies: + yallist: 4.0.0 + dev: true + + /lru-cache/7.13.1: + resolution: {integrity: sha512-CHqbAq7NFlW3RSnoWXLJBxCWaZVBrfa9UEHId2M3AW8iEBurbqduNexEUCGc3SHc6iCYXNJCDi903LajSVAEPQ==} + engines: {node: '>=12'} + dev: true + optional: true + + /lru_map/0.3.3: + resolution: {integrity: sha512-Pn9cox5CsMYngeDbmChANltQl+5pi6XmTrraMSzhPmMBbmgcxmqWry0U3PGapCU1yB4/LqCcom7qhHZiF/jGfQ==} + dev: true + + /ltgt/2.2.1: + resolution: {integrity: sha512-AI2r85+4MquTw9ZYqabu4nMwy9Oftlfa/e/52t9IjtfG+mGBbTNdAoZ3RQKLHR6r0wQnwZnPIEh/Ya6XTWAKNA==} + dev: true + optional: true + + /markdown-table/1.1.3: + resolution: {integrity: sha512-1RUZVgQlpJSPWYbFSpmudq5nHY1doEIv89gBtF0s4gW1GF2XorxcA/70M5vq7rLv0a6mhOUccRsqkwhwLCIQ2Q==} + dev: true + + /mcl-wasm/0.7.9: + resolution: {integrity: sha512-iJIUcQWA88IJB/5L15GnJVnSQJmf/YaxxV6zRavv83HILHaJQb6y0iFyDMdDO0gN8X37tdxmAOrH/P8B6RB8sQ==} + engines: {node: '>=8.9.0'} + dev: true + + /md5.js/1.3.5: + resolution: {integrity: sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==} + dependencies: + hash-base: 3.1.0 + inherits: 2.0.4 + safe-buffer: 5.2.1 + dev: true + + /media-typer/0.3.0: + resolution: {integrity: sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==} + engines: {node: '>= 0.6'} + dev: true + + /memdown/1.4.1: + resolution: {integrity: sha512-iVrGHZB8i4OQfM155xx8akvG9FIj+ht14DX5CQkCTG4EHzZ3d3sgckIf/Lm9ivZalEsFuEVnWv2B2WZvbrro2w==} + dependencies: + abstract-leveldown: 2.7.2 + functional-red-black-tree: 1.0.1 + immediate: 3.3.0 + inherits: 2.0.4 + ltgt: 2.2.1 + safe-buffer: 5.1.2 + dev: true + optional: true + + /memory-level/1.0.0: + resolution: {integrity: sha512-UXzwewuWeHBz5krr7EvehKcmLFNoXxGcvuYhC41tRnkrTbJohtS7kVn9akmgirtRygg+f7Yjsfi8Uu5SGSQ4Og==} + engines: {node: '>=12'} + dependencies: + abstract-level: 1.0.4 + functional-red-black-tree: 1.0.1 + module-error: 1.0.2 + dev: true + + /memorystream/0.3.1: + resolution: {integrity: sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw==} + engines: {node: '>= 0.10.0'} + dev: true + + /merge-descriptors/1.0.1: + resolution: {integrity: sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==} + dev: true + + /methods/1.1.2: + resolution: {integrity: sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==} + engines: {node: '>= 0.6'} + dev: true + + /micro-ftch/0.3.1: + resolution: {integrity: sha512-/0LLxhzP0tfiR5hcQebtudP56gUurs2CLkGarnCiB/OqEyUFQ6U3paQi/tgLv0hBJYt2rnr9MNpxz4fiiugstg==} + dev: true + + /mime-db/1.52.0: + resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} + engines: {node: '>= 0.6'} + dev: true + + /mime-types/2.1.35: + resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} + engines: {node: '>= 0.6'} + dependencies: + mime-db: 1.52.0 + dev: true + + /mime/1.6.0: + resolution: {integrity: sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==} + engines: {node: '>=4'} + hasBin: true + dev: true + + /mimic-fn/2.1.0: + resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} + engines: {node: '>=6'} + dev: true + + /mimic-fn/3.1.0: + resolution: {integrity: sha512-Ysbi9uYW9hFyfrThdDEQuykN4Ey6BuwPD2kpI5ES/nFTDn/98yxYNLZJcgUAKPT/mcrLLKaGzJR9YVxJrIdASQ==} + engines: {node: '>=8'} + dev: true + + /mimic-response/1.0.1: + resolution: {integrity: sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==} + engines: {node: '>=4'} + dev: true + + /mimic-response/3.1.0: + resolution: {integrity: sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==} + engines: {node: '>=10'} + dev: true + + /mimic-response/4.0.0: + resolution: {integrity: sha512-e5ISH9xMYU0DzrT+jl8q2ze9D6eWBto+I8CNpe+VI+K2J/F/k3PdkdTdz4wvGVH4NTpo+NRYTVIuMQEMMcsLqg==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + dev: true + + /min-document/2.19.0: + resolution: {integrity: sha512-9Wy1B3m3f66bPPmU5hdA4DR4PB2OfDU/+GS3yAB7IQozE3tqXaVv2zOjgla7MEGSRv95+ILmOuvhLkOK6wJtCQ==} + dependencies: + dom-walk: 0.1.2 + dev: true + + /minimalistic-assert/1.0.1: + resolution: {integrity: sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==} + dev: true + + /minimalistic-crypto-utils/1.0.1: + resolution: {integrity: sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==} + dev: true + + /minimatch/3.1.2: + resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} + dependencies: + brace-expansion: 1.1.11 + dev: true + + /minimatch/5.0.1: + resolution: {integrity: sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==} + engines: {node: '>=10'} + dependencies: + brace-expansion: 2.0.1 + dev: true + + /minimatch/5.1.6: + resolution: {integrity: sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==} + engines: {node: '>=10'} + dependencies: + brace-expansion: 2.0.1 + dev: true + + /minimist/1.2.8: + resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} + dev: true + + /minipass/2.9.0: + resolution: {integrity: sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==} + dependencies: + safe-buffer: 5.2.1 + yallist: 3.1.1 + dev: true + + /minizlib/1.3.3: + resolution: {integrity: sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q==} + dependencies: + minipass: 2.9.0 + dev: true + + /mkdirp-promise/5.0.1: + resolution: {integrity: sha512-Hepn5kb1lJPtVW84RFT40YG1OddBNTOVUZR2bzQUHc+Z03en8/3uX0+060JDhcEzyO08HmipsN9DcnFMxhIL9w==} + engines: {node: '>=4'} + deprecated: This package is broken and no longer maintained. 'mkdirp' itself supports promises now, please switch to that. + dependencies: + mkdirp: 3.0.1 + dev: true + + /mkdirp/0.5.6: + resolution: {integrity: sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==} + hasBin: true + dependencies: + minimist: 1.2.8 + dev: true + + /mkdirp/1.0.4: + resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==} + engines: {node: '>=10'} + hasBin: true + dev: true + + /mkdirp/3.0.1: + resolution: {integrity: sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg==} + engines: {node: '>=10'} + hasBin: true + dev: true + + /mnemonist/0.38.5: + resolution: {integrity: sha512-bZTFT5rrPKtPJxj8KSV0WkPyNxl72vQepqqVUAW2ARUpUSF2qXMB6jZj7hW5/k7C1rtpzqbD/IIbJwLXUjCHeg==} + dependencies: + obliterator: 2.0.4 + dev: true + + /mocha/10.1.0: + resolution: {integrity: sha512-vUF7IYxEoN7XhQpFLxQAEMtE4W91acW4B6En9l97MwE9stL1A9gusXfoHZCLVHDUJ/7V5+lbCM6yMqzo5vNymg==} + engines: {node: '>= 14.0.0'} + hasBin: true + dependencies: + ansi-colors: 4.1.1 + browser-stdout: 1.3.1 + chokidar: 3.5.3 + debug: 4.3.4_supports-color@8.1.1 + diff: 5.0.0 + escape-string-regexp: 4.0.0 + find-up: 5.0.0 + glob: 7.2.0 + he: 1.2.0 + js-yaml: 4.1.0 + log-symbols: 4.1.0 + minimatch: 5.0.1 + ms: 2.1.3 + nanoid: 3.3.3 + serialize-javascript: 6.0.0 + strip-json-comments: 3.1.1 + supports-color: 8.1.1 + workerpool: 6.2.1 + yargs: 16.2.0 + yargs-parser: 20.2.4 + yargs-unparser: 2.0.0 + dev: true + + /mocha/10.3.0: + resolution: {integrity: sha512-uF2XJs+7xSLsrmIvn37i/wnc91nw7XjOQB8ccyx5aEgdnohr7n+rEiZP23WkCYHjilR6+EboEnbq/ZQDz4LSbg==} + engines: {node: '>= 14.0.0'} + hasBin: true + dependencies: + ansi-colors: 4.1.1 + browser-stdout: 1.3.1 + chokidar: 3.5.3 + debug: 4.3.4_supports-color@8.1.1 + diff: 5.0.0 + escape-string-regexp: 4.0.0 + find-up: 5.0.0 + glob: 8.1.0 + he: 1.2.0 + js-yaml: 4.1.0 + log-symbols: 4.1.0 + minimatch: 5.0.1 + ms: 2.1.3 + serialize-javascript: 6.0.0 + strip-json-comments: 3.1.1 + supports-color: 8.1.1 + workerpool: 6.2.1 + yargs: 16.2.0 + yargs-parser: 20.2.4 + yargs-unparser: 2.0.0 + dev: true + + /mock-fs/4.14.0: + resolution: {integrity: sha512-qYvlv/exQ4+svI3UOvPUpLDF0OMX5euvUH0Ny4N5QyRyhNdgAgUrVH3iUINSzEPLvx0kbo/Bp28GJKIqvE7URw==} + dev: true + + /module-error/1.0.2: + resolution: {integrity: sha512-0yuvsqSCv8LbaOKhnsQ/T5JhyFlCYLPXK3U2sgV10zoKQwzs/MyfuQUOZQ1V/6OCOJsK/TRgNVrPuPDqtdMFtA==} + engines: {node: '>=10'} + dev: true + + /ms/2.0.0: + resolution: {integrity: sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==} + dev: true + + /ms/2.1.2: + resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} + dev: true + + /ms/2.1.3: + resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} + dev: true + + /multibase/0.6.1: + resolution: {integrity: sha512-pFfAwyTjbbQgNc3G7D48JkJxWtoJoBMaR4xQUOuB8RnCgRqaYmWNFeJTTvrJ2w51bjLq2zTby6Rqj9TQ9elSUw==} + deprecated: This module has been superseded by the multiformats module + dependencies: + base-x: 3.0.9 + buffer: 5.7.1 + dev: true + + /multibase/0.7.0: + resolution: {integrity: sha512-TW8q03O0f6PNFTQDvh3xxH03c8CjGaaYrjkl9UQPG6rz53TQzzxJVCIWVjzcbN/Q5Y53Zd0IBQBMVktVgNx4Fg==} + deprecated: This module has been superseded by the multiformats module + dependencies: + base-x: 3.0.9 + buffer: 5.7.1 + dev: true + + /multicodec/0.5.7: + resolution: {integrity: sha512-PscoRxm3f+88fAtELwUnZxGDkduE2HD9Q6GHUOywQLjOGT/HAdhjLDYNZ1e7VR0s0TP0EwZ16LNUTFpoBGivOA==} + deprecated: This module has been superseded by the multiformats module + dependencies: + varint: 5.0.2 + dev: true + + /multicodec/1.0.4: + resolution: {integrity: sha512-NDd7FeS3QamVtbgfvu5h7fd1IlbaC4EQ0/pgU4zqE2vdHCmBGsUa0TiM8/TdSeG6BMPC92OOCf8F1ocE/Wkrrg==} + deprecated: This module has been superseded by the multiformats module + dependencies: + buffer: 5.7.1 + varint: 5.0.2 + dev: true + + /multihashes/0.4.21: + resolution: {integrity: sha512-uVSvmeCWf36pU2nB4/1kzYZjsXD9vofZKpgudqkceYY5g2aZZXJ5r9lxuzoRLl1OAp28XljXsEJ/X/85ZsKmKw==} + dependencies: + buffer: 5.7.1 + multibase: 0.7.0 + varint: 5.0.2 + dev: true + + /nano-base32/1.0.1: + resolution: {integrity: sha512-sxEtoTqAPdjWVGv71Q17koMFGsOMSiHsIFEvzOM7cNp8BXB4AnEwmDabm5dorusJf/v1z7QxaZYxUorU9RKaAw==} + dev: true + + /nano-json-stream-parser/0.1.2: + resolution: {integrity: sha512-9MqxMH/BSJC7dnLsEMPyfN5Dvoo49IsPFYMcHw3Bcfc2kN0lpHRBSzlMSVx4HGyJ7s9B31CyBTVehWJoQ8Ctew==} + dev: true + + /nanoassert/2.0.0: + resolution: {integrity: sha512-7vO7n28+aYO4J+8w96AzhmU8G+Y/xpPDJz/se19ICsqj/momRbb9mh9ZUtkoJ5X3nTnPdhEJyc0qnM6yAsHBaA==} + dev: true + + /nanoid/3.3.3: + resolution: {integrity: sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w==} + engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} + hasBin: true + dev: true + + /napi-macros/2.0.0: + resolution: {integrity: sha512-A0xLykHtARfueITVDernsAWdtIMbOJgKgcluwENp3AlsKN/PloyO10HtmoqnFAQAcxPkgZN7wdfPfEd0zNGxbg==} + dev: true + + /napi-macros/2.2.2: + resolution: {integrity: sha512-hmEVtAGYzVQpCKdbQea4skABsdXW4RUh5t5mJ2zzqowJS2OyXZTU1KhDVFhx+NlWZ4ap9mqR9TcDO3LTTttd+g==} + dev: true + + /natural-compare/1.4.0: + resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} + dev: true + + /negotiator/0.6.3: + resolution: {integrity: sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==} + engines: {node: '>= 0.6'} + dev: true + + /neodoc/2.0.2: + resolution: {integrity: sha512-NAppJ0YecKWdhSXFYCHbo6RutiX8vOt/Jo3l46mUg6pQlpJNaqc5cGxdrW2jITQm5JIYySbFVPDl3RrREXNyPw==} + dependencies: + ansi-regex: 2.1.1 + dev: true + + /next-tick/1.1.0: + resolution: {integrity: sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==} + dev: true + + /no-case/2.3.2: + resolution: {integrity: sha512-rmTZ9kz+f3rCvK2TD1Ue/oZlns7OGoIWP4fc3llxxRXlOkHKoWPPWJOfFYpITabSow43QJbRIoHQXtt10VldyQ==} + dependencies: + lower-case: 1.1.4 + dev: true + + /node-abort-controller/3.1.1: + resolution: {integrity: sha512-AGK2yQKIjRuqnc6VkX2Xj5d+QW8xZ87pa1UK6yA6ouUyuxfHuMP6umE5QK7UmTeOAymo+Zx1Fxiuw9rVx8taHQ==} + dev: true + + /node-addon-api/2.0.2: + resolution: {integrity: sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA==} + dev: true + + /node-fetch/2.6.7: + resolution: {integrity: sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==} + engines: {node: 4.x || >=6.0.0} + peerDependencies: + encoding: ^0.1.0 + peerDependenciesMeta: + encoding: + optional: true + dependencies: + whatwg-url: 5.0.0 + dev: true + optional: true + + /node-fetch/2.7.0: + resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} + engines: {node: 4.x || >=6.0.0} + peerDependencies: + encoding: ^0.1.0 + peerDependenciesMeta: + encoding: + optional: true + dependencies: + whatwg-url: 5.0.0 + dev: true + + /node-gyp-build/4.1.1: + resolution: {integrity: sha512-dSq1xmcPDKPZ2EED2S6zw/b9NKsqzXRE6dVr8TVQnI3FJOTteUMuqF3Qqs6LZg+mLGYJWqQzMbIjMtJqTv87nQ==} + hasBin: true + dev: true + optional: true + + /node-gyp-build/4.3.0: + resolution: {integrity: sha512-iWjXZvmboq0ja1pUGULQBexmxq8CV4xBhX7VDOTbL7ZR4FOowwY/VOtRxBN/yKxmdGoIp4j5ysNT4u3S2pDQ3Q==} + hasBin: true + dev: true + optional: true + + /node-gyp-build/4.4.0: + resolution: {integrity: sha512-amJnQCcgtRVw9SvoebO3BKGESClrfXGCUTX9hSn1OuGQTQBOZmVd0Z0OlecpuRksKvbsUqALE8jls/ErClAPuQ==} + hasBin: true + dev: true + + /node-gyp-build/4.8.0: + resolution: {integrity: sha512-u6fs2AEUljNho3EYTJNBfImO5QTo/J/1Etd+NVdCj7qWKUSN/bSLkZwhDv7I+w/MSC6qJ4cknepkAYykDdK8og==} + hasBin: true + dev: true + + /node-interval-tree/1.3.3: + resolution: {integrity: sha512-K9vk96HdTK5fEipJwxSvIIqwTqr4e3HRJeJrNxBSeVMNSC/JWARRaX7etOLOuTmrRMeOI/K5TCJu3aWIwZiNTw==} + engines: {node: '>= 7.6.0'} + dependencies: + shallowequal: 1.1.0 + dev: true + + /nofilter/1.0.4: + resolution: {integrity: sha512-N8lidFp+fCz+TD51+haYdbDGrcBWwuHX40F5+z0qkUjMJ5Tp+rdSuAkMJ9N9eoolDlEVTf6u5icM+cNKkKW2mA==} + engines: {node: '>=8'} + dev: true + + /nofilter/3.1.0: + resolution: {integrity: sha512-l2NNj07e9afPnhAhvgVrCD/oy2Ai1yfLpuo3EpiO1jFTsB4sFz6oIfAfSZyQzVpkZQ9xS8ZS5g1jCBgq4Hwo0g==} + engines: {node: '>=12.19'} + dev: true + + /normalize-package-data/2.5.0: + resolution: {integrity: sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==} + dependencies: + hosted-git-info: 2.8.9 + resolve: 1.22.8 + semver: 5.7.2 + validate-npm-package-license: 3.0.4 + dev: true + + /normalize-path/3.0.0: + resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} + engines: {node: '>=0.10.0'} + dev: true + + /normalize-url/6.1.0: + resolution: {integrity: sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A==} + engines: {node: '>=10'} + dev: true + + /normalize-url/8.0.0: + resolution: {integrity: sha512-uVFpKhj5MheNBJRTiMZ9pE/7hD1QTeEvugSJW/OmLzAp78PB5O6adfMNTvmfKhXBkvCzC+rqifWcVYpGFwTjnw==} + engines: {node: '>=14.16'} + dev: true + + /nth-check/2.1.1: + resolution: {integrity: sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==} + dependencies: + boolbase: 1.0.0 + dev: true + + /number-is-nan/1.0.1: + resolution: {integrity: sha512-4jbtZXNAsfZbAHiiqjLPBiCl16dES1zI4Hpzzxw61Tk+loF+sBDBKx1ICKKKwIqQ7M0mFn1TmkN7euSncWgHiQ==} + engines: {node: '>=0.10.0'} + dev: true + + /number-to-bn/1.7.0: + resolution: {integrity: sha512-wsJ9gfSz1/s4ZsJN01lyonwuxA1tml6X1yBDnfpMglypcBRFZZkus26EdPSlqS5GJfYddVZa22p3VNb3z5m5Ig==} + engines: {node: '>=6.5.0', npm: '>=3'} + dependencies: + bn.js: 4.11.6 + strip-hex-prefix: 1.0.0 + dev: true + + /oauth-sign/0.9.0: + resolution: {integrity: sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==} + dev: true + + /object-assign/4.1.1: + resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} + engines: {node: '>=0.10.0'} + dev: true + + /object-inspect/1.13.1: + resolution: {integrity: sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==} + dev: true + + /object-keys/1.1.1: + resolution: {integrity: sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==} + engines: {node: '>= 0.4'} + dev: true + + /object.assign/4.1.5: + resolution: {integrity: sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + define-properties: 1.2.1 + has-symbols: 1.0.3 + object-keys: 1.1.1 + dev: true + + /object.fromentries/2.0.7: + resolution: {integrity: sha512-UPbPHML6sL8PI/mOqPwsH4G6iyXcCGzLin8KvEPenOZN5lpCNBZZQ+V62vdjB1mQHrmqGQt5/OJzemUA+KJmEA==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + define-properties: 1.2.1 + es-abstract: 1.22.4 + dev: true + + /object.groupby/1.0.2: + resolution: {integrity: sha512-bzBq58S+x+uo0VjurFT0UktpKHOZmv4/xePiOA1nbB9pMqpGK7rUPNgf+1YC+7mE+0HzhTMqNUuCqvKhj6FnBw==} + dependencies: + array.prototype.filter: 1.0.3 + call-bind: 1.0.7 + define-properties: 1.2.1 + es-abstract: 1.22.4 + es-errors: 1.3.0 + dev: true + + /object.values/1.1.7: + resolution: {integrity: sha512-aU6xnDFYT3x17e/f0IiiwlGPTy2jzMySGfUB4fq6z7CV8l85CWHDk5ErhyhpfDHhrOMwGFhSQkhMGHaIotA6Ng==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + define-properties: 1.2.1 + es-abstract: 1.22.4 + dev: true + + /obliterator/2.0.4: + resolution: {integrity: sha512-lgHwxlxV1qIg1Eap7LgIeoBWIMFibOjbrYPIPJZcI1mmGAI2m3lNYpK12Y+GBdPQ0U1hRwSord7GIaawz962qQ==} + dev: true + + /oboe/2.1.5: + resolution: {integrity: sha512-zRFWiF+FoicxEs3jNI/WYUrVEgA7DeET/InK0XQuudGHRg8iIob3cNPrJTKaz4004uaA9Pbe+Dwa8iluhjLZWA==} + dependencies: + http-https: 1.0.0 + dev: true + + /on-finished/2.4.1: + resolution: {integrity: sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==} + engines: {node: '>= 0.8'} + dependencies: + ee-first: 1.1.1 + dev: true + + /once/1.4.0: + resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} + dependencies: + wrappy: 1.0.2 + dev: true + + /onetime/5.1.2: + resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} + engines: {node: '>=6'} + dependencies: + mimic-fn: 2.1.0 + dev: true + + /optionator/0.9.3: + resolution: {integrity: sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==} + engines: {node: '>= 0.8.0'} + dependencies: + '@aashutoshrathi/word-wrap': 1.2.6 + deep-is: 0.1.4 + fast-levenshtein: 2.0.6 + levn: 0.4.1 + prelude-ls: 1.2.1 + type-check: 0.4.0 + dev: true + + /original-require/1.0.1: + resolution: {integrity: sha512-5vdKMbE58WaE61uVD+PKyh8xdM398UnjPBLotW2sjG5MzHARwta/+NtMBCBA0t2WQblGYBvq5vsiZpWokwno+A==} + dev: true + + /os-locale/1.4.0: + resolution: {integrity: sha512-PRT7ZORmwu2MEFt4/fv3Q+mEfN4zetKxufQrkShY2oGvUms9r8otu5HfdyIFHkYXjO7laNsoVGmM2MANfuTA8g==} + engines: {node: '>=0.10.0'} + dependencies: + lcid: 1.0.0 + dev: true + + /os-tmpdir/1.0.2: + resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} + engines: {node: '>=0.10.0'} + dev: true + + /p-cancelable/2.1.1: + resolution: {integrity: sha512-BZOr3nRQHOntUjTrH8+Lh54smKHoHyur8We1V8DSMVrl5A2malOOwuJRnKRDjSnkoeBh4at6BwEnb5I7Jl31wg==} + engines: {node: '>=8'} + dev: true + + /p-cancelable/3.0.0: + resolution: {integrity: sha512-mlVgR3PGuzlo0MmTdk4cXqXWlwQDLnONTAg6sm62XkMJEiRxN3GL3SffkYvqwonbkJBcrI7Uvv5Zh9yjvn2iUw==} + engines: {node: '>=12.20'} + dev: true + + /p-limit/1.3.0: + resolution: {integrity: sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==} + engines: {node: '>=4'} + dependencies: + p-try: 1.0.0 + dev: true + + /p-limit/2.3.0: + resolution: {integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==} + engines: {node: '>=6'} + dependencies: + p-try: 2.2.0 + dev: true + + /p-limit/3.1.0: + resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==} + engines: {node: '>=10'} + dependencies: + yocto-queue: 0.1.0 + dev: true + + /p-locate/2.0.0: + resolution: {integrity: sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg==} + engines: {node: '>=4'} + dependencies: + p-limit: 1.3.0 + dev: true + + /p-locate/3.0.0: + resolution: {integrity: sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==} + engines: {node: '>=6'} + dependencies: + p-limit: 2.3.0 + dev: true + + /p-locate/4.1.0: + resolution: {integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==} + engines: {node: '>=8'} + dependencies: + p-limit: 2.3.0 + dev: true + + /p-locate/5.0.0: + resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==} + engines: {node: '>=10'} + dependencies: + p-limit: 3.1.0 + dev: true + + /p-map/4.0.0: + resolution: {integrity: sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==} + engines: {node: '>=10'} + dependencies: + aggregate-error: 3.1.0 + dev: true + + /p-try/1.0.0: + resolution: {integrity: sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww==} + engines: {node: '>=4'} + dev: true + + /p-try/2.2.0: + resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==} + engines: {node: '>=6'} + dev: true + + /package-json/8.1.1: + resolution: {integrity: sha512-cbH9IAIJHNj9uXi196JVsRlt7cHKak6u/e6AkL/bkRelZ7rlL3X1YKxsZwa36xipOEKAsdtmaG6aAJoM1fx2zA==} + engines: {node: '>=14.16'} + dependencies: + got: 12.6.1 + registry-auth-token: 5.0.2 + registry-url: 6.0.1 + semver: 7.6.0 + dev: true + + /param-case/2.1.1: + resolution: {integrity: sha512-eQE845L6ot89sk2N8liD8HAuH4ca6Vvr7VWAWwt7+kvvG5aBcPmmphQ68JsEG2qa9n1TykS2DLeMt363AAH8/w==} + dependencies: + no-case: 2.3.2 + dev: true + + /parent-module/1.0.1: + resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} + engines: {node: '>=6'} + dependencies: + callsites: 3.1.0 + dev: true + + /parse-cache-control/1.0.1: + resolution: {integrity: sha512-60zvsJReQPX5/QP0Kzfd/VrpjScIQ7SHBW6bFCYfEP+fp0Eppr1SHhIO5nd1PjZtvclzSzES9D/p5nFJurwfWg==} + dev: true + + /parse-headers/2.0.5: + resolution: {integrity: sha512-ft3iAoLOB/MlwbNXgzy43SWGP6sQki2jQvAyBg/zDFAgr9bfNWZIUj42Kw2eJIl8kEi4PbgE6U1Zau/HwI75HA==} + dev: true + + /parse-json/2.2.0: + resolution: {integrity: sha512-QR/GGaKCkhwk1ePQNYDRKYZ3mwU9ypsKhB0XyFnLQdomyEqk3e8wpW3V5Jp88zbxK4n5ST1nqo+g9juTpownhQ==} + engines: {node: '>=0.10.0'} + dependencies: + error-ex: 1.3.2 + dev: true + + /parse-json/5.2.0: + resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} + engines: {node: '>=8'} + dependencies: + '@babel/code-frame': 7.23.5 + error-ex: 1.3.2 + json-parse-even-better-errors: 2.3.1 + lines-and-columns: 1.2.4 + dev: true + + /parse-passwd/1.0.0: + resolution: {integrity: sha512-1Y1A//QUXEZK7YKz+rD9WydcE1+EuPr6ZBgKecAB8tmoW6UFv0NREVJe1p+jRxtThkcbbKkfwIbWJe/IeE6m2Q==} + engines: {node: '>=0.10.0'} + dev: true + + /parse5-htmlparser2-tree-adapter/7.0.0: + resolution: {integrity: sha512-B77tOZrqqfUfnVcOrUvfdLbz4pu4RopLD/4vmu3HUPswwTA8OH0EMW9BlWR2B0RCoiZRAHEUu7IxeP1Pd1UU+g==} + dependencies: + domhandler: 5.0.3 + parse5: 7.1.2 + dev: true + + /parse5/7.1.2: + resolution: {integrity: sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==} + dependencies: + entities: 4.5.0 + dev: true + + /parseurl/1.3.3: + resolution: {integrity: sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==} + engines: {node: '>= 0.8'} + dev: true + + /pascal-case/2.0.1: + resolution: {integrity: sha512-qjS4s8rBOJa2Xm0jmxXiyh1+OFf6ekCWOvUaRgAQSktzlTbMotS0nmG9gyYAybCWBcuP4fsBeRCKNwGBnMe2OQ==} + dependencies: + camel-case: 3.0.0 + upper-case-first: 1.1.2 + dev: true + + /path-case/2.1.1: + resolution: {integrity: sha512-Ou0N05MioItesaLr9q8TtHVWmJ6fxWdqKB2RohFmNWVyJ+2zeKIeDNWAN6B/Pe7wpzWChhZX6nONYmOnMeJQ/Q==} + dependencies: + no-case: 2.3.2 + dev: true + + /path-exists/2.1.0: + resolution: {integrity: sha512-yTltuKuhtNeFJKa1PiRzfLAU5182q1y4Eb4XCJ3PBqyzEDkAZRzBrKKBct682ls9reBVHf9udYLN5Nd+K1B9BQ==} + engines: {node: '>=0.10.0'} + dependencies: + pinkie-promise: 2.0.1 + dev: true + + /path-exists/3.0.0: + resolution: {integrity: sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==} + engines: {node: '>=4'} + dev: true + + /path-exists/4.0.0: + resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} + engines: {node: '>=8'} + dev: true + + /path-is-absolute/1.0.1: + resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} + engines: {node: '>=0.10.0'} + dev: true + + /path-key/3.1.1: + resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} + engines: {node: '>=8'} + dev: true + + /path-parse/1.0.7: + resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} + dev: true + + /path-to-regexp/0.1.7: + resolution: {integrity: sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==} + dev: true + + /path-type/1.1.0: + resolution: {integrity: sha512-S4eENJz1pkiQn9Znv33Q+deTOKmbl+jj1Fl+qiP/vYezj+S8x+J3Uo0ISrx/QoEvIlOaDWJhPaRd1flJ9HXZqg==} + engines: {node: '>=0.10.0'} + dependencies: + graceful-fs: 4.2.11 + pify: 2.3.0 + pinkie-promise: 2.0.1 + dev: true + + /path-type/4.0.0: + resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} + engines: {node: '>=8'} + dev: true + + /pathval/1.1.1: + resolution: {integrity: sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==} + dev: true + + /pbkdf2/3.1.2: + resolution: {integrity: sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA==} + engines: {node: '>=0.12'} + dependencies: + create-hash: 1.2.0 + create-hmac: 1.1.7 + ripemd160: 2.0.2 + safe-buffer: 5.2.1 + sha.js: 2.4.11 + dev: true + + /performance-now/2.1.0: + resolution: {integrity: sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==} + dev: true + + /picomatch/2.3.1: + resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} + engines: {node: '>=8.6'} + dev: true + + /pify/2.3.0: + resolution: {integrity: sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==} + engines: {node: '>=0.10.0'} + dev: true + + /pinkie-promise/2.0.1: + resolution: {integrity: sha512-0Gni6D4UcLTbv9c57DfxDGdr41XfgUjqWZu492f0cIGr16zDU06BWP/RAEvOuo7CQ0CNjHaLlM59YJJFm3NWlw==} + engines: {node: '>=0.10.0'} + dependencies: + pinkie: 2.0.4 + dev: true + + /pinkie/2.0.4: + resolution: {integrity: sha512-MnUuEycAemtSaeFSjXKW/aroV7akBbY+Sv+RkyqFjgAe73F+MR0TBWKBRDkmfWq/HiFmdavfZ1G7h4SPZXaCSg==} + engines: {node: '>=0.10.0'} + dev: true + + /pkg-up/3.1.0: + resolution: {integrity: sha512-nDywThFk1i4BQK4twPQ6TA4RT8bDY96yeuCVBWL3ePARCiEKDRSrNGbFIgUJpLp+XeIR65v8ra7WuJOFUBtkMA==} + engines: {node: '>=8'} + dependencies: + find-up: 3.0.0 + dev: true + + /pluralize/8.0.0: + resolution: {integrity: sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==} + engines: {node: '>=4'} + dev: true + + /pouchdb-abstract-mapreduce/7.3.1: + resolution: {integrity: sha512-0zKXVFBvrfc1KnN0ggrB762JDmZnUpePHywo9Bq3Jy+L1FnoG7fXM5luFfvv5/T0gEw+ZTIwoocZECMnESBI9w==} + dependencies: + pouchdb-binary-utils: 7.3.1 + pouchdb-collate: 7.3.1 + pouchdb-collections: 7.3.1 + pouchdb-errors: 7.3.1 + pouchdb-fetch: 7.3.1 + pouchdb-mapreduce-utils: 7.3.1 + pouchdb-md5: 7.3.1 + pouchdb-utils: 7.3.1 + transitivePeerDependencies: + - encoding + dev: true + optional: true + + /pouchdb-adapter-leveldb-core/7.3.1: + resolution: {integrity: sha512-mxShHlqLMPz2gChrgtA9okV1ogFmQrRAoM/O4EN0CrQWPLXqYtpL1f7sI2asIvFe7SmpnvbLx7kkZyFmLTfwjA==} + dependencies: + argsarray: 0.0.1 + buffer-from: 1.1.2 + double-ended-queue: 2.1.0-0 + levelup: 4.4.0 + pouchdb-adapter-utils: 7.3.1 + pouchdb-binary-utils: 7.3.1 + pouchdb-collections: 7.3.1 + pouchdb-errors: 7.3.1 + pouchdb-json: 7.3.1 + pouchdb-md5: 7.3.1 + pouchdb-merge: 7.3.1 + pouchdb-utils: 7.3.1 + sublevel-pouchdb: 7.3.1 + through2: 3.0.2 + dev: true + optional: true + + /pouchdb-adapter-memory/7.3.1: + resolution: {integrity: sha512-iHdWGJAHONqQv0we3Oi1MYen69ZS8McLW9wUyaAYcWTJnAIIAr2ZM0/TeTDVSHfMUwYqEYk7X8jRtJZEMwLnwg==} + dependencies: + memdown: 1.4.1 + pouchdb-adapter-leveldb-core: 7.3.1 + pouchdb-utils: 7.3.1 + dev: true + optional: true + + /pouchdb-adapter-utils/7.3.1: + resolution: {integrity: sha512-uKLG6dClwTs/sLIJ4WkLAi9wlnDBpOnfyhpeAgOjlOGN/XLz5nKHrA4UJRnURDyc+uv79S9r/Unc4hVpmbSPUw==} + dependencies: + pouchdb-binary-utils: 7.3.1 + pouchdb-collections: 7.3.1 + pouchdb-errors: 7.3.1 + pouchdb-md5: 7.3.1 + pouchdb-merge: 7.3.1 + pouchdb-utils: 7.3.1 + dev: true + optional: true + + /pouchdb-binary-utils/7.3.1: + resolution: {integrity: sha512-crZJNfAEOnUoRk977Qtmk4cxEv6sNKllQ6vDDKgQrQLFjMUXma35EHzNyIJr1s76J77Q4sqKQAmxz9Y40yHGtw==} + dependencies: + buffer-from: 1.1.2 + dev: true + optional: true + + /pouchdb-collate/7.3.1: + resolution: {integrity: sha512-o4gyGqDMLMSNzf6EDTr3eHaH/JRMoqRhdc+eV+oA8u00nTBtr9wD+jypVe2LbgKLJ4NWqx2qVkXiTiQdUFtsLQ==} + dev: true + optional: true + + /pouchdb-collections/7.3.1: + resolution: {integrity: sha512-yUyDqR+OJmtwgExOSJegpBJXDLAEC84TWnbAYycyh+DZoA51Yw0+XVQF5Vh8Ii90/Ut2xo88fmrmp0t6kqom8w==} + dev: true + optional: true + + /pouchdb-debug/7.2.1: + resolution: {integrity: sha512-eP3ht/AKavLF2RjTzBM6S9gaI2/apcW6xvaKRQhEdOfiANqerFuksFqHCal3aikVQuDO+cB/cw+a4RyJn/glBw==} + dependencies: + debug: 3.1.0 + transitivePeerDependencies: + - supports-color + dev: true + optional: true + + /pouchdb-errors/7.3.1: + resolution: {integrity: sha512-Zktz4gnXEUcZcty8FmyvtYUYsHskoST05m6H5/E2gg/0mCfEXq/XeyyLkZHaZmqD0ZPS9yNmASB1VaFWEKEaDw==} + dependencies: + inherits: 2.0.4 + dev: true + optional: true + + /pouchdb-fetch/7.3.1: + resolution: {integrity: sha512-205xAtvdHRPQ4fp1h9+RmT9oQabo9gafuPmWsS9aEl3ER54WbY8Vaj1JHZGbU4KtMTYvW7H5088zLS7Nrusuag==} + dependencies: + abort-controller: 3.0.0 + fetch-cookie: 0.11.0 + node-fetch: 2.6.7 + transitivePeerDependencies: + - encoding + dev: true + optional: true + + /pouchdb-find/7.3.1: + resolution: {integrity: sha512-AeqUfAVY1c7IFaY36BRT0vIz9r4VTKq/YOWTmiqndOZUQ/pDGxyO2fNFal6NN3PyYww0JijlD377cPvhnrhJVA==} + dependencies: + pouchdb-abstract-mapreduce: 7.3.1 + pouchdb-collate: 7.3.1 + pouchdb-errors: 7.3.1 + pouchdb-fetch: 7.3.1 + pouchdb-md5: 7.3.1 + pouchdb-selector-core: 7.3.1 + pouchdb-utils: 7.3.1 + transitivePeerDependencies: + - encoding + dev: true + optional: true + + /pouchdb-json/7.3.1: + resolution: {integrity: sha512-AyOKsmc85/GtHjMZyEacqzja8qLVfycS1hh1oskR+Bm5PIITX52Fb8zyi0hEetV6VC0yuGbn0RqiLjJxQePeqQ==} + dependencies: + vuvuzela: 1.0.3 + dev: true + optional: true + + /pouchdb-mapreduce-utils/7.3.1: + resolution: {integrity: sha512-oUMcq82+4pTGQ6dtrhgORHOVHZSr6w/5tFIUGlv7RABIDvJarL4snMawADjlpiEwPdiQ/ESG8Fqt8cxqvqsIgg==} + dependencies: + argsarray: 0.0.1 + inherits: 2.0.4 + pouchdb-collections: 7.3.1 + pouchdb-utils: 7.3.1 + dev: true + optional: true + + /pouchdb-md5/7.3.1: + resolution: {integrity: sha512-aDV8ui/mprnL3xmt0gT/81DFtTtJiKyn+OxIAbwKPMfz/rDFdPYvF0BmDC9QxMMzGfkV+JJUjU6at0PPs2mRLg==} + dependencies: + pouchdb-binary-utils: 7.3.1 + spark-md5: 3.0.2 + dev: true + optional: true + + /pouchdb-merge/7.3.1: + resolution: {integrity: sha512-FeK3r35mKimokf2PQ2tUI523QWyZ4lYZ0Yd75FfSch/SPY6wIokz5XBZZ6PHdu5aOJsEKzoLUxr8CpSg9DhcAw==} + dev: true + optional: true + + /pouchdb-selector-core/7.3.1: + resolution: {integrity: sha512-HBX+nNGXcaL9z0uNpwSMRq2GNZd3EZXW+fe9rJHS0hvJohjZL7aRJLoaXfEdHPRTNW+CpjM3Rny60eGekQdI/w==} + dependencies: + pouchdb-collate: 7.3.1 + pouchdb-utils: 7.3.1 + dev: true + optional: true + + /pouchdb-utils/7.3.1: + resolution: {integrity: sha512-R3hHBo1zTdTu/NFs3iqkcaQAPwhIH0gMIdfVKd5lbDYlmP26rCG5pdS+v7NuoSSFLJ4xxnaGV+Gjf4duYsJ8wQ==} + dependencies: + argsarray: 0.0.1 + clone-buffer: 1.0.0 + immediate: 3.3.0 + inherits: 2.0.4 + pouchdb-collections: 7.3.1 + pouchdb-errors: 7.3.1 + pouchdb-md5: 7.3.1 + uuid: 8.3.2 + dev: true + optional: true + + /pouchdb/7.3.0: + resolution: {integrity: sha512-OwsIQGXsfx3TrU1pLruj6PGSwFH+h5k4hGNxFkZ76Um7/ZI8F5TzUHFrpldVVIhfXYi2vP31q0q7ot1FSLFYOw==} + dependencies: + abort-controller: 3.0.0 + argsarray: 0.0.1 + buffer-from: 1.1.2 + clone-buffer: 1.0.0 + double-ended-queue: 2.1.0-0 + fetch-cookie: 0.11.0 + immediate: 3.3.0 + inherits: 2.0.4 + level: 6.0.1 + level-codec: 9.0.2 + level-write-stream: 1.0.0 + leveldown: 5.6.0 + levelup: 4.4.0 + ltgt: 2.2.1 + node-fetch: 2.6.7 + readable-stream: 1.1.14 + spark-md5: 3.0.2 + through2: 3.0.2 + uuid: 8.3.2 + vuvuzela: 1.0.3 + transitivePeerDependencies: + - encoding + dev: true + optional: true + + /prelude-ls/1.2.1: + resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} + engines: {node: '>= 0.8.0'} + dev: true + + /prettier-plugin-solidity/1.3.1_prettier@2.8.8: + resolution: {integrity: sha512-MN4OP5I2gHAzHZG1wcuJl0FsLS3c4Cc5494bbg+6oQWBPuEamjwDvmGfFMZ6NFzsh3Efd9UUxeT7ImgjNH4ozA==} + engines: {node: '>=16'} + requiresBuild: true + peerDependencies: + prettier: '>=2.3.0' + dependencies: + '@solidity-parser/parser': 0.17.0 + prettier: 2.8.8 + semver: 7.6.0 + solidity-comments-extractor: 0.0.8 + dev: true + optional: true + + /prettier/2.8.8: + resolution: {integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==} + engines: {node: '>=10.13.0'} + hasBin: true + requiresBuild: true + dev: true + optional: true + + /process-nextick-args/2.0.1: + resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==} + dev: true + + /process/0.11.10: + resolution: {integrity: sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==} + engines: {node: '>= 0.6.0'} + dev: true + + /promise/8.3.0: + resolution: {integrity: sha512-rZPNPKTOYVNEEKFaq1HqTgOwZD+4/YHS5ukLzQCypkj+OkYx7iv0mA91lJlpPPZ8vMau3IIGj5Qlwrx+8iiSmg==} + dependencies: + asap: 2.0.6 + dev: true + + /proper-lockfile/4.1.2: + resolution: {integrity: sha512-TjNPblN4BwAWMXU8s9AEz4JmQxnD1NNL7bNOY/AKUzyamc379FWASUhc/K1pL2noVb+XmZKLL68cjzLsiOAMaA==} + dependencies: + graceful-fs: 4.2.11 + retry: 0.12.0 + signal-exit: 3.0.7 + dev: false + + /proto-list/1.2.4: + resolution: {integrity: sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==} + dev: true + + /proxy-addr/2.0.7: + resolution: {integrity: sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==} + engines: {node: '>= 0.10'} + dependencies: + forwarded: 0.2.0 + ipaddr.js: 1.9.1 + dev: true + + /proxy-from-env/1.1.0: + resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} + dev: true + + /prr/1.0.1: + resolution: {integrity: sha512-yPw4Sng1gWghHQWj0B3ZggWUm4qVbPwPFcRG8KyxiU7J2OHFSoEHKS+EZ3fv5l1t9CyCiop6l/ZYeWbrgoQejw==} + dev: true + optional: true + + /psl/1.9.0: + resolution: {integrity: sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==} + dev: true + + /pump/3.0.0: + resolution: {integrity: sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==} + dependencies: + end-of-stream: 1.4.4 + once: 1.4.0 + dev: true + + /punycode/2.1.0: + resolution: {integrity: sha512-Yxz2kRwT90aPiWEMHVYnEf4+rhwF1tBmmZ4KepCP+Wkium9JxtWnUm1nqGwpiAHr/tnTSeHqr3wb++jgSkXjhA==} + engines: {node: '>=6'} + dev: true + + /punycode/2.3.1: + resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} + engines: {node: '>=6'} + dev: true + + /pure-rand/5.0.5: + resolution: {integrity: sha512-BwQpbqxSCBJVpamI6ydzcKqyFmnd5msMWUGvzXLm1aXvusbbgkbOto/EUPM00hjveJEaJtdbhUjKSzWRhQVkaw==} + dev: true + + /qs/6.11.0: + resolution: {integrity: sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==} + engines: {node: '>=0.6'} + dependencies: + side-channel: 1.0.5 + dev: true + + /qs/6.11.2: + resolution: {integrity: sha512-tDNIz22aBzCDxLtVH++VnTfzxlfeK5CbqohpSqpJgj1Wg/cQbStNAz3NuqCs5vV+pjBsK4x4pN9HlVh7rcYRiA==} + engines: {node: '>=0.6'} + dependencies: + side-channel: 1.0.5 + dev: true + + /qs/6.5.3: + resolution: {integrity: sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==} + engines: {node: '>=0.6'} + dev: true + + /query-string/5.1.1: + resolution: {integrity: sha512-gjWOsm2SoGlgLEdAGt7a6slVOk9mGiXmPFMqrEhLQ68rhQuBnpfs3+EmlvqKyxnCo9/PPlF+9MtY02S1aFg+Jw==} + engines: {node: '>=0.10.0'} + dependencies: + decode-uri-component: 0.2.2 + object-assign: 4.1.1 + strict-uri-encode: 1.1.0 + dev: true + + /querystring/0.2.1: + resolution: {integrity: sha512-wkvS7mL/JMugcup3/rMitHmd9ecIGd2lhFhK9N3UUQ450h66d1r3Y9nvXzQAW1Lq+wyx61k/1pfKS5KuKiyEbg==} + engines: {node: '>=0.4.x'} + deprecated: The querystring API is considered Legacy. new code should use the URLSearchParams API instead. + dev: true + + /querystringify/2.2.0: + resolution: {integrity: sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==} + dev: true + optional: true + + /queue-microtask/1.2.3: + resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} + dev: true + + /quick-lru/5.1.1: + resolution: {integrity: sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==} + engines: {node: '>=10'} + dev: true + + /randombytes/2.1.0: + resolution: {integrity: sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==} + dependencies: + safe-buffer: 5.2.1 + dev: true + + /range-parser/1.2.1: + resolution: {integrity: sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==} + engines: {node: '>= 0.6'} + dev: true + + /raw-body/2.5.1: + resolution: {integrity: sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==} + engines: {node: '>= 0.8'} + dependencies: + bytes: 3.1.2 + http-errors: 2.0.0 + iconv-lite: 0.4.24 + unpipe: 1.0.0 + dev: true + + /raw-body/2.5.2: + resolution: {integrity: sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==} + engines: {node: '>= 0.8'} + dependencies: + bytes: 3.1.2 + http-errors: 2.0.0 + iconv-lite: 0.4.24 + unpipe: 1.0.0 + dev: true + + /rc/1.2.8: + resolution: {integrity: sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==} + hasBin: true + dependencies: + deep-extend: 0.6.0 + ini: 1.3.8 + minimist: 1.2.8 + strip-json-comments: 2.0.1 + dev: true + + /read-pkg-up/1.0.1: + resolution: {integrity: sha512-WD9MTlNtI55IwYUS27iHh9tK3YoIVhxis8yKhLpTqWtml739uXc9NWTpxoHkfZf3+DkCCsXox94/VWZniuZm6A==} + engines: {node: '>=0.10.0'} + dependencies: + find-up: 1.1.2 + read-pkg: 1.1.0 + dev: true + + /read-pkg/1.1.0: + resolution: {integrity: sha512-7BGwRHqt4s/uVbuyoeejRn4YmFnYZiFl4AuaeXHlgZf3sONF0SOGlxs2Pw8g6hCKupo08RafIO5YXFNOKTfwsQ==} + engines: {node: '>=0.10.0'} + dependencies: + load-json-file: 1.1.0 + normalize-package-data: 2.5.0 + path-type: 1.1.0 + dev: true + + /readable-stream/0.0.4: + resolution: {integrity: sha512-azrivNydKRYt7zwLV5wWUK7YzKTWs3q87xSmY6DlHapPrCvaT6ZrukvM5erV+yCSSPmZT8zkSdttOHQpWWm9zw==} + dev: true + optional: true + + /readable-stream/1.1.14: + resolution: {integrity: sha512-+MeVjFf4L44XUkhM1eYbD8fyEsxcV81pqMSR5gblfcLCHfZvbrqy4/qYHE+/R5HoBUT11WV5O08Cr1n3YXkWVQ==} + dependencies: + core-util-is: 1.0.3 + inherits: 2.0.4 + isarray: 0.0.1 + string_decoder: 0.10.31 + dev: true + optional: true + + /readable-stream/2.3.8: + resolution: {integrity: sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==} + dependencies: + core-util-is: 1.0.3 + inherits: 2.0.4 + isarray: 1.0.0 + process-nextick-args: 2.0.1 + safe-buffer: 5.1.2 + string_decoder: 1.1.1 + util-deprecate: 1.0.2 + dev: true + + /readable-stream/3.6.2: + resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} + engines: {node: '>= 6'} + dependencies: + inherits: 2.0.4 + string_decoder: 1.3.0 + util-deprecate: 1.0.2 + dev: true + + /readdirp/3.6.0: + resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} + engines: {node: '>=8.10.0'} + dependencies: + picomatch: 2.3.1 + dev: true + + /redux-saga/1.0.0: + resolution: {integrity: sha512-GvJWs/SzMvEQgeaw6sRMXnS2FghlvEGsHiEtTLpJqc/FHF3I5EE/B+Hq5lyHZ8LSoT2r/X/46uWvkdCnK9WgHA==} + dependencies: + '@redux-saga/core': 1.3.0 + dev: true + + /redux/3.7.2: + resolution: {integrity: sha512-pNqnf9q1hI5HHZRBkj3bAngGZW/JMCmexDlOxw4XagXY2o1327nHH54LoTjiPJ0gizoqPDRqWyX/00g0hD6w+A==} + dependencies: + lodash: 4.17.21 + lodash-es: 4.17.21 + loose-envify: 1.4.0 + symbol-observable: 1.2.0 + dev: true + + /regenerator-runtime/0.14.1: + resolution: {integrity: sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==} + dev: true + + /regexp.prototype.flags/1.5.2: + resolution: {integrity: sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + define-properties: 1.2.1 + es-errors: 1.3.0 + set-function-name: 2.0.1 + dev: true + + /registry-auth-token/5.0.2: + resolution: {integrity: sha512-o/3ikDxtXaA59BmZuZrJZDJv8NMDGSj+6j6XaeBmHw8eY1i1qd9+6H+LjVvQXx3HN6aRCGa1cUdJ9RaJZUugnQ==} + engines: {node: '>=14'} + dependencies: + '@pnpm/npm-conf': 2.2.2 + dev: true + + /registry-url/6.0.1: + resolution: {integrity: sha512-+crtS5QjFRqFCoQmvGduwYWEBng99ZvmFvF+cUJkGYF1L1BfU8C6Zp9T7f5vPAwyLkUExpvK+ANVZmGU49qi4Q==} + engines: {node: '>=12'} + dependencies: + rc: 1.2.8 + dev: true + + /req-cwd/2.0.0: + resolution: {integrity: sha512-ueoIoLo1OfB6b05COxAA9UpeoscNpYyM+BqYlA7H6LVF4hKGPXQQSSaD2YmvDVJMkk4UDpAHIeU1zG53IqjvlQ==} + engines: {node: '>=4'} + dependencies: + req-from: 2.0.0 + dev: true + + /req-from/2.0.0: + resolution: {integrity: sha512-LzTfEVDVQHBRfjOUMgNBA+V6DWsSnoeKzf42J7l0xa/B4jyPOuuF5MlNSmomLNGemWTnV2TIdjSSLnEn95fOQA==} + engines: {node: '>=4'} + dependencies: + resolve-from: 3.0.0 + dev: true + + /request/2.88.2: + resolution: {integrity: sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==} + engines: {node: '>= 6'} + deprecated: request has been deprecated, see https://github.com/request/request/issues/3142 + dependencies: + aws-sign2: 0.7.0 + aws4: 1.12.0 + caseless: 0.12.0 + combined-stream: 1.0.8 + extend: 3.0.2 + forever-agent: 0.6.1 + form-data: 2.3.3 + har-validator: 5.1.5 + http-signature: 1.2.0 + is-typedarray: 1.0.0 + isstream: 0.1.2 + json-stringify-safe: 5.0.1 + mime-types: 2.1.35 + oauth-sign: 0.9.0 + performance-now: 2.1.0 + qs: 6.5.3 + safe-buffer: 5.2.1 + tough-cookie: 2.5.0 + tunnel-agent: 0.6.0 + uuid: 3.4.0 + dev: true + + /require-directory/2.1.1: + resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} + engines: {node: '>=0.10.0'} + dev: true + + /require-from-string/1.2.1: + resolution: {integrity: sha512-H7AkJWMobeskkttHyhTVtS0fxpFLjxhbfMa6Bk3wimP7sdPRGL3EyCg3sAQenFfAe+xQ+oAc85Nmtvq0ROM83Q==} + engines: {node: '>=0.10.0'} + dev: true + + /require-from-string/2.0.2: + resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==} + engines: {node: '>=0.10.0'} + dev: true + + /require-main-filename/1.0.1: + resolution: {integrity: sha512-IqSUtOVP4ksd1C/ej5zeEh/BIP2ajqpn8c5x+q99gvcIG/Qf0cud5raVnE/Dwd0ua9TXYDoDc0RE5hBSdz22Ug==} + dev: true + + /requires-port/1.0.0: + resolution: {integrity: sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==} + dev: true + optional: true + + /reselect-tree/1.3.7: + resolution: {integrity: sha512-kZN+C1cVJ6fFN2smSb0l4UvYZlRzttgnu183svH4NrU22cBY++ikgr2QT75Uuk4MYpv5gXSVijw4c5U6cx6GKg==} + dependencies: + debug: 3.2.7 + json-pointer: 0.6.2 + reselect: 4.1.8 + transitivePeerDependencies: + - supports-color + dev: true + + /reselect/4.1.8: + resolution: {integrity: sha512-ab9EmR80F/zQTMNeneUr4cv+jSwPJgIlvEmVwLerwrWVbpLlBuls9XHzIeTFy4cegU2NHBp3va0LKOzU5qFEYQ==} + dev: true + + /resolve-alpn/1.2.1: + resolution: {integrity: sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g==} + dev: true + + /resolve-dir/1.0.1: + resolution: {integrity: sha512-R7uiTjECzvOsWSfdM0QKFNBVFcK27aHOUwdvK53BcW8zqnGdYp0Fbj82cy54+2A4P2tFM22J5kRfe1R+lM/1yg==} + engines: {node: '>=0.10.0'} + dependencies: + expand-tilde: 2.0.2 + global-modules: 1.0.0 + dev: true + + /resolve-from/3.0.0: + resolution: {integrity: sha512-GnlH6vxLymXJNMBo7XP1fJIzBFbdYt49CuTwmB/6N53t+kMPRMFKz783LlQ4tv28XoQfMWinAJX6WCGf2IlaIw==} + engines: {node: '>=4'} + dev: true + + /resolve-from/4.0.0: + resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} + engines: {node: '>=4'} + dev: true + + /resolve-pkg-maps/1.0.0: + resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==} + dev: true + + /resolve/1.17.0: + resolution: {integrity: sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==} + dependencies: + path-parse: 1.0.7 + dev: true + + /resolve/1.22.8: + resolution: {integrity: sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==} + hasBin: true + dependencies: + is-core-module: 2.13.1 + path-parse: 1.0.7 + supports-preserve-symlinks-flag: 1.0.0 + dev: true + + /responselike/2.0.1: + resolution: {integrity: sha512-4gl03wn3hj1HP3yzgdI7d3lCkF95F21Pz4BPGvKHinyQzALR5CapwC8yIi0Rh58DEMQ/SguC03wFj2k0M/mHhw==} + dependencies: + lowercase-keys: 2.0.0 + dev: true + + /responselike/3.0.0: + resolution: {integrity: sha512-40yHxbNcl2+rzXvZuVkrYohathsSJlMTXKryG5y8uciHv1+xDLHQpgjG64JUO9nrEq2jGLH6IZ8BcZyw3wrweg==} + engines: {node: '>=14.16'} + dependencies: + lowercase-keys: 3.0.0 + dev: true + + /restore-cursor/3.1.0: + resolution: {integrity: sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==} + engines: {node: '>=8'} + dependencies: + onetime: 5.1.2 + signal-exit: 3.0.7 + dev: true + + /retry/0.12.0: + resolution: {integrity: sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==} + engines: {node: '>= 4'} + dev: false + + /retry/0.13.1: + resolution: {integrity: sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg==} + engines: {node: '>= 4'} + dev: true + optional: true + + /reusify/1.0.4: + resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} + engines: {iojs: '>=1.0.0', node: '>=0.10.0'} + dev: true + + /rimraf/2.7.1: + resolution: {integrity: sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==} + hasBin: true + dependencies: + glob: 7.2.0 + dev: true + + /rimraf/3.0.2: + resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} + hasBin: true + dependencies: + glob: 7.2.3 + dev: true + + /ripemd160-min/0.0.6: + resolution: {integrity: sha512-+GcJgQivhs6S9qvLogusiTcS9kQUfgR75whKuy5jIhuiOfQuJ8fjqxV6EGD5duH1Y/FawFUMtMhyeq3Fbnib8A==} + engines: {node: '>=8'} + dev: true + + /ripemd160/2.0.2: + resolution: {integrity: sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==} + dependencies: + hash-base: 3.1.0 + inherits: 2.0.4 + dev: true + + /rlp/2.2.7: + resolution: {integrity: sha512-d5gdPmgQ0Z+AklL2NVXr/IoSjNZFfTVvQWzL/AM2AOcSzYP2xjlb0AC8YyCLc41MSNf6P6QVtjgPdmVtzb+4lQ==} + hasBin: true + dependencies: + bn.js: 5.2.1 + dev: true + + /run-parallel-limit/1.1.0: + resolution: {integrity: sha512-jJA7irRNM91jaKc3Hcl1npHsFLOXOoTkPCUL1JEa1R82O2miplXXRaGdjW/KM/98YQWDhJLiSs793CnXfblJUw==} + dependencies: + queue-microtask: 1.2.3 + dev: true + + /run-parallel/1.2.0: + resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} + dependencies: + queue-microtask: 1.2.3 + dev: true + + /rustbn.js/0.2.0: + resolution: {integrity: sha512-4VlvkRUuCJvr2J6Y0ImW7NvTCriMi7ErOAqWk1y69vAdoNIzCF3yPmgeNzx+RQTLEDFq5sHfscn1MwHxP9hNfA==} + dev: true + + /safe-array-concat/1.1.0: + resolution: {integrity: sha512-ZdQ0Jeb9Ofti4hbt5lX3T2JcAamT9hfzYU1MNB+z/jaEbB6wfFfPIR/zEORmZqobkCCJhSjodobH6WHNmJ97dg==} + engines: {node: '>=0.4'} + dependencies: + call-bind: 1.0.7 + get-intrinsic: 1.2.4 + has-symbols: 1.0.3 + isarray: 2.0.5 + dev: true + + /safe-buffer/5.1.2: + resolution: {integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==} + dev: true + + /safe-buffer/5.2.1: + resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} + dev: true + + /safe-regex-test/1.0.3: + resolution: {integrity: sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + es-errors: 1.3.0 + is-regex: 1.1.4 + dev: true + + /safer-buffer/2.1.2: + resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} + dev: true + + /scrypt-js/2.0.4: + resolution: {integrity: sha512-4KsaGcPnuhtCZQCxFxN3GVYIhKFPTdLd8PLC552XwbMndtD0cjRFAhDuuydXQ0h08ZfPgzqe6EKHozpuH74iDw==} + dev: true + + /scrypt-js/3.0.1: + resolution: {integrity: sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==} + dev: true + + /secp256k1/4.0.3: + resolution: {integrity: sha512-NLZVf+ROMxwtEj3Xa562qgv2BK5e2WNmXPiOdVIPLgs6lyTzMvBq0aWTYMI5XCP9jZMVKOcqZLw/Wc4vDkuxhA==} + engines: {node: '>=10.0.0'} + requiresBuild: true + dependencies: + elliptic: 6.5.4 + node-addon-api: 2.0.2 + node-gyp-build: 4.8.0 + dev: true + + /seedrandom/3.0.5: + resolution: {integrity: sha512-8OwmbklUNzwezjGInmZ+2clQmExQPvomqjL7LFqOYqtmuxRgQYqOD3mHaU+MvZn5FLUeVxVfQjwLZW/n/JFuqg==} + dev: true + + /semver/5.7.2: + resolution: {integrity: sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==} + hasBin: true + dev: true + + /semver/6.3.1: + resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} + hasBin: true + dev: true + + /semver/7.6.0: + resolution: {integrity: sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==} + engines: {node: '>=10'} + hasBin: true + dependencies: + lru-cache: 6.0.0 + dev: true + + /send/0.18.0: + resolution: {integrity: sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==} + engines: {node: '>= 0.8.0'} + dependencies: + debug: 2.6.9 + depd: 2.0.0 + destroy: 1.2.0 + encodeurl: 1.0.2 + escape-html: 1.0.3 + etag: 1.8.1 + fresh: 0.5.2 + http-errors: 2.0.0 + mime: 1.6.0 + ms: 2.1.3 + on-finished: 2.4.1 + range-parser: 1.2.1 + statuses: 2.0.1 + transitivePeerDependencies: + - supports-color + dev: true + + /sentence-case/2.1.1: + resolution: {integrity: sha512-ENl7cYHaK/Ktwk5OTD+aDbQ3uC8IByu/6Bkg+HDv8Mm+XnBnppVNalcfJTNsp1ibstKh030/JKQQWglDvtKwEQ==} + dependencies: + no-case: 2.3.2 + upper-case-first: 1.1.2 + dev: true + + /serialize-javascript/6.0.0: + resolution: {integrity: sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==} + dependencies: + randombytes: 2.1.0 + dev: true + + /serve-static/1.15.0: + resolution: {integrity: sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==} + engines: {node: '>= 0.8.0'} + dependencies: + encodeurl: 1.0.2 + escape-html: 1.0.3 + parseurl: 1.3.3 + send: 0.18.0 + transitivePeerDependencies: + - supports-color + dev: true + + /servify/0.1.12: + resolution: {integrity: sha512-/xE6GvsKKqyo1BAY+KxOWXcLpPsUUyji7Qg3bVD7hh1eRze5bR1uYiuDA/k3Gof1s9BTzQZEJK8sNcNGFIzeWw==} + engines: {node: '>=6'} + dependencies: + body-parser: 1.20.2 + cors: 2.8.5 + express: 4.18.2 + request: 2.88.2 + xhr: 2.6.0 + transitivePeerDependencies: + - supports-color + dev: true + + /set-blocking/2.0.0: + resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} + dev: true + + /set-function-length/1.2.1: + resolution: {integrity: sha512-j4t6ccc+VsKwYHso+kElc5neZpjtq9EnRICFZtWyBsLojhmeF/ZBd/elqm22WJh/BziDe/SBiOeAt0m2mfLD0g==} + engines: {node: '>= 0.4'} + dependencies: + define-data-property: 1.1.4 + es-errors: 1.3.0 + function-bind: 1.1.2 + get-intrinsic: 1.2.4 + gopd: 1.0.1 + has-property-descriptors: 1.0.2 + dev: true + + /set-function-name/2.0.1: + resolution: {integrity: sha512-tMNCiqYVkXIZgc2Hnoy2IvC/f8ezc5koaRFkCjrpWzGpCd3qbZXPzVy9MAZzK1ch/X0jvSkojys3oqJN0qCmdA==} + engines: {node: '>= 0.4'} + dependencies: + define-data-property: 1.1.4 + functions-have-names: 1.2.3 + has-property-descriptors: 1.0.2 + dev: true + + /setimmediate/1.0.4: + resolution: {integrity: sha512-/TjEmXQVEzdod/FFskf3o7oOAsGhHf2j1dZqRFbDzq4F3mvvxflIIi4Hd3bLQE9y/CpwqfSQam5JakI/mi3Pog==} + dev: true + + /setimmediate/1.0.5: + resolution: {integrity: sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==} + dev: true + + /setprototypeof/1.2.0: + resolution: {integrity: sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==} + dev: true + + /sha.js/2.4.11: + resolution: {integrity: sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==} + hasBin: true + dependencies: + inherits: 2.0.4 + safe-buffer: 5.2.1 + dev: true + + /sha1/1.1.1: + resolution: {integrity: sha512-dZBS6OrMjtgVkopB1Gmo4RQCDKiZsqcpAQpkV/aaj+FCrCg8r4I4qMkDPQjBgLIxlmu9k4nUbWq6ohXahOneYA==} + dependencies: + charenc: 0.0.2 + crypt: 0.0.2 + dev: true + + /sha3-wasm/1.0.0: + resolution: {integrity: sha512-yX0ULD3VD8U80YlM+6FapExy9uzYBpEOZzXRHwdhJn/+3PBbKhRHiNhknBqmMkW110zglXrJoZ52gtRbDGK4tg==} + dependencies: + nanoassert: 2.0.0 + dev: true + + /sha3/2.1.4: + resolution: {integrity: sha512-S8cNxbyb0UGUM2VhRD4Poe5N58gJnJsLJ5vC7FYWGUmGhcsj4++WaIOBFVDxlG0W3To6xBuiRh+i0Qp2oNCOtg==} + dependencies: + buffer: 6.0.3 + dev: true + + /shallowequal/1.1.0: + resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==} + dev: true + + /shebang-command/2.0.0: + resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} + engines: {node: '>=8'} + dependencies: + shebang-regex: 3.0.0 + dev: true + + /shebang-regex/3.0.0: + resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} + engines: {node: '>=8'} + dev: true + + /side-channel/1.0.5: + resolution: {integrity: sha512-QcgiIWV4WV7qWExbN5llt6frQB/lBven9pqliLXfGPB+K9ZYXxDozp0wLkHS24kWCm+6YXH/f0HhnObZnZOBnQ==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + es-errors: 1.3.0 + get-intrinsic: 1.2.4 + object-inspect: 1.13.1 + dev: true + + /signal-exit/3.0.7: + resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} + + /simple-concat/1.0.1: + resolution: {integrity: sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==} + dev: true + + /simple-get/2.8.2: + resolution: {integrity: sha512-Ijd/rV5o+mSBBs4F/x9oDPtTx9Zb6X9brmnXvMW4J7IR15ngi9q5xxqWBKU744jTZiaXtxaPL7uHG6vtN8kUkw==} + dependencies: + decompress-response: 3.3.0 + once: 1.4.0 + simple-concat: 1.0.1 + dev: true + + /slice-ansi/4.0.0: + resolution: {integrity: sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==} + engines: {node: '>=10'} + dependencies: + ansi-styles: 4.3.0 + astral-regex: 2.0.0 + is-fullwidth-code-point: 3.0.0 + dev: true + + /snake-case/2.1.0: + resolution: {integrity: sha512-FMR5YoPFwOLuh4rRz92dywJjyKYZNLpMn1R5ujVpIYkbA9p01fq8RMg0FkO4M+Yobt4MjHeLTJVm5xFFBHSV2Q==} + dependencies: + no-case: 2.3.2 + dev: true + + /solc/0.4.26: + resolution: {integrity: sha512-o+c6FpkiHd+HPjmjEVpQgH7fqZ14tJpXhho+/bQXlXbliLIS/xjXb42Vxh+qQY1WCSTMQ0+a5vR9vi0MfhU6mA==} + hasBin: true + dependencies: + fs-extra: 0.30.0 + memorystream: 0.3.1 + require-from-string: 1.2.1 + semver: 5.7.2 + yargs: 4.8.1 + dev: true + + /solc/0.7.3_debug@4.3.4: + resolution: {integrity: sha512-GAsWNAjGzIDg7VxzP6mPjdurby3IkGCjQcM8GFYZT6RyaoUZKmMU6Y7YwG+tFGhv7dwZ8rmR4iwFDrrD99JwqA==} + engines: {node: '>=8.0.0'} + hasBin: true + dependencies: + command-exists: 1.2.9 + commander: 3.0.2 + follow-redirects: 1.15.5 + fs-extra: 0.30.0 + js-sha3: 0.8.0 + memorystream: 0.3.1 + require-from-string: 2.0.2 + semver: 5.7.2 + tmp: 0.0.33 + transitivePeerDependencies: + - debug + dev: true + + /solc/0.8.21_debug@4.3.4: + resolution: {integrity: sha512-N55ogy2dkTRwiONbj4e6wMZqUNaLZkiRcjGyeafjLYzo/tf/IvhHY5P5wpe+H3Fubh9idu071i8eOGO31s1ylg==} + engines: {node: '>=10.0.0'} + hasBin: true + dependencies: + command-exists: 1.2.9 + commander: 8.3.0 + follow-redirects: 1.15.5 + js-sha3: 0.8.0 + memorystream: 0.3.1 + semver: 5.7.2 + tmp: 0.0.33 + transitivePeerDependencies: + - debug + dev: true + + /solhint/4.1.1: + resolution: {integrity: sha512-7G4iF8H5hKHc0tR+/uyZesSKtfppFIMvPSW+Ku6MSL25oVRuyFeqNhOsXHfkex64wYJyXs4fe+pvhB069I19Tw==} + hasBin: true + dependencies: + '@solidity-parser/parser': 0.16.2 + ajv: 6.12.6 + antlr4: 4.13.1 + ast-parents: 0.0.1 + chalk: 4.1.2 + commander: 10.0.1 + cosmiconfig: 8.3.6 + fast-diff: 1.3.0 + glob: 8.1.0 + ignore: 5.3.1 + js-yaml: 4.1.0 + latest-version: 7.0.0 + lodash: 4.17.21 + pluralize: 8.0.0 + semver: 7.6.0 + strip-ansi: 6.0.1 + table: 6.8.1 + text-table: 0.2.0 + optionalDependencies: + prettier: 2.8.8 + transitivePeerDependencies: + - typescript + dev: true + + /solidity-comments-extractor/0.0.8: + resolution: {integrity: sha512-htM7Vn6LhHreR+EglVMd2s+sZhcXAirB1Zlyrv5zBuTxieCvjfnRpd7iZk75m/u6NOlEyQ94C6TWbBn2cY7w8g==} + dev: true + optional: true + + /source-map-support/0.5.21: + resolution: {integrity: sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==} + dependencies: + buffer-from: 1.1.2 + source-map: 0.6.1 + dev: true + + /source-map/0.6.1: + resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} + engines: {node: '>=0.10.0'} + dev: true + + /spark-md5/3.0.2: + resolution: {integrity: sha512-wcFzz9cDfbuqe0FZzfi2or1sgyIrsDwmPwfZC4hiNidPdPINjeUwNfv5kldczoEAcjl9Y1L3SM7Uz2PUEQzxQw==} + dev: true + optional: true + + /spdx-correct/3.2.0: + resolution: {integrity: sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==} + dependencies: + spdx-expression-parse: 3.0.1 + spdx-license-ids: 3.0.17 + dev: true + + /spdx-exceptions/2.4.0: + resolution: {integrity: sha512-hcjppoJ68fhxA/cjbN4T8N6uCUejN8yFw69ttpqtBeCbF3u13n7mb31NB9jKwGTTWWnt9IbRA/mf1FprYS8wfw==} + dev: true + + /spdx-expression-parse/3.0.1: + resolution: {integrity: sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==} + dependencies: + spdx-exceptions: 2.4.0 + spdx-license-ids: 3.0.17 + dev: true + + /spdx-license-ids/3.0.17: + resolution: {integrity: sha512-sh8PWc/ftMqAAdFiBu6Fy6JUOYjqDJBJvIhpfDMyHrr0Rbp5liZqd4TjtQ/RgfLjKFZb+LMx5hpml5qOWy0qvg==} + dev: true + + /sshpk/1.18.0: + resolution: {integrity: sha512-2p2KJZTSqQ/I3+HX42EpYOa2l3f8Erv8MWKsy2I9uf4wA7yFIkXRffYdsx86y6z4vHtV8u7g+pPlr8/4ouAxsQ==} + engines: {node: '>=0.10.0'} + hasBin: true + dependencies: + asn1: 0.2.6 + assert-plus: 1.0.0 + bcrypt-pbkdf: 1.0.2 + dashdash: 1.14.1 + ecc-jsbn: 0.1.2 + getpass: 0.1.7 + jsbn: 0.1.1 + safer-buffer: 2.1.2 + tweetnacl: 0.14.5 + dev: true + + /stacktrace-parser/0.1.10: + resolution: {integrity: sha512-KJP1OCML99+8fhOHxwwzyWrlUuVX5GQ0ZpJTd1DFXhdkrvg1szxfHhawXUZ3g9TkXORQd4/WG68jMlQZ2p8wlg==} + engines: {node: '>=6'} + dependencies: + type-fest: 0.7.1 + dev: true + + /statuses/2.0.1: + resolution: {integrity: sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==} + engines: {node: '>= 0.8'} + dev: true + + /strict-uri-encode/1.1.0: + resolution: {integrity: sha512-R3f198pcvnB+5IpnBlRkphuE9n46WyVl8I39W/ZUTZLz4nqSP/oLYUrcnJrw462Ds8he4YKMov2efsTIw1BDGQ==} + engines: {node: '>=0.10.0'} + dev: true + + /string-width/1.0.2: + resolution: {integrity: sha512-0XsVpQLnVCXHJfyEs8tC0zpTVIr5PKKsQtkT29IwupnPTjtPmQ3xT/4yCREF9hYkV/3M3kzcUTSAZT6a6h81tw==} + engines: {node: '>=0.10.0'} + dependencies: + code-point-at: 1.1.0 + is-fullwidth-code-point: 1.0.0 + strip-ansi: 3.0.1 + dev: true + + /string-width/2.1.1: + resolution: {integrity: sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==} + engines: {node: '>=4'} + dependencies: + is-fullwidth-code-point: 2.0.0 + strip-ansi: 4.0.0 + dev: true + + /string-width/4.2.3: + resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} + engines: {node: '>=8'} + dependencies: + emoji-regex: 8.0.0 + is-fullwidth-code-point: 3.0.0 + strip-ansi: 6.0.1 + dev: true + + /string.prototype.trim/1.2.8: + resolution: {integrity: sha512-lfjY4HcixfQXOfaqCvcBuOIapyaroTXhbkfJN3gcB1OtyupngWK4sEET9Knd0cXd28kTUqu/kHoV4HKSJdnjiQ==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + define-properties: 1.2.1 + es-abstract: 1.22.4 + dev: true + + /string.prototype.trimend/1.0.7: + resolution: {integrity: sha512-Ni79DqeB72ZFq1uH/L6zJ+DKZTkOtPIHovb3YZHQViE+HDouuU4mBrLOLDn5Dde3RF8qw5qVETEjhu9locMLvA==} + dependencies: + call-bind: 1.0.7 + define-properties: 1.2.1 + es-abstract: 1.22.4 + dev: true + + /string.prototype.trimstart/1.0.7: + resolution: {integrity: sha512-NGhtDFu3jCEm7B4Fy0DpLewdJQOZcQ0rGbwQ/+stjnrp2i+rlKeCvos9hOIeCmqwratM47OBxY7uFZzjxHXmrg==} + dependencies: + call-bind: 1.0.7 + define-properties: 1.2.1 + es-abstract: 1.22.4 + dev: true + + /string_decoder/0.10.31: + resolution: {integrity: sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==} + dev: true + optional: true + + /string_decoder/1.1.1: + resolution: {integrity: sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==} + dependencies: + safe-buffer: 5.1.2 + dev: true + + /string_decoder/1.3.0: + resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} + dependencies: + safe-buffer: 5.2.1 + dev: true + + /strip-ansi/3.0.1: + resolution: {integrity: sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==} + engines: {node: '>=0.10.0'} + dependencies: + ansi-regex: 2.1.1 + dev: true + + /strip-ansi/4.0.0: + resolution: {integrity: sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==} + engines: {node: '>=4'} + dependencies: + ansi-regex: 3.0.1 + dev: true + + /strip-ansi/6.0.1: + resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} + engines: {node: '>=8'} + dependencies: + ansi-regex: 5.0.1 + dev: true + + /strip-bom/2.0.0: + resolution: {integrity: sha512-kwrX1y7czp1E69n2ajbG65mIo9dqvJ+8aBQXOGVxqwvNbsXdFM6Lq37dLAY3mknUwru8CfcCbfOLL/gMo+fi3g==} + engines: {node: '>=0.10.0'} + dependencies: + is-utf8: 0.2.1 + dev: true + + /strip-bom/3.0.0: + resolution: {integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==} + engines: {node: '>=4'} + dev: true + + /strip-hex-prefix/1.0.0: + resolution: {integrity: sha512-q8d4ue7JGEiVcypji1bALTos+0pWtyGlivAWyPuTkHzuTCJqrK9sWxYQZUq6Nq3cuyv3bm734IhHvHtGGURU6A==} + engines: {node: '>=6.5.0', npm: '>=3'} + dependencies: + is-hex-prefixed: 1.0.0 + dev: true + + /strip-indent/2.0.0: + resolution: {integrity: sha512-RsSNPLpq6YUL7QYy44RnPVTn/lcVZtb48Uof3X5JLbF4zD/Gs7ZFDv2HWol+leoQN2mT86LAzSshGfkTlSOpsA==} + engines: {node: '>=4'} + dev: true + + /strip-json-comments/2.0.1: + resolution: {integrity: sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==} + engines: {node: '>=0.10.0'} + dev: true + + /strip-json-comments/3.1.1: + resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} + engines: {node: '>=8'} + dev: true + + /sublevel-pouchdb/7.3.1: + resolution: {integrity: sha512-n+4fK72F/ORdqPwoGgMGYeOrW2HaPpW9o9k80bT1B3Cim5BSvkKkr9WbWOWynni/GHkbCEdvLVFJL1ktosAdhQ==} + dependencies: + inherits: 2.0.4 + level-codec: 9.0.2 + ltgt: 2.2.1 + readable-stream: 1.1.14 + dev: true + optional: true + + /supports-color/5.5.0: + resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} + engines: {node: '>=4'} + dependencies: + has-flag: 3.0.0 + dev: true + + /supports-color/7.2.0: + resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} + engines: {node: '>=8'} + dependencies: + has-flag: 4.0.0 + dev: true + + /supports-color/8.1.1: + resolution: {integrity: sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==} + engines: {node: '>=10'} + dependencies: + has-flag: 4.0.0 + dev: true + + /supports-preserve-symlinks-flag/1.0.0: + resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} + engines: {node: '>= 0.4'} + dev: true + + /swap-case/1.1.2: + resolution: {integrity: sha512-BAmWG6/bx8syfc6qXPprof3Mn5vQgf5dwdUNJhsNqU9WdPt5P+ES/wQ5bxfijy8zwZgZZHslC3iAsxsuQMCzJQ==} + dependencies: + lower-case: 1.1.4 + upper-case: 1.1.3 + dev: true + + /swarm-js/0.1.42: + resolution: {integrity: sha512-BV7c/dVlA3R6ya1lMlSSNPLYrntt0LUq4YMgy3iwpCIc6rZnS5W2wUoctarZ5pXlpKtxDDf9hNziEkcfrxdhqQ==} + dependencies: + bluebird: 3.7.2 + buffer: 5.7.1 + eth-lib: 0.1.29 + fs-extra: 4.0.3 + got: 11.8.6 + mime-types: 2.1.35 + mkdirp-promise: 5.0.1 + mock-fs: 4.14.0 + setimmediate: 1.0.5 + tar: 4.4.19 + xhr-request: 1.1.0 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + dev: true + + /symbol-observable/1.2.0: + resolution: {integrity: sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ==} + engines: {node: '>=0.10.0'} + dev: true + + /sync-request/6.1.0: + resolution: {integrity: sha512-8fjNkrNlNCrVc/av+Jn+xxqfCjYaBoHqCsDz6mt030UMxJGr+GSfCV1dQt2gRtlL63+VPidwDVLr7V2OcTSdRw==} + engines: {node: '>=8.0.0'} + dependencies: + http-response-object: 3.0.2 + sync-rpc: 1.3.6 + then-request: 6.0.2 + dev: true + + /sync-rpc/1.3.6: + resolution: {integrity: sha512-J8jTXuZzRlvU7HemDgHi3pGnh/rkoqR/OZSjhTyyZrEkkYQbk7Z33AXp37mkPfPpfdOuj7Ex3H/TJM1z48uPQw==} + dependencies: + get-port: 3.2.0 + dev: true + + /table/6.8.1: + resolution: {integrity: sha512-Y4X9zqrCftUhMeH2EptSSERdVKt/nEdijTOacGD/97EKjhQ/Qs8RTlEGABSJNNN8lac9kheH+af7yAkEWlgneA==} + engines: {node: '>=10.0.0'} + dependencies: + ajv: 8.12.0 + lodash.truncate: 4.4.2 + slice-ansi: 4.0.0 + string-width: 4.2.3 + strip-ansi: 6.0.1 + dev: true + + /tar/4.4.19: + resolution: {integrity: sha512-a20gEsvHnWe0ygBY8JbxoM4w3SJdhc7ZAuxkLqh+nvNQN2IOt0B5lLgM490X5Hl8FF0dl0tOf2ewFYAlIFgzVA==} + engines: {node: '>=4.5'} + dependencies: + chownr: 1.1.4 + fs-minipass: 1.2.7 + minipass: 2.9.0 + minizlib: 1.3.3 + mkdirp: 0.5.6 + safe-buffer: 5.2.1 + yallist: 3.1.1 + dev: true + + /testrpc/0.0.1: + resolution: {integrity: sha512-afH1hO+SQ/VPlmaLUFj2636QMeDvPCeQMc/9RBMW0IfjNe9gFD9Ra3ShqYkB7py0do1ZcCna/9acHyzTJ+GcNA==} + deprecated: testrpc has been renamed to ganache-cli, please use this package from now on. + dev: true + + /text-table/0.2.0: + resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} + dev: true + + /then-request/6.0.2: + resolution: {integrity: sha512-3ZBiG7JvP3wbDzA9iNY5zJQcHL4jn/0BWtXIkagfz7QgOL/LqjCEOBQuJNZfu0XYnv5JhKh+cDxCPM4ILrqruA==} + engines: {node: '>=6.0.0'} + dependencies: + '@types/concat-stream': 1.6.1 + '@types/form-data': 0.0.33 + '@types/node': 8.10.66 + '@types/qs': 6.9.11 + caseless: 0.12.0 + concat-stream: 1.6.2 + form-data: 2.5.1 + http-basic: 8.1.3 + http-response-object: 3.0.2 + promise: 8.3.0 + qs: 6.11.2 + dev: true + + /through2/3.0.2: + resolution: {integrity: sha512-enaDQ4MUyP2W6ZyT6EsMzqBPZaM/avg8iuo+l2d3QCs0J+6RaqkHV/2/lOwDTueBHeJ/2LG9lrLW3d5rWPucuQ==} + dependencies: + inherits: 2.0.4 + readable-stream: 3.6.2 + dev: true + optional: true + + /timed-out/4.0.1: + resolution: {integrity: sha512-G7r3AhovYtr5YKOWQkta8RKAPb+J9IsO4uVmzjl8AZwfhs8UcUwTiD6gcJYSgOtzyjvQKrKYn41syHbUWMkafA==} + engines: {node: '>=0.10.0'} + dev: true + + /tiny-typed-emitter/2.1.0: + resolution: {integrity: sha512-qVtvMxeXbVej0cQWKqVSSAHmKZEHAvxdF8HEUBFWts8h+xEo5m/lEiPakuyZ3BnCBjOD8i24kzNOiOLLgsSxhA==} + dev: true + + /title-case/2.1.1: + resolution: {integrity: sha512-EkJoZ2O3zdCz3zJsYCsxyq2OC5hrxR9mfdd5I+w8h/tmFfeOxJ+vvkxsKxdmN0WtS9zLdHEgfgVOiMVgv+Po4Q==} + dependencies: + no-case: 2.3.2 + upper-case: 1.1.3 + dev: true + + /tmp/0.0.33: + resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==} + engines: {node: '>=0.6.0'} + dependencies: + os-tmpdir: 1.0.2 + dev: true + + /to-regex-range/5.0.1: + resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} + engines: {node: '>=8.0'} + dependencies: + is-number: 7.0.0 + dev: true + + /toidentifier/1.0.1: + resolution: {integrity: sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==} + engines: {node: '>=0.6'} + dev: true + + /tough-cookie/2.5.0: + resolution: {integrity: sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==} + engines: {node: '>=0.8'} + dependencies: + psl: 1.9.0 + punycode: 2.3.1 + dev: true + + /tough-cookie/4.1.3: + resolution: {integrity: sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw==} + engines: {node: '>=6'} + dependencies: + psl: 1.9.0 + punycode: 2.3.1 + universalify: 0.2.0 + url-parse: 1.5.10 + dev: true + optional: true + + /tr46/0.0.3: + resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} + dev: true + + /truffle-assertions/0.9.2: + resolution: {integrity: sha512-9g2RhaxU2F8DeWhqoGQvL/bV8QVoSnQ6PY+ZPvYRP5eF7+/8LExb4mjLx/FeliLTjc3Tv1SABG05Gu5qQ/ErmA==} + deprecated: Truffle was sunset, so this package will be deprecated alongside Truffle + dependencies: + assertion-error: 1.1.0 + lodash.isequal: 4.5.0 + dev: true + + /truffle-flattener/1.6.0: + resolution: {integrity: sha512-scS5Bsi4CZyvlrmD4iQcLHTiG2RQFUXVheTgWeH6PuafmI+Lk5U87Es98loM3w3ImqC9/fPHq+3QIXbcPuoJ1Q==} + hasBin: true + dependencies: + '@resolver-engine/imports-fs': 0.2.2 + '@solidity-parser/parser': 0.14.5 + find-up: 2.1.0 + mkdirp: 1.0.4 + tsort: 0.0.1 + transitivePeerDependencies: + - supports-color + dev: true + + /truffle-plugin-verify/0.6.7: + resolution: {integrity: sha512-Z+kk3i0rc58nXYWVLuiUKWYrcK1ws9lSa2+EJLFfDegV3WPl0k0P6htIYwb5ifG/fHztAS79n8bgNZ9hxStxtg==} + deprecated: Truffle was sunset, so this package will be deprecated alongside Truffle + dependencies: + '@truffle/resolver': 9.0.53 + axios: 0.26.1 + cli-logger: 0.5.40 + delay: 5.0.0 + querystring: 0.2.1 + tunnel: 0.0.6 + transitivePeerDependencies: + - bufferutil + - debug + - encoding + - supports-color + - utf-8-validate + dev: true + + /truffle/5.11.5: + resolution: {integrity: sha512-yCa2uWs5DmL0spuJUuIMtnVayRQrVuWLtcRXHMB0NLrtWDcRo7VM9RViveV4+oi9LdZ8VpFmmqHGm43LbzUxOA==} + engines: {node: ^16.20 || ^18.16 || >=20} + hasBin: true + requiresBuild: true + dependencies: + '@truffle/db-loader': 0.2.36 + '@truffle/debugger': 12.1.5 + app-module-path: 2.2.0 + ganache: 7.9.1 + mocha: 10.1.0 + original-require: 1.0.1 + optionalDependencies: + '@truffle/db': 2.0.36 + transitivePeerDependencies: + - bufferutil + - encoding + - supports-color + - utf-8-validate + dev: true + + /tsconfig-paths/3.15.0: + resolution: {integrity: sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==} + dependencies: + '@types/json5': 0.0.29 + json5: 1.0.2 + minimist: 1.2.8 + strip-bom: 3.0.0 + dev: true + + /tslib/1.14.1: + resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} + dev: true + + /tslib/2.4.1: + resolution: {integrity: sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==} + dev: true + optional: true + + /tslib/2.6.2: + resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} + dev: true + optional: true + + /tsort/0.0.1: + resolution: {integrity: sha512-Tyrf5mxF8Ofs1tNoxA13lFeZ2Zrbd6cKbuH3V+MQ5sb6DtBj5FjrXVsRWT8YvNAQTqNoz66dz1WsbigI22aEnw==} + dev: true + + /tunnel-agent/0.6.0: + resolution: {integrity: sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==} + dependencies: + safe-buffer: 5.2.1 + dev: true + + /tunnel/0.0.6: + resolution: {integrity: sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==} + engines: {node: '>=0.6.11 <=0.7.0 || >=0.7.3'} + dev: true + + /tweetnacl-util/0.15.1: + resolution: {integrity: sha512-RKJBIj8lySrShN4w6i/BonWp2Z/uxwC3h4y7xsRrpP59ZboCd0GpEVsOnMDYLMmKBpYhb5TgHzZXy7wTfYFBRw==} + dev: true + + /tweetnacl/0.14.5: + resolution: {integrity: sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==} + dev: true + + /tweetnacl/1.0.3: + resolution: {integrity: sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==} + dev: true + + /type-check/0.4.0: + resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} + engines: {node: '>= 0.8.0'} + dependencies: + prelude-ls: 1.2.1 + dev: true + + /type-detect/4.0.8: + resolution: {integrity: sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==} + engines: {node: '>=4'} + dev: true + + /type-fest/0.20.2: + resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==} + engines: {node: '>=10'} + dev: true + + /type-fest/0.21.3: + resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} + engines: {node: '>=10'} + dev: true + + /type-fest/0.7.1: + resolution: {integrity: sha512-Ne2YiiGN8bmrmJJEuTWTLJR32nh/JdL1+PSicowtNb0WFpn59GK8/lfD61bVtzguz7b3PBt74nxpv/Pw5po5Rg==} + engines: {node: '>=8'} + dev: true + + /type-is/1.6.18: + resolution: {integrity: sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==} + engines: {node: '>= 0.6'} + dependencies: + media-typer: 0.3.0 + mime-types: 2.1.35 + dev: true + + /type/1.2.0: + resolution: {integrity: sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==} + dev: true + + /type/2.7.2: + resolution: {integrity: sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw==} + dev: true + + /typed-array-buffer/1.0.1: + resolution: {integrity: sha512-RSqu1UEuSlrBhHTWC8O9FnPjOduNs4M7rJ4pRKoEjtx1zUNOPN2sSXHLDX+Y2WPbHIxbvg4JFo2DNAEfPIKWoQ==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + es-errors: 1.3.0 + is-typed-array: 1.1.13 + dev: true + + /typed-array-byte-length/1.0.0: + resolution: {integrity: sha512-Or/+kvLxNpeQ9DtSydonMxCx+9ZXOswtwJn17SNLvhptaXYDJvkFFP5zbfU/uLmvnBJlI4yrnXRxpdWH/M5tNA==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + for-each: 0.3.3 + has-proto: 1.0.1 + is-typed-array: 1.1.13 + dev: true + + /typed-array-byte-offset/1.0.1: + resolution: {integrity: sha512-tcqKMrTRXjqvHN9S3553NPCaGL0VPgFI92lXszmrE8DMhiDPLBYLlvo8Uu4WZAAX/aGqp/T1sbA4ph8EWjDF9Q==} + engines: {node: '>= 0.4'} + dependencies: + available-typed-arrays: 1.0.6 + call-bind: 1.0.7 + for-each: 0.3.3 + gopd: 1.0.1 + has-proto: 1.0.1 + is-typed-array: 1.1.13 + dev: true + + /typed-array-length/1.0.4: + resolution: {integrity: sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng==} + dependencies: + call-bind: 1.0.7 + for-each: 0.3.3 + is-typed-array: 1.1.13 + dev: true + + /typedarray-to-buffer/3.1.5: + resolution: {integrity: sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==} + dependencies: + is-typedarray: 1.0.0 + dev: true + + /typedarray/0.0.6: + resolution: {integrity: sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==} + dev: true + + /typescript-compare/0.0.2: + resolution: {integrity: sha512-8ja4j7pMHkfLJQO2/8tut7ub+J3Lw2S3061eJLFQcvs3tsmJKp8KG5NtpLn7KcY2w08edF74BSVN7qJS0U6oHA==} + dependencies: + typescript-logic: 0.0.0 + dev: true + + /typescript-logic/0.0.0: + resolution: {integrity: sha512-zXFars5LUkI3zP492ls0VskH3TtdeHCqu0i7/duGt60i5IGPIpAHE/DWo5FqJ6EjQ15YKXrt+AETjv60Dat34Q==} + dev: true + + /typescript-tuple/2.2.1: + resolution: {integrity: sha512-Zcr0lbt8z5ZdEzERHAMAniTiIKerFCMgd7yjq1fPnDJ43et/k9twIFQMUYff9k5oXcsQ0WpvFcgzK2ZKASoW6Q==} + dependencies: + typescript-compare: 0.0.2 + dev: true + + /ultron/1.1.1: + resolution: {integrity: sha512-UIEXBNeYmKptWH6z8ZnqTeS8fV74zG0/eRU9VGkpzz+LIJNs8W/zM/L+7ctCkRrgbNnnR0xxw4bKOr0cW0N0Og==} + dev: true + + /unbox-primitive/1.0.2: + resolution: {integrity: sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==} + dependencies: + call-bind: 1.0.7 + has-bigints: 1.0.2 + has-symbols: 1.0.3 + which-boxed-primitive: 1.0.2 + dev: true + + /undici-types/5.26.5: + resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} + dev: true + + /undici/5.28.3: + resolution: {integrity: sha512-3ItfzbrhDlINjaP0duwnNsKpDQk3acHI3gVJ1z4fmwMK31k5G9OVIAMLSIaP6w4FaGkaAkN6zaQO9LUvZ1t7VA==} + engines: {node: '>=14.0'} + dependencies: + '@fastify/busboy': 2.1.0 + dev: true + + /universalify/0.1.2: + resolution: {integrity: sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==} + engines: {node: '>= 4.0.0'} + dev: true + + /universalify/0.2.0: + resolution: {integrity: sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==} + engines: {node: '>= 4.0.0'} + dev: true + optional: true + + /universalify/2.0.1: + resolution: {integrity: sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==} + engines: {node: '>= 10.0.0'} + dev: true + + /unpipe/1.0.0: + resolution: {integrity: sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==} + engines: {node: '>= 0.8'} + dev: true + + /upper-case-first/1.1.2: + resolution: {integrity: sha512-wINKYvI3Db8dtjikdAqoBbZoP6Q+PZUyfMR7pmwHzjC2quzSkUq5DmPrTtPEqHaz8AGtmsB4TqwapMTM1QAQOQ==} + dependencies: + upper-case: 1.1.3 + dev: true + + /upper-case/1.1.3: + resolution: {integrity: sha512-WRbjgmYzgXkCV7zNVpy5YgrHgbBv126rMALQQMrmzOVC4GM2waQ9x7xtm8VU+1yF2kWyPzI9zbZ48n4vSxwfSA==} + dev: true + + /uri-js/4.4.1: + resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} + dependencies: + punycode: 2.3.1 + dev: true + + /url-parse/1.5.10: + resolution: {integrity: sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==} + dependencies: + querystringify: 2.2.0 + requires-port: 1.0.0 + dev: true + optional: true + + /url-set-query/1.0.0: + resolution: {integrity: sha512-3AChu4NiXquPfeckE5R5cGdiHCMWJx1dwCWOmWIL4KHAziJNOFIYJlpGFeKDvwLPHovZRCxK3cYlwzqI9Vp+Gg==} + dev: true + + /utf-8-validate/5.0.10: + resolution: {integrity: sha512-Z6czzLq4u8fPOyx7TU6X3dvUZVvoJmxSQ+IcrlmagKhilxlhZgxPK6C5Jqbkw1IDUmFTM+cz9QDnnLTwDz/2gQ==} + engines: {node: '>=6.14.2'} + requiresBuild: true + dependencies: + node-gyp-build: 4.8.0 + dev: true + + /utf-8-validate/5.0.7: + resolution: {integrity: sha512-vLt1O5Pp+flcArHGIyKEQq883nBt8nN8tVBcoL0qUXj2XT1n7p70yGIq2VK98I5FdZ1YHc0wk/koOnHjnXWk1Q==} + engines: {node: '>=6.14.2'} + requiresBuild: true + dependencies: + node-gyp-build: 4.8.0 + dev: true + optional: true + + /utf-8-validate/6.0.3: + resolution: {integrity: sha512-uIuGf9TWQ/y+0Lp+KGZCMuJWc3N9BHA+l/UmHd/oUHwJJDeysyTRxNQVkbzsIWfGFbRe3OcgML/i0mvVRPOyDA==} + engines: {node: '>=6.14.2'} + requiresBuild: true + dependencies: + node-gyp-build: 4.8.0 + dev: true + + /utf8/3.0.0: + resolution: {integrity: sha512-E8VjFIQ/TyQgp+TZfS6l8yp/xWppSAHzidGiRrqe4bK4XP9pTRyKFgGJpO3SN7zdX4DeomTrwaseCHovfpFcqQ==} + dev: true + + /util-deprecate/1.0.2: + resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} + dev: true + + /util/0.12.5: + resolution: {integrity: sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA==} + dependencies: + inherits: 2.0.4 + is-arguments: 1.1.1 + is-generator-function: 1.0.10 + is-typed-array: 1.1.13 + which-typed-array: 1.1.14 + dev: true + + /utils-merge/1.0.1: + resolution: {integrity: sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==} + engines: {node: '>= 0.4.0'} + dev: true + + /uuid/2.0.1: + resolution: {integrity: sha512-nWg9+Oa3qD2CQzHIP4qKUqwNfzKn8P0LtFhotaCTFchsV7ZfDhAybeip/HZVeMIpZi9JgY1E3nUlwaCmZT1sEg==} + deprecated: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. + dev: true + + /uuid/3.4.0: + resolution: {integrity: sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==} + deprecated: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. + hasBin: true + dev: true + + /uuid/8.3.2: + resolution: {integrity: sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==} + hasBin: true + dev: true + + /uuid/9.0.1: + resolution: {integrity: sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==} + hasBin: true + dev: true + + /validate-npm-package-license/3.0.4: + resolution: {integrity: sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==} + dependencies: + spdx-correct: 3.2.0 + spdx-expression-parse: 3.0.1 + dev: true + + /value-or-promise/1.0.11: + resolution: {integrity: sha512-41BrgH+dIbCFXClcSapVs5M6GkENd3gQOJpEfPDNa71LsUGMXDL0jMWpI/Rh7WhX+Aalfz2TTS3Zt5pUsbnhLg==} + engines: {node: '>=12'} + dev: true + optional: true + + /value-or-promise/1.0.12: + resolution: {integrity: sha512-Z6Uz+TYwEqE7ZN50gwn+1LCVo9ZVrpxRPOhOLnncYkY1ZzOYtrX8Fwf/rFktZ8R5mJms6EZf5TqNOMeZmnPq9Q==} + engines: {node: '>=12'} + dev: true + optional: true + + /varint/5.0.2: + resolution: {integrity: sha512-lKxKYG6H03yCZUpAGOPOsMcGxd1RHCu1iKvEHYDPmTyq2HueGhD73ssNBqqQWfvYs04G9iUFRvmAVLW20Jw6ow==} + dev: true + + /vary/1.1.2: + resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==} + engines: {node: '>= 0.8'} + dev: true + + /verror/1.10.0: + resolution: {integrity: sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw==} + engines: {'0': node >=0.6.0} + dependencies: + assert-plus: 1.0.0 + core-util-is: 1.0.2 + extsprintf: 1.3.0 + dev: true + + /vuvuzela/1.0.3: + resolution: {integrity: sha512-Tm7jR1xTzBbPW+6y1tknKiEhz04Wf/1iZkcTJjSFcpNko43+dFW6+OOeQe9taJIug3NdfUAjFKgUSyQrIKaDvQ==} + dev: true + optional: true + + /web3-bzz/1.10.0: + resolution: {integrity: sha512-o9IR59io3pDUsXTsps5pO5hW1D5zBmg46iNc2t4j2DkaYHNdDLwk2IP9ukoM2wg47QILfPEJYzhTfkS/CcX0KA==} + engines: {node: '>=8.0.0'} + requiresBuild: true + dependencies: + '@types/node': 12.20.55 + got: 12.1.0 + swarm-js: 0.1.42 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + dev: true + + /web3-bzz/1.10.4: + resolution: {integrity: sha512-ZZ/X4sJ0Uh2teU9lAGNS8EjveEppoHNQiKlOXAjedsrdWuaMErBPdLQjXfcrYvN6WM6Su9PMsAxf3FXXZ+HwQw==} + engines: {node: '>=8.0.0'} + requiresBuild: true + dependencies: + '@types/node': 12.20.55 + got: 12.1.0 + swarm-js: 0.1.42 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + dev: true + + /web3-core-helpers/1.10.0: + resolution: {integrity: sha512-pIxAzFDS5vnbXvfvLSpaA1tfRykAe9adw43YCKsEYQwH0gCLL0kMLkaCX3q+Q8EVmAh+e1jWL/nl9U0de1+++g==} + engines: {node: '>=8.0.0'} + dependencies: + web3-eth-iban: 1.10.0 + web3-utils: 1.10.0 + dev: true + + /web3-core-helpers/1.10.4: + resolution: {integrity: sha512-r+L5ylA17JlD1vwS8rjhWr0qg7zVoVMDvWhajWA5r5+USdh91jRUYosp19Kd1m2vE034v7Dfqe1xYRoH2zvG0g==} + engines: {node: '>=8.0.0'} + dependencies: + web3-eth-iban: 1.10.4 + web3-utils: 1.10.4 + dev: true + + /web3-core-method/1.10.0: + resolution: {integrity: sha512-4R700jTLAMKDMhQ+nsVfIXvH6IGJlJzGisIfMKWAIswH31h5AZz7uDUW2YctI+HrYd+5uOAlS4OJeeT9bIpvkA==} + engines: {node: '>=8.0.0'} + dependencies: + '@ethersproject/transactions': 5.7.0 + web3-core-helpers: 1.10.0 + web3-core-promievent: 1.10.0 + web3-core-subscriptions: 1.10.0 + web3-utils: 1.10.0 + dev: true + + /web3-core-method/1.10.4: + resolution: {integrity: sha512-uZTb7flr+Xl6LaDsyTeE2L1TylokCJwTDrIVfIfnrGmnwLc6bmTWCCrm71sSrQ0hqs6vp/MKbQYIYqUN0J8WyA==} + engines: {node: '>=8.0.0'} + dependencies: + '@ethersproject/transactions': 5.7.0 + web3-core-helpers: 1.10.4 + web3-core-promievent: 1.10.4 + web3-core-subscriptions: 1.10.4 + web3-utils: 1.10.4 + dev: true + + /web3-core-promievent/1.10.0: + resolution: {integrity: sha512-68N7k5LWL5R38xRaKFrTFT2pm2jBNFaM4GioS00YjAKXRQ3KjmhijOMG3TICz6Aa5+6GDWYelDNx21YAeZ4YTg==} + engines: {node: '>=8.0.0'} + dependencies: + eventemitter3: 4.0.4 + dev: true + + /web3-core-promievent/1.10.4: + resolution: {integrity: sha512-2de5WnJQ72YcIhYwV/jHLc4/cWJnznuoGTJGD29ncFQHAfwW/MItHFSVKPPA5v8AhJe+r6y4Y12EKvZKjQVBvQ==} + engines: {node: '>=8.0.0'} + dependencies: + eventemitter3: 4.0.4 + dev: true + + /web3-core-requestmanager/1.10.0: + resolution: {integrity: sha512-3z/JKE++Os62APml4dvBM+GAuId4h3L9ckUrj7ebEtS2AR0ixyQPbrBodgL91Sv7j7cQ3Y+hllaluqjguxvSaQ==} + engines: {node: '>=8.0.0'} + dependencies: + util: 0.12.5 + web3-core-helpers: 1.10.0 + web3-providers-http: 1.10.0 + web3-providers-ipc: 1.10.0 + web3-providers-ws: 1.10.0 + transitivePeerDependencies: + - encoding + - supports-color + dev: true + + /web3-core-requestmanager/1.10.4: + resolution: {integrity: sha512-vqP6pKH8RrhT/2MoaU+DY/OsYK9h7HmEBNCdoMj+4ZwujQtw/Mq2JifjwsJ7gits7Q+HWJwx8q6WmQoVZAWugg==} + engines: {node: '>=8.0.0'} + dependencies: + util: 0.12.5 + web3-core-helpers: 1.10.4 + web3-providers-http: 1.10.4 + web3-providers-ipc: 1.10.4 + web3-providers-ws: 1.10.4 + transitivePeerDependencies: + - encoding + - supports-color + dev: true + + /web3-core-subscriptions/1.10.0: + resolution: {integrity: sha512-HGm1PbDqsxejI075gxBc5OSkwymilRWZufIy9zEpnWKNmfbuv5FfHgW1/chtJP6aP3Uq2vHkvTDl3smQBb8l+g==} + engines: {node: '>=8.0.0'} + dependencies: + eventemitter3: 4.0.4 + web3-core-helpers: 1.10.0 + dev: true + + /web3-core-subscriptions/1.10.4: + resolution: {integrity: sha512-o0lSQo/N/f7/L76C0HV63+S54loXiE9fUPfHFcTtpJRQNDBVsSDdWRdePbWwR206XlsBqD5VHApck1//jEafTw==} + engines: {node: '>=8.0.0'} + dependencies: + eventemitter3: 4.0.4 + web3-core-helpers: 1.10.4 + dev: true + + /web3-core/1.10.0: + resolution: {integrity: sha512-fWySwqy2hn3TL89w5TM8wXF1Z2Q6frQTKHWmP0ppRQorEK8NcHJRfeMiv/mQlSKoTS1F6n/nv2uyZsixFycjYQ==} + engines: {node: '>=8.0.0'} + dependencies: + '@types/bn.js': 5.1.5 + '@types/node': 12.20.55 + bignumber.js: 9.1.2 + web3-core-helpers: 1.10.0 + web3-core-method: 1.10.0 + web3-core-requestmanager: 1.10.0 + web3-utils: 1.10.0 + transitivePeerDependencies: + - encoding + - supports-color + dev: true + + /web3-core/1.10.4: + resolution: {integrity: sha512-B6elffYm81MYZDTrat7aEhnhdtVE3lDBUZft16Z8awYMZYJDbnykEbJVS+l3mnA7AQTnSDr/1MjWofGDLBJPww==} + engines: {node: '>=8.0.0'} + dependencies: + '@types/bn.js': 5.1.5 + '@types/node': 12.20.55 + bignumber.js: 9.1.2 + web3-core-helpers: 1.10.4 + web3-core-method: 1.10.4 + web3-core-requestmanager: 1.10.4 + web3-utils: 1.10.4 + transitivePeerDependencies: + - encoding + - supports-color + dev: true + + /web3-eth-abi/1.10.0: + resolution: {integrity: sha512-cwS+qRBWpJ43aI9L3JS88QYPfFcSJJ3XapxOQ4j40v6mk7ATpA8CVK1vGTzpihNlOfMVRBkR95oAj7oL6aiDOg==} + engines: {node: '>=8.0.0'} + dependencies: + '@ethersproject/abi': 5.7.0 + web3-utils: 1.10.0 + dev: true + + /web3-eth-abi/1.10.4: + resolution: {integrity: sha512-cZ0q65eJIkd/jyOlQPDjr8X4fU6CRL1eWgdLwbWEpo++MPU/2P4PFk5ZLAdye9T5Sdp+MomePPJ/gHjLMj2VfQ==} + engines: {node: '>=8.0.0'} + dependencies: + '@ethersproject/abi': 5.7.0 + web3-utils: 1.10.4 + dev: true + + /web3-eth-accounts/1.10.0: + resolution: {integrity: sha512-wiq39Uc3mOI8rw24wE2n15hboLE0E9BsQLdlmsL4Zua9diDS6B5abXG0XhFcoNsXIGMWXVZz4TOq3u4EdpXF/Q==} + engines: {node: '>=8.0.0'} + dependencies: + '@ethereumjs/common': 2.5.0 + '@ethereumjs/tx': 3.3.2 + eth-lib: 0.2.8 + ethereumjs-util: 7.1.5 + scrypt-js: 3.0.1 + uuid: 9.0.1 + web3-core: 1.10.0 + web3-core-helpers: 1.10.0 + web3-core-method: 1.10.0 + web3-utils: 1.10.0 + transitivePeerDependencies: + - encoding + - supports-color + dev: true + + /web3-eth-accounts/1.10.4: + resolution: {integrity: sha512-ysy5sVTg9snYS7tJjxVoQAH6DTOTkRGR8emEVCWNGLGiB9txj+qDvSeT0izjurS/g7D5xlMAgrEHLK1Vi6I3yg==} + engines: {node: '>=8.0.0'} + dependencies: + '@ethereumjs/common': 2.6.5 + '@ethereumjs/tx': 3.5.2 + '@ethereumjs/util': 8.1.0 + eth-lib: 0.2.8 + scrypt-js: 3.0.1 + uuid: 9.0.1 + web3-core: 1.10.4 + web3-core-helpers: 1.10.4 + web3-core-method: 1.10.4 + web3-utils: 1.10.4 + transitivePeerDependencies: + - encoding + - supports-color + dev: true + + /web3-eth-contract/1.10.0: + resolution: {integrity: sha512-MIC5FOzP/+2evDksQQ/dpcXhSqa/2hFNytdl/x61IeWxhh6vlFeSjq0YVTAyIzdjwnL7nEmZpjfI6y6/Ufhy7w==} + engines: {node: '>=8.0.0'} + dependencies: + '@types/bn.js': 5.1.5 + web3-core: 1.10.0 + web3-core-helpers: 1.10.0 + web3-core-method: 1.10.0 + web3-core-promievent: 1.10.0 + web3-core-subscriptions: 1.10.0 + web3-eth-abi: 1.10.0 + web3-utils: 1.10.0 + transitivePeerDependencies: + - encoding + - supports-color + dev: true + + /web3-eth-contract/1.10.4: + resolution: {integrity: sha512-Q8PfolOJ4eV9TvnTj1TGdZ4RarpSLmHnUnzVxZ/6/NiTfe4maJz99R0ISgwZkntLhLRtw0C7LRJuklzGYCNN3A==} + engines: {node: '>=8.0.0'} + dependencies: + '@types/bn.js': 5.1.5 + web3-core: 1.10.4 + web3-core-helpers: 1.10.4 + web3-core-method: 1.10.4 + web3-core-promievent: 1.10.4 + web3-core-subscriptions: 1.10.4 + web3-eth-abi: 1.10.4 + web3-utils: 1.10.4 + transitivePeerDependencies: + - encoding + - supports-color + dev: true + + /web3-eth-ens/1.10.0: + resolution: {integrity: sha512-3hpGgzX3qjgxNAmqdrC2YUQMTfnZbs4GeLEmy8aCWziVwogbuqQZ+Gzdfrym45eOZodk+lmXyLuAdqkNlvkc1g==} + engines: {node: '>=8.0.0'} + dependencies: + content-hash: 2.5.2 + eth-ens-namehash: 2.0.8 + web3-core: 1.10.0 + web3-core-helpers: 1.10.0 + web3-core-promievent: 1.10.0 + web3-eth-abi: 1.10.0 + web3-eth-contract: 1.10.0 + web3-utils: 1.10.0 + transitivePeerDependencies: + - encoding + - supports-color + dev: true + + /web3-eth-ens/1.10.4: + resolution: {integrity: sha512-LLrvxuFeVooRVZ9e5T6OWKVflHPFgrVjJ/jtisRWcmI7KN/b64+D/wJzXqgmp6CNsMQcE7rpmf4CQmJCrTdsgg==} + engines: {node: '>=8.0.0'} + dependencies: + content-hash: 2.5.2 + eth-ens-namehash: 2.0.8 + web3-core: 1.10.4 + web3-core-helpers: 1.10.4 + web3-core-promievent: 1.10.4 + web3-eth-abi: 1.10.4 + web3-eth-contract: 1.10.4 + web3-utils: 1.10.4 + transitivePeerDependencies: + - encoding + - supports-color + dev: true + + /web3-eth-iban/1.10.0: + resolution: {integrity: sha512-0l+SP3IGhInw7Q20LY3IVafYEuufo4Dn75jAHT7c2aDJsIolvf2Lc6ugHkBajlwUneGfbRQs/ccYPQ9JeMUbrg==} + engines: {node: '>=8.0.0'} + dependencies: + bn.js: 5.2.1 + web3-utils: 1.10.0 + dev: true + + /web3-eth-iban/1.10.4: + resolution: {integrity: sha512-0gE5iNmOkmtBmbKH2aTodeompnNE8jEyvwFJ6s/AF6jkw9ky9Op9cqfzS56AYAbrqEFuClsqB/AoRves7LDELw==} + engines: {node: '>=8.0.0'} + dependencies: + bn.js: 5.2.1 + web3-utils: 1.10.4 + dev: true + + /web3-eth-personal/1.10.0: + resolution: {integrity: sha512-anseKn98w/d703eWq52uNuZi7GhQeVjTC5/svrBWEKob0WZ5kPdo+EZoFN0sp5a5ubbrk/E0xSl1/M5yORMtpg==} + engines: {node: '>=8.0.0'} + dependencies: + '@types/node': 12.20.55 + web3-core: 1.10.0 + web3-core-helpers: 1.10.0 + web3-core-method: 1.10.0 + web3-net: 1.10.0 + web3-utils: 1.10.0 + transitivePeerDependencies: + - encoding + - supports-color + dev: true + + /web3-eth-personal/1.10.4: + resolution: {integrity: sha512-BRa/hs6jU1hKHz+AC/YkM71RP3f0Yci1dPk4paOic53R4ZZG4MgwKRkJhgt3/GPuPliwS46f/i5A7fEGBT4F9w==} + engines: {node: '>=8.0.0'} + dependencies: + '@types/node': 12.20.55 + web3-core: 1.10.4 + web3-core-helpers: 1.10.4 + web3-core-method: 1.10.4 + web3-net: 1.10.4 + web3-utils: 1.10.4 + transitivePeerDependencies: + - encoding + - supports-color + dev: true + + /web3-eth/1.10.0: + resolution: {integrity: sha512-Z5vT6slNMLPKuwRyKGbqeGYC87OAy8bOblaqRTgg94CXcn/mmqU7iPIlG4506YdcdK3x6cfEDG7B6w+jRxypKA==} + engines: {node: '>=8.0.0'} + dependencies: + web3-core: 1.10.0 + web3-core-helpers: 1.10.0 + web3-core-method: 1.10.0 + web3-core-subscriptions: 1.10.0 + web3-eth-abi: 1.10.0 + web3-eth-accounts: 1.10.0 + web3-eth-contract: 1.10.0 + web3-eth-ens: 1.10.0 + web3-eth-iban: 1.10.0 + web3-eth-personal: 1.10.0 + web3-net: 1.10.0 + web3-utils: 1.10.0 + transitivePeerDependencies: + - encoding + - supports-color + dev: true + + /web3-eth/1.10.4: + resolution: {integrity: sha512-Sql2kYKmgt+T/cgvg7b9ce24uLS7xbFrxE4kuuor1zSCGrjhTJ5rRNG8gTJUkAJGKJc7KgnWmgW+cOfMBPUDSA==} + engines: {node: '>=8.0.0'} + dependencies: + web3-core: 1.10.4 + web3-core-helpers: 1.10.4 + web3-core-method: 1.10.4 + web3-core-subscriptions: 1.10.4 + web3-eth-abi: 1.10.4 + web3-eth-accounts: 1.10.4 + web3-eth-contract: 1.10.4 + web3-eth-ens: 1.10.4 + web3-eth-iban: 1.10.4 + web3-eth-personal: 1.10.4 + web3-net: 1.10.4 + web3-utils: 1.10.4 + transitivePeerDependencies: + - encoding + - supports-color + dev: true + + /web3-net/1.10.0: + resolution: {integrity: sha512-NLH/N3IshYWASpxk4/18Ge6n60GEvWBVeM8inx2dmZJVmRI6SJIlUxbL8jySgiTn3MMZlhbdvrGo8fpUW7a1GA==} + engines: {node: '>=8.0.0'} + dependencies: + web3-core: 1.10.0 + web3-core-method: 1.10.0 + web3-utils: 1.10.0 + transitivePeerDependencies: + - encoding + - supports-color + dev: true + + /web3-net/1.10.4: + resolution: {integrity: sha512-mKINnhOOnZ4koA+yV2OT5s5ztVjIx7IY9a03w6s+yao/BUn+Luuty0/keNemZxTr1E8Ehvtn28vbOtW7Ids+Ow==} + engines: {node: '>=8.0.0'} + dependencies: + web3-core: 1.10.4 + web3-core-method: 1.10.4 + web3-utils: 1.10.4 + transitivePeerDependencies: + - encoding + - supports-color + dev: true + + /web3-providers-http/1.10.0: + resolution: {integrity: sha512-eNr965YB8a9mLiNrkjAWNAPXgmQWfpBfkkn7tpEFlghfww0u3I0tktMZiaToJVcL2+Xq+81cxbkpeWJ5XQDwOA==} + engines: {node: '>=8.0.0'} + dependencies: + abortcontroller-polyfill: 1.7.5 + cross-fetch: 3.1.8 + es6-promise: 4.2.8 + web3-core-helpers: 1.10.0 + transitivePeerDependencies: + - encoding + dev: true + + /web3-providers-http/1.10.4: + resolution: {integrity: sha512-m2P5Idc8hdiO0l60O6DSCPw0kw64Zgi0pMjbEFRmxKIck2Py57RQMu4bxvkxJwkF06SlGaEQF8rFZBmuX7aagQ==} + engines: {node: '>=8.0.0'} + dependencies: + abortcontroller-polyfill: 1.7.5 + cross-fetch: 4.0.0 + es6-promise: 4.2.8 + web3-core-helpers: 1.10.4 + transitivePeerDependencies: + - encoding + dev: true + + /web3-providers-ipc/1.10.0: + resolution: {integrity: sha512-OfXG1aWN8L1OUqppshzq8YISkWrYHaATW9H8eh0p89TlWMc1KZOL9vttBuaBEi96D/n0eYDn2trzt22bqHWfXA==} + engines: {node: '>=8.0.0'} + dependencies: + oboe: 2.1.5 + web3-core-helpers: 1.10.0 + dev: true + + /web3-providers-ipc/1.10.4: + resolution: {integrity: sha512-YRF/bpQk9z3WwjT+A6FI/GmWRCASgd+gC0si7f9zbBWLXjwzYAKG73bQBaFRAHex1hl4CVcM5WUMaQXf3Opeuw==} + engines: {node: '>=8.0.0'} + dependencies: + oboe: 2.1.5 + web3-core-helpers: 1.10.4 + dev: true + + /web3-providers-ws/1.10.0: + resolution: {integrity: sha512-sK0fNcglW36yD5xjnjtSGBnEtf59cbw4vZzJ+CmOWIKGIR96mP5l684g0WD0Eo+f4NQc2anWWXG74lRc9OVMCQ==} + engines: {node: '>=8.0.0'} + dependencies: + eventemitter3: 4.0.4 + web3-core-helpers: 1.10.0 + websocket: 1.0.34 + transitivePeerDependencies: + - supports-color + dev: true + + /web3-providers-ws/1.10.4: + resolution: {integrity: sha512-j3FBMifyuFFmUIPVQR4pj+t5ILhAexAui0opgcpu9R5LxQrLRUZxHSnU+YO25UycSOa/NAX8A+qkqZNpcFAlxA==} + engines: {node: '>=8.0.0'} + dependencies: + eventemitter3: 4.0.4 + web3-core-helpers: 1.10.4 + websocket: 1.0.34 + transitivePeerDependencies: + - supports-color + dev: true + + /web3-shh/1.10.0: + resolution: {integrity: sha512-uNUUuNsO2AjX41GJARV9zJibs11eq6HtOe6Wr0FtRUcj8SN6nHeYIzwstAvJ4fXA53gRqFMTxdntHEt9aXVjpg==} + engines: {node: '>=8.0.0'} + requiresBuild: true + dependencies: + web3-core: 1.10.0 + web3-core-method: 1.10.0 + web3-core-subscriptions: 1.10.0 + web3-net: 1.10.0 + transitivePeerDependencies: + - encoding + - supports-color + dev: true + + /web3-shh/1.10.4: + resolution: {integrity: sha512-cOH6iFFM71lCNwSQrC3niqDXagMqrdfFW85hC9PFUrAr3PUrIem8TNstTc3xna2bwZeWG6OBy99xSIhBvyIACw==} + engines: {node: '>=8.0.0'} + requiresBuild: true + dependencies: + web3-core: 1.10.4 + web3-core-method: 1.10.4 + web3-core-subscriptions: 1.10.4 + web3-net: 1.10.4 + transitivePeerDependencies: + - encoding + - supports-color + dev: true + + /web3-utils/1.10.0: + resolution: {integrity: sha512-kSaCM0uMcZTNUSmn5vMEhlo02RObGNRRCkdX0V9UTAU0+lrvn0HSaudyCo6CQzuXUsnuY2ERJGCGPfeWmv19Rg==} + engines: {node: '>=8.0.0'} + dependencies: + bn.js: 5.2.1 + ethereum-bloom-filters: 1.0.10 + ethereumjs-util: 7.1.5 + ethjs-unit: 0.1.6 + number-to-bn: 1.7.0 + randombytes: 2.1.0 + utf8: 3.0.0 + dev: true + + /web3-utils/1.10.4: + resolution: {integrity: sha512-tsu8FiKJLk2PzhDl9fXbGUWTkkVXYhtTA+SmEFkKft+9BgwLxfCRpU96sWv7ICC8zixBNd3JURVoiR3dUXgP8A==} + engines: {node: '>=8.0.0'} + dependencies: + '@ethereumjs/util': 8.1.0 + bn.js: 5.2.1 + ethereum-bloom-filters: 1.0.10 + ethereum-cryptography: 2.1.3 + ethjs-unit: 0.1.6 + number-to-bn: 1.7.0 + randombytes: 2.1.0 + utf8: 3.0.0 + dev: true + + /web3/1.10.0: + resolution: {integrity: sha512-YfKY9wSkGcM8seO+daR89oVTcbu18NsVfvOngzqMYGUU0pPSQmE57qQDvQzUeoIOHAnXEBNzrhjQJmm8ER0rng==} + engines: {node: '>=8.0.0'} + requiresBuild: true + dependencies: + web3-bzz: 1.10.0 + web3-core: 1.10.0 + web3-eth: 1.10.0 + web3-eth-personal: 1.10.0 + web3-net: 1.10.0 + web3-shh: 1.10.0 + web3-utils: 1.10.0 + transitivePeerDependencies: + - bufferutil + - encoding + - supports-color + - utf-8-validate + dev: true + + /web3/1.10.4: + resolution: {integrity: sha512-kgJvQZjkmjOEKimx/tJQsqWfRDPTTcBfYPa9XletxuHLpHcXdx67w8EFn5AW3eVxCutE9dTVHgGa9VYe8vgsEA==} + engines: {node: '>=8.0.0'} + requiresBuild: true + dependencies: + web3-bzz: 1.10.4 + web3-core: 1.10.4 + web3-eth: 1.10.4 + web3-eth-personal: 1.10.4 + web3-net: 1.10.4 + web3-shh: 1.10.4 + web3-utils: 1.10.4 + transitivePeerDependencies: + - bufferutil + - encoding + - supports-color + - utf-8-validate + dev: true + + /webidl-conversions/3.0.1: + resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} + dev: true + + /websocket/1.0.34: + resolution: {integrity: sha512-PRDso2sGwF6kM75QykIesBijKSVceR6jL2G8NGYyq2XrItNC2P5/qL5XeR056GhA+Ly7JMFvJb9I312mJfmqnQ==} + engines: {node: '>=4.0.0'} + dependencies: + bufferutil: 4.0.8 + debug: 2.6.9 + es5-ext: 0.10.62 + typedarray-to-buffer: 3.1.5 + utf-8-validate: 5.0.10 + yaeti: 0.0.6 + transitivePeerDependencies: + - supports-color + dev: true + + /whatwg-mimetype/3.0.0: + resolution: {integrity: sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q==} + engines: {node: '>=12'} + dev: true + optional: true + + /whatwg-url/5.0.0: + resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} + dependencies: + tr46: 0.0.3 + webidl-conversions: 3.0.1 + dev: true + + /which-boxed-primitive/1.0.2: + resolution: {integrity: sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==} + dependencies: + is-bigint: 1.0.4 + is-boolean-object: 1.1.2 + is-number-object: 1.0.7 + is-string: 1.0.7 + is-symbol: 1.0.4 + dev: true + + /which-module/1.0.0: + resolution: {integrity: sha512-F6+WgncZi/mJDrammbTuHe1q0R5hOXv/mBaiNA2TCNT/LTHusX0V+CJnj9XT8ki5ln2UZyyddDgHfCzyrOH7MQ==} + dev: true + + /which-typed-array/1.1.14: + resolution: {integrity: sha512-VnXFiIW8yNn9kIHN88xvZ4yOWchftKDsRJ8fEPacX/wl1lOvBrhsJ/OeJCXq7B0AaijRuqgzSKalJoPk+D8MPg==} + engines: {node: '>= 0.4'} + dependencies: + available-typed-arrays: 1.0.6 + call-bind: 1.0.7 + for-each: 0.3.3 + gopd: 1.0.1 + has-tostringtag: 1.0.2 + dev: true + + /which/1.3.1: + resolution: {integrity: sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==} + hasBin: true + dependencies: + isexe: 2.0.0 + dev: true + + /which/2.0.2: + resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} + engines: {node: '>= 8'} + hasBin: true + dependencies: + isexe: 2.0.0 + dev: true + + /widest-line/3.1.0: + resolution: {integrity: sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg==} + engines: {node: '>=8'} + dependencies: + string-width: 4.2.3 + dev: true + + /window-size/0.2.0: + resolution: {integrity: sha512-UD7d8HFA2+PZsbKyaOCEy8gMh1oDtHgJh1LfgjQ4zVXmYjAT/kvz3PueITKuqDiIXQe7yzpPnxX3lNc+AhQMyw==} + engines: {node: '>= 0.10.0'} + hasBin: true + dev: true + + /workerpool/6.2.1: + resolution: {integrity: sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==} + dev: true + + /wrap-ansi/2.1.0: + resolution: {integrity: sha512-vAaEaDM946gbNpH5pLVNR+vX2ht6n0Bt3GXwVB1AuAqZosOvHNF3P7wDnh8KLkSqgUh0uh77le7Owgoz+Z9XBw==} + engines: {node: '>=0.10.0'} + dependencies: + string-width: 1.0.2 + strip-ansi: 3.0.1 + dev: true + + /wrap-ansi/7.0.0: + resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} + engines: {node: '>=10'} + dependencies: + ansi-styles: 4.3.0 + string-width: 4.2.3 + strip-ansi: 6.0.1 + dev: true + + /wrappy/1.0.2: + resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} + dev: true + + /write-stream/0.4.3: + resolution: {integrity: sha512-IJrvkhbAnj89W/GAVdVgbnPiVw5Ntg/B4tc/MUCIEwj/g6JIww1DWJyB/yBMT3yw2/TkT6IUZ0+IYef3flEw8A==} + dependencies: + readable-stream: 0.0.4 + dev: true + optional: true + + /ws/3.3.3: + resolution: {integrity: sha512-nnWLa/NwZSt4KQJu51MYlCcSQ5g7INpOrOMt4XV8j4dqTXdmlUmSHQ8/oLC069ckre0fRsgfvsKwbTdtKLCDkA==} + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: ^5.0.2 + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + dependencies: + async-limiter: 1.0.1 + safe-buffer: 5.1.2 + ultron: 1.1.1 + dev: true + + /ws/7.4.6: + resolution: {integrity: sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==} + engines: {node: '>=8.3.0'} + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: ^5.0.2 + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + dev: true + + /ws/7.5.9: + resolution: {integrity: sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==} + engines: {node: '>=8.3.0'} + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: ^5.0.2 + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + dev: true + + /ws/8.13.0_2adebc2xdjqbcvbjxkodkhadp4: + resolution: {integrity: sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==} + engines: {node: '>=10.0.0'} + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: '>=5.0.2' + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + dependencies: + bufferutil: 4.0.7 + utf-8-validate: 6.0.3 + dev: true + + /xhr-request-promise/0.1.3: + resolution: {integrity: sha512-YUBytBsuwgitWtdRzXDDkWAXzhdGB8bYm0sSzMPZT7Z2MBjMSTHFsyCT1yCRATY+XC69DUrQraRAEgcoCRaIPg==} + dependencies: + xhr-request: 1.1.0 + dev: true + + /xhr-request/1.1.0: + resolution: {integrity: sha512-Y7qzEaR3FDtL3fP30k9wO/e+FBnBByZeybKOhASsGP30NIkRAAkKD/sCnLvgEfAIEC1rcmK7YG8f4oEnIrrWzA==} + dependencies: + buffer-to-arraybuffer: 0.0.5 + object-assign: 4.1.1 + query-string: 5.1.1 + simple-get: 2.8.2 + timed-out: 4.0.1 + url-set-query: 1.0.0 + xhr: 2.6.0 + dev: true + + /xhr/2.6.0: + resolution: {integrity: sha512-/eCGLb5rxjx5e3mF1A7s+pLlR6CGyqWN91fv1JgER5mVWg1MZmlhBvy9kjcsOdRk8RrIujotWyJamfyrp+WIcA==} + dependencies: + global: 4.4.0 + is-function: 1.0.2 + parse-headers: 2.0.5 + xtend: 4.0.2 + dev: true + + /xmlhttprequest/1.8.0: + resolution: {integrity: sha512-58Im/U0mlVBLM38NdZjHyhuMtCqa61469k2YP/AaPbvCoV9aQGUpbJBj1QRm2ytRiVQBD/fsw7L2bJGDVQswBA==} + engines: {node: '>=0.4.0'} + dev: true + + /xss/1.0.14: + resolution: {integrity: sha512-og7TEJhXvn1a7kzZGQ7ETjdQVS2UfZyTlsEdDOqvQF7GoxNfY+0YLCzBy1kPdsDDx4QuNAonQPddpsn6Xl/7sw==} + engines: {node: '>= 0.10.0'} + hasBin: true + dependencies: + commander: 2.20.3 + cssfilter: 0.0.10 + dev: true + optional: true + + /xtend/4.0.2: + resolution: {integrity: sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==} + engines: {node: '>=0.4'} + dev: true + + /y18n/3.2.2: + resolution: {integrity: sha512-uGZHXkHnhF0XeeAPgnKfPv1bgKAYyVvmNL1xlKsPYZPaIHxGti2hHqvOCQv71XMsLxu1QjergkqogUnms5D3YQ==} + dev: true + + /y18n/5.0.8: + resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} + engines: {node: '>=10'} + dev: true + + /yaeti/0.0.6: + resolution: {integrity: sha512-MvQa//+KcZCUkBTIC9blM+CU9J2GzuTytsOUwf2lidtvkx/6gnEp1QvJv34t9vdjhFmha/mUiNDbN0D0mJWdug==} + engines: {node: '>=0.10.32'} + dev: true + + /yallist/3.1.1: + resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==} + dev: true + + /yallist/4.0.0: + resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} + dev: true + + /yargs-parser/2.4.1: + resolution: {integrity: sha512-9pIKIJhnI5tonzG6OnCFlz/yln8xHYcGl+pn3xR0Vzff0vzN1PbNRaelgfgRUwZ3s4i3jvxT9WhmUGL4whnasA==} + dependencies: + camelcase: 3.0.0 + lodash.assign: 4.2.0 + dev: true + + /yargs-parser/20.2.4: + resolution: {integrity: sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==} + engines: {node: '>=10'} + dev: true + + /yargs-unparser/2.0.0: + resolution: {integrity: sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==} + engines: {node: '>=10'} + dependencies: + camelcase: 6.3.0 + decamelize: 4.0.0 + flat: 5.0.2 + is-plain-obj: 2.1.0 + dev: true + + /yargs/16.2.0: + resolution: {integrity: sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==} + engines: {node: '>=10'} + dependencies: + cliui: 7.0.4 + escalade: 3.1.2 + get-caller-file: 2.0.5 + require-directory: 2.1.1 + string-width: 4.2.3 + y18n: 5.0.8 + yargs-parser: 20.2.4 + dev: true + + /yargs/4.8.1: + resolution: {integrity: sha512-LqodLrnIDM3IFT+Hf/5sxBnEGECrfdC1uIbgZeJmESCSo4HoCAaKEus8MylXHAkdacGc0ye+Qa+dpkuom8uVYA==} + dependencies: + cliui: 3.2.0 + decamelize: 1.2.0 + get-caller-file: 1.0.3 + lodash.assign: 4.2.0 + os-locale: 1.4.0 + read-pkg-up: 1.0.1 + require-directory: 2.1.1 + require-main-filename: 1.0.1 + set-blocking: 2.0.0 + string-width: 1.0.2 + which-module: 1.0.0 + window-size: 0.2.0 + y18n: 3.2.2 + yargs-parser: 2.4.1 + dev: true + + /yocto-queue/0.1.0: + resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} + engines: {node: '>=10'} + dev: true diff --git a/scripts/addresses.js b/scripts/addresses.js index ba962c6d3..12af4b0e4 100644 --- a/scripts/addresses.js +++ b/scripts/addresses.js @@ -1,4 +1,4 @@ -let addresses = require("../migrations/witnet.addresses") +let addresses = require("../migrations/addresses") let realm, network if (process.argv.length >= 3) { network = process.argv[2].toLowerCase() diff --git a/scripts/eth-create2.js b/scripts/eth-create2.js new file mode 100644 index 000000000..5a364f00e --- /dev/null +++ b/scripts/eth-create2.js @@ -0,0 +1,36 @@ +const assert = require("nanoassert") +const { utils } = require("eth-helpers") +const keccak = require("sha3-wasm").keccak256 + +const prefix = Buffer.from([0xff]) + +/** + * Generate Ethereum CREATE2 address + * + * @param {string|Buffer} address Ethereum address of creator contract as + * string or as a 20 byte `Buffer` + * @param {string|Buffer} salt 256 bit salt as either string or 32 byte `Buffer` + * @param {string|Buffer} initCode init_code as string or Buffer + * @returns {string} result address as hex encoded string. Not + * checksum'ed. This can be done with + * `eth-checksum` or similar modules + */ +module.exports = function create2 (address, salt, initCode) { + if (typeof address === "string") address = utils.parse.address(address) + if (typeof salt === "string") salt = utils.parse.uint256(salt) + if (typeof initCode === "string") initCode = utils.parse.bytes(initCode) + + assert(address.byteLength === 20, "address must be 20 bytes") + assert(salt.byteLength === 32, "salt must be 32 bytes") + assert(initCode.byteLength != null, "initCode must be Buffer") + + const codeHash = keccak().update(initCode).digest() + + return utils.format.address(keccak() + .update(prefix) + .update(address) + .update(salt) + .update(codeHash) + .digest() + .slice(-20)) +} diff --git a/scripts/eth-create3.js b/scripts/eth-create3.js new file mode 100644 index 000000000..613e8de59 --- /dev/null +++ b/scripts/eth-create3.js @@ -0,0 +1,42 @@ +const assert = require("nanoassert") +const { utils } = require("eth-helpers") +const keccak = require("sha3-wasm").keccak256 + +const factoryPrefix = Buffer.from([0xff]) + +/** + * Generate Ethereum CREATE3-library address + * + * @param {string|Buffer} address Ethereum address of creator contract as + * string or as a 20 byte `Buffer` + * @param {string|Buffer} salt 256 bit salt as either string or 32 byte `Buffer` + * @returns {string} result address as hex encoded string. Not + * checksum'ed. This can be done with + * `eth-checksum` or similar modules + */ +module.exports = function create3 (address, salt) { + if (typeof address === "string") address = utils.parse.address(address) + if (typeof salt === "string") salt = utils.parse.uint256(salt) + + assert(address.byteLength === 20, "address must be 20 bytes") + assert(salt.byteLength === 32, "salt must be 32 bytes") + + const factoryHash = utils.parse.uint256("0x21c35dbe1b344a2488cf3321d6ce542f8e9f305544ff09e4993a62319a497c1f") + const factoryAddr = keccak() + .update(factoryPrefix) + .update(address) + .update(salt) + .update(factoryHash) + .digest() + .slice(-20) + + assert(factoryAddr.byteLength === 20, "address must be 20 bytes") + + return utils.format.address(keccak() + .update(Buffer.from([0xd6, 0x94])) + .update(factoryAddr) + .update(Buffer.from([0x01])) + .digest() + .slice(-20) + ) +} diff --git a/scripts/prepare.js b/scripts/prepare.js new file mode 100644 index 000000000..d82ff282a --- /dev/null +++ b/scripts/prepare.js @@ -0,0 +1,15 @@ +const exec = require("child_process").execSync +const os = require("os") +const fs = require("fs") + +if (fs.existsSync("./artifacts")) { + if (os.type() === "Windows_NT") { + exec("del /s /q artifacts\\*.dbg.json") + } else { + exec("find ./artifacts -name \"*.dbg.json\" -exec rm -r {} \\;") + } +} + +if (fs.existsSync("./build/contracts")) { + exec("sed -i -- \"/\bsourcePath\b/d\" build/contracts/*.json") +} diff --git a/scripts/utils/index.js b/scripts/utils/index.js deleted file mode 100644 index ec39657fd..000000000 --- a/scripts/utils/index.js +++ /dev/null @@ -1,118 +0,0 @@ -const fs = require("fs") -require("dotenv").config() -const readline = require("readline") -const web3 = require("web3") - -const traceHeader = require("./traceHeader") -const traceTx = require("./traceTx") - -module.exports = { - fromAscii, - getRealmNetworkFromArgs, - getRealmNetworkFromString, - isNullAddress, - padLeft, - prompt, - saveAddresses, - traceHeader, - traceTx, -} - -function fromAscii (str) { - const arr1 = [] - for (let n = 0, l = str.length; n < l; n++) { - const hex = Number(str.charCodeAt(n)).toString(16) - arr1.push(hex) - } - return "0x" + arr1.join("") -} - -function getRealmNetworkFromArgs () { - let networkString = process.argv.includes("test") ? "test" : "development" - // If a `--network` argument is provided, use that instead - const args = process.argv.join("=").split("=") - const networkIndex = args.indexOf("--network") - if (networkIndex >= 0) { - networkString = args[networkIndex + 1] - } - return getRealmNetworkFromString(networkString) -} - -function getRealmNetworkFromString (network) { - network = network ? network.replaceAll(":", ".").toLowerCase() : "development" - - // Try to extract realm/network info from environment - const envRealm = process.env.WITNET_EVM_REALM - ? process.env.WITNET_EVM_REALM.toLowerCase() - : null - - let realm - if (network.split(".")[1]) { - realm = network.split(".")[0] - if (realm === "ethereum") { - // Realm in "ethereum.*" networks must be set to "default" - realm = "default" - } - if (envRealm && realm !== envRealm) { - // Check that WITNET_EVM_REALM, if defined, and network's realm actually match - console.error( - `\n> Fatal: network "${network}" and WITNET_EVM_REALM value`, - `("${envRealm.toUpperCase()}") don't match.\n` - ) - process.exit(1) - } - } else { - realm = envRealm || "default" - network = `${realm === "default" ? "ethereum" : realm}.${network}` - } - if (realm === "default") { - const subnetwork = network.split(".")[1] - if (subnetwork === "development" || subnetwork === "test") { - // In "default" realm, networks "development" and "test" must be returned without a prefix. - network = subnetwork - } - } - return [realm, network] -} - -function isNullAddress (addr) { - return !addr || - addr === "0x0000000000000000000000000000000000000000" || - !web3.utils.isAddress(addr) -} - -function padLeft (str, char, size) { - if (str.length < size) { - return char.repeat((size - str.length) / char.length) + str - } else { - return str - } -} - -async function prompt (text) { - const rl = readline.createInterface({ - input: process.stdin, - output: process.stdout, - }) - let answer - await new Promise((resolve) => { - rl.question( - text, - function (input) { - answer = input - rl.close() - }) - rl.on("close", function () { - resolve() - }) - }) - return answer -} - -function saveAddresses (addrs) { - fs.writeFileSync( - "./migrations/witnet.addresses.json", - JSON.stringify(addrs, null, 4), - { flag: "w+" } - ) -} diff --git a/scripts/utils/traceHeader.js b/scripts/utils/traceHeader.js deleted file mode 100644 index de350909d..000000000 --- a/scripts/utils/traceHeader.js +++ /dev/null @@ -1,5 +0,0 @@ -module.exports = function (header) { - console.log("") - console.log(" ", header) - console.log(" ", `${"-".repeat(header.length)}`) -} diff --git a/scripts/utils/traceTx.js b/scripts/utils/traceTx.js deleted file mode 100644 index 06bdb31ef..000000000 --- a/scripts/utils/traceTx.js +++ /dev/null @@ -1,9 +0,0 @@ -module.exports = function (receipt, totalCost) { - console.log(" ", "> block number: ", receipt.blockNumber) - console.log(" ", "> transaction hash: ", receipt.transactionHash) - console.log(" ", "> transaction gas: ", receipt.gasUsed) - if (totalCost) { - console.log(" ", "> total cost: ", totalCost, "ETH") - } - console.log() -} diff --git a/scripts/vanity2gen.js b/scripts/vanity2gen.js new file mode 100644 index 000000000..4b3847d7a --- /dev/null +++ b/scripts/vanity2gen.js @@ -0,0 +1,82 @@ +const { assert } = require("chai") +const create2 = require("./eth-create2") +const fs = require("fs") +const utils = require("../src/utils") + +const addresses = require("../migrations/addresses") + +module.exports = async function () { + let artifact + let count = 0 + let ecosystem = "default" + let from + let hits = 10 + let offset = 0 + let network = "default" + let prefix = "0x00" + let suffix = "00" + let hexArgs = "" + process.argv.map((argv, index, args) => { + if (argv === "--offset") { + offset = parseInt(args[index + 1]) + } else if (argv === "--artifact") { + artifact = artifacts.require(args[index + 1]) + } else if (argv === "--prefix") { + prefix = args[index + 1].toLowerCase() + assert(web3.utils.isHexStrict(prefix), "--prefix: invalid hex string") + } else if (argv === "--suffix") { + suffix = args[index + 1].toLowerCase() + assert(web3.utils.isHexStrict(suffix), "--suffix: invalid hex string") + } else if (argv === "--hits") { + hits = parseInt(args[index + 1]) + } else if (argv === "--network") { + [ecosystem, network] = utils.getRealmNetworkFromString(args[index + 1].toLowerCase()) + } else if (argv === "--hexArgs") { + hexArgs = args[index + 1].toLowerCase() + if (hexArgs.startsWith("0x")) hexArgs = hexArgs.slice(2) + assert(web3.utils.isHexStrict("0x" + hexArgs), "--hexArgs: invalid hex string") + } else if (argv === "--from") { + from = args[index + 1] + } + return argv + }) + try { + from = from || addresses[ecosystem][network].WitnetDeployer + } catch { + console.error(`WitnetDeployer must have been previously deployed on network '${network}'.\n`) + console.info("Usage:\n") + console.info(" --artifact => Truffle artifact name (mandatory)") + console.info(" --hexArgs => Hexified constructor arguments") + console.info(" --hits => Number of vanity hits to look for (default: 10)") + console.info(" --network => Network name") + console.info(" --offset => Salt starting value minus 1 (default: 0)") + console.info(" --prefix => Prefix hex string to look for (default: 0x00)") + console.info(" --suffix => suffix hex string to look for (default: 0x00)") + process.exit(1) + } + if (!artifact) { + console.error("No --artifact was set!") + process.exit(1) + } + const initCode = artifact.toJSON().bytecode + hexArgs + console.log("Init code: ", initCode) + console.log("Artifact: ", artifact?.contractName) + console.log("From: ", from) + console.log("Hits: ", hits) + console.log("Offset: ", offset) + console.log("Prefix: ", prefix) + console.log("Suffix: ", suffix) + console.log("=".repeat(55)) + suffix = suffix.slice(2) + while (count < hits) { + const salt = "0x" + utils.padLeft(offset.toString(16), "0", 32) + const addr = create2(from, salt, initCode).toLowerCase() + if (addr.startsWith(prefix) && addr.endsWith(suffix)) { + const found = `${offset} => ${web3.utils.toChecksumAddress(addr)}` + console.log(found) + fs.appendFileSync(`./migrations/salts/${artifact?.contractName}$${from.toLowerCase()}.tmp`, found + "\n") + count++ + } + offset++ + } +} diff --git a/scripts/vanity3gen.js b/scripts/vanity3gen.js new file mode 100644 index 000000000..6b20d7e45 --- /dev/null +++ b/scripts/vanity3gen.js @@ -0,0 +1,65 @@ +const { assert } = require("chai") +const create3 = require("./eth-create3") +const fs = require("fs") +const utils = require("../src/utils") + +const addresses = require("../migrations/addresses") + +module.exports = async function () { + let count = 0 + let ecosystem = "default" + let from + let hits = 10 + let offset = 0 + let network = "default" + let prefix = "0x00" + let suffix = "0x00" + process.argv.map((argv, index, args) => { + if (argv === "--offset") { + offset = parseInt(args[index + 1]) + } else if (argv === "--prefix") { + prefix = args[index + 1].toLowerCase() + assert(web3.utils.isHexStrict(prefix), "--prefix: invalid hex string") + } else if (argv === "--suffix") { + suffix = args[index + 1].toLowerCase() + assert(web3.utils.isHexStrict(suffix), "--suffix: invalid hex string") + } else if (argv === "--hits") { + hits = parseInt(args[index + 1]) + } else if (argv === "--network") { + [ecosystem, network] = utils.getRealmNetworkFromString(args[index + 1].toLowerCase()) + } else if (argv === "--from") { + from = args[index + 1] + } + return argv + }) + try { + from = from || addresses[ecosystem][network].WitnetDeployer + } catch { + console.error(`WitnetDeployer must have been previously deployed on network '${network}'.\n`) + console.info("Usage:\n") + console.info(" --hits => Number of vanity hits to look for (default: 10)") + console.info(" --network => Network name") + console.info(" --offset => Salt starting value minus 1 (default: 0)") + console.info(" --prefix => Prefix hex string to look for (default: 0x00)") + console.info(" --suffix => suffix hex string to look for (default: 0x00)") + process.exit(1) + } + console.log("From: ", from) + console.log("Hits: ", hits) + console.log("Offset: ", offset) + console.log("Prefix: ", prefix) + console.log("Suffix: ", suffix) + console.log("=".repeat(55)) + suffix = suffix.slice(2) + while (count < hits) { + const salt = "0x" + utils.padLeft(offset.toString(16), "0", 32) + const addr = create3(from, salt).toLowerCase() + if (addr.startsWith(prefix) && addr.endsWith(suffix)) { + const found = `${offset} => ${web3.utils.toChecksumAddress(addr)}` + console.log(found) + fs.appendFileSync(`./migrations/salts/create3$${from.toLowerCase()}.tmp`, found + "\n") + count++ + } + offset++ + } +} diff --git a/scripts/vanitygen.js b/scripts/vanitygen.js deleted file mode 100644 index b86638fce..000000000 --- a/scripts/vanitygen.js +++ /dev/null @@ -1,70 +0,0 @@ -const { assert } = require("chai") -const create2 = require("eth-create2") -const fs = require("fs") -const utils = require("./utils") - -const addresses = require("../migrations/witnet.addresses") - -module.exports = async function () { - let artifact - let count = 0 - let ecosystem = "default" - let from - let hits = 10 - let offset = 0 - let network = "default" - let target = "0xfacade" - process.argv.map((argv, index, args) => { - if (argv === "--from") { - from = args[index + 1] - } else if (argv === "--offset") { - offset = parseInt(args[index + 1]) - } else if (argv === "--artifact") { - artifact = artifacts.require(args[index + 1]) - } else if (argv === "--target") { - target = args[index + 1].toLowerCase() - } else if (argv === "--hits") { - hits = parseInt(args[index + 1]) - } else if (argv === "--network") { - [ecosystem, network] = utils.getRealmNetworkFromString(args[index + 1].toLowerCase()) - } - return argv - }) - try { - from = from || addresses[ecosystem][network].Create2Factory - } catch { - console.error(` Create2Factory must have been previously deployed on network '${network}'.\n`) - console.info("Usage:\n") - console.info(" --artifact => Truffle artifact name (default: WitnetProxy)") - console.info(" --hits => Number of vanity hits to look for (default: 10)") - console.info(" --offset => Salt starting value minus 1 (default: 0)") - console.info(" --network => Network name") - console.info(" --target => Prefix hex number to look for (default: 0xc0ffee)") - process.exit(1) - } - const bytecode = artifact - ? artifact.toJSON().bytecode - : `0x3d602d80600a3d3981f3363d3d373d3d3d363d73${from.toLowerCase().slice(2)}5af43d82803e903d91602b57fd5bf3` - const targets = target.split(",") - for (let j = 0; j < targets.length; j++) { - assert(web3.utils.isHexStrict(targets[j]), "--target refers invalid hex string") - } - console.log("Bytecode: ", bytecode) - console.log("Artifact: ", artifact?.contractName || "ERC-1167: Minimal Proxy Contract") - console.log("From: ", from) - console.log("Hits: ", hits) - console.log("Offset: ", offset) - console.log("Target: ", target) - console.log("=".repeat(55)) - while (count < hits) { - const salt = "0x" + utils.padLeft(offset.toString(16), "0", 32) - const addr = create2(from, salt, bytecode) - if (targets.some((word) => addr.toLowerCase().startsWith(word))) { - const found = `${offset} => ${web3.utils.toChecksumAddress(addr)}` - console.log(found) - fs.appendFileSync(`./migrations/salts/${artifact?.contractName || "MinimalProxy"}$${from.toLowerCase()}.tmp`, found + "\n") - count++ - } - offset++ - } -} diff --git a/scripts/verify-core.js b/scripts/verify-core.js new file mode 100644 index 000000000..797a8509f --- /dev/null +++ b/scripts/verify-core.js @@ -0,0 +1,29 @@ +#!/usr/bin/env node + +const utils = require("../src/utils") + +if (process.argv.length < 3) { + console.error("\nUsage:\n\n$ node ./scripts/verify-proxies.js : ...OPTIONAL_ARGS\n") + process.exit(0) +} + +const network = process.argv[2].toLowerCase().replaceAll(".", ":") + +const header = network.toUpperCase() + " CORE" +console.info() +console.info(header) +console.info("=".repeat(header.length)) +console.info() + +utils.traceVerify(network, "WitnetDeployer") +utils.traceVerify(network, "WitnetProxy") + +const singletons = [ + "WitnetOracle", + "WitnetPriceFeeds", + "WitnetRequestBytecodes", + "witnetRequestFactory", +] +for (const index in singletons) { + utils.traceVerify(network, `${singletons[index]} --custom-proxy WitnetProxy`) +} diff --git a/scripts/verify-impls.js b/scripts/verify-impls.js new file mode 100644 index 000000000..c888ea612 --- /dev/null +++ b/scripts/verify-impls.js @@ -0,0 +1,31 @@ +#!/usr/bin/env node + +const settings = require("../settings") +const utils = require("../src/utils") + +if (process.argv.length < 3) { + console.error("\nUsage:\n\n$ node ./scripts/verify-proxies.js : ...OPTIONAL_ARGS\n") + process.exit(0) +} + +const network = process.argv[2].toLowerCase().replaceAll(".", ":") + +const header = network.toUpperCase() +console.info() +console.info(header) +console.info("=".repeat(header.length)) +console.info() + +const artifacts = settings.getArtifacts(network) +const impls = [ + artifacts.WitnetOracle, + artifacts.WitnetPriceFeeds, + artifacts.WitnetRequestBytecodes, + artifacts.WitnetRequestFactory, +] +const constructorArgs = require("../migrations/constructorArgs.json") +for (const index in impls) { + utils.traceVerify(network, `${impls[index]} --forceConstructorArgs string:${ + constructorArgs[network][impls[index]] + } --verifiers etherscan`) +} diff --git a/scripts/verify-libs.js b/scripts/verify-libs.js new file mode 100644 index 000000000..ff123b661 --- /dev/null +++ b/scripts/verify-libs.js @@ -0,0 +1,27 @@ +#!/usr/bin/env node + +const settings = require("../settings") +const utils = require("../src/utils") + +if (process.argv.length < 3) { + console.error("\nUsage:\n\n$ node ./scripts/verify-proxies.js : ...OPTIONAL_ARGS\n") + process.exit(0) +} + +const network = process.argv[2].toLowerCase().replaceAll(".", ":") + +const header = network.toUpperCase() + " LIBS" +console.info() +console.info(header) +console.info("=".repeat(header.length)) +console.info() + +const artifacts = settings.getArtifacts(network) +const libs = [ + artifacts.WitnetEncodingLib, + artifacts.WitnetErrorsLib, + artifacts.WitnetPriceFeedsLib, +] +for (const index in libs) { + utils.traceVerify(network, `${libs[index]}`) +} diff --git a/settings/artifacts.js b/settings/artifacts.js new file mode 100644 index 000000000..5f2b4d158 --- /dev/null +++ b/settings/artifacts.js @@ -0,0 +1,41 @@ +module.exports = { + default: { + WitnetOracle: "WitnetRequestBoardTrustableDefault", + WitnetPriceFeeds: "WitnetPriceFeedsDefault", + WitnetRequestBytecodes: "WitnetRequestBytecodesDefault", + WitnetRequestFactory: "WitnetRequestFactoryDefault", + WitnetEncodingLib: "WitnetEncodingLib", + WitnetErrorsLib: "WitnetErrorsLib", + WitnetPriceFeedsLib: "WitnetPriceFeedsLib", + }, + boba: { + WitnetOracle: "WitnetRequestBoardTrustableOvm2", + }, + conflux: { + WitnetRequestFactory: "WitnetRequestFactoryCfxCore", + }, + mantle: { + WitnetOracle: "WitnetRequestBoardTrustableOvm2", + }, + optimism: { + WitnetOracle: "WitnetRequestBoardTrustableOvm2", + }, + "polygon.zkevm.goerli": { + WitnetRequestBytecodes: "WitnetRequestBytecodesNoSha256", + }, + "polygon.zkevm.mainnet": { + WitnetRequestBytecodes: "WitnetRequestBytecodesNoSha256", + }, + reef: { + WitnetOracle: "WitnetOracleTrustableReef", + }, + scroll: { + WitnetRequestBytecodes: "WitnetRequestBytecodesNoSha256", + }, + "syscoin.rollux.testnet": { + WitnetOracle: "WitnetRequestBoardTrustableOvm2", + }, + ten: { + WitnetOracle: "WitnetRequestBoardTrustableObscuro", + }, +} diff --git a/settings/index.js b/settings/index.js new file mode 100644 index 000000000..b055264fd --- /dev/null +++ b/settings/index.js @@ -0,0 +1,51 @@ +const artifacts = require("./artifacts") +const merge = require("lodash.merge") +const networks = require("./networks") +const specs = require("./specs") +const solidity = require("./solidity") +const utils = require("../src/utils") + +module.exports = { + getArtifacts: (network) => { + const [eco, net] = utils.getRealmNetworkFromArgs(network) + return merge( + artifacts.default, + artifacts[eco], + artifacts[net] + ) + }, + getCompilers: (network) => { + const [eco, net] = utils.getRealmNetworkFromArgs(network) + return merge( + solidity.default, + solidity[eco], + solidity[net], + ) + }, + getNetworks: () => { + return Object.fromEntries(Object.entries(networks) + .filter(entry => entry[0].indexOf(":") > -1) + .map(entry => { + const [ecosystem, network] = utils.getRealmNetworkFromString(entry[0]) + return [ + network.toLowerCase(), merge( + { ...networks.default }, + networks[ecosystem], + networks[entry[0]] + ), + ] + }) + ) + }, + getSpecs: (network) => { + const [eco, net] = utils.getRealmNetworkFromArgs(network) + return merge( + specs.default, + specs[eco], + specs[net] + ) + }, + artifacts, + solidity, + specs, +} diff --git a/settings/networks.js b/settings/networks.js new file mode 100644 index 000000000..7ae1bc594 --- /dev/null +++ b/settings/networks.js @@ -0,0 +1,377 @@ +module.exports = { + default: { + host: "localhost", + skipDryRun: true, + }, + "arbitrum:goerli": { + network_id: 421613, + port: 8517, + verify: { + apiUrl: "https://api-goerli.arbiscan.io/", + browserURL: "https://goerli.arbiscan.io/", + }, + }, + "arbitrum:one": { + network_id: 42161, + port: 9517, + }, + "avalanche:mainnet": { + network_id: 43114, + port: 9533, + }, + "avalanche:testnet": { + network_id: 43113, + port: 8533, + verify: { + apiUrl: "https://api.arbiscan.io/api", + browserURL: "https://arbiscan.io/", + }, + }, + "boba:bnb:testnet": { + network_id: 9728, + port: 8510, + verify: { + apiUrl: "https://api.routescan.io/v2/network/testnet/evm/2888/etherscan", + browserURL: "https://boba.testnet.routescan.io/", + }, + }, + "boba:bnb:mainnet": { + network_id: 56288, + port: 9510, + verify: { + apiUrl: "https://blockexplorer.bnb.boba.network/api", + browserURL: "https://blockexplorer.bnb.boba.network/", + apiKey: "MY_API_KEY", + }, + }, + "boba:ethereum:mainnet": { + network_id: 288, + port: 9539, + verify: { + apiUrl: "https://api.routescan.io/v2/network/mainnet/evm/all/etherscan", + browserURL: "https://bobascan.com/address/", + apiKey: "MY_API_KEY", + }, + }, + "boba:ethereum:goerli": { + network_id: 2888, + port: 8515, + verify: { + apiUrl: "https://api.routescan.io/v2/network/testnet/evm/2888/etherscan", + browserURL: "https://boba.testnet.routescan.io/", + }, + }, + "celo:alfajores": { + network_id: 44787, + port: 8538, + }, + "celo:mainnet": { + network_id: 42220, + port: 9538, + verify: { + apiKey: "MY_API_KEY", + apiUrl: "https://explorer.celo.org/alfajores/api", + browserURL: "https://explorer.celo.org/alfajores/", + }, + }, + "conflux:core:testnet": { + port: 8540, + network_id: 1, + gasPrice: 10, + }, + "conflux:core:mainnet": { + port: 9540, + network_id: 1029, + gasPrice: 10, + verify: { + apiUrl: "https://explorer.celo.org/mainnet/api", + browserURL: "https://explorer.celo.org/mainnet/", + }, + }, + "conflux:espace:testnet": { + port: 8529, + network_id: 71, + networkCheckTimeout: 999999, + gas: 15000000, + }, + "conflux:espace:mainnet": { + port: 9529, + network_id: 1030, + networkCheckTimeout: 999999, + gas: 15000000, + }, + "cronos:testnet": { + port: 8530, + network_id: 338, + verify: { + apiUrl: "https://cronos.org/explorer/testnet3/api", + browserURL: "https://cronos.org/explorer/testnet3", + }, + }, + "cronos:mainnet": { + port: 9530, + network_id: 25, + }, + "cube:testnet": { + port: 8522, + network_id: 1819, + }, + "ethereum:goerli": { + network_id: 5, + port: 8545, + verify: { + apiUrl: "https://api-goerli.etherscan.io/", + browserURL: "https://goerli.etherscan.io/", + }, + }, + "ethereum:mainnet": { + network_id: 1, + port: 9545, + }, + "ethereum:sepolia": { + network_id: 11155111, + port: 8506, + verify: { + apiUrl: "https://api-sepolia.etherscan.io/api", + browserURL: "https://sepolia.etherscan.io/", + }, + }, + "dogechain:testnet": { + port: 8519, + network_id: 568, + gas: 6000000, + verify: { + apiKey: "MY_API_KEY", + apiUrl: "http://explorer-testnet.dogechain.dog/api", + browserURL: "https://explorer-testnet.dogechain.dog/", + }, + }, + "dogechain:mainnet": { + port: 9519, + network_id: 2000, + }, + "elastos:testnet": { + port: 8513, + network_id: 21, + verify: { + apiKey: "MY_API_KEY", + apiUrl: "https://esc-testnet.elastos.io/api", + browserURL: "https://esc-testnet.elastos.io/address", + }, + }, + "elastos:mainnet": { + port: 9513, + network_id: 20, + verify: { + apiUrl: "https://esc.elastos.io/api", + browserURL: "https://esc.elastos.io/address", + }, + }, + "fuse:testnet": { + port: 8511, + network_id: 123, + verify: { + apiUrl: "https://explorer.fusespark.io/api", + browserURL: "https://explorer.fusespark.io/address", + apiKey: "MY_API_KEY", + }, + }, + "gnosis:testnet": { + port: 8509, + network_id: 10200, + verify: { + apiUrl: "https://gnosis-chiado.blockscout.com/api", + browserURL: "https://gnosis-chiado.blockscout.com/address", + apiKey: "MY_API_KEY", + }, + }, + "harmony:testnet#0": { + port: 8534, + network_id: 1666700000, + }, + "kava:testnet": { + port: 8526, + network_id: 2221, + verify: { + apiKey: "MY_API_KEY", + apiUrl: "https://explorer.testnet.kava.io/api", + browserURL: "https://explorer.testnet.kava.io/", + }, + }, + "kava:mainnet": { + port: 9526, + network_id: 2222, + }, + "kcc:testnet": { + port: 8537, + network_id: 322, + verify: { + apiKey: "MY_API_KEY", + apiUrl: "https://scan-testnet.kcc.network/api", + browserURL: "https://scan-testnet.kcc.network/", + }, + }, + "kcc:mainnet": { + port: 9537, + network_id: 321, + }, + "klaytn:testnet": { + port: 8527, + network_id: 1001, + }, + "klaytn:mainnet": { + port: 9527, + network_id: 8217, + }, + "mantle:testnet": { + port: 8508, + network_id: 5001, + verify: { + apiKey: "MY_API_KEY", + apiUrl: "https://explorer.testnet.mantle.xyz/api", + explorerUrl: "https://explorer.testnet.mantle.xyz/address", + }, + }, + "mantle:mainnet": { + port: 9508, + network_id: 5000, + verify: { + apiKey: "MY_API_KEY", + apiUrl: "https://explorer.mantle.xyz/api", + explorerUrl: "https://explorer.mantle.xyz/address", + }, + }, + "metis:mainnet": { + port: 9536, + network_id: 1088, + }, + "metis:goerli": { + port: 8536, + network_id: 599, + verify: { + apiKey: "MY_API_KEY", + apiUrl: "https://goerli.explorer.metisdevops.link/api", + explorerUrl: "https://goerli.explorer.metisdevops.link/address", + }, + }, + "meter:testnet": { + port: 8523, + network_id: 83, + }, + "meter:mainnet": { + port: 9523, + network_id: 82, + }, + "moonbeam:mainnet": { + port: 9531, + network_id: 1284, + }, + "moonbeam:moonriver": { + port: 7531, + network_id: 1285, + }, + "moonbeam:moonbase": { + port: 8531, + network_id: 1287, + }, + "okxchain:testnet": { + port: 8528, + network_id: 65, + }, + "okxchain:mainnet": { + port: 9528, + network_id: 66, + }, + "optimism:goerli": { + port: 8520, + network_id: 420, + verify: { + apiKey: "MY_API_KEY", + apiUrl: "https://optimism-goerli.blockscout.com/api", + explorerUrl: "https://optimism-goerli.blockscout.com/", + }, + }, + "optimism:mainnet": { + port: 9520, + network_id: 10, + + }, + "polygon:goerli": { + port: 8535, + network_id: 80001, + }, + "polygon:mainnet": { + port: 9535, + network_id: 137, + }, + "polygon:zkevm:goerli": { + port: 8512, + network_id: 1442, + verify: { + apiUrl: "https://api-testnet-zkevm.polygonscan.com/api", + explorerUrl: "https://testnet-zkevm.polygonscan.com/address", + }, + }, + "polygon:zkevm:mainnet": { + port: 9512, + network_id: 1101, + verify: { + apiUrl: "https://api-zkevm.polygonscan.com/api", + explorerUrl: "https://zkevm.polygonscan.com/address/", + }, + }, + "reef:testnet": { + port: 8532, + network_id: 13939, + }, + "reef:mainnet": { + port: 9532, + network_id: 13939, + }, + "scroll:sepolia": { + port: 8514, + network_id: 534351, + verify: { + apiUrl: "http://api-sepolia.scrollscan.io/api", + explorerUrl: "https://sepolia.scrollscan.io/", + }, + }, + "scroll:mainnet": { + port: 9514, + network_id: 534352, + verify: { + apiUrl: "https://api.scrollscan.com/api", + explorerUrl: "https://scrollscan.com/address", + }, + }, + "syscoin:testnet": { + port: 8521, + network_id: 5700, + }, + "syscoin:mainnet": { + port: 9521, + network_id: 57, + }, + "syscoin:rollux:testnet": { + port: 8507, + network_id: 57000, + verify: { + apiKey: "abc", + apiUrl: "https://rollux.tanenbaum.io/api", + explorerUrl: "https://rollux.tanenbaum.io/address/", + }, + }, + "ten:testnet": { + port: 8504, + network_id: 443, + gas: 6000000, + }, + "ultron:testnet": { + port: 8516, + network_id: 1230, + }, + "ultron:mainnet": { + port: 9516, + network_id: 1231, + }, +} diff --git a/settings/solidity.js b/settings/solidity.js new file mode 100644 index 000000000..db7b0e5f9 --- /dev/null +++ b/settings/solidity.js @@ -0,0 +1,12 @@ +module.exports = { + default: { + version: "0.8.22", + settings: { + optimizer: { + enabled: true, + runs: 200, + }, + evmVersion: "paris", + }, + }, +} diff --git a/settings/specs.js b/settings/specs.js new file mode 100644 index 000000000..b16c847a1 --- /dev/null +++ b/settings/specs.js @@ -0,0 +1,191 @@ +module.exports = { + default: { + WitnetOracle: { + immutables: { + types: ["uint256", "uint256", "uint256", "uint256"], + values: [ + /* _reportResultGasBase */ 58282, + /* _reportResultWithCallbackGasBase */ 65273, + /* _reportResultWithCallbackRevertGasBase */ 69546, + /* _sstoreFromZeroGas */ 20000, + ], + }, + libs: ["WitnetErrorsLib"], + vanity: 899032812, // 0x000071F0c823bD30D2Bf4CD1E829Eba5A6070000 + }, + WitnetPriceFeeds: { + from: "0xF121b71715E71DDeD592F1125a06D4ED06F0694D", + libs: ["WitnetPriceFeedsLib"], + vanity: 1865150170, // 0x1111AbA2164AcdC6D291b08DfB374280035E1111 + }, + WitnetRequestBytecodes: { + libs: ["WitnetEncodingLib"], + vanity: 6765579443, // 0x000B61Fe075F545fd37767f40391658275900000 + }, + WitnetRequestFactory: { + vanity: 2294036679, // 0x000F4cCF726c5445626DBD6f2258482f61377000 + }, + }, + avalanche: { + WitnetOracle: { + immutables: { + values: [ + /* _reportResultGasBase */ 155000, + ], + }, + }, + }, + celo: { + WitnetOracle: { + immutables: { + values: [ + /* _reportResultGasBase */ 114000, + ], + }, + }, + }, + conflux: { + WitnetOracle: { + immutables: { + values: [ + /* _reportResultGasBase */ 78500, + ], + }, + }, + }, + "conflux.espace.testnet": { + WitnetOracle: { + immutables: { + values: [ + /* _reportResultGasBase */ 225000, + ], + }, + }, + }, + "conflux.espace.mainnet": { + WitnetOracle: { + immutables: { + values: [ + /* _reportResultGasBase */ 225000, + ], + }, + }, + }, + cronos: { + WitnetOracle: { + immutables: { + values: [ + /* _reportResultGasBase */ 137500, + ], + }, + }, + }, + dogechain: { + WitnetOracle: { + immutables: { + values: [ + /* _reportResultGasBase */ 85000, + ], + }, + }, + }, + harmony: { + WitnetOracle: { + immutables: { + values: [ + /* _reportResultGasBase */ 530000, + ], + }, + }, + }, + hsc: { + WitnetOracle: { + immutables: { + values: [ + /* _reportResultGasBase */ 85000, + ], + }, + }, + }, + kcc: { + WitnetOracle: { + immutables: { + values: [ + /* _reportResultGasBase */ 92500, + ], + }, + }, + }, + klaytn: { + WitnetOracle: { + immutables: { + values: [ + /* _reportResultGasBase */ 105000, + ], + }, + }, + }, + meter: { + WitnetOracle: { + immutables: { + values: [ + /* _reportResultGasBase */ 85000, + ], + }, + }, + }, + metis: { + WitnetOracle: { + immutables: { + values: [ + /* _reportResultGasBase */ 134800, + ], + }, + }, + }, + moonbeam: { + WitnetOracle: { + immutables: { + values: [ + /* _reportResultGasBase */ 115000, + ], + }, + }, + }, + okxchain: { + WitnetOracle: { + immutables: { + values: [ + /* _reportResultGasBase */ 145000, + ], + }, + }, + }, + optimism: { + WitnetOracle: { + immutables: { + values: [ + /* _reportResultGasBase */ 135000, + ], + }, + }, + }, + reef: { + WitnetOracle: { + immutables: { + values: [ + /* _reportResultGasBase */ "0x3100A1CAC7EF19DC", + ], + }, + }, + }, + ultron: { + WitnetOracle: { + immutables: { + values: [ + /* _reportResultGasBase */ 83949, + ], + }, + }, + }, +} diff --git a/src/index.js b/src/index.js new file mode 100644 index 000000000..1f475f7d4 --- /dev/null +++ b/src/index.js @@ -0,0 +1,52 @@ +const addresses = require("../migrations/addresses.json") +const merge = require("lodash.merge") +const utils = require("./utils") +module.exports = { + getAddresses: (network) => { + const [eco, net] = utils.getRealmNetworkFromString(network) + if (addresses[net]) { + const merged = merge( + addresses.default, + addresses[eco], + addresses[net], + ) + return { + WitnetPriceFeeds: merged?.WitnetPriceFeeds, + WitnetOracle: merged?.WitnetOracle, + } + } else { + return {} + } + }, + supportedEcosystems: () => { + const ecosystems = [] + supportedNetworks().forEach(network => { + const [ecosystem] = utils.getRealmNetworkFromString(network) + if (!ecosystems.includes(ecosystem)) { + ecosystems.push(ecosystem) + } + }) + return ecosystems + }, + supportedNetworks, + artifacts: { + WitnetOracle: require("../artifacts/contracts/WitnetOracle.sol/WitnetOracle.json"), + WitnetPriceFeeds: require("../artifacts/contracts/WitnetPriceFeeds.sol/WitnetPriceFeeds.json"), + WitnetPriceRouteSolver: require("../artifacts/contracts/interfaces/IWitnetPriceSolver.sol/IWitnetPriceSolver.json"), + WitnetRequest: require("../artifacts/contracts/WitnetRequest.sol/WitnetRequest.json"), + WitnetRequestBytecodes: require("../artifacts/contracts/WitnetRequestBytecodes.sol/WitnetRequestBytecodes.json"), + WitnetRequestFactory: require("../artifacts/contracts/WitnetRequestFactory.sol/WitnetRequestFactory.json"), + WitnetRequestTemplate: require("../artifacts/contracts/WitnetRequestTemplate.sol/WitnetRequestTemplate.json"), + WitnetUpgradableBase: require("../artifacts/contracts/core/WitnetUpgradableBase.sol/WitnetUpgradableBase.json"), + }, + settings: require("../settings"), + utils, +} + +function supportedNetworks (ecosystem) { + return Object + .entries(addresses) + .filter(value => value[0].indexOf(":") > -1 && (!ecosystem || value[0].startsWith(ecosystem))) + .map(value => value[0]) + .sort() +} diff --git a/src/utils.js b/src/utils.js new file mode 100644 index 000000000..dc74e7672 --- /dev/null +++ b/src/utils.js @@ -0,0 +1,158 @@ +const execSync = require("child_process").execSync +const fs = require("fs") +require("dotenv").config() +const lockfile = require("proper-lockfile") +const readline = require("readline") + +module.exports = { + fromAscii, + getRealmNetworkFromArgs, + getRealmNetworkFromString, + getWitnetArtifactsFromArgs, + getWitnetRequestMethodString, + isDryRun, + isNullAddress, + padLeft, + prompt, + readJsonFromFile, + overwriteJsonFile, + traceHeader, + traceTx, + traceVerify, +} + +function fromAscii (str) { + const arr1 = [] + for (let n = 0, l = str.length; n < l; n++) { + const hex = Number(str.charCodeAt(n)).toString(16) + arr1.push(hex) + } + return "0x" + arr1.join("") +} + +function getRealmNetworkFromArgs () { + let networkString = process.env.WSB_DEFAULT_CHAIN || process.argv.includes("test") ? "test" : "development" + // If a `--network` argument is provided, use that instead + const args = process.argv.join("=").split("=") + const networkIndex = args.indexOf("--network") + if (networkIndex >= 0) { + networkString = args[networkIndex + 1] + } + return getRealmNetworkFromString(networkString) +} + +function getRealmNetworkFromString (network) { + network = network ? network.toLowerCase() : "development" + if (network.indexOf(":") > -1) { + return [network.split(":")[0], network] + } else { + return [null, network] + } +} + +function getWitnetRequestMethodString (method) { + if (!method) { + return "HTTP-GET" + } else { + const strings = { + 0: "UNKNOWN", + 1: "HTTP-GET", + 2: "RNG", + 3: "HTTP-POST", + 4: "HTTP-HEAD", + } + return strings[method] || method.toString() + } +} + +function getWitnetArtifactsFromArgs () { + let selection = [] + process.argv.map((argv, index, args) => { + if (argv === "--artifacts") { + selection = args[index + 1].split(",") + } + return argv + }) + return selection +}; + +function isDryRun (network) { + return network === "test" || network.split("-")[1] === "fork" || network.split("-")[0] === "develop" +} + +function isNullAddress (addr) { + return !addr || + addr === "" || + addr === "0x0000000000000000000000000000000000000000" +} + +function padLeft (str, char, size) { + if (str.length < size) { + return char.repeat((size - str.length) / char.length) + str + } else { + return str + } +} + +async function prompt (text) { + const rl = readline.createInterface({ + input: process.stdin, + output: process.stdout, + }) + let answer + await new Promise((resolve) => { + rl.question( + text, + function (input) { + answer = input + rl.close() + }) + rl.on("close", function () { + resolve() + }) + }) + return answer +} + +async function readJsonFromFile (filename) { + lockfile.lockSync(filename) + const json = JSON.parse(await fs.readFileSync(filename)) + lockfile.unlockSync(filename) + return json || {} +} + +async function overwriteJsonFile (filename, extra) { + lockfile.lockSync(filename) + const json = { ...JSON.parse(fs.readFileSync(filename)), ...extra } + fs.writeFileSync(filename, JSON.stringify(json, null, 4), { flag: "w+" }) + lockfile.unlockSync(filename) +} + +function traceHeader (header) { + console.log("") + console.log(" ", header) + console.log(" ", `${"-".repeat(header.length)}`) +} + +function traceTx (tx) { + console.info(" ", "> transaction hash: ", tx.receipt.transactionHash) + console.info(" ", "> gas used: ", tx.receipt.gasUsed.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")) + console.info(" ", "> gas price: ", tx.receipt.effectiveGasPrice / 10 ** 9, "gwei") + console.info(" ", "> total cost: ", parseFloat( + BigInt(tx.receipt.gasUsed) * + BigInt(tx.receipt.effectiveGasPrice) / + BigInt(10 ** 18) + ).toString(), + "ETH" + ) +} + +function traceVerify (network, verifyArgs) { + console.log( + execSync( + `npx truffle run verify --network ${network} ${verifyArgs} ${process.argv.slice(3)}`, + { stdout: "inherit" } + ).toString().split("\n") + .join("\n") + ) +} diff --git a/test/TestWitnetEncodingLib.sol b/test/TestWitnetEncodingLib.sol index ba2db8d31..64628a4ab 100644 --- a/test/TestWitnetEncodingLib.sol +++ b/test/TestWitnetEncodingLib.sol @@ -42,18 +42,18 @@ contract TestWitnetEncodingLib { function testEncodeRadonReducerOpcodes() external { bytes memory bytecode = WitnetEncodingLib.encode( - WitnetV2.RadonReducerOpcodes.StandardDeviation + Witnet.RadonReducerOpcodes.StandardDeviation ); Assert.equal( keccak256(bytecode), keccak256(hex"1007"), - "bad encode(WitnetV2.RadonReducerOpcodes)" + "bad encode(Witnet.RadonReducerOpcodes)" ); } function testEncodeRadonSLA() external { bytes memory bytecode = WitnetEncodingLib.encode( - WitnetV2.RadonSLA({ + Witnet.RadonSLA({ numWitnesses: 10, minConsensusPercentage: 51, minerCommitRevealFee: 1000000, @@ -65,28 +65,28 @@ contract TestWitnetEncodingLib { Assert.equal( keccak256(bytecode), keccak256(hex"10c0843d180a20c0843d283330c096b102"), - "bad encode(WitnetV2.RadonSLA)" + "bad encode(Witnet.RadonSLA)" ); } function testEncodeRadonReducer1Filter() external { - WitnetV2.RadonReducer memory reducer; - reducer.opcode = WitnetV2.RadonReducerOpcodes.Mode; - reducer.filters = new WitnetV2.RadonFilter[](1); - reducer.filters[0].opcode = WitnetV2.RadonFilterOpcodes.StandardDeviation; + Witnet.RadonReducer memory reducer; + reducer.opcode = Witnet.RadonReducerOpcodes.Mode; + reducer.filters = new Witnet.RadonFilter[](1); + reducer.filters[0].opcode = Witnet.RadonFilterOpcodes.StandardDeviation; reducer.filters[0].args = hex"fa40200000"; bytes memory bytecode = WitnetEncodingLib.encode(reducer); // emit Log(bytecode); Assert.equal( keccak256(bytecode), keccak256(hex"0a0908051205fa402000001002"), - "bad encode(WitnetV2.RadonReducer)" + "bad encode(Witnet.RadonReducer)" ); } function testEncodeRadonRetrievalUrlOnly() external { - WitnetV2.RadonRetrieval memory source; - source.method = WitnetV2.DataRequestMethods.HttpGet; + Witnet.RadonRetrieval memory source; + source.method = Witnet.RadonDataRequestMethods.HttpGet; source.url = "https://data.messar.io/api/v1/assets/\\0\\/metrics/market-data?fields=market_data/price_\\1\\"; source.script = hex"861877821866646461746182186664706f6f6c8218646b746f6b656e3150726963658218571a000f4240185b"; bytes memory bytecode = WitnetEncodingLib.encode(source); @@ -94,13 +94,13 @@ contract TestWitnetEncodingLib { Assert.equal( keccak256(bytecode), keccak256(hex"128b010801125968747470733a2f2f646174612e6d65737361722e696f2f6170692f76312f6173736574732f5c305c2f6d6574726963732f6d61726b65742d646174613f6669656c64733d6d61726b65745f646174612f70726963655f5c315c1a2c861877821866646461746182186664706f6f6c8218646b746f6b656e3150726963658218571a000f4240185b"), - "bad encode(WitnetV2.RadonRetrieval)" + "bad encode(Witnet.RadonRetrieval)" ); } function testEncodeRadonRetrievalUrlBodyHeaders() external { - WitnetV2.RadonRetrieval memory source; - source.method = WitnetV2.DataRequestMethods.HttpPost; + Witnet.RadonRetrieval memory source; + source.method = Witnet.RadonDataRequestMethods.HttpPost; source.url = "https://api.thegraph.com/subgraphs/name/uniswap/uniswap-v3"; source.body = "{\"query\":\"{pool(id:\\\"0xc2a856c3aff2110c1171b8f942256d40e980c726\\\"){token1Price}}\"}"; source.headers = new string[2][](2); @@ -113,7 +113,7 @@ contract TestWitnetEncodingLib { keccak256(bytecode), keccak256( hex"1285020803123a68747470733a2f2f6170692e74686567726170682e636f6d2f7375626772617068732f6e616d652f756e69737761702f756e69737761702d76331a2c861877821866646461746182186664706f6f6c8218646b746f6b656e3150726963658218571a000f4240185b22527b227175657279223a227b706f6f6c2869643a5c223078633261383536633361666632313130633131373162386639343232353664343065393830633732365c22297b746f6b656e3150726963657d7d227d2a190a0a757365722d6167656e74120b7769746e65742d727573742a280a0c636f6e74656e742d747970651218746578742f68746d6c3b20636861727365743d7574662d38"), - "bad encode(WitnetV2.RadonRetrieval)" + "bad encode(Witnet.RadonRetrieval)" ); } @@ -134,7 +134,7 @@ contract TestWitnetEncodingLib { function testVerifyRadonScriptOk1() external { Assert.equal( uint(WitnetEncodingLib.verifyRadonScriptResultDataType(hex"861877821866646461746182186664706f6f6c8218646b746f6b656e3150726963658218571a000f4240185b")), - uint(WitnetV2.RadonDataTypes.Integer), + uint(Witnet.RadonDataTypes.Integer), "unexpected result data type" ); } @@ -142,7 +142,7 @@ contract TestWitnetEncodingLib { function testVerifyRadonScriptOk2() external { Assert.equal( uint(WitnetEncodingLib.verifyRadonScriptResultDataType(hex"80")), - uint(WitnetV2.RadonDataTypes.Any), + uint(Witnet.RadonDataTypes.Any), "unexpected result data type" ); } @@ -150,7 +150,7 @@ contract TestWitnetEncodingLib { function testVerifyRadonScriptOk3() external { Assert.equal( uint(WitnetEncodingLib.verifyRadonScriptResultDataType(hex"8218778218676445746167")), - uint(WitnetV2.RadonDataTypes.String), + uint(Witnet.RadonDataTypes.String), "unexpected result data type" ); } @@ -158,7 +158,7 @@ contract TestWitnetEncodingLib { function testVerifyRadonScriptOk4() external { Assert.equal( uint(WitnetEncodingLib.verifyRadonScriptResultDataType(hex"880B821866646461746182186165706169727382118282186762696483187582635C305CF5F4821818F48218646D746F6B656E5C315C50726963658218571A000F4240185B")), - uint(WitnetV2.RadonDataTypes.Integer), + uint(Witnet.RadonDataTypes.Integer), "unexpected result data type" ); } @@ -166,7 +166,7 @@ contract TestWitnetEncodingLib { function testVerifyRadonScriptOk5() external { Assert.equal( uint(WitnetEncodingLib.verifyRadonScriptResultDataType(hex"851876821182821867657469746c65831875a1635c315cf5f4821183821867696d65726765645f617418748218430082181800821867657374617465")), - uint(WitnetV2.RadonDataTypes.String), + uint(Witnet.RadonDataTypes.String), "unexpected result data type" ); } diff --git a/test/TestWitnetErrorsLib.sol b/test/TestWitnetErrorsLib.sol deleted file mode 100644 index 486e112d7..000000000 --- a/test/TestWitnetErrorsLib.sol +++ /dev/null @@ -1,310 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity >=0.7.0 <0.9.0; -pragma experimental ABIEncoderV2; - -import "truffle/Assert.sol"; -import "../contracts/libs/WitnetErrorsLib.sol"; - -contract TestWitnetErrorsLib { - - using Witnet for Witnet.Result; - - event Log(bytes data, uint256 length); - event Error(Witnet.ResultError log); - - // Test decoding of `RadonError` error codes - function testErrorCodes1() external { - Witnet.ResultError memory errorEmpty = WitnetErrorsLib.resultErrorFromCborBytes(hex"D82780"); - Witnet.ResultError memory error0x00 = WitnetErrorsLib.resultErrorFromCborBytes(hex"D8278100"); - Witnet.ResultError memory error0x01 = WitnetErrorsLib.resultErrorFromCborBytes(hex"D8278101"); - Witnet.ResultError memory error0x02 = WitnetErrorsLib.resultErrorFromCborBytes(hex"D8278102"); - Witnet.ResultError memory error0x03 = WitnetErrorsLib.resultErrorFromCborBytes(hex"D8278103"); - Witnet.ResultError memory error0x10 = WitnetErrorsLib.resultErrorFromCborBytes(hex"D8278110"); - Witnet.ResultError memory error0x11 = WitnetErrorsLib.resultErrorFromCborBytes(hex"D8278111"); - Witnet.ResultError memory error0x20 = WitnetErrorsLib.resultErrorFromCborBytes(hex"D827811820"); - Witnet.ResultError memory error0x30 = WitnetErrorsLib.resultErrorFromCborBytes(hex"D827811830"); - Witnet.ResultError memory error0x31 = WitnetErrorsLib.resultErrorFromCborBytes(hex"D827811831"); - Witnet.ResultError memory error0x40 = WitnetErrorsLib.resultErrorFromCborBytes(hex"D827811840"); - Witnet.ResultError memory error0x41 = WitnetErrorsLib.resultErrorFromCborBytes(hex"D827811841"); - Witnet.ResultError memory error0x42 = WitnetErrorsLib.resultErrorFromCborBytes(hex"D827811842"); - Assert.equal( - uint(errorEmpty.code), - uint(Witnet.ResultErrorCodes.Unknown), - "empty error code `[]` should be `Witnet.ResultErrorCodes.Unknown`" - ); - Assert.equal( - uint(error0x00.code), - uint(Witnet.ResultErrorCodes.Unknown), - "error code `0x00` should be `Witnet.ResultErrorCodes.Unknown`" - ); - Assert.equal( - uint(error0x01.code), - uint(Witnet.ResultErrorCodes.SourceScriptNotCBOR), - "error code `0x01` should be `Witnet.ResultErrorCodes.SourceScriptNotCBOR`" - ); - Assert.equal( - uint(error0x02.code), - uint(Witnet.ResultErrorCodes.SourceScriptNotArray), - "error code `0x02` should be `Witnet.ResultErrorCodes.SourceScriptNotArray`" - ); - Assert.equal( - uint(error0x03.code), - uint(Witnet.ResultErrorCodes.SourceScriptNotRADON), - "error code `0x03` should be `Witnet.ResultErrorCodes.SourceScriptNotRADON`" - ); - Assert.equal( - uint(error0x10.code), - uint(Witnet.ResultErrorCodes.RequestTooManySources), - "error code `0x10` should be `Witnet.ResultErrorCodes.RequestTooManySources`" - ); - Assert.equal( - uint(error0x11.code), - uint(Witnet.ResultErrorCodes.ScriptTooManyCalls), - "error code `0x11` should be `Witnet.ResultErrorCodes.ScriptTooManyCalls`" - ); - Assert.equal( - uint(error0x20.code), - uint(Witnet.ResultErrorCodes.UnsupportedOperator), - "error code `0x20` should be `Witnet.ResultErrorCodes.UnsupportedOperator`" - ); - Assert.equal( - uint(error0x30.code), - uint(Witnet.ResultErrorCodes.HTTP), - "error code `0x30` should be `Witnet.ResultErrorCodes.HTTP`" - ); - Assert.equal( - uint(error0x31.code), - uint(Witnet.ResultErrorCodes.RetrievalTimeout), - "Error code 0x31 should be `Witnet.ResultErrorCodes.RetrievalTimeout`" - ); - Assert.equal( - uint(error0x40.code), - uint(Witnet.ResultErrorCodes.Underflow), - "error code `0x40` should be `Witnet.ResultErrorCodes.Underflow`" - ); - Assert.equal( - uint(error0x41.code), - uint(Witnet.ResultErrorCodes.Overflow), - "error code `0x41` should be `Witnet.ResultErrorCodes.Overflow`" - ); - Assert.equal( - uint(error0x42.code), - uint(Witnet.ResultErrorCodes.DivisionByZero), - "Error code #0x42 should be `Witnet.ResultErrorCodes.DivisionByZero`" - ); - } - - function testErrorCodes2() external { - Witnet.ResultError memory error0x50 = WitnetErrorsLib.resultErrorFromCborBytes(hex"D827811850"); - Witnet.ResultError memory error0x51 = WitnetErrorsLib.resultErrorFromCborBytes(hex"D827811851"); - Witnet.ResultError memory error0x52 = WitnetErrorsLib.resultErrorFromCborBytes(hex"D827811852"); - Witnet.ResultError memory error0x53 = WitnetErrorsLib.resultErrorFromCborBytes(hex"D827811853"); - Witnet.ResultError memory error0x60 = WitnetErrorsLib.resultErrorFromCborBytes(hex"D827811860"); - Witnet.ResultError memory error0x70 = WitnetErrorsLib.resultErrorFromCborBytes(hex"D827811870"); - Witnet.ResultError memory error0x71 = WitnetErrorsLib.resultErrorFromCborBytes(hex"D827811871"); - Witnet.ResultError memory error0xe0 = WitnetErrorsLib.resultErrorFromCborBytes(hex"D8278118E0"); - Witnet.ResultError memory error0xe1 = WitnetErrorsLib.resultErrorFromCborBytes(hex"D8278118E1"); - Witnet.ResultError memory error0xe2 = WitnetErrorsLib.resultErrorFromCborBytes(hex"D8278118E2"); - Witnet.ResultError memory error0xff = WitnetErrorsLib.resultErrorFromCborBytes(hex"D8278118FF"); - Assert.equal( - uint(error0x50.code), - uint(Witnet.ResultErrorCodes.NoReveals), - "Error code #0x50 should be `Witnet.ResultErrorCodes.NoReveals`" - ); - Assert.equal( - uint(error0x51.code), - uint(Witnet.ResultErrorCodes.InsufficientConsensus), - "Error code #0x51 should be `Witnet.ResultErrorCodes.InsufficientConsensus`" - ); - Assert.equal( - uint(error0x52.code), - uint(Witnet.ResultErrorCodes.InsufficientCommits), - "Error code #0x52 should be `Witnet.ResultErrorCodes.InsufficientCommits`" - ); - Assert.equal( - uint(error0x53.code), - uint(Witnet.ResultErrorCodes.TallyExecution), - "Error code #0x53 should be `Witnet.ResultErrorCodes.TallyExecution`" - ); - Assert.equal( - uint(error0x60.code), - uint(Witnet.ResultErrorCodes.MalformedReveal), - "Error code #0x60 should be `Witnet.ResultErrorCodes.MalformedReveal`" - ); - Assert.equal( - uint(error0x70.code), - uint(Witnet.ResultErrorCodes.ArrayIndexOutOfBounds), - "Error code #0x70 should be `Witnet.ResultErrorCodes.ArrayIndexOutOfBounds`" - ); - Assert.equal( - uint(error0x71.code), - uint(Witnet.ResultErrorCodes.MapKeyNotFound), - "Error code #0x71 should be `Witnet.ResultErrorCodes.MapKeyNotFound`" - ); - Assert.equal( - uint(error0xe0.code), - uint(Witnet.ResultErrorCodes.BridgeMalformedRequest), - "Error code #0xE0 should be `Witnet.ResultErrorCodes.BridgeMalformedRequest`" - ); - Assert.equal( - uint(error0xe1.code), - uint(Witnet.ResultErrorCodes.BridgePoorIncentives), - "Error code #0xE1 should be `Witnet.ResultErrorCodes.BridgePoorIncentives`" - ); - Assert.equal( - uint(error0xe2.code), - uint(Witnet.ResultErrorCodes.BridgeOversizedResult), - "Error code #0xE2 should be `Witnet.ResultErrorCodes.BridgeOversizedResult`" - ); - Assert.equal( - uint(error0xff.code), - uint(Witnet.ResultErrorCodes.UnhandledIntercept), - "Error code #0xFF should be `Witnet.ResultErrorCodes.UnhandledIntercept`" - ); - } - - // Test decoding of `RadonError` error messages - function testErrorMessages() external { - Witnet.ResultError memory errorEmpty = WitnetErrorsLib.resultErrorFromCborBytes(hex"D82780"); - Witnet.ResultError memory error0x00 = WitnetErrorsLib.resultErrorFromCborBytes(hex"D8278100"); - Witnet.ResultError memory error0x01 = WitnetErrorsLib.resultErrorFromCborBytes(hex"D8278101"); - Witnet.ResultError memory error0x02 = WitnetErrorsLib.resultErrorFromCborBytes(hex"D8278102"); - Witnet.ResultError memory error0x03 = WitnetErrorsLib.resultErrorFromCborBytes(hex"D8278103"); - Witnet.ResultError memory error0x10 = WitnetErrorsLib.resultErrorFromCborBytes(hex"D8278110"); - Witnet.ResultError memory error0x11 = WitnetErrorsLib.resultErrorFromCborBytes(hex"D8278111"); - Witnet.ResultError memory error0x20 = WitnetErrorsLib.resultErrorFromCborBytes(hex"D8278418206b5261646f6e537472696e676a496e74656765724164648101"); - Witnet.ResultError memory error0x30 = WitnetErrorsLib.resultErrorFromCborBytes(hex"D827821830190194"); - Witnet.ResultError memory error0x31 = WitnetErrorsLib.resultErrorFromCborBytes(hex"D827811831"); - Witnet.ResultError memory error0x40 = WitnetErrorsLib.resultErrorFromCborBytes(hex"D827811840"); - Witnet.ResultError memory error0x41 = WitnetErrorsLib.resultErrorFromCborBytes(hex"D827811841"); - Witnet.ResultError memory error0x42 = WitnetErrorsLib.resultErrorFromCborBytes(hex"D827811842"); - Assert.equal( - errorEmpty.reason, - "Unknown error: no error code was found.", - "Empty error message `[]` should be properly formatted" - ); - Assert.equal( - error0x00.reason, - "Unhandled error: 0x00.", - "Error message 0x00 should be properly formatted" - ); - Assert.equal( - error0x01.reason, - "Witnet: Radon: invalid CBOR value.", - "Error message for error code `0x01` (`Witnet.ResultErrorCodes.SourceScriptNotCBOR`) should be properly formatted" - ); - Assert.equal( - error0x02.reason, - "Witnet: Radon: CBOR value expected to be an array of calls.", - "Error message for error code `0x02` (`Witnet.ResultErrorCodes.SourceScriptNotArray`) should be properly formatted" - ); - Assert.equal( - error0x03.reason, - "Witnet: Radon: CBOR value expected to be a data request.", - "Error message for error code `0x03` (`Witnet.ResultErrorCodes.SourceScriptNotRADON`) should be properly formatted" - ); - Assert.equal( - error0x10.reason, - "Witnet: Radon: too many sources.", - "Error message for error code `0x10` (`Witnet.ResultErrorCodes.RequestTooManySources`) should be properly formatted" - ); - Assert.equal( - error0x11.reason, - "Witnet: Radon: too many calls.", - "Error message for error code `0x11` (`Witnet.ResultErrorCodes.ScriptTooManyCalls`) should be properly formatted" - ); - Assert.equal( - error0x20.reason, - "Witnet: Radon: unsupported 'IntegerAdd' for input type 'RadonString'.", - "Error message for error code `0x20` (`Witnet.ResultErrorCodes.UnsupportedOperator`) should be properly formatted" - ); - Assert.equal( - error0x30.reason, - "Witnet: Retrieval: HTTP/404 error.", - "Error message for error code `0x30` (`Witnet.ResultErrorCodes.HTTP`) should be properly formatted" - ); - Assert.equal( - error0x31.reason, - "Witnet: Retrieval: timeout.", - "Error message for error code `0x31` (`Witnet.ResultErrorCodes.RetrievalTimeout`) should be properly formatted" - ); - Assert.equal( - error0x40.reason, - "Witnet: Aggregation: math underflow.", - "Error message for error code `0x40` (`Witnet.ResultErrorCodes.Underflow`) should be properly formatted" - ); - Assert.equal( - error0x41.reason, - "Witnet: Aggregation: math overflow.", - "Error message for error code `0x41` (`Witnet.ResultErrorCodes.Overflow`) should be properly formatted" - ); - Assert.equal( - error0x42.reason, - "Witnet: Aggregation: division by zero.", - "Error message for e rror code `0x42` (`Witnet.ResultErrorCodes.DivisionByZero`) should be properly formatted" - ); - } - - function testBridgeErrorMessages() external { - Witnet.ResultError memory error0xe0 = WitnetErrorsLib.resultErrorFromCborBytes(hex"D8278118E0"); - Witnet.ResultError memory error0xe1 = WitnetErrorsLib.resultErrorFromCborBytes(hex"D8278118E1"); - Witnet.ResultError memory error0xe2 = WitnetErrorsLib.resultErrorFromCborBytes(hex"D8278118E2"); - - Assert.equal( - error0xe0.reason, - "Witnet: Bridge: malformed data request cannot be processed.", - "Error message failed (0xE0)" - ); - Assert.equal( - error0xe1.reason, - "Witnet: Bridge: rejected due to poor witnessing incentives.", - "Error message failed (0xE1)" - ); - Assert.equal( - error0xe2.reason, - "Witnet: Bridge: rejected due to poor bridging incentives.", - "Error message failed (0xE2)" - ); - } - - function testTallyErrorMessages() external { - Witnet.ResultError memory error0x50 = WitnetErrorsLib.resultErrorFromCborBytes(hex"D827811850"); - Witnet.ResultError memory error0x51 = WitnetErrorsLib.resultErrorFromCborBytes(hex"D827831851fb400aaaaaaaaaaaabf95260"); - Witnet.ResultError memory error0x51b = WitnetErrorsLib.resultErrorFromCborBytes(hex"D827831851f95220f95260"); - Witnet.ResultError memory error0x52 = WitnetErrorsLib.resultErrorFromCborBytes(hex"D827811852"); - Witnet.ResultError memory error0x60 = WitnetErrorsLib.resultErrorFromCborBytes(hex"D827811860"); - Witnet.ResultError memory error0xff = WitnetErrorsLib.resultErrorFromCborBytes(hex"D8278118ff"); - Assert.equal( - error0x50.reason, - "Witnet: Tally: no reveals.", - "Error message for error code `0x50` (`Witnet.ResultErrorCodes.NoReveals`) should be properly formatted" - ); - Assert.equal( - error0x51.reason, - "Witnet: Tally: insufficient consensus: 3% <= 51%.", - "Error message for error code `0x51` (`Witnet.ResultErrorCodes.InsufficientConsensus`) should be properly formatted" - ); - Assert.equal( - error0x51b.reason, - "Witnet: Tally: insufficient consensus: 49% <= 51%.", - "Error message for error code `0x51` (`Witnet.ResultErrorCodes.InsufficientConsensus`) should be properly formatted" - ); - Assert.equal( - error0x52.reason, - "Witnet: Tally: insufficient commits.", - "Error message for error code `0x52` (`Witnet.ResultErrorCodes.InsufficientCommits`) should be properly formatted" - ); - Assert.equal( - error0x60.reason, - "Witnet: Tally: malformed reveal.", - "Error message for error code `0x60` (`Witnet.ResultErrorCodes.MalformedReveal`) should be properly formatted" - ); - Assert.equal( - error0xff.reason, - "Witnet: Tally: unhandled intercept.", - "Error message for error code `0xFF` (`Witnet.ResultErrorCodes.UnhandledIntercept`) should be properly formatted" - ); - } - -} diff --git a/test/TestWitnetV2.sol b/test/TestWitnetV2.sol new file mode 100644 index 000000000..51406b0f4 --- /dev/null +++ b/test/TestWitnetV2.sol @@ -0,0 +1,74 @@ +// SPDX-License-Identifier: MIT + +pragma solidity >=0.7.0 <0.9.0; +pragma experimental ABIEncoderV2; + +import "truffle/Assert.sol"; +import "../contracts/libs/WitnetV2.sol"; + +contract TestWitnetV2 { + using WitnetV2 for *; + + + WitnetV2.Request internal __request; + WitnetV2.Response internal __response; + + uint256 internal __finalityBlock; + + function testNOP() external {} + + function testSSTORE() external { + __finalityBlock = block.number; + } + + function testWitnetRequestPackingWithBytecode() external { + __request = WitnetV2.Request({ + requester: msg.sender, + gasCallback: 500000, + evmReward: 10 ** 18, + witnetBytecode: hex"0aab0412520801123268747470733a2f2f6170692e62696e616e63652e55532f6170692f76332f7469636b65723f73796d626f6c3d4254435553441a1a841877821864696c61737450726963658218571a000f4240185b124d0801122c68747470733a2f2f6170692e62697466696e65782e636f6d2f76312f7075627469636b65722f6274637573641a1b8418778218646a6c6173745f70726963658218571a000f4240185b12480801122d68747470733a2f2f7777772e6269747374616d702e6e65742f6170692f76322f7469636b65722f6274637573641a15841877821864646c6173748218571a000f4240185b12550801123168747470733a2f2f6170692e626974747265782e636f6d2f76332f6d61726b6574732f4254432d5553442f7469636b65721a1e8418778218646d6c6173745472616465526174658218571a000f4240185b12620801123768747470733a2f2f6170692e636f696e626173652e636f6d2f76322f65786368616e67652d72617465733f63757272656e63793d4254431a258618778218666464617461821866657261746573821864635553448218571a000f4240185b12630801123268747470733a2f2f6170692e6b72616b656e2e636f6d2f302f7075626c69632f5469636b65723f706169723d4254435553441a2b87187782186666726573756c7482186668585842545a55534482186161618216008218571a000f4240185b1a0d0a0908051205fa3fc000001003220d0a0908051205fa4020000010031080a3c347180a2080ade20428333080acc7f037", + witnetRAD: bytes32(0), + witnetSLA: WitnetV2.RadonSLA({ + committeeSize: 7, + witnessingFee: 10 ** 9 + }) + }); + } + + function testWitnetRequestUnpackingWithBytecode() external returns (WitnetV2.Request memory) { + return __request; + } + + function testWitnetRequestPackingWithRadHash() external { + __request = WitnetV2.Request({ + requester: msg.sender, + gasCallback: 500000, + evmReward: 10 ** 18, + witnetBytecode: hex"", + witnetRAD: bytes32(bytes2(0x1234)), + witnetSLA: WitnetV2.RadonSLA({ + committeeSize: 7, + witnessingFee: 10 ** 9 + }) + }); + } + + function testWitnetRequestUnpackingWithRadHash() external returns (WitnetV2.Request memory) { + return __request; + } + + function testWitnetResponsePacking() external { + __response = WitnetV2.Response({ + reporter: msg.sender, + finality: uint64(block.number), + resultTimestamp: uint32(block.timestamp), + resultTallyHash: blockhash(block.number - 1), + resultCborBytes: hex"010203040506" + }); + } + + function testWitnetResponseUnpacking() external returns (WitnetV2.Response memory) { + return __response; + } + +} diff --git a/test/examples/RandomnessBareMinimal.sol b/test/examples/RandomnessBareMinimal.sol deleted file mode 100644 index 632ab121e..000000000 --- a/test/examples/RandomnessBareMinimal.sol +++ /dev/null @@ -1,35 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >=0.7.0 <0.9.0; - -import "../../contracts/interfaces/IWitnetRandomness.sol"; - -contract RandomnessBareMinimal { - - uint32 public randomness; - uint256 public latestRandomizingBlock; - IWitnetRandomness immutable public witnet; - - /// @param _witnetRandomness Address of the WitnetRandomness contract. - constructor (IWitnetRandomness _witnetRandomness) { - assert(address(_witnetRandomness) != address(0)); - witnet = _witnetRandomness; - } - - receive () external payable {} - - function nextBlock() external {} - - function requestRandomNumber() external payable { - latestRandomizingBlock = block.number; - uint _usedFunds = witnet.randomize{ value: msg.value }(); - if (_usedFunds < msg.value) { - payable(msg.sender).transfer(msg.value - _usedFunds); - } - } - - function fetchRandomNumber() external { - assert(latestRandomizingBlock > 0); - randomness = witnet.random(type(uint32).max, 0, latestRandomizingBlock); - } - -} diff --git a/test/helpers/UsingWitnetTestHelper.sol b/test/helpers/UsingWitnetTestHelper.sol deleted file mode 100644 index f5c2429e7..000000000 --- a/test/helpers/UsingWitnetTestHelper.sol +++ /dev/null @@ -1,71 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity >=0.7.0 <0.9.0; -pragma experimental ABIEncoderV2; - -import "../../contracts/UsingWitnet.sol"; - -/** - * @title Test Helper for the UsingWitnet contract - * @dev The aim of this contract is: - * 1. Raise the visibility modifier of UsingWitnet contract functions for testing purposes - * @author Witnet Foundation - */ -contract UsingWitnetTestHelper is UsingWitnet { - - Witnet.Result public result; - - constructor (WitnetRequestBoard _wrb) - UsingWitnet(_wrb) - {} - - receive() external payable {} - - function witnetPostRequest(IWitnetRequest _request) - external payable - returns(uint256 _id) - { - uint256 _reward; - (_id, _reward) = _witnetPostRequest(_request); - if (_reward < msg.value) { - payable(msg.sender).transfer(msg.value - _reward); - } - } - - function witnetUpgradeReward(uint256 _id) - external payable - { - uint256 _value = msg.value; - uint256 _used = _witnetUpgradeReward(_id); - if (_used < _value) { - payable(msg.sender).transfer(_value - _used); - } - } - - function witnetReadResult(uint256 _requestId) - external - returns (Witnet.Result memory) - { - result = _witnetReadResult(_requestId); - return result; - } - - function witnetCurrentReward(uint256 _requestId) - external view - returns (uint256) - { - return witnet.readRequestReward(_requestId); - } - - function witnetEstimateReward(uint256 _gasPrice) external view returns (uint256) { - return witnet.estimateReward(_gasPrice); - } - - function witnetAsUint64() external view returns (uint) { - return witnet.asUint64(result); - } - - function witnetCheckRequestResolved(uint256 _id) external view returns (bool) { - return _witnetCheckResultAvailability(_id); - } -} diff --git a/test/helpers/WitnetRequestBoardTestHelper.sol b/test/helpers/WitnetRequestBoardTestHelper.sol deleted file mode 100644 index ec3b05537..000000000 --- a/test/helpers/WitnetRequestBoardTestHelper.sol +++ /dev/null @@ -1,51 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity >=0.7.0 <0.9.0; -pragma experimental ABIEncoderV2; - -import "../../contracts/impls/boards/trustable/WitnetRequestBoardTrustableDefault.sol"; - -/** - * @title Witnet Requests Board Version 1 - * @notice Contract to bridge requests to Witnet - * @dev This contract enables posting requests that Witnet bridges will insert into the Witnet network - * The result of the requests will be posted back to this contract by the bridge nodes too. - * The contract has been created for testing purposes - * @author Witnet Foundation - */ -contract WitnetRequestBoardTestHelper - is - WitnetRequestBoardTrustableDefault -{ - address public witnet; - - constructor (address[] memory _committee, bool _upgradable) - WitnetRequestBoardTrustableDefault(_upgradable, "WitnetRequestBoardTestHelper", 120547) - { - witnet = msg.sender; - setReporters(_committee); - } - - /// @dev Estimate the amount of reward we need to insert for a given gas price. - /// @return The rewards to be included for the given gas price as inclusionReward, resultReward, blockReward. - function estimateReward(uint256) - public pure - override - returns(uint256) - { - return 0; - } - - /// @dev Posts a data request into the WRB, with immediate mock result. - /// @param _request The contract containing the Witnet Witnet data request actual bytecode. - /// @return _id The unique identifier of the data request. - function postRequest(IWitnetRequest _request) - public payable - override - returns(uint256 _id) - { - _id = super.postRequest(_request); - __storage().queries[_id].response.drTxHash = keccak256("hello"); - __storage().queries[_id].response.cborBytes = "hello"; - } -} diff --git a/test/helpers/WitnetRequestBoardTrojanHorseBadProxiable.sol b/test/helpers/WitnetRequestBoardTrojanHorseBadProxiable.sol deleted file mode 100644 index 88cafe84b..000000000 --- a/test/helpers/WitnetRequestBoardTrojanHorseBadProxiable.sol +++ /dev/null @@ -1,60 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity >=0.7.0 <0.9.0; - -/* solhint-disable var-name-mixedcase */ - -import "../../contracts/patterns/Initializable.sol"; -import "../../contracts/patterns/Proxiable.sol"; - -/** - * @title Witnet Requests Board Trojan Horse: Proxiable with a bad `proxiableUUID()`. - * @notice Contract to test proxy upgrade assertions. - * @dev Upgrading an existing WitnetRequestBoard implementation with an instance of - * this kind (i.e. Proxiable and Upgradeable) but with a `proxiableUUID()` value different - * to the one required for WitnetRequestBoards, should not be permitted by the WitnetProxy. - * The contract has been created for testing purposes. - * @author Witnet Foundation - */ -contract WitnetRequestBoardTrojanHorseBadProxiable is Initializable, Proxiable { - address internal immutable _BASE; - bytes32 internal immutable _CODEHASH; - address internal immutable _OWNER; - - constructor() { - address _base = address(this); - bytes32 _codehash; - assembly { - _codehash := extcodehash(_base) - } - _BASE = _base; - _CODEHASH = _codehash; - _OWNER = msg.sender; - } - - modifier onlyOwner { - if (msg.sender == _OWNER) { - _; - } - } - - function initialize(bytes calldata) external { - // WATCH OUT: any one could reset storage context after - // upgrading the WRB to this implementation. - } - - function isUpgradable() external pure returns (bool) { - return false; - } - - function isUpgradableFrom(address) external pure returns (bool) { - return true; - } - - function proxiableUUID() external pure override returns (bytes32) { - return ( - /* On purpose: keccak256("WitnetRequestBoardTrojanHorseBadProxiable") */ - 0x4d3080726a91bfa6730c817863d1d6dc232091b814f64e60803244379b522d7d - ); - } -} diff --git a/test/helpers/WitnetRequestBoardTrojanHorseNotUpgradable.sol b/test/helpers/WitnetRequestBoardTrojanHorseNotUpgradable.sol deleted file mode 100644 index 25ee71d4a..000000000 --- a/test/helpers/WitnetRequestBoardTrojanHorseNotUpgradable.sol +++ /dev/null @@ -1,57 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity >=0.7.0 <0.9.0; - -/* solhint-disable var-name-mixedcase */ - -import "../../contracts/patterns/Initializable.sol"; -import "../../contracts/patterns/Proxiable.sol"; - -/** - * @title Witnet Requests Board Trojan Horse: Proxiable but not-Upgradeable - * @notice Contract to test proxy upgrade assertions. - * @dev Upgrading an existing WitnetRequestBoard implementation with an instance of - * this kind (i.e. Proxiable but not-Upgradeable), should not be permitted by the WitnetProxy. - * The contract has been created for testing purposes. - * @author Witnet Foundation - */ -contract WitnetRequestBoardTrojanHorseNotUpgradable is Initializable, Proxiable { - address internal immutable _BASE; - bytes32 internal immutable _CODEHASH; - address internal immutable _OWNER; - - constructor() { - address _base = address(this); - bytes32 _codehash; - assembly { - _codehash := extcodehash(_base) - } - _BASE = _base; - _CODEHASH = _codehash; - _OWNER = msg.sender; - } - - modifier onlyOwner { - if (msg.sender == _OWNER) { - _; - } - } - - function initialize(bytes calldata) external { - // WATCH OUT: any one could reset storage context after - // upgrading the WRB to this implementation. - } - - function isUpgradableFrom(address) external pure returns (bool) { - return true; - } - - function proxiableUUID() external pure override returns (bytes32) { - return ( - /* keccak256("io.witnet.proxiable.board") */ - 0x9969c6aff411c5e5f0807500693e8f819ce88529615cfa6cab569b24788a1018 - ); - } - - /* On purpose: isUpgradable(bool) not to be implemented */ -} diff --git a/test/helpers/WitnetRequestTestHelper.sol b/test/helpers/WitnetRequestTestHelper.sol deleted file mode 100644 index 66daf60ee..000000000 --- a/test/helpers/WitnetRequestTestHelper.sol +++ /dev/null @@ -1,30 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity >=0.7.0 <0.9.0; -import "../../contracts/libs/Witnet.sol"; - -/** - * @title The serialized form of a Witnet data request - */ -contract WitnetRequestTestHelper is IWitnetRequest { - - using Witnet for bytes; - - constructor(bytes memory _bytecode) { - bytecode = _bytecode; - } - - /// Contains a well-formed Witnet Data Request, encoded using Protocol Buffers. - bytes public override bytecode; - - /// Applies Witnet-compatible hash function over the `bytecode()` in order to - /// uniquely identify every possible well-formed Data Request. - function hash() public view override returns (bytes32) { - return bytecode.hash(); - } - - /// Modifies the Witnet Data Request bytecode. - function modifyBytecode(bytes memory _bytecode) public { - bytecode = _bytecode; - } -} diff --git a/test/helpers/WrbProxyTestHelper.sol b/test/helpers/WrbProxyTestHelper.sol deleted file mode 100644 index 05dd2325b..000000000 --- a/test/helpers/WrbProxyTestHelper.sol +++ /dev/null @@ -1,25 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity >=0.7.0 <0.9.0; - -import "../../contracts/impls/WitnetProxy.sol"; - -/** - * @title Test Helper for the WitnetRequestBoardProxy contract - * @dev The aim of this contract is: - * Raise the visibility modifier of WitnetRequestBoardProxy contract functions for testing purposes - * @author Witnet Foundation - */ -contract WrbProxyTestHelper is WitnetProxy { - - constructor () {} - function getWrbAddress() external view returns(address) { - return implementation(); - } - - function upgradeWitnetRequestBoard(address _newWrb) external { - address[] memory _reporters = new address[](1); - _reporters[0] = msg.sender; - upgradeTo(_newWrb, abi.encode(_reporters)); - } -} diff --git a/test/using_witnet.test.js b/test/using_witnet.test.js deleted file mode 100644 index 24474478f..000000000 --- a/test/using_witnet.test.js +++ /dev/null @@ -1,293 +0,0 @@ -const settings = require("../migrations/witnet.settings") - -const { expectRevert } = require("@openzeppelin/test-helpers") - -const WRB = artifacts.require(settings.artifacts.default.WitnetRequestBoard) -const WRBProxy = artifacts.require(settings.artifacts.default.WitnetProxy) -const WitnetLib = artifacts.require(settings.artifacts.default.WitnetLib) - -const UsingWitnetTestHelper = artifacts.require("UsingWitnetTestHelper") -const WitnetRequest = artifacts.require("WitnetRequestTestHelper") - -const truffleAssert = require("truffle-assertions") - -contract("UsingWitnet", accounts => { - describe("UsingWitnet \"happy path\" test case. " + - "This covers pretty much all the life cycle of a Witnet request:", () => { - const requestHex = "0x01" - const resultHex = "0x1a002fefd8" - const resultDecimal = 3141592 - const drTxHash = "0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" - - let witnet, clientContract, wrb, proxy, request, requestId, result - let lastAccount1Balance, lastReward - - const ownerAccount = accounts[0] - const reporterAccount = accounts[1] - - before(async () => { - witnet = await WitnetLib.deployed() - await WRB.link(WitnetLib, witnet.address) - if (!proxy) { - // create one and only proxy contract: - proxy = await WRBProxy.new({ from: ownerAccount }) - // let 'wrb' artifact always point to proxy address - wrb = await WRB.at(proxy.address) - } - // notwithstanding, upgrade proxy on each iteration... - await proxy.upgradeTo( - // ...to new implementation instance: - (await WRB.new( - ...settings.constructorParams.default.WitnetRequestBoard, - { from: ownerAccount } - ) - ).address, - // ...resetting reporters ACL: - web3.eth.abi.encodeParameter("address[]", [reporterAccount]), - // ...from owner account. - { from: ownerAccount } - ) - await UsingWitnetTestHelper.link(WitnetLib, witnet.address) - clientContract = await UsingWitnetTestHelper.new(proxy.address) - lastAccount1Balance = await web3.eth.getBalance(accounts[1]) - }) - - it("should create a data request", async () => { - request = await WitnetRequest.new(requestHex) - const internalBytes = await request.bytecode() - assert.equal(internalBytes, requestHex) - }) - - it("should post a data request into the wrb", async () => { - const gasPrice = 1e9 - lastReward = await clientContract.witnetEstimateReward(gasPrice) - requestId = await returnData(clientContract.witnetPostRequest( - request.address, - { - from: accounts[1], - value: lastReward * 2, - gasPrice, - } - )) - assert.equal(requestId, 1) - }) - - it("should have posted and read the same bytes", async () => { - const internalBytes = await wrb.readRequestBytecode(requestId) - assert.equal(internalBytes, requestHex) - }) - - it("should have set the correct rewards", async () => { - // Retrieve rewards - const drInfo = await wrb.readRequest(requestId) - const drReward = drInfo.reward.toString() - assert.equal(drReward, lastReward) - }) - - it("requester balance should decrease", async () => { - const afterBalance = await web3.eth.getBalance(accounts[1]) - assert(parseInt(afterBalance) < parseInt(lastAccount1Balance)) - lastAccount1Balance = afterBalance - }) - - it("client contract balance should remain stable", async () => { - const usingWitnetBalance = await web3.eth.getBalance(clientContract.address) - assert.equal(usingWitnetBalance, 0) - }) - - it("WRB balance should have increased in the exact fare", async () => { - const wrbBalance = await web3.eth.getBalance(wrb.address) - assert.equal(wrbBalance, lastReward) - }) - - it("should upgrade the rewards of an existing data request", async () => { - const gasPrice = 2e9 - lastReward = await clientContract.witnetEstimateReward(gasPrice) - const currentReward = await clientContract.witnetCurrentReward.call(requestId) - await returnData(clientContract.witnetUpgradeReward(requestId, { - from: accounts[1], - value: (lastReward - currentReward) * 2, - gasPrice, - })) - }) - - it("should have upgraded the rewards correctly", async () => { - // Retrieve reward - const drInfo = await wrb.readRequest(requestId) - assert.equal(drInfo.reward.toString(), lastReward.toString()) - }) - - it("requester balance should decrease after rewards upgrade", async () => { - const afterBalance = await web3.eth.getBalance(accounts[1]) - assert(parseInt(afterBalance) < parseInt(lastAccount1Balance)) - lastAccount1Balance = afterBalance - }) - - it("client contract balance should remain stable after rewards upgrade", async () => { - const usingWitnetBalance = await web3.eth.getBalance(clientContract.address) - assert.equal(usingWitnetBalance, 0) - }) - - it("WRB balance should increase after rewards upgrade", async () => { - const wrbBalance = await web3.eth.getBalance(wrb.address) - assert.equal(wrbBalance, lastReward) - }) - - it("should fail if posting result from unauthorized reporter", async () => { - await expectRevert( - wrb.reportResult(requestId, drTxHash, resultHex, { from: ownerAccount }), - "unauthorized reporter" - ) - }) - - it("should post the result of the request into the WRB", async () => { - await returnData(wrb.reportResult(requestId, drTxHash, resultHex, { - from: reporterAccount, - })) - const result = await wrb.readResponseResult.call(requestId) - assert.equal(result.value.buffer.data, resultHex) - }) - - it("should check if the request is resolved", async () => { - assert.equal(await clientContract.witnetCheckRequestResolved(requestId), true) - }) - - it("should pull the result from the WRB back into the client contract", async () => { - await clientContract.witnetReadResult(requestId, { from: accounts[0] }) - result = await clientContract.result() - assert.equal(result.success, true) - assert.equal(result.value.buffer.data, resultHex) - }) - - it("should decode result successfully", async () => { - const actualResultDecimal = await clientContract.witnetAsUint64.call() - assert.equal(actualResultDecimal.toString(), resultDecimal.toString()) - }) - }) - - describe("UsingWitnet \"happy path\" test case with a false result:", () => { - const requestHex = "0x02" - const resultHex = "0xd82701" - const drTxHash = "0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" - - const reward = web3.utils.toWei("1", "ether") - - const ownerAccount = accounts[0] - const reporterAccount = accounts[1] - - const gasPrice = 1e9 - - let witnet, clientContract, wrb, proxy, request, requestId, result - - before(async () => { - witnet = await WitnetLib.deployed() - if (!proxy) { - // create one and only proxy contract: - proxy = await WRBProxy.new() - // let 'wrb' artifact always point to proxy address - wrb = await WRB.at(proxy.address) - // initialize 'wrb' artifact, - // setting 'ownerAccount' as owner - // and 'reporterAccount' as authorized reporter: - await proxy.upgradeTo( - (await WRB.new( - ...settings.constructorParams.default.WitnetRequestBoard - ) - ).address, - web3.eth.abi.encodeParameter("address[]", [reporterAccount]), - { from: ownerAccount } - ) - } - await UsingWitnetTestHelper.link(WitnetLib, witnet.address) - clientContract = await UsingWitnetTestHelper.new(wrb.address) - }) - - it("should create a data request", async () => { - request = await WitnetRequest.new(requestHex) - const internalBytes = await request.bytecode() - assert.equal(internalBytes, requestHex) - }) - - it("should pass the data request to the wrb", async () => { - requestId = await returnData(clientContract.witnetPostRequest( - request.address, - { - from: accounts[0], - value: reward, - gasPrice, - } - )) - assert.equal(requestId, 1) - }) - - it("should check the request is not yet resolved", async () => { - assert.equal(await clientContract.witnetCheckRequestResolved(requestId), false) - }) - - it("should fail if posting result from unauthorized reporter", async () => { - await expectRevert( - wrb.reportResult(requestId, drTxHash, resultHex, { from: ownerAccount }), - "unauthorized reporter" - ) - }) - - it("should report the result in the WRB", async () => { - await returnData(wrb.reportResult(requestId, drTxHash, resultHex, { - from: reporterAccount, - })) - const result = await wrb.readResponseResult(requestId) - assert.equal(result.value.buffer.data, resultHex) - }) - - it("should pull the result from the WRB back to the client contract", async () => { - await clientContract.witnetReadResult(requestId, { from: accounts[1] }) - result = await clientContract.result() - assert.equal(result.value.buffer.data, resultHex) - }) - - it("should detect the result is false", async () => { - await clientContract.witnetReadResult(requestId, { from: accounts[1] }) - result = await clientContract.result() - assert.equal(result.success, false) - }) - - it("should be able to estimate gas cost and post the DR", async () => { - const estimatedReward = await clientContract.witnetEstimateReward.call(gasPrice) - await truffleAssert.passes( - clientContract.witnetPostRequest(request.address, { - from: accounts[1], - value: estimatedReward, - gasPrice, - }), - "Estimated rewards should cover the gas costs" - ) - }) - }) -}) - -function waitForHash (tx) { - return new Promise((resolve, reject) => - tx.on("transactionHash", resolve).catch(reject) - ) -} - -async function returnData (tx) { - const txHash = await waitForHash(tx) - const txReceipt = await web3.eth.getTransactionReceipt(txHash) - if (txReceipt.logs && txReceipt.logs.length > 0) { - const decoded = web3.eth.abi.decodeLog( - [ - { - type: "uint256", - name: "id", - }, { - type: "address", - name: "from", - }, - ], - txReceipt.logs[0].data, - txReceipt.logs[0].topics - ) - return decoded.id - } -} diff --git a/test/witnet_bytecodes.test.js b/test/witnet_bytecodes.test.js index b3cd827d3..825fc3b73 100644 --- a/test/witnet_bytecodes.test.js +++ b/test/witnet_bytecodes.test.js @@ -1,12 +1,13 @@ -const utils = require("../scripts/utils") +const utils = require("../src/utils") const { expectEvent, expectRevert } = require("@openzeppelin/test-helpers") const { assert } = require("chai") const { expectRevertCustomError } = require("custom-error-test-helper") -const WitnetBytecodes = artifacts.require("WitnetBytecodes") +const WitnetRequestBytecodes = artifacts.require("WitnetRequestBytecodesDefault") +const WitnetEncodingLib = artifacts.require("WitnetEncodingLib") const WitnetV2 = artifacts.require("WitnetV2") -contract("WitnetBytecodes", (accounts) => { +contract("WitnetRequestBytecodes", (accounts) => { const creatorAddress = accounts[0] const firstOwnerAddress = accounts[1] const unprivilegedAddress = accounts[4] @@ -14,7 +15,8 @@ contract("WitnetBytecodes", (accounts) => { let bytecodes before(async () => { - bytecodes = await WitnetBytecodes.new( + await WitnetRequestBytecodes.link(WitnetEncodingLib, WitnetEncodingLib.address) + bytecodes = await WitnetRequestBytecodes.new( true, utils.fromAscii("testing") ) @@ -74,19 +76,19 @@ contract("WitnetBytecodes", (accounts) => { }) it("cannot be initialized more than once", async () => { await expectRevertCustomError( - WitnetBytecodes, + WitnetRequestBytecodes, bytecodes.initialize("0x", { from: firstOwnerAddress }), "AlreadyUpgraded" ) await expectRevertCustomError( - WitnetBytecodes, + WitnetRequestBytecodes, bytecodes.initialize("0x", { from: unprivilegedAddress }), "OnlyOwner" ) }) }) - context("IWitnetBytecodes", async () => { + context("IWitnetRequestBytecodes", async () => { let slaHash let concathashReducerHash @@ -104,7 +106,7 @@ contract("WitnetBytecodes", (accounts) => { let btcUsdPriceFeedHash context("verifyRadonRetrieval(..)", async () => { - context("WitnetV2.DataRequestMethods.Rng", async () => { + context("WitnetV2.RadonDataRequestMethods.Rng", async () => { it("emits appropiate single event when verifying randomness data source for the first time", async () => { const tx = await bytecodes.verifyRadonRetrieval( 2, // requestMethod @@ -150,7 +152,7 @@ contract("WitnetBytecodes", (accounts) => { }) // ... reverts }) - context("WitnetV2.DataRequestMethods.HttpGet", async () => { + context("WitnetV2.RadonDataRequestMethods.HttpGet", async () => { it( "emits new data provider and source events when verifying a new http-get source for the first time", async () => { const tx = await bytecodes.verifyRadonRetrieval( @@ -201,7 +203,7 @@ contract("WitnetBytecodes", (accounts) => { ) }) }) - context("WitnetV2.DataRequestMethods.HttpPost", async () => { + context("WitnetV2.RadonDataRequestMethods.HttpPost", async () => { it( "emits new data provider and source events when verifying a new http-post source for the first time", async () => { const tx = await bytecodes.verifyRadonRetrieval( @@ -656,7 +658,7 @@ contract("WitnetBytecodes", (accounts) => { context("radon requests", async () => { it("reverts if trying to get bytecode from unknown radon request", async () => { await expectRevertCustomError( - WitnetBytecodes, + WitnetRequestBytecodes, bytecodes.bytecodeOf("0x0"), "UnknownRadonRequest" ) @@ -671,7 +673,7 @@ contract("WitnetBytecodes", (accounts) => { context("radon slas", async () => { it("reverts if trying to get bytecode from unknown radon sla", async () => { await expectRevertCustomError( - WitnetBytecodes, + WitnetRequestBytecodes, bytecodes.bytecodeOf(btcUsdPriceFeedHash, "0x0"), "UnknownRadonSLA" ) @@ -697,14 +699,14 @@ contract("WitnetBytecodes", (accounts) => { context("hashWeightRewardOf(..)", async () => { it("hashing unknown radon request reverts", async () => { await expectRevertCustomError( - WitnetBytecodes, + WitnetRequestBytecodes, bytecodes.hashWeightWitsOf("0x0", slaHash), "UnknownRadonRequest" ) }) it("hashing unknown radon sla reverts", async () => { await expectRevertCustomError( - WitnetBytecodes, + WitnetRequestBytecodes, bytecodes.hashWeightWitsOf(btcUsdPriceFeedHash, "0x0"), "UnknownRadonSLA" ) diff --git a/test/witnet_randomness.test.js b/test/witnet_randomness.test.js deleted file mode 100644 index 0d3405d23..000000000 --- a/test/witnet_randomness.test.js +++ /dev/null @@ -1,127 +0,0 @@ -const WitnetRandomnessMock = artifacts.require("WitnetRandomnessMock") -const WitnetRequestBoard = artifacts.require("WitnetRequestBoard") -const RandomnessBareMinimal = artifacts.require("RandomnessBareMinimal") - -const { - balance, - BN, -} = require("@openzeppelin/test-helpers") - -const truffleAssert = require("truffle-assertions") -const { expect, assert } = require("chai") - -contract("WitnetRandomnesMock", accounts => { - let witnet - const deployer = accounts[0] - const stranger = accounts[1] - const fee = 10 ** 15 - const gasPrice = 1e9 - - before(async () => { - witnet = await WitnetRandomnessMock.new( - WitnetRequestBoard.address, - 2, // _mockRandomizeLatencyBlock - fee, // _mockRandomizeFee - { from: deployer } - ) - }) - describe("Example: RandomnessBareMinimal", async () => { - let myContract - before(async () => { - myContract = await RandomnessBareMinimal.new( - witnet.address, - { from: deployer } - ) - }) - it("witnet address is accesible and valid", async () => { - assert.equal( - await myContract.witnet(), - witnet.address - ) - }) - it("initial randomness is zero", async () => { - assert.equal( - (await myContract.randomness()).toString(), - "0" - ) - }) - it("initial randomizing block is zero", async () => { - assert.equal( - (await myContract.latestRandomizingBlock()).toString(), - "0" - ) - }) - it("requesting random number with no fee, fails", async () => { - await truffleAssert.reverts( - myContract.requestRandomNumber(), - "reward too low" - ) - }) - it("requesting random number with less fee than required, fails", async () => { - await truffleAssert.reverts( - myContract.requestRandomNumber( - { value: fee / 2 } - ), - "reward too low" - ) - }) - let randomizingblock1 - it("requesting random number will spend only required gas and reward", async () => { - const balanceTracker = await balance.tracker(deployer) - const initialBalance = await balanceTracker.get() - const tx = await myContract.requestRandomNumber({ - value: 10 ** 18, - from: deployer, - gasPrice, - }) - const finalBalance = await balanceTracker.get() - expect( - finalBalance.eq( - initialBalance - .sub(new BN(fee)) - .sub(new BN(tx.receipt.gasUsed)) - ), - "caller balance should have decreased only by required gas and reward" - ) - randomizingblock1 = await myContract.latestRandomizingBlock() - assert(randomizingblock1 > 0, "no randomizing block number") - }) - it("fetching random number from unsolved randomize, fails", async () => { - await truffleAssert.reverts( - myContract.fetchRandomNumber(), - "pending randomize" - ) - }) - it("fetching random number from solved randomize, works", async () => { - await myContract.nextBlock() - await myContract.fetchRandomNumber() - }) - let randomizingblock2 - it("upgrading pending randomize that requires no reward upgrade, transfers back unused funds", async () => { - await myContract.requestRandomNumber({ - value: 10 ** 18, - from: stranger, - gasPrice: 10 * 10 ** 9, - }) - randomizingblock2 = await myContract.latestRandomizingBlock() - const balanceTracker = await balance.tracker(stranger) - const initialBalance = await balanceTracker.get() - const tx = await witnet.upgradeRandomizeFee( - randomizingblock2, - { - value: 10 ** 18, - from: stranger, - gasPrice, - } - ) - const finalBalance = await balanceTracker.get() - expect( - finalBalance.eq( - initialBalance - .sub(new BN(tx.receipt.gasUsed)) - ), - "caller balance should have decreased only be used gas" - ) - }) - }) -}) diff --git a/test/wrb.test.js b/test/wrb.test.js deleted file mode 100644 index c993ae8a4..000000000 --- a/test/wrb.test.js +++ /dev/null @@ -1,759 +0,0 @@ -const settings = require("../migrations/witnet.settings") - -const { - BN, - expectEvent, - expectRevert, - balance, - ether, -} = require("@openzeppelin/test-helpers") -const { expect, assert } = require("chai") - -// Contracts -const WRB = artifacts.require(settings.artifacts.default.WitnetRequestBoard) -const WitnetLib = artifacts.require("WitnetLib") -const WitnetRequest = artifacts.require("WitnetRequestTestHelper") -const WitnetRequestTestHelper = artifacts.require("WitnetRequestTestHelper") - -// WitnetRequest definition -const queryId = new BN(1) -// eslint-disable-next-line no-multi-str -const requestHex = "0x0abb0108bd8cb8fa05123b122468747470733a2f2f7777772e6269747374616d702e6e65742f6170692f7469636b65722\ -f1a13841877821864646c6173748218571903e8185b125c123168747470733a2f2f6170692e636f696e6465736b2e636f6d2f76312f6270692f6375\ -7272656e7470726963652e6a736f6e1a2786187782186663627069821866635553448218646a726174655f666c6f61748218571903e8185b1a0d0a0\ -908051205fa3fc00000100322090a0508051201011003100a1804200128\ -46308094ebdc03" -const resultHex = "0x1a000702c8" -const drTxHash = "0x0000000000000000000000000000000000000000000000000000000000000001" - -contract("WitnetRequestBoard", ([ - requester, - owner, - committeeMember, - other, -]) => { - beforeEach(async () => { - await WRB.link(WitnetLib, WitnetLib.address) - this.WitnetRequestBoard = await WRB.new( - ...settings.constructorParams.default.WitnetRequestBoard, - { from: owner } - ) - await this.WitnetRequestBoard.initialize( - web3.eth.abi.encodeParameter("address[]", - [owner, committeeMember]), - { from: owner } - ) - this.WitnetRequest = await WitnetRequest.new(requestHex, { from: requester }) - }) - - describe("deployments", async () => { - it("deploys WitnetRequestBoard successfully", async () => { - expect(this.WitnetRequestBoard.address != null) - }) - }) - - describe("post data request", async () => { - it("creator can post a data request", async () => { - // Initial balance - const contractBalanceTracker = await balance.tracker(this.WitnetRequestBoard.address) - const contractInitialBalance = await contractBalanceTracker.get() - - // Post Data Request - const postDataRequestTx = await this.WitnetRequestBoard.postRequest( - this.WitnetRequest.address, - { - from: requester, - value: ether("1"), - } - ) - - // Check `PostedRequest` event - expectEvent( - postDataRequestTx, - "PostedRequest", - { - queryId, - } - ) - expect(postDataRequestTx.logs[0].args.queryId, "match data request id").to.be.bignumber.equal(queryId) - - // Check contract balance (increased by reward) - const contractFinalBalance = await contractBalanceTracker.get() - expect( - contractFinalBalance.eq(contractInitialBalance - .add(ether("1")) - ), - "contract balance should have increase after the request creation by 1 eth", - ).to.equal(true) - }) - it("creator can post data requests with sequential identifiers", async () => { - // Post Data Requests - const postDataRequestTx1 = await this.WitnetRequestBoard.postRequest( - this.WitnetRequest.address, - { - from: requester, - value: ether("1"), - }) - const postDataRequestTx2 = await this.WitnetRequestBoard.postRequest( - this.WitnetRequest.address, - { - from: requester, - value: ether("1"), - }) - - // Check `PostedRequest` events - expectEvent( - postDataRequestTx1, - "PostedRequest", - { - queryId, - }) - expect(postDataRequestTx1.logs[0].args.queryId, "match data request id").to.be.bignumber.equal(queryId) - // Check `PostedRequest` events - expectEvent( - postDataRequestTx2, - "PostedRequest", - { - queryId: queryId.add(new BN(1)), - }) - expect( - postDataRequestTx2.logs[0].args.queryId, - "match data request id" - ).to.be.bignumber.equal(queryId.add(new BN(1))) - }) - it("fails if creator is not covering DR reward", async () => { - // Transaction value < reward - await expectRevert( - this.WitnetRequestBoard.postRequest( - this.WitnetRequest.address, - { - from: requester, - value: ether("0"), - gasPrice: 1, - } - ), - "reward too low." - ) - }) - it("fails if creator is not covering DR result report gas cost", async () => { - // Tally reward < ESTIMATED_REPORT_RESULT_GAS - await expectRevert( - this.WitnetRequestBoard.postRequest( - this.WitnetRequest.address, - { - from: requester, - value: new BN("1"), - gasPrice: 1, - } - ), - "reward too low." - ) - }) - it("reading bytecode from unsolved query works if the request was not modified before being solved", async () => { - await this.WitnetRequestBoard.postRequest(this.WitnetRequest.address, { from: requester, value: ether("1") }) - assert.equal( - await this.WitnetRequest.bytecode.call(), - await this.WitnetRequestBoard.readRequestBytecode.call(1) - ) - }) - it("reading bytecode from unsolved query fails if the request gets modified before being solved", async () => { - await this.WitnetRequestBoard.postRequest(this.WitnetRequest.address, { from: requester, value: ether("1") }) - const newDrBytes = web3.utils.fromAscii("This is a different DR") - await this.WitnetRequest.modifyBytecode(newDrBytes) - await expectRevert( - this.WitnetRequestBoard.readRequestBytecode.call(1), - "bytecode changed after posting" - ) - }) - }) - - describe("upgrade data request", async () => { - beforeEach(async () => { - await this.WitnetRequestBoard.postRequest( - this.WitnetRequest.address, - { - from: requester, - value: ether("1"), - gasPrice: 1e9, - } - ) - }) - it("anyone can upgrade existing data request increasing the reward", async () => { - // Initial balance - const contractBalanceTracker = await balance.tracker(this.WitnetRequestBoard.address) - const contractInitialBalance = await contractBalanceTracker.get() - - // Update data request (increased reward) - await this.WitnetRequestBoard.upgradeReward(queryId, { - from: other, - value: ether("1"), - gasPrice: 2e9, - }) - - // Check contract balance (increased by reward) - const contractFinalBalance = await contractBalanceTracker.get() - expect( - contractFinalBalance.eq(contractInitialBalance - .add(ether("1")) - ), - "contract balance should have increased after request upgrade by 1 eth", - ).to.equal(true) - }) - it("anyone can upgrade existing data request gas price", async () => { - // Update data request (increased reward) - await this.WitnetRequestBoard.upgradeReward(queryId, { - from: other, - value: ether("1"), - gasPrice: 3e9, - }) - - // Read data request gas price from WitnetRequestBoard by `queryId` - const gasPrice = await this.WitnetRequestBoard.readRequestGasPrice.call(queryId, { from: other }) - - // Check that gas price has been updated to 3 wei - expect( - gasPrice.eq(new BN(3e9)), - "data request gas price should have been set to 3 gwei", - ).to.equal(true) - }) - it("creator cannot decrease existing data request gas price", async () => { - // Update data request (increased reward) - await this.WitnetRequestBoard.upgradeReward(queryId, { - from: requester, - value: ether("1"), - gasPrice: 3e9, - }) - // Read data request gas price from WitnetRequestBoard by `queryId` - const gasPrice = await this.WitnetRequestBoard.readRequestGasPrice.call(queryId, { from: other }) - // Check that gas price has not been updated to 1 wei - expect( - gasPrice.eq(new BN(3e9)), - "data request gas price should not have been set to 1 gwei", - ).to.equal(true) - }) - it("fails if anyone upgrades DR with new gas price that decreases reward below gas limit", async () => { - // Report result reward < ESTIMATED_REPORT_RESULT_GAS * newGasPrice - const newGasPrice = ether("0.01") - await expectRevert( - this.WitnetRequestBoard.upgradeReward(queryId, { - from: requester, - value: ether("0"), - gasPrice: newGasPrice, - }), - "reward too low" - ) - }) - it("fails if result is already reported", async () => { - await this.WitnetRequestBoard.reportResult( - queryId, drTxHash, resultHex, - { from: owner, gasPrice: 1e9 } - ) - // Update data request (increased reward) - await expectRevert( - this.WitnetRequestBoard.upgradeReward(queryId, { - from: requester, - value: ether("1"), - gasPrice: 3e9, - }), - "not in Posted status" - ) - }) - }) - - describe("report data request result", async () => { - beforeEach(async () => { - // Post data request - await this.WitnetRequestBoard.postRequest(this.WitnetRequest.address, { - from: requester, - value: ether("1"), - gasPrice: 1e9, - }) - }) - it("committee members can report a request result from Witnet and it should receive the reward", async () => { - // Initial balances - const contractBalanceTracker = await balance.tracker(this.WitnetRequestBoard.address) - const ownerBalanceTracker = await balance.tracker(owner) - const contractInitialBalance = await contractBalanceTracker.get() - const ownerInitialBalance = await ownerBalanceTracker.get() - - // Report data request result from Witnet to WitnetRequestBoard - const reportResultTx = await this.WitnetRequestBoard.reportResult( - queryId, drTxHash, resultHex, - { from: owner, gasPrice: 1e9 } - ) - - // Check `PostedRequest` event - expectEvent( - reportResultTx, - "PostedResult", - { - queryId, - }, - ) - expect(reportResultTx.logs[0].args.queryId, "match data request id").to.be.bignumber.equal(queryId) - - // Check balances (contract decreased and claimer increased) - const contractFinalBalance = await contractBalanceTracker.get() - const ownerFinalBalance = await ownerBalanceTracker.get() - - expect( - contractFinalBalance.eq(contractInitialBalance - .sub(ether("1")) - ), - "contract balance should have decreased after reporting dr request result by 1 eth", - ).to.equal(true) - expect( - ownerFinalBalance.gt(ownerInitialBalance), - "Owner balance should have increased after reporting result", - ).to.equal(true) - }) - it("fails if reporter is not a committee member", async () => { - await expectRevert( - this.WitnetRequestBoard.reportResult(queryId, drTxHash, resultHex, { - from: other, - gasPrice: 1e9, - }), - "unauthorized reporter" - ) - }) - it("fails if trying to report with zero as Witnet drTxHash", async () => { - await expectRevert( - this.WitnetRequestBoard.reportResult( - queryId, "0x0", resultHex, - { from: owner, gasPrice: 1e9 } - ), - "drTxHash cannot be zero" - ) - }) - it("fails if result was already reported", async () => { - // Report data request result from Witnet to WitnetRequestBoard - await this.WitnetRequestBoard.reportResult( - queryId, drTxHash, resultHex, - { from: owner, gasPrice: 1e9 } - ) - - // Try to report the result of the previous data request - await expectRevert( - this.WitnetRequestBoard.reportResult(queryId, drTxHash, resultHex, { - from: committeeMember, - gasPrice: 1e9, - }), - "not in Posted status" - ) - }) - it("fails if data request has not been posted", async () => { - await expectRevert( - this.WitnetRequestBoard.reportResult( - queryId.add(new BN(1)), drTxHash, resultHex, - { from: owner, gasPrice: 1e9 } - ), - "not in Posted status" - ) - }) - it("retrieves null array if trying to read bytecode from solved data request", async () => { - await this.WitnetRequestBoard.reportResult( - queryId, drTxHash, resultHex, - { from: owner, gasPrice: 1e9 } - ) - const bytecode = await this.WitnetRequestBoard.readRequestBytecode.call(queryId) - assert(bytecode == null) - }) - }) - - describe("batch report multiple results", async () => { - beforeEach(async () => { - for (let j = 0; j < 3; j++) { - await this.WitnetRequestBoard.postRequest( - this.WitnetRequest.address, { - from: requester, - value: ether("1"), - gasPrice: 1e9, - } - ) - } - }) - it("fails if trying to batch report valid results from unauthorized address", async () => { - await expectRevert( - this.WitnetRequestBoard.reportResultBatch( - [ - [1, 0, drTxHash, resultHex], - [2, 0, drTxHash, resultHex], - [3, 0, drTxHash, resultHex], - ], - true, - { from: other, gasPrice: 1e9 } - ), - "unauthorized reporter" - ) - }) - it("committee member can batch report multiple results, and receive the sum of all rewards", async () => { - // Initial balances - const contractBalanceTracker = await balance.tracker(this.WitnetRequestBoard.address) - const ownerBalanceTracker = await balance.tracker(owner) - const contractInitialBalance = await contractBalanceTracker.get() - const ownerInitialBalance = await ownerBalanceTracker.get() - - // Report data request result from Witnet to WitnetRequestBoard - const tx = await this.WitnetRequestBoard.reportResultBatch( - [ - [1, 0, drTxHash, resultHex], - [2, 0, drTxHash, resultHex], - [3, 0, drTxHash, resultHex], - ], - false, - { from: owner, gasPrice: 1e9 } - ) - - // Check balances (contract decreased and claimer increased) - const contractFinalBalance = await contractBalanceTracker.get() - const ownerFinalBalance = await ownerBalanceTracker.get() - expect( - contractFinalBalance.eq(contractInitialBalance - .sub(ether("3")) - ), - "contract balance should have decreased after reporting dr request result by 3 eth", - ).to.equal(true) - expect( - ownerFinalBalance.gt(ownerInitialBalance), - "Owner balance should have increased after reporting result", - ).to.equal(true) - - // Check number of PostedResult events - expect( - tx.logs.filter(log => log.event === "PostedResult").length, - "PostedResult event should have been emitted three times" - ).to.equal(3) - }) - it( - "trying to verbose batch report same query twice, should pay reward once and emit error event once", - async () => { - // Initial balances - const contractBalanceTracker = await balance.tracker(this.WitnetRequestBoard.address) - const ownerBalanceTracker = await balance.tracker(owner) - const contractInitialBalance = await contractBalanceTracker.get() - const ownerInitialBalance = await ownerBalanceTracker.get() - - // Report data request result from Witnet to WitnetRequestBoard - const tx = await this.WitnetRequestBoard.reportResultBatch( - [ - [3, 0, drTxHash, resultHex], - [3, 0, drTxHash, resultHex], - ], - true, - { from: owner, gasPrice: 1e9 } - ) - - // Check balances (contract decreased and claimer increased) - const contractFinalBalance = await contractBalanceTracker.get() - const ownerFinalBalance = await ownerBalanceTracker.get() - expect( - contractFinalBalance.eq(contractInitialBalance - .sub(ether("1")) - ), - "contract balance should have decreased after reporting dr request result by 3 eth", - ).to.equal(true) - expect( - ownerFinalBalance.gt(ownerInitialBalance), - "Owner balance should have increased after reporting result", - ).to.equal(true) - - // Check number of emitted PostedResult events: - expect( - tx.logs.filter(log => log.event === "PostedResult").length, - "PostedResult event should have been emitted once" - ).to.equal(1) - - // Check number and quality of BatchReportError events: - const errors = tx.logs.filter(log => log.event === "BatchReportError") - expect( - errors.length, - "BatchReportResult event should have been emitted just once" - ).to.equal(1) - expect( - errors[0].args.queryId.toString(), - "BatchReportResult event refers unexpected query id" - ).to.equal("3") - expect( - errors[0].args.reason, - "BatchReportResult manifest wrong reason" - ).to.contain("bad queryId") - }) - it( - "reporting bad drTxHash within non-verbose batch, should pay rewards for valid results and emit no error event", - async () => { - // Initial balances - const contractBalanceTracker = await balance.tracker(this.WitnetRequestBoard.address) - const ownerBalanceTracker = await balance.tracker(owner) - const contractInitialBalance = await contractBalanceTracker.get() - const ownerInitialBalance = await ownerBalanceTracker.get() - - // Report data request result from Witnet to WitnetRequestBoard - const tx = await this.WitnetRequestBoard.reportResultBatch( - [ - [1, 0, drTxHash, resultHex], - [2, 0, "0x0000000000000000000000000000000000000000000000000000000000000000", resultHex], - [3, 0, drTxHash, resultHex], - ], - false, - { from: owner, gasPrice: 1e9 } - ) - - // Check balances (contract decreased and claimer increased) - const contractFinalBalance = await contractBalanceTracker.get() - const ownerFinalBalance = await ownerBalanceTracker.get() - expect( - contractFinalBalance.eq(contractInitialBalance - .sub(ether("2")) - ), - "contract balance should have decreased after reporting dr request result by 2 eth", - ).to.equal(true) - expect( - ownerFinalBalance.gt(ownerInitialBalance), - "Owner balance should have increased after reporting result", - ).to.equal(true) - - // Check number of emitted PostedResult events: - expect( - tx.logs.filter(log => log.event === "PostedResult").length, - "PostedResult event should have been emitted three times" - ).to.equal(2) - - // Check number of BatchReportError events: - const errors = tx.logs.filter(log => log.event === "BatchReportError") - expect( - errors.length, - "No BatchReportResult events should have been emitted" - ).to.equal(0) - }) - it( - "reporting bad results within verbose batch, should pay no reward and emit no PostedResult events", async () => { - // Initial balances - const contractBalanceTracker = await balance.tracker(this.WitnetRequestBoard.address) - const contractInitialBalance = await contractBalanceTracker.get() - - // Report data request result from Witnet to WitnetRequestBoard - const tx = await this.WitnetRequestBoard.reportResultBatch( - [ - [1, 0, drTxHash, "0x"], - [3, 0, "0x0000000000000000000000000000000000000000000000000000000000000000", resultHex], - [2, 4070905200 /* 2099-01-01 00:00:00 UTC */, drTxHash, resultHex], - ], - true, - { from: owner, gasPrice: 1e9 } - ) - - // Check balances (contract decreased and claimer increased) - const contractFinalBalance = await contractBalanceTracker.get() - expect( - contractFinalBalance.eq( - contractInitialBalance - ), - "contract balance should have not changed", - ).to.equal(true) - - // Check number of emitted PostedResult events: - expect( - tx.logs.filter(log => log.event === "PostedResult").length, - "Should have not emitted any PostedResult event" - ).to.equal(0) - - // Check number and quality of BatchReportError events: - const errors = tx.logs.filter(log => log.event === "BatchReportError") - expect( - errors.length, - "Three BatchReportResult events should have been emitted" - ).to.equal(3) - expect( - errors[0].args.queryId.toString(), - "First BatchReportResult event refers to unexpected query id" - ).to.equal("1") - expect( - errors[0].args.reason, - "First BatchReportResult manifests wrong reason" - ).to.contain("bad cborBytes") - expect( - errors[1].args.queryId.toString(), - "Second BatchReportResult event refers to unexpected query id" - ).to.equal("3") - expect( - errors[1].args.reason, - "Second BatchReportResult manifests wrong reason" - ).to.contain("bad drTxHash") - expect( - errors[2].args.queryId.toString(), - "Third BatchReportResult event refers to unexpected query id" - ).to.equal("2") - expect( - errors[2].args.reason, - "Third BatchReportResult manifests wrong reason" - ).to.contain("bad timestamp") - }) - }) - - describe("read data request result", async () => { - let requestTestHelper - beforeEach(async () => { - requestTestHelper = await WitnetRequestTestHelper.new(requestHex, { from: requester }) - // Post data request - await this.WitnetRequestBoard.postRequest(requestTestHelper.address, { - from: requester, - value: ether("1"), - }) - // Report data request result from Witnet to WitnetRequestBoard - await this.WitnetRequestBoard.reportResult(queryId, drTxHash, resultHex, { - from: committeeMember, - gasPrice: 1e9, - }) - }) - it("anyone can read the data request result", async () => { - // Read data request result from WitnetRequestBoard by `queryId` - const result = await this.WitnetRequestBoard.readResponseResult(queryId, { from: requester }) - expect(result.value.buffer.data).to.be.equal(resultHex) - }) - it("should revert reading data for non-existent Ids", async () => { - await expectRevert(this.WitnetRequestBoard.readRequestBytecode.call(200), "not yet posted") - await expectRevert(this.WitnetRequestBoard.readResponseDrTxHash.call(200), "not in Reported status") - await expectRevert(this.WitnetRequestBoard.readResponseResult.call(200), "not in Reported status") - }) - }) - - describe("read data request gas price", async () => { - beforeEach(async () => { - await this.WitnetRequestBoard.postRequest( - this.WitnetRequest.address, - { - from: requester, - value: ether("1"), - gasPrice: 1e9, - } - ) - }) - it("anyone can read data request gas price", async () => { - // Read data request gas price from WitnetRequestBoard by `queryId` - const gasPrice = await this.WitnetRequestBoard.readRequestGasPrice.call(queryId, { from: other }) - expect( - gasPrice.eq(new BN(1e9)), - "data request gas price should have been set to 1 gwei", - ).to.equal(true) - }) - }) - - describe("estimate gas cost", async () => { - it("anyone can estime a data request gas cost", async () => { - // Gas price = 1 - const maxResRe = new BN(135000) - const reward = await this.WitnetRequestBoard.estimateReward.call(1) - expect( - reward.lte(maxResRe), - `The estimated maximum gas cost for result reward should be less than ${maxResRe.toString()}` - ).to.equal(true) - } - ) - }) - - describe("delete data request", async () => { - let drId - beforeEach(async () => { - const tx = await this.WitnetRequestBoard.postRequest( - this.WitnetRequest.address, - { - from: requester, - value: ether("0.1"), - gasPrice: 1e9, - } - ) - drId = tx.logs[0].args[0] - }) - it("fails if trying to delete data request from non requester address", async () => { - await this.WitnetRequestBoard.reportResult( - drId, drTxHash, resultHex, - { from: owner, gasPrice: 1e9 } - ) - await expectRevert( - this.WitnetRequestBoard.deleteQuery(drId, { from: other }), - "only requester" - ) - }) - it("unsolved data request cannot be deleted", async () => { - await expectRevert( - this.WitnetRequestBoard.deleteQuery(drId, { from: requester }), - "not in Reported status" - ) - }) - it("requester can delete solved data request", async () => { - await this.WitnetRequestBoard.reportResult( - drId, drTxHash, resultHex, - { from: owner, gasPrice: 1e9 } - ) - await this.WitnetRequestBoard.deleteQuery(drId, { from: requester }) - }) - it("fails if reporting result on deleted data request", async () => { - await this.WitnetRequestBoard.reportResult( - drId, drTxHash, resultHex, - { from: owner, gasPrice: 1e9 } - ) - await this.WitnetRequestBoard.deleteQuery(drId, { from: requester }) - await expectRevert( - this.WitnetRequestBoard.reportResult( - drId, drTxHash, resultHex, - { from: owner, gasPrice: 1e9 } - ), - "not in Posted status" - ) - }) - it("retrieves null array if trying to read bytecode from deleted data request", async () => { - await this.WitnetRequestBoard.reportResult( - drId, drTxHash, resultHex, - { from: owner, gasPrice: 1e9 } - ) - await this.WitnetRequestBoard.deleteQuery(drId, { from: requester }) - const bytecode = await this.WitnetRequestBoard.readRequestBytecode.call(drId) - assert(bytecode == null) - }) - }) - - describe("interfaces", async () => { - describe("Upgradeable:", async () => { - it("initialization fails if called from non owner address", async () => { - await expectRevert( - this.WitnetRequestBoard.initialize( - web3.eth.abi.encodeParameter("address[]", [other]), - { from: other } - ), - "only owner" - ) - }) - it("cannot initialize same instance more than once", async () => { - await expectRevert( - this.WitnetRequestBoard.initialize( - web3.eth.abi.encodeParameter("address[]", [other]), - { from: owner } - ), - "already upgraded" - ) - }) - }) - - describe("Destructible:", async () => { - it("fails if trying to destruct from non owner address", async () => { - await expectRevert( - this.WitnetRequestBoard.destruct({ from: other }), - "not the owner" - ) - }) - it("instance gets actually destructed", async () => { - await this.WitnetRequestBoard.destruct({ from: owner }) - await expectRevert( - this.WitnetRequestBoard.getNextQueryId(), - "Out of Gas?" - ) - }) - it("fails if trying to delete unposted DR", async () => { - await expectRevert( - this.WitnetRequestBoard.deleteQuery(200, { from: owner }), - "not in Reported status" - ) - }) - }) - }) -}) diff --git a/test/wrb_proxy.test.js b/test/wrb_proxy.test.js deleted file mode 100644 index 5551efe52..000000000 --- a/test/wrb_proxy.test.js +++ /dev/null @@ -1,258 +0,0 @@ -const settings = require("../migrations/witnet.settings") - -const { assert } = require("chai") -const truffleAssert = require("truffle-assertions") - -const WitnetLib = artifacts.require(settings.artifacts.default.WitnetLib) - -const WitnetRequest = artifacts.require("WitnetRequestTestHelper") -const WitnetRequestBoard = artifacts.require("WitnetRequestBoardTestHelper") -const WrbProxyHelper = artifacts.require("WrbProxyTestHelper") -const TrojanHorseNotUpgradable = artifacts.require("WitnetRequestBoardTrojanHorseNotUpgradable") -const TrojanHorseBadProxiable = artifacts.require("WitnetRequestBoardTrojanHorseBadProxiable") - -contract("Witnet Requests Board Proxy", accounts => { - describe("Witnet Requests Board Proxy test suite:", () => { - const contractOwner = accounts[0] - const requestSender = accounts[1] - - let witnet - let wrbInstance1 - let wrbInstance2 - let wrbInstance3 - let proxy - let wrb - - before(async () => { - witnet = await WitnetLib.deployed() - await WitnetRequestBoard.link(WitnetLib, witnet.address) - wrbInstance1 = await WitnetRequestBoard.new([contractOwner], true) - wrbInstance2 = await WitnetRequestBoard.new([contractOwner], true) - wrbInstance3 = await WitnetRequestBoard.new([contractOwner], false) - proxy = await WrbProxyHelper.new({ from: accounts[2] }) - proxy.upgradeWitnetRequestBoard(wrbInstance1.address, { from: contractOwner }) - wrb = await WitnetRequestBoard.at(proxy.address) - }) - - it("should revert when inserting id 0", async () => { - // It should revert because of non-existent id 0 - await truffleAssert.reverts( - wrb.upgradeReward(0, { from: requestSender }), - "not in Posted" - ) - }) - - it("should post a data request and update the getNextQueryId meter", async () => { - // The data request to be posted - const drBytes = web3.utils.fromAscii("This is a DR") - const request = await WitnetRequest.new(drBytes) - - // Post the data request through the Proxy - const tx1 = wrb.postRequest(request.address, { - from: requestSender, - value: web3.utils.toWei("0.5", "ether"), - }) - const txHash1 = await waitForHash(tx1) - const txReceipt1 = await web3.eth.getTransactionReceipt(txHash1) - - // The id of the data request - const id1 = parseInt(decodeWitnetLogs(txReceipt1.logs, 0).id) - const nextId = await wrb.getNextQueryId.call() - - // check the nextId has been updated in the Proxy when posting the data request - assert.equal((id1 + 1).toString(), nextId.toString()) - }) - - it("fails if trying to upgrade to null contract", async () => { - await truffleAssert.reverts( - proxy.upgradeWitnetRequestBoard("0x0000000000000000000000000000000000000000", { from: contractOwner }), - "null implementation" - ) - }) - - it("fails if owner tries to upgrade to same implementation instance as current one", async () => { - await truffleAssert.reverts( - proxy.upgradeWitnetRequestBoard(await proxy.implementation.call(), { from: contractOwner }), - "nothing to upgrade" - ) - }) - - it("fails if owner tries to upgrade to non-Initializable implementation", async () => { - await truffleAssert.reverts( - proxy.upgradeWitnetRequestBoard(proxy.address, { from: contractOwner }), - "" - ) - }) - - it("fails if foreigner tries to upgrade to compliant new implementation", async () => { - await truffleAssert.reverts( - proxy.upgradeWitnetRequestBoard(wrbInstance2.address, { from: requestSender }), - "not authorized" - ) - }) - - it("fails if owner tries to upgrade to not Upgradeable-compliant implementation", async () => { - const troyHorse = await TrojanHorseNotUpgradable.new() - await truffleAssert.reverts( - proxy.upgradeWitnetRequestBoard(troyHorse.address, { from: contractOwner }), - "not compliant" - ) - }) - - it("fails if owner tries to upgrade to a bad Proxiable-compliant implementation", async () => { - const troyHorse = await TrojanHorseBadProxiable.new() - await truffleAssert.reverts( - proxy.upgradeWitnetRequestBoard(troyHorse.address, { from: contractOwner }), - "proxiableUUIDs mismatch" - ) - }) - - it("should upgrade proxy to compliant new implementation, if called from owner address", async () => { - // The data request to be posted - const drBytes = web3.utils.fromAscii("This is a DR") - const request = await WitnetRequest.new(drBytes) - - // Post the data request through the Proxy - const tx1 = wrb.postRequest(request.address, { - from: requestSender, - value: web3.utils.toWei("0.5", "ether"), - }) - const txHash1 = await waitForHash(tx1) - const txReceipt1 = await web3.eth.getTransactionReceipt(txHash1) - - // The id of the data request, it should be equal 2 since is the second DR - const id1 = decodeWitnetLogs(txReceipt1.logs, 0).id - assert.equal(id1, 2) - - // Upgrade the WRB address to wrbInstance2 (destroying wrbInstance1) - await proxy.upgradeWitnetRequestBoard(wrbInstance2.address, { from: contractOwner }) - - // The current wrb in the proxy should be equal to wrbInstance2 - assert.equal(await proxy.implementation.call(), wrbInstance2.address) - }) - - it("fails if foreigner tries to re-initialize current implementation", async () => { - await truffleAssert.reverts( - wrb.initialize(web3.eth.abi.encodeParameter("address[]", [requestSender]), { from: requestSender }), - "only owner" - ) - }) - - it("fails also if the owner tries to re-initialize current implementation", async () => { - await truffleAssert.reverts( - wrb.initialize(web3.eth.abi.encodeParameter("address[]", [requestSender]), { from: contractOwner }), - "already upgraded" - ) - }) - - it("should post a data request to new WRB and keep previous data request routes", async () => { - // The data request to be posted - const drBytes = web3.utils.fromAscii("This is a DR") - const request = await WitnetRequest.new(drBytes) - - // The id of the data request - const id2 = await wrb.postRequest.call(request.address, { - from: requestSender, - value: web3.utils.toWei("0.5", "ether"), - }) - assert.equal(id2, 3) - - // Post the data request through the Proxy - await waitForHash( - wrb.postRequest(request.address, { - from: requestSender, - value: web3.utils.toWei("0.5", "ether"), - }) - ) - - // Reading previous query (<3) should work: - await wrb.getQueryData.call(2) - }) - - it("should post a data request to WRB and read the result", async () => { - // The data request to be posted - const drBytes = web3.utils.fromAscii("This is a DR") - const request = await WitnetRequest.new(drBytes) - - // The id of the data request with result "hello" - const id2 = await wrb.postRequest.call(request.address, { - from: requestSender, - value: web3.utils.toWei("0.5", "ether"), - }) - assert.equal(id2, 4) - - // Post the data request through the Proxy - await waitForHash( - wrb.postRequest(request.address, { - from: requestSender, - value: web3.utils.toWei("0.5", "ether"), - }) - ) - - // Read the actual result of the DR - const result = await wrb.readResponseResult.call(id2) - assert.equal(result.value.buffer.data, web3.utils.fromAscii("hello")) - }) - - it("should read the result of a dr of an old wrb", async () => { - // Upgrade the WRB address to wrbInstance3 - await proxy.upgradeWitnetRequestBoard(wrbInstance3.address, { - from: contractOwner, - }) - - // Read the actual result of the DR - const result = await wrb.readResponseResult.call(4) - assert.equal(result.value.buffer.data, web3.utils.fromAscii("hello")) - }) - - it("a solved data request can only be deleted by actual requester", async () => { - // Read the result of the DR just before destruction: - const response = await wrb.deleteQuery.call(4, { from: requestSender }) - const result = await wrb.resultFromCborBytes.call(response.cborBytes) - assert.equal(result.value.buffer.data, web3.utils.fromAscii("hello")) - - await truffleAssert.reverts( - wrb.deleteQuery(4, { from: contractOwner }), - "only requester" - ) - const tx = await wrb.deleteQuery(4, { from: requestSender }) // should work - assert.equal(tx.logs[0].args[1], requestSender) - }) - - it("retrieves null array if trying to get bytecode from deleted DRs", async () => { - const bytecode = await wrb.readRequestBytecode.call(4) - assert(bytecode == null) - }) - - it("fails if trying to upgrade a non upgradable implementation", async () => { - // It should revert when trying to upgrade the wrb since wrbInstance3 is not upgradable - await truffleAssert.reverts( - proxy.upgradeWitnetRequestBoard(wrbInstance1.address, { from: contractOwner }), - "not upgradable" - ) - }) - }) -}) - -const waitForHash = txQ => - new Promise((resolve, reject) => - txQ.on("transactionHash", resolve).catch(reject) - ) - -function decodeWitnetLogs (logs, index) { - if (logs.length > index) { - return web3.eth.abi.decodeLog( - [ - { - type: "uint256", - name: "id", - }, { - type: "address", - name: "from", - }, - ], - logs[index].data, - logs[index].topcis - ) - } -} diff --git a/truffle-config.js b/truffle-config.js index b97a944c2..c0a5cd6ed 100644 --- a/truffle-config.js +++ b/truffle-config.js @@ -1,27 +1,21 @@ -const { merge } = require("lodash") -const settings = require("./migrations/witnet.settings") -const utils = require("./scripts/utils") +const settings = require("./settings") +const utils = require("./src/utils") -const rn = utils.getRealmNetworkFromArgs() -const realm = rn[0]; const network = rn[1] -if (!settings.networks[realm] || !settings.networks[realm][network]) { - if (network !== "development" && network !== "test") { - console.error( - `Fatal: network "${realm}:${network}"`, - "configuration not found in \"./migrations/witnet.settings.js#networks\"" - ) - process.exit(1) - } +const { ecosystem, network } = utils.getRealmNetworkFromArgs() +if (ecosystem) { + const header = console.info(`${ecosystem.toUpperCase()}`) + console.info(header) + console.info("=".repeat(header.length)) } -console.info(` -Targetting "${realm.toUpperCase()}" realm -===================${"=".repeat(realm.length)}`) + module.exports = { - build_directory: `./build/${realm}/`, + build_directory: "./build/", contracts_directory: "./contracts/", migrations_directory: "./migrations/scripts/", - networks: settings.networks[realm], - compilers: merge(settings.compilers.default, settings.compilers[realm]), + networks: settings.getNetworks(network), + compilers: { + solc: settings.getCompilers(network), + }, mocha: { reporter: "eth-gas-reporter", reporterOptions: {