witnet-solidity-bridge
Version:
Witnet Solidity Bridge contracts for EVM-compatible chains
1,017 lines • 53.5 kB
JSON
{
"contractName": "WitRandomnessLegacy",
"abi": [
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint256",
"name": "blockNumber",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "evmTxGasPrice",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "evmRandomizeFee",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "witnetQueryId",
"type": "uint256"
},
{
"components": [
{
"internalType": "uint8",
"name": "committeeSize",
"type": "uint8"
},
{
"internalType": "uint64",
"name": "witnessingFeeNanoWit",
"type": "uint64"
}
],
"indexed": false,
"internalType": "struct IWitRandomnessLegacy.RandomizeQueryParams",
"name": "witnetQuerySLA",
"type": "tuple"
}
],
"name": "Randomizing",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "evmRequester",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "evmGasPrice",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "evmReward",
"type": "uint256"
},
{
"indexed": false,
"internalType": "Witnet.QueryId",
"name": "queryId",
"type": "uint64"
},
{
"indexed": false,
"internalType": "Witnet.RadonHash",
"name": "radonHash",
"type": "bytes32"
},
{
"components": [
{
"internalType": "uint16",
"name": "witResultMaxSize",
"type": "uint16"
},
{
"internalType": "uint16",
"name": "witCommitteeSize",
"type": "uint16"
},
{
"internalType": "uint64",
"name": "witUnitaryReward",
"type": "uint64"
}
],
"indexed": false,
"internalType": "struct Witnet.QuerySLA",
"name": "radonParams",
"type": "tuple"
}
],
"name": "WitOracleQuery",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "Witnet.QueryId",
"name": "queryId",
"type": "uint64"
},
{
"indexed": false,
"internalType": "uint256",
"name": "evmGasPrice",
"type": "uint256"
}
],
"name": "WitOracleQueryReport",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "Witnet.QueryId",
"name": "queryId",
"type": "uint64"
},
{
"indexed": false,
"internalType": "address",
"name": "evmConsumer",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "evmGasPrice",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "evmCallbackGas",
"type": "uint256"
}
],
"name": "WitOracleQueryReportDelivery",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "Witnet.QueryId",
"name": "queryId",
"type": "uint64"
},
{
"indexed": false,
"internalType": "address",
"name": "evmDisputer",
"type": "address"
}
],
"name": "WitOracleQueryReportDispute",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "Witnet.QueryId",
"name": "queryId",
"type": "uint64"
},
{
"indexed": false,
"internalType": "address",
"name": "evmSender",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "evmGasPrice",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "evmReward",
"type": "uint256"
}
],
"name": "WitOracleQueryUpgrade",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "Witnet.QueryId",
"name": "queryId",
"type": "uint64"
},
{
"indexed": false,
"internalType": "address",
"name": "evmConsumer",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "evmGasPrice",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "evmCallbackActualGas",
"type": "uint256"
},
{
"indexed": false,
"internalType": "string",
"name": "evmCallbackRevertReason",
"type": "string"
},
{
"indexed": false,
"internalType": "bytes",
"name": "resultCborBytes",
"type": "bytes"
}
],
"name": "WitOracleResportDeliveryFailed",
"type": "event"
},
{
"inputs": [],
"name": "class",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "evmGasPrice",
"type": "uint256"
}
],
"name": "estimateRandomizeFee",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "blockNumber",
"type": "uint256"
}
],
"name": "fetchRandomnessAfter",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "blockNumber",
"type": "uint256"
}
],
"name": "fetchRandomnessAfterProof",
"outputs": [
{
"internalType": "bytes32",
"name": "witnetResultRandomness",
"type": "bytes32"
},
{
"internalType": "uint64",
"name": "witnetResultTimestamp",
"type": "uint64"
},
{
"internalType": "bytes32",
"name": "witnetResultTallyHash",
"type": "bytes32"
},
{
"internalType": "uint256",
"name": "witnetResultFinalityBlock",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getLastRandomizeBlock",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "blockNumber",
"type": "uint256"
}
],
"name": "getRandomizeData",
"outputs": [
{
"internalType": "uint256",
"name": "witnetQueryId",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "prevRandomizeBlock",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "nextRandomizeBlock",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "blockNumber",
"type": "uint256"
}
],
"name": "getRandomizeNextBlock",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "blockNumber",
"type": "uint256"
}
],
"name": "getRandomizePrevBlock",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "blockNumber",
"type": "uint256"
}
],
"name": "getRandomizeStatus",
"outputs": [
{
"internalType": "enum IWitRandomnessLegacy.RandomizeStatus",
"name": "",
"type": "uint8"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "blockNumber",
"type": "uint256"
}
],
"name": "isRandomized",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint32",
"name": "range",
"type": "uint32"
},
{
"internalType": "uint256",
"name": "nonce",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "blockNumber",
"type": "uint256"
}
],
"name": "random",
"outputs": [
{
"internalType": "uint32",
"name": "",
"type": "uint32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "randomize",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [],
"name": "witOracle",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "witnet",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "witnetQuerySLA",
"outputs": [
{
"components": [
{
"internalType": "uint8",
"name": "committeeSize",
"type": "uint8"
},
{
"internalType": "uint64",
"name": "witnessingFeeNanoWit",
"type": "uint64"
}
],
"internalType": "struct IWitRandomnessLegacy.RandomizeQueryParams",
"name": "",
"type": "tuple"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "witnetRadHash",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "specs",
"outputs": [
{
"internalType": "bytes4",
"name": "",
"type": "bytes4"
}
],
"stateMutability": "pure",
"type": "function"
}
],
"metadata": "{\"compiler\":{\"version\":\"0.8.30+commit.73712a01\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"blockNumber\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"evmTxGasPrice\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"evmRandomizeFee\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"witnetQueryId\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"uint8\",\"name\":\"committeeSize\",\"type\":\"uint8\"},{\"internalType\":\"uint64\",\"name\":\"witnessingFeeNanoWit\",\"type\":\"uint64\"}],\"indexed\":false,\"internalType\":\"struct IWitRandomnessLegacy.RandomizeQueryParams\",\"name\":\"witnetQuerySLA\",\"type\":\"tuple\"}],\"name\":\"Randomizing\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"evmRequester\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"evmGasPrice\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"evmReward\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"Witnet.QueryId\",\"name\":\"queryId\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"Witnet.RadonHash\",\"name\":\"radonHash\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint16\",\"name\":\"witResultMaxSize\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"witCommitteeSize\",\"type\":\"uint16\"},{\"internalType\":\"uint64\",\"name\":\"witUnitaryReward\",\"type\":\"uint64\"}],\"indexed\":false,\"internalType\":\"struct Witnet.QuerySLA\",\"name\":\"radonParams\",\"type\":\"tuple\"}],\"name\":\"WitOracleQuery\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"Witnet.QueryId\",\"name\":\"queryId\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"evmGasPrice\",\"type\":\"uint256\"}],\"name\":\"WitOracleQueryReport\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"Witnet.QueryId\",\"name\":\"queryId\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"evmConsumer\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"evmGasPrice\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"evmCallbackGas\",\"type\":\"uint256\"}],\"name\":\"WitOracleQueryReportDelivery\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"Witnet.QueryId\",\"name\":\"queryId\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"evmDisputer\",\"type\":\"address\"}],\"name\":\"WitOracleQueryReportDispute\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"Witnet.QueryId\",\"name\":\"queryId\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"evmSender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"evmGasPrice\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"evmReward\",\"type\":\"uint256\"}],\"name\":\"WitOracleQueryUpgrade\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"Witnet.QueryId\",\"name\":\"queryId\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"evmConsumer\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"evmGasPrice\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"evmCallbackActualGas\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"evmCallbackRevertReason\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"resultCborBytes\",\"type\":\"bytes\"}],\"name\":\"WitOracleResportDeliveryFailed\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"class\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"evmGasPrice\",\"type\":\"uint256\"}],\"name\":\"estimateRandomizeFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockNumber\",\"type\":\"uint256\"}],\"name\":\"fetchRandomnessAfter\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockNumber\",\"type\":\"uint256\"}],\"name\":\"fetchRandomnessAfterProof\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"witnetResultRandomness\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"witnetResultTimestamp\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"witnetResultTallyHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"witnetResultFinalityBlock\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getLastRandomizeBlock\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockNumber\",\"type\":\"uint256\"}],\"name\":\"getRandomizeData\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"witnetQueryId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"prevRandomizeBlock\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nextRandomizeBlock\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockNumber\",\"type\":\"uint256\"}],\"name\":\"getRandomizeNextBlock\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockNumber\",\"type\":\"uint256\"}],\"name\":\"getRandomizePrevBlock\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockNumber\",\"type\":\"uint256\"}],\"name\":\"getRandomizeStatus\",\"outputs\":[{\"internalType\":\"enum IWitRandomnessLegacy.RandomizeStatus\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockNumber\",\"type\":\"uint256\"}],\"name\":\"isRandomized\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"range\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"blockNumber\",\"type\":\"uint256\"}],\"name\":\"random\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"randomize\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"specs\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"witOracle\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"witnet\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"witnetQuerySLA\",\"outputs\":[{\"components\":[{\"internalType\":\"uint8\",\"name\":\"committeeSize\",\"type\":\"uint8\"},{\"internalType\":\"uint64\",\"name\":\"witnessingFeeNanoWit\",\"type\":\"uint64\"}],\"internalType\":\"struct IWitRandomnessLegacy.RandomizeQueryParams\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"witnetRadHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"fetchRandomnessAfter(uint256)\":{\"details\":\"Reverts if:i. no `randomize()` was requested on neither the given block, nor afterwards.ii. the first non-errored `randomize()` request found on or after the given block is not solved yet.iii. all `randomize()` requests that took place on or after the given block were solved with errors.\",\"params\":{\"blockNumber\":\"Block number from which the search will start.\"}},\"fetchRandomnessAfterProof(uint256)\":{\"details\":\"Reverts if:i. no `randomize()` was requested on neither the given block, nor afterwards.ii. the first non-errored `randomize()` request found on or after the given block is not solved yet.iii. all `randomize()` requests that took place on or after the given block were solved with errors.\",\"params\":{\"blockNumber\":\"Block number from which the search will start.\"},\"returns\":{\"witnetResultFinalityBlock\":\"EVM block number from which the provided randomness can be considered to be final.\",\"witnetResultRandomness\":\"Random value provided by the Witnet blockchain and used for solving randomness after given block.\",\"witnetResultTallyHash\":\"Hash of the witnessing commit/reveal act that took place on the Witnet blockchain.\",\"witnetResultTimestamp\":\"Timestamp at which the randomness value was generated by the Witnet blockchain.\"}},\"getRandomizeData(uint256)\":{\"details\":\"Returns zero values if no randomize request was actually posted on the given block.\",\"returns\":{\"nextRandomizeBlock\":\"Block number in which a randomize request got posted just after this one, 0 if none.\",\"prevRandomizeBlock\":\"Block number in which a randomize request got posted just before this one. 0 if none.\",\"witnetQueryId\":\"Identifier of the underlying Witnet query created on the given block number. \"}},\"getRandomizeNextBlock(uint256)\":{\"params\":{\"blockNumber\":\"Block number from which the search will start.\"},\"returns\":{\"_0\":\"Number of the first block found after the given one, or `0` otherwise.\"}},\"getRandomizePrevBlock(uint256)\":{\"params\":{\"blockNumber\":\"Block number from which the search will start.\"},\"returns\":{\"_0\":\"First block found before the given one, or `0` otherwise.\"}},\"getRandomizeStatus(uint256)\":{\"details\":\"Possible values:- 0 -> Void: no randomize request was actually posted on or after the given block number.- 1 -> Awaiting: a randomize request was found but it's not yet solved by the Witnet blockchain.- 2 -> Ready: a successfull randomize value was reported and ready to be read.- 3 -> Error: all randomize resolutions after the given block were solved with errors.- 4 -> Finalizing: a randomize resolution has been reported from the Witnet blockchain, but it's not yet final. \"},\"random(uint32,uint256,uint256)\":{\"details\":\"Fails under same conditions as `getRandomnessAfter(uint256)` does.\",\"params\":{\"blockNumber\":\"Block number from which the search for the first randomize request solved aftewards will start.\",\"nonce\":\"Nonce value enabling multiple random numbers from the same randomness value.\",\"range\":\"Range within which the uniformly-distributed random number will be generated.\"}},\"randomize()\":{\"details\":\"Only one randomness request per block will be actually posted to the Witnet Oracle. Unused funds will be transfered back to the `msg.sender`. \",\"returns\":{\"_0\":\"Funds actually paid as randomize fee. \"}}},\"version\":1},\"userdoc\":{\"events\":{\"Randomizing(uint256,uint256,uint256,uint256,(uint8,uint64))\":{\"notice\":\"Emitted every time a new randomize is requested.\"},\"WitOracleQuery(address,uint256,uint256,uint64,bytes32,(uint16,uint16,uint64))\":{\"notice\":\"Emitted every time a new query containing some verified data request is posted to the WitOracle.\"},\"WitOracleQueryReport(uint64,uint256)\":{\"notice\":\"Emitted when a query with no callback gets reported into the WRB.\"},\"WitOracleQueryReportDelivery(uint64,address,uint256,uint256)\":{\"notice\":\"Emitted when a query with a callback gets successfully reported into the WRB.\"},\"WitOracleQueryUpgrade(uint64,address,uint256,uint256)\":{\"notice\":\"Emitted when the reward of some not-yet reported query gets upgraded.\"},\"WitOracleResportDeliveryFailed(uint64,address,uint256,uint256,string,bytes)\":{\"notice\":\"Emitted when a query with a callback cannot get reported into the WRB.\"}},\"kind\":\"user\",\"methods\":{\"class()\":{\"notice\":\"Returns the name of the actual contract implementing the logic of this Witnet appliance.\"},\"estimateRandomizeFee(uint256)\":{\"notice\":\"Returns amount of wei required to be paid as a fee when requesting randomization with a transaction gas price as the one given.\"},\"fetchRandomnessAfter(uint256)\":{\"notice\":\"Retrieves the result of keccak256-hashing the given block number with the randomness value generated by the Witnet Oracle blockchain in response to the first non-errored randomize request solved after such block number.\"},\"fetchRandomnessAfterProof(uint256)\":{\"notice\":\"Retrieves the actual random value, unique hash and timestamp of the witnessing commit/reveal act that tookplace in the Witnet Oracle blockchain in response to the first non-errored randomize requestsolved after the given block number.\"},\"getLastRandomizeBlock()\":{\"notice\":\"Returns last block number on which a randomize was requested.\"},\"getRandomizeData(uint256)\":{\"notice\":\"Retrieves metadata related to the randomize request that got posted to the Witnet Oracle contract on the given block number.\"},\"getRandomizeNextBlock(uint256)\":{\"notice\":\"Returns the number of the next block in which a randomize request was posted after the given one. \"},\"getRandomizePrevBlock(uint256)\":{\"notice\":\"Returns the number of the previous block in which a randomize request was posted before the given one.\"},\"getRandomizeStatus(uint256)\":{\"notice\":\"Gets current status of the first non-errored randomize request posted on or after the given block number.\"},\"isRandomized(uint256)\":{\"notice\":\"Returns `true` only if a successfull resolution from the Witnet blockchain is found for the first non-errored randomize request posted on or after the given block number.\"},\"random(uint32,uint256,uint256)\":{\"notice\":\"Generates a pseudo-random number uniformly distributed within the range [0 .. _range), by using the given `nonce` and the randomness returned by `getRandomnessAfter(blockNumber)`. \"},\"randomize()\":{\"notice\":\"Requests the Witnet oracle to generate an EVM-agnostic and trustless source of randomness. \"},\"specs()\":{\"notice\":\"Returns the ERC-165 id of the minimal functionality expected for this appliance.\"},\"witOracle()\":{\"notice\":\"Returns the WitOracle address that this appliance is bound to.\"},\"witnet()\":{\"notice\":\"Returns address of the Witnet Oracle bridging contract being used for solving randomness requests.\"},\"witnetQuerySLA()\":{\"notice\":\"Returns the SLA parameters required for the Witnet Oracle blockchain to fulfill when solving randomness requests:- number of witnessing nodes contributing to randomness generation- reward in $nanoWIT received per witnessing node in the Witnet blockchain\"},\"witnetRadHash()\":{\"notice\":\"Returns the unique identifier of the Witnet-compliant data request being used for solving randomness.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"project:/contracts/WitRandomnessLegacy.sol\":\"WitRandomnessLegacy\"},\"evmVersion\":\"prague\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"project:/contracts/WitOracle.sol\":{\"keccak256\":\"0x7f20eab15140df459753dfa8e406b826918b56ebe2c46456f9d04345c02629d1\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://e0573ce3d48200c71d8235a1a8c055b706420b2037bd21336f3c61713c3b8349\",\"dweb:/ipfs/QmY7BnVaNXFtJs1BFdeaa7dQfvUVoZyfwtv9HuToCxUUHU\"]},\"project:/contracts/WitRandomnessLegacy.sol\":{\"keccak256\":\"0x03726a17e14def89ec3ab3d25a0fb962cc0a64b508e93797127060c6ec2a1790\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://b27cf5a0a25ffa2c9eceea06f5ab6b65bb7f4bc0a502265076837d553b0a37dd\",\"dweb:/ipfs/QmXsYoBf3w8kVbB4Ex3KpXjQYrQYpZ8wMmvgau22HyEmrR\"]},\"project:/contracts/interfaces/IWitAppliance.sol\":{\"keccak256\":\"0xd207ca54a1049445a3d99eea497d9b34c6dbdd44d771eee825e4c031bd2f447e\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://f81de32d868ff2881ed6fe97cc897e40b4b11d23cbe53a0e23cf3e68f9c0f0a3\",\"dweb:/ipfs/QmeeXmzmK5MAzt7Hf5DB2L81efKtTzZg9VbQ8sUiTqEk5c\"]},\"project:/contracts/interfaces/IWitOracle.sol\":{\"keccak256\":\"0x26cbe2074c0b3f545a46d95fad5e2280b67edcd958e4ae0b88f3a018aa11b805\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://5324bac61f65e3edb01c88b9b75ca17affd593be88da5753a93b3f5304d3f479\",\"dweb:/ipfs/QmcVmNV6smbFiPaxvuN8ShkqbDZsT1wfjnF7f3qs6ke7QG\"]},\"project:/contracts/interfaces/IWitOracleAppliance.sol\":{\"keccak256\":\"0xcd8e57eca7f8042c85a83264e2ff6d1cd7a9f1521831736d7f57bcc7800642e6\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://5c639668e9439d60770b5df77436088ae7bd0aeb1d1be446552a98b6c29138f0\",\"dweb:/ipfs/QmbN3f5YuKMSd2j9tjay3VEkiYibGWpbfbwRNyrxA8k4o4\"]},\"project:/contracts/interfaces/IWitOracleQueriable.sol\":{\"keccak256\":\"0xdb0da1e377a35a7d620f43cb583a876750a52d91da2b888f48042483ad9c4910\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://edfcdf3e96ec3c5de7438f82e3d5a1dc9af9eb29080044213dccb26ff978354c\",\"dweb:/ipfs/Qmap2FzSysh2fug88eortbsTM7itFygRzKc9HfV43ePMik\"]},\"project:/contracts/interfaces/IWitOracleQueriableEvents.sol\":{\"keccak256\":\"0x47c283e931006d35bd2599524f86724e45eae6fad2fdd9cdecd1c85a90ff3f8c\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://3ad0520f99ec9298536ae9434f58caeb470c10dd3eaab1e4c7ed4cae9a97e2a2\",\"dweb:/ipfs/QmSuYCsSPweZfQc5Fbf9jYDdx4u7gwYCUdjhpcrrxmWZy6\"]},\"project:/contracts/interfaces/IWitOracleRadonRegistry.sol\":{\"keccak256\":\"0x437bbb89129311bd1cc8f6becd333df46109ec53b24d3159be942b225614071f\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://ef9bcdf4a73cb126885478c994821b7fe2b87d9221b767b4c9342b89b0d6550a\",\"dweb:/ipfs/QmXzZXPMxjSiFpcEnhg6CjLFNxGCpDZt22xpUh7VHxNTGd\"]},\"project:/contracts/interfaces/legacy/IWitRandomnessLegacy.sol\":{\"keccak256\":\"0x6efed45a64d1440b6f855130d30c93d34ced38d9fcd390a15e27f33c347ae05d\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://18de98643262a56af0c74897c856c426d8680fd144eb43d9e73e7e25d3185b3e\",\"dweb:/ipfs/QmcgfoVbVNVTgXfAEvztTczNw1t6YgxDaQrZi4ZXw4EA8N\"]},\"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 \"./interfaces/IWitOracleAppliance.sol\";\r\nimport \"./interfaces/IWitOracleQueriableEvents.sol\";\r\nimport \"./interfaces/legacy/IWitRandomnessLegacy.sol\";\r\n\r\nabstract contract WitRandomnessLegacy\r\n is\r\n IWitOracleAppliance,\r\n IWitOracleQueriableEvents,\r\n IWitRandomnessLegacy\r\n{\r\n function specs() virtual override external pure returns (bytes4) {\r\n return (\r\n type(IWitRandomnessLegacy).interfaceId\r\n );\r\n }\r\n}\r\n",
"sourcePath": "C:\\Users\\guill\\github\\guidiaz\\witnet-solidity-bridge\\contracts\\WitRandomnessLegacy.sol",
"ast": {
"absolutePath": "project:/contracts/WitRandomnessLegacy.sol",
"exportedSymbols": {
"Bech32": [
31372
],
"IWitAppliance": [
26514
],
"IWitOracle": [
26581
],
"IWitOracleAppliance": [
26593
],
"IWitOracleQueriable": [
26795
],
"IWitOracleQueriableEvents": [
26892
],
"IWitOracleRadonRegistry": [
27394
],
"IWitRandomnessLegacy": [
29984
],
"Secp256k1": [
32535
],
"WitOracle": [
678
],
"WitRandomnessLegacy": [
904
],
"Witnet": [
40741
],
"WitnetBuffer": [
42631
],
"WitnetCBOR": [
44174
]
},
"id": 905,
"license": "MIT",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 881,
"literals": [
"solidity",
">=",
"0.8",
".0",
"<",
"0.9",
".0"
],
"nodeType": "PragmaDirective",
"src": "35:31:15"
},
{
"absolutePath": "project:/contracts/interfaces/IWitOracleAppliance.sol",
"file": "./interfaces/IWitOracleAppliance.sol",
"id": 882,
"nameLocation": "-1:-1:-1",
"nodeType": "ImportDirective",
"scope": 905,
"sourceUnit": 26594,
"src": "70:46:15",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "project:/contracts/interfaces/IWitOracleQueriableEvents.sol",
"file": "./interfaces/IWitOracleQueriableEvents.sol",
"id": 883,
"nameLocation": "-1:-1:-1",
"nodeType": "ImportDirective",
"scope": 905,
"sourceUnit": 26893,
"src": "118:52:15",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "project:/contracts/interfaces/legacy/IWitRandomnessLegacy.sol",
"file": "./interfaces/legacy/IWitRandomnessLegacy.sol",
"id": 884,
"nameLocation": "-1:-1:-1",
"nodeType": "ImportDirective",
"scope": 905,
"sourceUnit": 29985,
"src": "172:54:15",
"symbolAliases": [],
"unitAlias": ""
},
{
"abstract": true,
"baseContracts": [
{
"baseName": {
"id": 885,
"name": "IWitOracleAppliance",
"nameLocations": [
"285:19:15"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 26593,
"src": "285:19:15"
},
"id": 886,
"nodeType": "InheritanceSpecifier",
"src": "285:19:15"
},
{
"baseName": {
"id": 887,
"name": "IWitOracleQueriableEvents",
"nameLocations": [
"315:25:15"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 26892,
"src": "315:25:15"
},
"id": 888,
"nodeType": "InheritanceSpecifier",
"src": "315:25:15"
},
{
"baseName": {
"id": 889,
"name": "IWitRandomnessLegacy",
"nameLocations": [
"351:20:15"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 29984,
"src": "351:20:15"
},
"id": 890,
"nodeType": "InheritanceSpecifier",
"src": "351:20:15"
}
],
"canonicalName": "WitRandomnessLegacy",
"contractDependencies": [],
"contractKind": "contract",
"fullyImplemented": false,
"id": 904,
"linearizedBaseContracts": [
904,
29984,
26892,
26593,
26514
],
"name": "WitRandomnessLegacy",
"nameLocation": "248:19:15",
"nodeType": "ContractDefinition",
"nodes": [
{
"baseFunctions": [
26478
],
"body": {
"id": 902,
"nodeType": "Block",
"src": "445:90:15",
"statements": [
{
"expression": {
"components": [
{
"expression": {
"arguments": [
{
"id": 897,
"name": "IWitRandomnessLegacy",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 29984,
"src": "483:20:15",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IWitRandomnessLegacy_$29984_$",
"typeString": "type(contract IWitRandomnessLegacy)"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_type$_t_contract$_IWitRandomnessLegacy_$29984_$",
"typeString": "type(contract IWitRandomnessLegacy)"
}
],
"id": 896,
"name": "type",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 4294967269,
"src": "478:4:15",
"typeDescriptions": {
"typeIdentifier": "t_function_metatype_pure$__$returns$__$",
"typeString": "function () pure"
}
},
"id": 898,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "functionCall",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "478:26:15",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_magic_meta_type_t_contract$_IWitRandomnessLegacy_$29984",
"typeString": "type(contract IWitRandomnessLegacy)"
}
},
"id": 899,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"memberLocation": "505:11:15",
"memberName": "interfaceId",
"nodeType": "MemberAccess",
"src": "478:38:15",
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
}
}
],
"id": 900,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "463:64:15",
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
}
},
"functionReturnParameters": 895,
"id": 901,
"nodeType": "Return",
"src": "456:71:15"
}
]
},
"functionSelector": "adb7c3f7",
"id": 903,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "specs",
"nameLocation": "389:5:15",
"nodeType": "FunctionDefinition",
"overrides": {
"id": 892,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "405:8:15"
},
"parameters": {
"id": 891,
"nodeType": "ParameterList",
"parameters": [],
"src": "394:2:15"
},
"returnParameters": {
"id": 895,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 894,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 903,
"src": "437:6:15",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
},
"typeName": {
"id": 893,
"name": "bytes4",
"nodeType": "ElementaryTypeName",
"src": "437:6:15",
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
}
},
"visibility": "internal"
}
],
"src": "436:8:15"
},
"scope": 904,
"src": "380:155:15",
"stateMutability": "pure",
"virtual": true,
"visibility": "external"
}
],
"scope": 905,
"src": "230:308:15",
"usedErrors": [],
"usedEvents": [
26836,
26848,
26856,
26863,
26875,
26891,
29857
]
}
],
"src": "35:505:15"
},
"compiler": {
"name": "solc",
"version": "0.8.30+commit.73712a01.Emscripten.clang"
},
"networks": {},
"schemaVersion": "3.4.16",
"updatedAt": "2025-10-15T14:34:45.331Z",
"devdoc": {
"kind": "dev",
"methods": {
"fetchRandomnessAfter(uint256)": {
"details": "Reverts if:i. no `randomize()` was requested on neither the given block, nor afterwards.ii. the first non-errored `randomize()` request found on or after the given block is not solved yet.iii. all `randomize()` requests that took place on or after the given block were solved with errors.",
"params": {
"blockNumber": "Block number from which the search will start."
}
},
"fetchRandomnessAfterProof(uint256)": {
"details": "Reverts if:i. no `randomize()` was requested on neither the given block, nor afterwards.ii. the first non-errored `randomize()` request found on or after the given block is not solved yet.iii. all `randomize()` requests that took place on or after the given block were solved with errors.",
"params": {
"blockNumber": "Block number from which the search will start."
},
"returns": {
"witnetResultFinalityBlock": "EVM block number from which the provided randomness can be considered to be final.",
"witnetResultRandomness": "Random value provided by the Witnet blockchain and used for solving randomness after given block.",
"witnetResultTallyHash": "Hash of the witnessing commit/reveal act that took place on the Witnet blockchain.",
"witnetResultTimestamp": "Timestamp at which the randomness value was generated by the Witnet blockchain."
}
},
"getRandomizeData(uint256)": {
"details": "Returns zero values if no randomize request was actually posted on the given block.",
"returns": {
"nextRandomizeBlock": "Block number in which a randomize request got posted just after this one, 0 if none.",
"prevRandomizeBlock": "Block number in which a randomize request got posted just before this one. 0 if none.",
"witnetQueryId": "Identifier of the underlying Witnet query created on the given block number. "
}
},
"getRandomizeNextBlock(uint256)": {
"params": {
"blockNumber": "Block number from which the search will start."
},
"returns": {
"_0": "Number of the first block found after the given one, or `0` otherwise."
}
},
"getRandomizePrevBlock(uint256)": {
"params": {
"blockNumber": "Block number from which the search will start."
},
"returns": {
"_0": "First block found before the given one, or `0` otherwise."
}
},
"getRandomizeStatus(uint256)": {
"details": "Possible values:- 0 -> Void: no randomize request was actually posted on or after the given block number.- 1 -> Awaiting: a randomize request was found but it's not yet solved by the Witnet blockchain.- 2 -> Ready: a successfull randomize value was reported and ready to be read.- 3 -> Error: all randomize resolutions after the given block were solved with errors.- 4 -> Finalizing: a randomize resolution has been reported from the Witnet blockchain, but it's not yet final. "
},
"random(uint32,uint256,uint256)": {
"details": "Fails under same conditions as `getRandomnessAfter(uint256)` does.",
"params": {
"blockNumber": "Block number from which the search for the first randomize request solved aftewards will start.",
"nonce": "Nonce value enabling multiple random numbers from the same randomness value.",
"range": "Range within which the uniformly-distributed random number will be generated."
}
},
"randomize()": {
"details": "Only one randomness request per block will be actually posted to the Witnet Oracle. Unused funds will be transfered back to the `msg.sender`. ",
"returns": {
"_0": "Funds actually paid as randomize fee. "
}
}
},
"version": 1
},
"userdoc": {
"events": {
"Randomizing(uint256,uint256,uint256,uint256,(uint8,uint64))": {
"notice": "Emitted every time a new randomize is requested."
},
"WitOracleQuery(address,uint256,uint256,uint64,bytes32,(uint16,uint16,uint64))": {
"notice": "Emitted every time a new query containing some verified data request is posted to the WitOracle."
},
"WitOracleQueryReport(uint64,uint256)": {
"notice": "Emitted when a query with no callback gets reported into the WRB."
},
"WitOracleQueryReportDelivery(uint64,address,uint256,uint256)": {
"notice": "Emitted when a query with a callback gets successfully reported into the WRB."
},
"WitOracleQueryUpgrade(uint64,address,uint256,uint256)": {
"notice": "Emitted when the reward of some not-yet reported query gets upgraded."
},
"WitOra