UNPKG

witnet-solidity-bridge

Version:

Witnet Solidity Bridge contracts for EVM-compatible chains

823 lines 78.7 kB
{ "contractName": "IWitOracleRequestFactory", "abi": [ { "inputs": [ { "internalType": "bytes32[]", "name": "retrieveHashes", "type": "bytes32[]" }, { "components": [ { "internalType": "enum Witnet.RadonReduceOpcodes", "name": "opcode", "type": "uint8" }, { "components": [ { "internalType": "enum Witnet.RadonFilterOpcodes", "name": "opcode", "type": "uint8" }, { "internalType": "bytes", "name": "cborArgs", "type": "bytes" } ], "internalType": "struct Witnet.RadonFilter[]", "name": "filters", "type": "tuple[]" } ], "internalType": "struct Witnet.RadonReducer", "name": "aggregate", "type": "tuple" }, { "components": [ { "internalType": "enum Witnet.RadonReduceOpcodes", "name": "opcode", "type": "uint8" }, { "components": [ { "internalType": "enum Witnet.RadonFilterOpcodes", "name": "opcode", "type": "uint8" }, { "internalType": "bytes", "name": "cborArgs", "type": "bytes" } ], "internalType": "struct Witnet.RadonFilter[]", "name": "filters", "type": "tuple[]" } ], "internalType": "struct Witnet.RadonReducer", "name": "tally", "type": "tuple" } ], "name": "buildWitOracleRequest", "outputs": [ { "internalType": "contract IWitOracleRequest", "name": "", "type": "address" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "bytes32", "name": "baseRetrieveHash", "type": "bytes32" }, { "internalType": "string[][]", "name": "requestArgs", "type": "string[][]" }, { "components": [ { "internalType": "enum Witnet.RadonFilterOpcodes", "name": "opcode", "type": "uint8" }, { "internalType": "bytes", "name": "cborArgs", "type": "bytes" } ], "internalType": "struct Witnet.RadonFilter[]", "name": "tallySlashingFilters", "type": "tuple[]" } ], "name": "buildWitOracleRequestModal", "outputs": [ { "internalType": "contract IWitOracleRequest", "name": "", "type": "address" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "bytes32[]", "name": "retrieveHashes", "type": "bytes32[]" }, { "components": [ { "internalType": "enum Witnet.RadonReduceOpcodes", "name": "opcode", "type": "uint8" }, { "components": [ { "internalType": "enum Witnet.RadonFilterOpcodes", "name": "opcode", "type": "uint8" }, { "internalType": "bytes", "name": "cborArgs", "type": "bytes" } ], "internalType": "struct Witnet.RadonFilter[]", "name": "filters", "type": "tuple[]" } ], "internalType": "struct Witnet.RadonReducer", "name": "aggregate", "type": "tuple" }, { "components": [ { "internalType": "enum Witnet.RadonReduceOpcodes", "name": "opcode", "type": "uint8" }, { "components": [ { "internalType": "enum Witnet.RadonFilterOpcodes", "name": "opcode", "type": "uint8" }, { "internalType": "bytes", "name": "cborArgs", "type": "bytes" } ], "internalType": "struct Witnet.RadonFilter[]", "name": "filters", "type": "tuple[]" } ], "internalType": "struct Witnet.RadonReducer", "name": "tally", "type": "tuple" } ], "name": "buildWitOracleRequestTemplate", "outputs": [ { "internalType": "contract IWitOracleRequestTemplate", "name": "", "type": "address" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "bytes32", "name": "baseRetrieveHash", "type": "bytes32" }, { "internalType": "string[]", "name": "lastArgValues", "type": "string[]" }, { "components": [ { "internalType": "enum Witnet.RadonFilterOpcodes", "name": "opcode", "type": "uint8" }, { "internalType": "bytes", "name": "cborArgs", "type": "bytes" } ], "internalType": "struct Witnet.RadonFilter[]", "name": "tallySlashingFilters", "type": "tuple[]" } ], "name": "buildWitOracleRequestTemplateModal", "outputs": [ { "internalType": "contract IWitOracleRequestTemplate", "name": "", "type": "address" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "enum Witnet.RadonRetrievalMethods", "name": "requestMethod", "type": "uint8" }, { "internalType": "string", "name": "requestURL", "type": "string" }, { "internalType": "string", "name": "requestBody", "type": "string" }, { "internalType": "string[2][]", "name": "requestHeaders", "type": "string[2][]" }, { "internalType": "bytes", "name": "requestRadonScript", "type": "bytes" } ], "name": "verifyRadonRetrieval", "outputs": [ { "internalType": "bytes32", "name": "retrievalHash", "type": "bytes32" } ], "stateMutability": "nonpayable", "type": "function" } ], "metadata": "{\"compiler\":{\"version\":\"0.8.30+commit.73712a01\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"bytes32[]\",\"name\":\"retrieveHashes\",\"type\":\"bytes32[]\"},{\"components\":[{\"internalType\":\"enum Witnet.RadonReduceOpcodes\",\"name\":\"opcode\",\"type\":\"uint8\"},{\"components\":[{\"internalType\":\"enum Witnet.RadonFilterOpcodes\",\"name\":\"opcode\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"cborArgs\",\"type\":\"bytes\"}],\"internalType\":\"struct Witnet.RadonFilter[]\",\"name\":\"filters\",\"type\":\"tuple[]\"}],\"internalType\":\"struct Witnet.RadonReducer\",\"name\":\"aggregate\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"enum Witnet.RadonReduceOpcodes\",\"name\":\"opcode\",\"type\":\"uint8\"},{\"components\":[{\"internalType\":\"enum Witnet.RadonFilterOpcodes\",\"name\":\"opcode\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"cborArgs\",\"type\":\"bytes\"}],\"internalType\":\"struct Witnet.RadonFilter[]\",\"name\":\"filters\",\"type\":\"tuple[]\"}],\"internalType\":\"struct Witnet.RadonReducer\",\"name\":\"tally\",\"type\":\"tuple\"}],\"name\":\"buildWitOracleRequest\",\"outputs\":[{\"internalType\":\"contract IWitOracleRequest\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"baseRetrieveHash\",\"type\":\"bytes32\"},{\"internalType\":\"string[][]\",\"name\":\"requestArgs\",\"type\":\"string[][]\"},{\"components\":[{\"internalType\":\"enum Witnet.RadonFilterOpcodes\",\"name\":\"opcode\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"cborArgs\",\"type\":\"bytes\"}],\"internalType\":\"struct Witnet.RadonFilter[]\",\"name\":\"tallySlashingFilters\",\"type\":\"tuple[]\"}],\"name\":\"buildWitOracleRequestModal\",\"outputs\":[{\"internalType\":\"contract IWitOracleRequest\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[]\",\"name\":\"retrieveHashes\",\"type\":\"bytes32[]\"},{\"components\":[{\"internalType\":\"enum Witnet.RadonReduceOpcodes\",\"name\":\"opcode\",\"type\":\"uint8\"},{\"components\":[{\"internalType\":\"enum Witnet.RadonFilterOpcodes\",\"name\":\"opcode\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"cborArgs\",\"type\":\"bytes\"}],\"internalType\":\"struct Witnet.RadonFilter[]\",\"name\":\"filters\",\"type\":\"tuple[]\"}],\"internalType\":\"struct Witnet.RadonReducer\",\"name\":\"aggregate\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"enum Witnet.RadonReduceOpcodes\",\"name\":\"opcode\",\"type\":\"uint8\"},{\"components\":[{\"internalType\":\"enum Witnet.RadonFilterOpcodes\",\"name\":\"opcode\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"cborArgs\",\"type\":\"bytes\"}],\"internalType\":\"struct Witnet.RadonFilter[]\",\"name\":\"filters\",\"type\":\"tuple[]\"}],\"internalType\":\"struct Witnet.RadonReducer\",\"name\":\"tally\",\"type\":\"tuple\"}],\"name\":\"buildWitOracleRequestTemplate\",\"outputs\":[{\"internalType\":\"contract IWitOracleRequestTemplate\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"baseRetrieveHash\",\"type\":\"bytes32\"},{\"internalType\":\"string[]\",\"name\":\"lastArgValues\",\"type\":\"string[]\"},{\"components\":[{\"internalType\":\"enum Witnet.RadonFilterOpcodes\",\"name\":\"opcode\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"cborArgs\",\"type\":\"bytes\"}],\"internalType\":\"struct Witnet.RadonFilter[]\",\"name\":\"tallySlashingFilters\",\"type\":\"tuple[]\"}],\"name\":\"buildWitOracleRequestTemplateModal\",\"outputs\":[{\"internalType\":\"contract IWitOracleRequestTemplate\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"enum Witnet.RadonRetrievalMethods\",\"name\":\"requestMethod\",\"type\":\"uint8\"},{\"internalType\":\"string\",\"name\":\"requestURL\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"requestBody\",\"type\":\"string\"},{\"internalType\":\"string[2][]\",\"name\":\"requestHeaders\",\"type\":\"string[2][]\"},{\"internalType\":\"bytes\",\"name\":\"requestRadonScript\",\"type\":\"bytes\"}],\"name\":\"verifyRadonRetrieval\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"retrievalHash\",\"type\":\"bytes32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"buildWitOracleRequest(bytes32[],(uint8,(uint8,bytes)[]),(uint8,(uint8,bytes)[]))\":{\"details\":\"Reverts if:- unverified retrievals are passed;- any of the given retrievals is parameterized;- retrievals return different data types;- unsupported reducers are passed.\",\"params\":{\"aggregate\":\"The Radon Reducer to apply on values returned from data sources.\",\"retrieveHashes\":\"Hashes of previously verified data sources.\",\"tally\":\"The Radon Reducer to apply on values revealed by witnessing nodes.\"}},\"buildWitOracleRequestModal(bytes32,string[][],(uint8,bytes)[])\":{\"details\":\"Reverts if:- unverified base Radon Retrieval is passed;- the specified base Radon Retrieval is not parameterized;- 2nd dimension's rank of the `requestArgs` array doesn't match the number of required parameters required by the given Radon Retrieval;- unsupported Radon Filters are passed.\",\"params\":{\"baseRetrieveHash\":\"Hash of the parameterized Radon Retrieval upon which the new data request will be built.\",\"requestArgs\":\"Parameters to be applied to each repetition of the given retrieval.\",\"tallySlashingFilters\":\"Optional array of slashing filters to will be applied at the Tally stage.\"}},\"buildWitOracleRequestTemplate(bytes32[],(uint8,(uint8,bytes)[]),(uint8,(uint8,bytes)[]))\":{\"details\":\"Reverts if:- unverified retrievals are passed;- none of given retrievals is parameterized;- retrievals return different data types;- unsupported reducers are passed.\",\"params\":{\"aggregate\":\"The Radon Reducer to apply on values returned from data sources.\",\"retrieveHashes\":\"Hashes of previously verified data sources.\",\"tally\":\"The Radon Reducer to apply on values revealed by witnessing nodes.\"}},\"buildWitOracleRequestTemplateModal(bytes32,string[],(uint8,bytes)[])\":{\"details\":\"Reverts if:- unverified base Radon Retrieval is passed;- the specified base Radon Retrieval is either not parameterized or requires just one single parameter;- unsupported Radon Filters are passed.\",\"params\":{\"baseRetrieveHash\":\"Hash of the parameterized Radon Retrieval upon which the new data request will be built.\",\"lastArgValues\":\"Parameters to be applied to each repetition of the given retrieval.\",\"tallySlashingFilters\":\"Optional array of slashing filters to will be applied at the Tally stage.\"}},\"verifyRadonRetrieval(uint8,string,string,string[2][],bytes)\":{\"details\":\"Note: all input parameters but the `requestMethod` are parameterizableby using embedded wildcard `\\\\x\\\\` substrings (being `x='0'..'9').Reverts if:- unsupported data request method is given;- no URL is provided on Http/* data requests;- non-empty strings given on RNG data requests..\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"buildWitOracleRequest(bytes32[],(uint8,(uint8,bytes)[]),(uint8,(uint8,bytes)[]))\":{\"notice\":\"Builds a WitOracleRequest instance that will provide the bytecodeand RAD hash of some Witnet-compliant data request, provably made out of some previously verified Witnet Radon Retrievals(i.e. data sources), aggregate and tally Witnet Radon Reducers.\"},\"buildWitOracleRequestModal(bytes32,string[][],(uint8,bytes)[])\":{\"notice\":\"Builds a modal WitOracleRequest instance out of one single parameterized Witnet Radon Retrieval. Modal data requests apply the same data retrieval scriptto multiple data providers that are expected to produce exactly the same result. Moreover, modal data requests apply a Mode reducing function at both the Aggregate and Tally stages everytime they get eventually solved on the Wit/Oracleblockhain. You can optionally specify a list of filters to be applied at the Tally resolution stage (i.e. witnessing nodes on the Wit/Oracle blockchain reporting resultsthat get ultimately filtered out on the Tally stage would get slashed by losing collateral).\"},\"buildWitOracleRequestTemplate(bytes32[],(uint8,(uint8,bytes)[]),(uint8,(uint8,bytes)[]))\":{\"notice\":\"Builds a WitOracleRequestTemplate instance made out of one or moreparameterized Witnet Radon Retrievals (i.e. data sources), aggregateand tally Witnet Radon Reducers. \"},\"buildWitOracleRequestTemplateModal(bytes32,string[],(uint8,bytes)[])\":{\"notice\":\"Builds a modal WitOracleRequestTemplate instance out of one single parameterized Witnet Radon Retrieval. Modal request templates produce Witnet-compliant data requeststhat apply the same data retrieval script to multiple data providers that are expected toproduce exactly the same result. Moreover, data requests built out of a modal request templatesapply a Mode reducing function at both the Aggregate and Tally stages every time they geteventually solved on the Wit/Oracle blockchain. You can optionally specify a list of filters to be applied at the Tally resolution stage (i.e. witnessing nodes on the Wit/Oracle blockchainreporting results that get ultimately filtered out on the Tally stage would get slashed by losing collateral).\"},\"verifyRadonRetrieval(uint8,string,string,string[2][],bytes)\":{\"notice\":\"Verifies and registers the specified Witnet Radon Retrieval (i.e. public data sources) into the WitOracleRadonRegistry of theWitOracle attached to this factory. Returns a hash that uniquely identifies validated data source within the WitOracleRadonRegistry.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"project:/contracts/interfaces/legacy/IWitOracleRequestFactory.sol\":\"IWitOracleRequestFactory\"},\"evmVersion\":\"prague\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"project:/contracts/interfaces/legacy/IWitOracleRequest.sol\":{\"keccak256\":\"0x0fb3f0ba03f4f7a0214ecb36df26525564cf51a8a2176cba92c185af8a1d419e\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://340b7bdb92c3259519fe120eb3061b393e7a5e9c1b576a2fe4eab020af466b64\",\"dweb:/ipfs/QmRt4wMX9WdxFwfdFMUZ3zKMAW1grS7qLk1x1PDMJdEAVU\"]},\"project:/contracts/interfaces/legacy/IWitOracleRequestFactory.sol\":{\"keccak256\":\"0xd205194859f54004a0737a8d566d2a72bdd0f38aaa9eddeef5f8d0e3ce1a59a2\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://5a6c6c35bd7e74e717df675caf3e974035c919f1d35eed993f05416d605d976e\",\"dweb:/ipfs/QmbPkvckiTUD627CnAApubQauB7BWwsGxwDZtjcvQtNP3q\"]},\"project:/contracts/interfaces/legacy/IWitOracleRequestTemplate.sol\":{\"keccak256\":\"0x9e065ef5880c64eefff5fcfb1347fde6684e0e311f8c2350a6aefdbd1f8b0f22\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://817de760c7cce9d00dcd4312aea6434d88abddf1c0e68ea7e8fb1e6c5165a445\",\"dweb:/ipfs/QmUNmtn85nFXbje2nRJQY2h65KJCVinDMMU6P2jQmo1Nij\"]},\"project:/contracts/libs/Bech32.sol\":{\"keccak256\":\"0x14618323a0efe7586c20906a2e9cee7ad63baa976ff231c57f7f2d7d3707fb8b\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://a19f05fe84047a7a6d3d6fc39972b432e6e536aa70472386a9d7a6d9aab64a64\",\"dweb:/ipfs/QmcHwUY66yjiotRH4Q3kbRvSzcHyLQ1yHL3KbtQKiMhtZE\"]},\"project:/contracts/libs/Secp256k1.sol\":{\"keccak256\":\"0xbe686002da5004ff39dd70709f3820eba2afe9323ae9cb894009c161e4b1a666\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://18fab91775216de0707cea9ad285b10be09127461a13432fea358bf9cb2a0c2e\",\"dweb:/ipfs/QmeRUGsgstnM4hxM9hpkBf3L6cE5btirEaowcMxmuw3utj\"]},\"project:/contracts/libs/Witnet.sol\":{\"keccak256\":\"0x1d446c3e534e40e676d1763bfb2897fadfac8afed904ab757843d7d6770b0a6c\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://338fb1073f17d64e8d31bfe492d9475ce906788ee08e6489ce30413f91dc1328\",\"dweb:/ipfs/QmPe5QX2AGTnQFjse1Xttq4ZYWwYAiXoySb5VUui3PqPhk\"]},\"project:/contracts/libs/WitnetBuffer.sol\":{\"keccak256\":\"0x8e07aebe2954ab3e6f2d8eceedb12db7cf915c1f3e8630f4fa9999cecb1c78ec\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://ed6c54cc901183d61546e8fd15bd5ea8ef238ebc915642946071d435dd7481ea\",\"dweb:/ipfs/Qmcaqta7YjUSBbBUGqoh44bsCS6UqqoyHjBuz4qnKBShXM\"]},\"project:/contracts/libs/WitnetCBOR.sol\":{\"keccak256\":\"0xd99308373575cc10fb7f2ceb0f6a8625f3911275c1fa27811fae498d98d03d97\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://b4909a999d7b660a2dc54ca957b6eccfa523e2765fc4d6a2574dee7d5cd67b43\",\"dweb:/ipfs/QmWGQT4KDcfSFe1hcHVoWx6E4PhYMaod5iLpJCWBEeShzh\"]}},\"version\":1}", "bytecode": "0x", "deployedBytecode": "0x", "immutableReferences": {}, "generatedSources": [], "deployedGeneratedSources": [], "sourceMap": "", "deployedSourceMap": "", "source": "// SPDX-License-Identifier: MIT\r\n\r\npragma solidity >=0.8.0 <0.9.0;\r\n\r\nimport \"./IWitOracleRequestTemplate.sol\";\r\n\r\ninterface IWitOracleRequestFactory {\r\n \r\n /// @notice Builds a WitOracleRequest instance that will provide the bytecode\r\n /// @notice and RAD hash of some Witnet-compliant data request, provably \r\n /// @notice made out of some previously verified Witnet Radon Retrievals\r\n /// @notice (i.e. data sources), aggregate and tally Witnet Radon Reducers.\r\n /// @dev Reverts if:\r\n /// @dev - unverified retrievals are passed;\r\n /// @dev - any of the given retrievals is parameterized;\r\n /// @dev - retrievals return different data types;\r\n /// @dev - unsupported reducers are passed.\r\n /// @param retrieveHashes Hashes of previously verified data sources.\r\n /// @param aggregate The Radon Reducer to apply on values returned from data sources.\r\n /// @param tally The Radon Reducer to apply on values revealed by witnessing nodes.\r\n function buildWitOracleRequest(\r\n bytes32[] calldata retrieveHashes,\r\n Witnet.RadonReducer calldata aggregate,\r\n Witnet.RadonReducer calldata tally\r\n ) external returns (IWitOracleRequest);\r\n\r\n /// @notice Builds a modal WitOracleRequest instance out of one single parameterized \r\n /// @notice Witnet Radon Retrieval. Modal data requests apply the same data retrieval script\r\n /// @notice to multiple data providers that are expected to produce exactly the same result. \r\n /// @notice Moreover, modal data requests apply a Mode reducing function at both the \r\n /// @notice Aggregate and Tally stages everytime they get eventually solved on the Wit/Oracle\r\n /// @notice blockhain. You can optionally specify a list of filters to be applied at the Tally \r\n /// @notice resolution stage (i.e. witnessing nodes on the Wit/Oracle blockchain reporting results\r\n /// @notice that get ultimately filtered out on the Tally stage would get slashed by losing collateral).\r\n /// @dev Reverts if:\r\n /// @dev - unverified base Radon Retrieval is passed;\r\n /// @dev - the specified base Radon Retrieval is not parameterized;\r\n /// @dev - 2nd dimension's rank of the `requestArgs` array doesn't match the number of required parameters \r\n /// @dev required by the given Radon Retrieval;\r\n /// @dev - unsupported Radon Filters are passed.\r\n /// @param baseRetrieveHash Hash of the parameterized Radon Retrieval upon which the new data request will be built.\r\n /// @param requestArgs Parameters to be applied to each repetition of the given retrieval.\r\n /// @param tallySlashingFilters Optional array of slashing filters to will be applied at the Tally stage.\r\n function buildWitOracleRequestModal(\r\n bytes32 baseRetrieveHash,\r\n string[][] calldata requestArgs,\r\n Witnet.RadonFilter[] calldata tallySlashingFilters\r\n ) external returns (IWitOracleRequest);\r\n\r\n /// @notice Builds a WitOracleRequestTemplate instance made out of one or more\r\n /// @notice parameterized Witnet Radon Retrievals (i.e. data sources), aggregate\r\n /// @notice and tally Witnet Radon Reducers. \r\n /// @dev Reverts if:\r\n /// @dev - unverified retrievals are passed;\r\n /// @dev - none of given retrievals is parameterized;\r\n /// @dev - retrievals return different data types;\r\n /// @dev - unsupported reducers are passed.\r\n /// @param retrieveHashes Hashes of previously verified data sources.\r\n /// @param aggregate The Radon Reducer to apply on values returned from data sources.\r\n /// @param tally The Radon Reducer to apply on values revealed by witnessing nodes.\r\n function buildWitOracleRequestTemplate(\r\n bytes32[] calldata retrieveHashes,\r\n Witnet.RadonReducer calldata aggregate,\r\n Witnet.RadonReducer calldata tally\r\n ) external returns (IWitOracleRequestTemplate);\r\n\r\n /// @notice Builds a modal WitOracleRequestTemplate instance out of one single parameterized \r\n /// @notice Witnet Radon Retrieval. Modal request templates produce Witnet-compliant data requests\r\n /// @notice that apply the same data retrieval script to multiple data providers that are expected to\r\n /// @notice produce exactly the same result. Moreover, data requests built out of a modal request templates\r\n /// @notice apply a Mode reducing function at both the Aggregate and Tally stages every time they get\r\n /// @notice eventually solved on the Wit/Oracle blockchain. You can optionally specify a list of filters \r\n /// @notice to be applied at the Tally resolution stage (i.e. witnessing nodes on the Wit/Oracle blockchain\r\n /// @notice reporting results that get ultimately filtered out on the Tally stage would get slashed by losing collateral).\r\n /// @dev Reverts if:\r\n /// @dev - unverified base Radon Retrieval is passed;\r\n /// @dev - the specified base Radon Retrieval is either not parameterized or requires just one single parameter;\r\n /// @dev - unsupported Radon Filters are passed.\r\n /// @param baseRetrieveHash Hash of the parameterized Radon Retrieval upon which the new data request will be built.\r\n /// @param lastArgValues Parameters to be applied to each repetition of the given retrieval.\r\n /// @param tallySlashingFilters Optional array of slashing filters to will be applied at the Tally stage.\r\n function buildWitOracleRequestTemplateModal(\r\n bytes32 baseRetrieveHash,\r\n string[] calldata lastArgValues,\r\n Witnet.RadonFilter[] calldata tallySlashingFilters\r\n ) external returns (IWitOracleRequestTemplate);\r\n\r\n /// @notice Verifies and registers the specified Witnet Radon Retrieval \r\n /// @notice (i.e. public data sources) into the WitOracleRadonRegistry of the\r\n /// @notice WitOracle attached to this factory. Returns a hash that uniquely \r\n /// @notice identifies validated data source within the WitOracleRadonRegistry.\r\n /// @dev Note: all input parameters but the `requestMethod` are parameterizable\r\n /// @dev by using embedded wildcard `\\x\\` substrings (being `x='0'..'9').\r\n /// @dev Reverts if:\r\n /// @dev - unsupported data request method is given;\r\n /// @dev - no URL is provided on Http/* data requests;\r\n /// @dev - non-empty strings given on RNG data requests..\r\n function verifyRadonRetrieval(\r\n Witnet.RadonRetrievalMethods requestMethod,\r\n string calldata requestURL,\r\n string calldata requestBody,\r\n string[2][] calldata requestHeaders,\r\n bytes calldata requestRadonScript\r\n ) external returns (bytes32 retrievalHash);\r\n}\r\n", "sourcePath": "C:\\Users\\guill\\github\\guidiaz\\witnet-solidity-bridge\\contracts\\interfaces\\legacy\\IWitOracleRequestFactory.sol", "ast": { "absolutePath": "project:/contracts/interfaces/legacy/IWitOracleRequestFactory.sol", "exportedSymbols": { "Bech32": [ 31372 ], "IWitOracleRequest": [ 28922 ], "IWitOracleRequestFactory": [ 29011 ], "IWitOracleRequestTemplate": [ 29115 ], "Secp256k1": [ 32535 ], "Witnet": [ 40741 ], "WitnetBuffer": [ 42631 ], "WitnetCBOR": [ 44174 ] }, "id": 29012, "license": "MIT", "nodeType": "SourceUnit", "nodes": [ { "id": 28924, "literals": [ "solidity", ">=", "0.8", ".0", "<", "0.9", ".0" ], "nodeType": "PragmaDirective", "src": "35:31:96" }, { "absolutePath": "project:/contracts/interfaces/legacy/IWitOracleRequestTemplate.sol", "file": "./IWitOracleRequestTemplate.sol", "id": 28925, "nameLocation": "-1:-1:-1", "nodeType": "ImportDirective", "scope": 29012, "sourceUnit": 29116, "src": "70:41:96", "symbolAliases": [], "unitAlias": "" }, { "abstract": false, "baseContracts": [], "canonicalName": "IWitOracleRequestFactory", "contractDependencies": [], "contractKind": "interface", "fullyImplemented": false, "id": 29011, "linearizedBaseContracts": [ 29011 ], "name": "IWitOracleRequestFactory", "nameLocation": "125:24:96", "nodeType": "ContractDefinition", "nodes": [ { "documentation": { "id": 28926, "nodeType": "StructuredDocumentation", "src": "163:821:96", "text": "@notice Builds a WitOracleRequest instance that will provide the bytecode\n @notice and RAD hash of some Witnet-compliant data request, provably \n @notice made out of some previously verified Witnet Radon Retrievals\n @notice (i.e. data sources), aggregate and tally Witnet Radon Reducers.\n @dev Reverts if:\n @dev - unverified retrievals are passed;\n @dev - any of the given retrievals is parameterized;\n @dev - retrievals return different data types;\n @dev - unsupported reducers are passed.\n @param retrieveHashes Hashes of previously verified data sources.\n @param aggregate The Radon Reducer to apply on values returned from data sources.\n @param tally The Radon Reducer to apply on values revealed by witnessing nodes." }, "functionSelector": "7df0b485", "id": 28941, "implemented": false, "kind": "function", "modifiers": [], "name": "buildWitOracleRequest", "nameLocation": "999:21:96", "nodeType": "FunctionDefinition", "parameters": { "id": 28936, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 28929, "mutability": "mutable", "name": "retrieveHashes", "nameLocation": "1054:14:96", "nodeType": "VariableDeclaration", "scope": 28941, "src": "1035:33:96", "stateVariable": false, "storageLocation": "calldata", "typeDescriptions": { "typeIdentifier": "t_array$_t_bytes32_$dyn_calldata_ptr", "typeString": "bytes32[]" }, "typeName": { "baseType": { "id": 28927, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "1035:7:96", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "id": 28928, "nodeType": "ArrayTypeName", "src": "1035:9:96", "typeDescriptions": { "typeIdentifier": "t_array$_t_bytes32_$dyn_storage_ptr", "typeString": "bytes32[]" } }, "visibility": "internal" }, { "constant": false, "id": 28932, "mutability": "mutable", "name": "aggregate", "nameLocation": "1112:9:96", "nodeType": "VariableDeclaration", "scope": 28941, "src": "1083:38:96", "stateVariable": false, "storageLocation": "calldata", "typeDescriptions": { "typeIdentifier": "t_struct$_RadonReducer_$37748_calldata_ptr", "typeString": "struct Witnet.RadonReducer" }, "typeName": { "id": 28931, "nodeType": "UserDefinedTypeName", "pathNode": { "id": 28930, "name": "Witnet.RadonReducer", "nameLocations": [ "1083:6:96", "1090:12:96" ], "nodeType": "IdentifierPath", "referencedDeclaration": 37748, "src": "1083:19:96" }, "referencedDeclaration": 37748, "src": "1083:19:96", "typeDescriptions": { "typeIdentifier": "t_struct$_RadonReducer_$37748_storage_ptr", "typeString": "struct Witnet.RadonReducer" } }, "visibility": "internal" }, { "constant": false, "id": 28935, "mutability": "mutable", "name": "tally", "nameLocation": "1165:5:96", "nodeType": "VariableDeclaration", "scope": 28941, "src": "1136:34:96", "stateVariable": false, "storageLocation": "calldata", "typeDescriptions": { "typeIdentifier": "t_struct$_RadonReducer_$37748_calldata_ptr", "typeString": "struct Witnet.RadonReducer" }, "typeName": { "id": 28934, "nodeType": "UserDefinedTypeName", "pathNode": { "id": 28933, "name": "Witnet.RadonReducer", "nameLocations": [ "1136:6:96", "1143:12:96" ], "nodeType": "IdentifierPath", "referencedDeclaration": 37748, "src": "1136:19:96" }, "referencedDeclaration": 37748, "src": "1136:19:96", "typeDescriptions": { "typeIdentifier": "t_struct$_RadonReducer_$37748_storage_ptr", "typeString": "struct Witnet.RadonReducer" } }, "visibility": "internal" } ], "src": "1020:161:96" }, "returnParameters": { "id": 28940, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 28939, "mutability": "mutable", "name": "", "nameLocation": "-1:-1:-1", "nodeType": "VariableDeclaration", "scope": 28941, "src": "1200:17:96", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_contract$_IWitOracleRequest_$28922", "typeString": "contract IWitOracleRequest" }, "typeName": { "id": 28938, "nodeType": "UserDefinedTypeName", "pathNode": { "id": 28937, "name": "IWitOracleRequest", "nameLocations": [ "1200:17:96" ], "nodeType": "IdentifierPath", "referencedDeclaration": 28922, "src": "1200:17:96" }, "referencedDeclaration": 28922, "src": "1200:17:96", "typeDescriptions": { "typeIdentifier": "t_contract$_IWitOracleRequest_$28922", "typeString": "contract IWitOracleRequest" } }, "visibility": "internal" } ], "src": "1199:19:96" }, "scope": 29011, "src": "990:229:96", "stateMutability": "nonpayable", "virtual": false, "visibility": "external" }, { "documentation": { "id": 28942, "nodeType": "StructuredDocumentation", "src": "1227:1501:96", "text": "@notice Builds a modal WitOracleRequest instance out of one single parameterized \n @notice Witnet Radon Retrieval. Modal data requests apply the same data retrieval script\n @notice to multiple data providers that are expected to produce exactly the same result. \n @notice Moreover, modal data requests apply a Mode reducing function at both the \n @notice Aggregate and Tally stages everytime they get eventually solved on the Wit/Oracle\n @notice blockhain. You can optionally specify a list of filters to be applied at the Tally \n @notice resolution stage (i.e. witnessing nodes on the Wit/Oracle blockchain reporting results\n @notice that get ultimately filtered out on the Tally stage would get slashed by losing collateral).\n @dev Reverts if:\n @dev - unverified base Radon Retrieval is passed;\n @dev - the specified base Radon Retrieval is not parameterized;\n @dev - 2nd dimension's rank of the `requestArgs` array doesn't match the number of required parameters \n @dev required by the given Radon Retrieval;\n @dev - unsupported Radon Filters are passed.\n @param baseRetrieveHash Hash of the parameterized Radon Retrieval upon which the new data request will be built.\n @param requestArgs Parameters to be applied to each repetition of the given retrieval.\n @param tallySlashingFilters Optional array of slashing filters to will be applied at the Tally stage." }, "functionSelector": "3be83768", "id": 28958, "implemented": false, "kind": "function", "modifiers": [], "name": "buildWitOracleRequestModal", "nameLocation": "2743:26:96", "nodeType": "FunctionDefinition", "parameters": { "id": 28953, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 28944, "mutability": "mutable", "name": "baseRetrieveHash", "nameLocation": "2792:16:96", "nodeType": "VariableDeclaration", "scope": 28958, "src": "2784:24:96", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 28943, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "2784:7:96", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "visibility": "internal" }, { "constant": false, "id": 28948, "mutability": "mutable", "name": "requestArgs", "nameLocation": "2843:11:96", "nodeType": "VariableDeclaration", "scope": 28958, "src": "2823:31:96", "stateVariable": false, "storageLocation": "calldata", "typeDescriptions": { "typeIdentifier": "t_array$_t_array$_t_string_calldata_ptr_$dyn_calldata_ptr_$dyn_calldata_ptr", "typeString": "string[][]" }, "typeName": { "baseType": { "baseType": { "id": 28945, "name": "string", "nodeType": "ElementaryTypeName", "src": "2823:6:96", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" } }, "id": 28946, "nodeType": "ArrayTypeName", "src": "2823:8:96", "typeDescriptions": { "typeIdentifier": "t_array$_t_string_storage_$dyn_storage_ptr", "typeString": "string[]" } }, "id": 28947, "nodeType": "ArrayTypeName", "src": "2823:10:96", "typeDescriptions": { "typeIdentifier": "t_array$_t_array$_t_string_storage_$dyn_storage_$dyn_storage_ptr", "typeString": "string[][]" } }, "visibility": "internal" }, { "constant": false, "id": 28952, "mutability": "mutable", "name": "tallySlashingFilters", "nameLocation": "2899:20:96", "nodeType": "VariableDeclaration", "scope": 28958, "src": "2869:50:96", "stateVariable": false, "storageLocation": "calldata", "typeDescriptions": { "typeIdentifier": "t_array$_t_struct$_RadonFilter_$37727_calldata_ptr_$dyn_calldata_ptr", "typeString": "struct Witnet.RadonFilter[]" }, "typeName": { "baseType": { "id": 28950, "nodeType": "UserDefinedTypeName", "pathNode": { "id": 28949, "name": "Witnet.RadonFilter", "nameLocations": [ "2869:6:96", "2876:11:96" ], "nodeType": "IdentifierPath", "referencedDeclaration": 37727, "src": "2869:18:96" }, "referencedDeclaration": 37727, "src": "2869:18:96", "typeDescriptions": { "typeIdentifier": "t_struct$_RadonFilter_$37727_storage_ptr", "typeString": "struct Witnet.RadonFilter" } }, "id": 28951, "nodeType": "ArrayTypeName", "src": "2869:20:96", "typeDescriptions": { "typeIdentifier": "t_array$_t_struct$_RadonFilter_$37727_storage_$dyn_storage_ptr", "typeString": "struct Witnet.RadonFilter[]" } }, "visibility": "internal" } ], "src": "2769:161:96" }, "returnParameters": { "id": 28957, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 28956, "mutability": "mutable", "name": "", "nameLocation": "-1:-1:-1", "nodeType": "VariableDeclaration", "scope": 28958, "src": "2949:17:96", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_contract$_IWitOracleRequest_$28922", "typeString": "contract IWitOracleRequest" }, "typeName": { "id": 28955, "nodeType": "UserDefinedTypeName", "pathNode": { "id": 28954, "name": "IWitOracleRequest", "nameLocations": [ "2949:17:96" ], "nodeType": "IdentifierPath", "referencedDeclaration": 28922, "src": "2949:17:96" }, "referencedDeclaration": 28922, "src": "2949:17:96", "typeDescriptions": { "typeIdentifier": "t_contract$_IWitOracleRequest_$28922", "typeString": "contract IWitOracleRequest" } }, "visibility": "internal" } ], "src": "2948:19:96" }, "scope": 29011, "src": "2734:234:96", "stateMutability": "nonpayable", "virtual": false, "visibility": "external" }, { "documentation": { "id": 28959, "nodeType": "StructuredDocumentation", "src": "2976:718:96", "text": "@notice Builds a WitOracleRequestTemplate instance made out of one or more\n @notice parameterized Witnet Radon Retrievals (i.e. data sources), aggregate\n @notice and tally Witnet Radon Reducers. \n @dev Reverts if:\n @dev - unverified retrievals are passed;\n @dev - none of given retrievals is parameterized;\n @dev - retrievals return different data types;\n @dev - unsupported reducers are passed.\n @param retrieveHashes Hashes of previously verified data sources.\n @param aggregate The Radon Reducer to apply on values returned from data sources.\n @param tally The Radon Reducer to apply on values revealed by witnessing nodes." }, "functionSelector": "4d46588f", "id": 28974, "implemented": false, "kind": "function", "modifiers": [], "name": "buildWitOracleRequestTemplate", "nameLocation": "3709:29:96", "nodeType": "FunctionDefinition", "parameters": { "id": 28969, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 28962, "mutability": "mutable", "name": "retrieveHashes", "nameLocation": "3773:14:96", "nodeType": "VariableDeclaration", "scope": 28974, "src": "3753:34:96", "stateVariable": false, "storageLocation": "calldata", "typeDescriptions": { "typeIdentifier": "t_array$_t_bytes32_$dyn_calldata_ptr", "typeString": "bytes32[]" }, "typeName": { "baseType": { "id": 28960, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "3753:7:96", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "id": 28961, "nodeType": "ArrayTypeName", "src": "3753:9:96", "typeDescriptions": { "typeIdentifier": "t_array$_t_bytes32_$dyn_storage_ptr", "typeString": "bytes32[]" } }, "visibility": "internal" }, { "constant": false, "id": 28965, "mutability": "mutable", "name": "aggregate", "nameLocation": "3831:9:96", "nodeType": "VariableDeclaration", "scope": 28974, "src": "3802:38:96", "stateVariable": false, "storageLocation": "calldata", "typeDescriptions": { "typeIdentifier": "t_struct$_RadonReducer_$37748_calldata_ptr", "typeString": "struct Witnet.RadonReducer" }, "typeName": { "id": 28964, "nodeType": "UserDefinedTypeName", "pathNode": { "id": 28963, "name": "Witnet.RadonReducer", "nameLocations": [ "3802:6:96", "3809:12:96" ], "nodeType": "IdentifierPath", "referencedDeclaration": 37748, "src": "3802:19:96" }, "referencedDeclaration": 37748, "src