witnet-solidity-bridge
Version:
Witnet Solidity Bridge contracts for EVM-compatible chains
822 lines • 135 kB
JSON
{
"contractName": "IWitRandomness",
"abi": [
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint256",
"name": "randomizeBlock",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "finalityBlock",
"type": "uint256"
},
{
"indexed": false,
"internalType": "bytes32",
"name": "randomness",
"type": "bytes32"
}
],
"name": "Randomized",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "evmRequester",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "randomizeBlock",
"type": "uint256"
},
{
"indexed": false,
"internalType": "Witnet.QueryId",
"name": "witOracleQueryId",
"type": "uint64"
}
],
"name": "Randomizing",
"type": "event"
},
{
"inputs": [],
"name": "acceptOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "owner",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "pendingOwner",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "consumer",
"type": "address"
},
{
"internalType": "uint24",
"name": "maxCallbackGasLimit",
"type": "uint24"
}
],
"name": "settleConsumer",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint24",
"name": "callbackGasLimit",
"type": "uint24"
},
{
"internalType": "uint16",
"name": "extraFeePercentage",
"type": "uint16"
},
{
"internalType": "uint16",
"name": "minWitnesses",
"type": "uint16"
},
{
"internalType": "uint64",
"name": "minInclusionFees",
"type": "uint64"
}
],
"name": "settleQueryParams",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "",
"type": "uint16"
}
],
"name": "settleRandomizeWaitingBlocks",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"name": "transferOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "base",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "curator",
"type": "address"
}
],
"name": "clone",
"outputs": [
{
"internalType": "contract IWitRandomness",
"name": "",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "consumer",
"outputs": [
{
"internalType": "contract IWitRandomnessConsumer",
"name": "",
"type": "address"
}
],
"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": "witnetQueryUUID",
"type": "bytes32"
},
{
"internalType": "Witnet.Timestamp",
"name": "witnetTimestamp",
"type": "uint64"
},
{
"internalType": "Witnet.TransactionHash",
"name": "witnetDrTxHash",
"type": "bytes32"
},
{
"internalType": "uint256",
"name": "evmFinalityBlock",
"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": "Witnet.QueryId",
"name": "witOracleQueryId",
"type": "uint64"
},
{
"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": "getRandomizeQueryId",
"outputs": [
{
"internalType": "Witnet.QueryId",
"name": "",
"type": "uint64"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "blockNumber",
"type": "uint256"
}
],
"name": "getRandomizeQueryErrorDescription",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getRandomizeQueryParams",
"outputs": [
{
"internalType": "uint24",
"name": "callbackGasLimit",
"type": "uint24"
},
{
"internalType": "uint16",
"name": "extraFeePercentage",
"type": "uint16"
},
{
"internalType": "uint16",
"name": "witCommitteeSize",
"type": "uint16"
},
{
"internalType": "uint64",
"name": "witInclusionFees",
"type": "uint64"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getRandomizeRadonBytecode",
"outputs": [
{
"internalType": "bytes",
"name": "",
"type": "bytes"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getRandomizeRadonHash",
"outputs": [
{
"internalType": "Witnet.RadonHash",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "blockNumber",
"type": "uint256"
}
],
"name": "getRandomizeStatus",
"outputs": [
{
"internalType": "enum IWitRandomnessTypes.RandomizeStatus",
"name": "",
"type": "uint8"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getRandomizeWaitingBlocks",
"outputs": [
{
"internalType": "uint16",
"name": "",
"type": "uint16"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "blockNumber",
"type": "uint256"
}
],
"name": "isRandomized",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "randomize",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "blockNumber",
"type": "uint256"
},
{
"internalType": "bytes32",
"name": "witnetRandomness",
"type": "bytes32"
}
],
"name": "verifyRandomnessAfter",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "witOracle",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
}
],
"metadata": "{\"compiler\":{\"version\":\"0.8.30+commit.73712a01\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"randomizeBlock\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"finalityBlock\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"randomness\",\"type\":\"bytes32\"}],\"name\":\"Randomized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"evmRequester\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"randomizeBlock\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"Witnet.QueryId\",\"name\":\"witOracleQueryId\",\"type\":\"uint64\"}],\"name\":\"Randomizing\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"base\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"curator\",\"type\":\"address\"}],\"name\":\"clone\",\"outputs\":[{\"internalType\":\"contract IWitRandomness\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"consumer\",\"outputs\":[{\"internalType\":\"contract IWitRandomnessConsumer\",\"name\":\"\",\"type\":\"address\"}],\"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\":\"witnetQueryUUID\",\"type\":\"bytes32\"},{\"internalType\":\"Witnet.Timestamp\",\"name\":\"witnetTimestamp\",\"type\":\"uint64\"},{\"internalType\":\"Witnet.TransactionHash\",\"name\":\"witnetDrTxHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"evmFinalityBlock\",\"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\":\"Witnet.QueryId\",\"name\":\"witOracleQueryId\",\"type\":\"uint64\"},{\"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\":\"getRandomizeQueryErrorDescription\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockNumber\",\"type\":\"uint256\"}],\"name\":\"getRandomizeQueryId\",\"outputs\":[{\"internalType\":\"Witnet.QueryId\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRandomizeQueryParams\",\"outputs\":[{\"internalType\":\"uint24\",\"name\":\"callbackGasLimit\",\"type\":\"uint24\"},{\"internalType\":\"uint16\",\"name\":\"extraFeePercentage\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"witCommitteeSize\",\"type\":\"uint16\"},{\"internalType\":\"uint64\",\"name\":\"witInclusionFees\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRandomizeRadonBytecode\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRandomizeRadonHash\",\"outputs\":[{\"internalType\":\"Witnet.RadonHash\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockNumber\",\"type\":\"uint256\"}],\"name\":\"getRandomizeStatus\",\"outputs\":[{\"internalType\":\"enum IWitRandomnessTypes.RandomizeStatus\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRandomizeWaitingBlocks\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockNumber\",\"type\":\"uint256\"}],\"name\":\"isRandomized\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pendingOwner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"randomize\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"},{\"internalType\":\"uint24\",\"name\":\"maxCallbackGasLimit\",\"type\":\"uint24\"}],\"name\":\"settleConsumer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint24\",\"name\":\"callbackGasLimit\",\"type\":\"uint24\"},{\"internalType\":\"uint16\",\"name\":\"extraFeePercentage\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"minWitnesses\",\"type\":\"uint16\"},{\"internalType\":\"uint64\",\"name\":\"minInclusionFees\",\"type\":\"uint64\"}],\"name\":\"settleQueryParams\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"name\":\"settleRandomizeWaitingBlocks\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockNumber\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"witnetRandomness\",\"type\":\"bytes32\"}],\"name\":\"verifyRandomnessAfter\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"witOracle\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Witnet Foundation.\",\"kind\":\"dev\",\"methods\":{\"clone(address)\":{\"params\":{\"curator\":\"Address that will have authoritative access to `IWitRandomnessAdmin` methods.\"}},\"consumer()\":{\"details\":\"If zero, generated randomness will not be reported to any other external address. The consumer contract must implement the `IWitRandomnessConsumer` interface, and accept this instance as source of entropy.It can only be settled by a curator on cloned instances.\"},\"fetchRandomnessAfter(uint256)\":{\"details\":\"Reverts if: i. no `randomize()` was queried on neither the given block, nor afterwards. ii. the first non-failing `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 queried on neither the given block, nor afterwards. ii. the first non-failing `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\":{\"witnetDrTxHash\":\"Hash of the witnessing commit/reveal act that took place on the Witnet blockchain.\",\"witnetQueryUUID\":\"Universal identifier of the query posted from this contract that ultimately solved randomness.\",\"witnetTimestamp\":\"Timestamp at which the randomness value was generated by the Witnet blockchain.\"}},\"getRandomizeData(uint256)\":{\"details\":\"Returns zero values if no randomize request was actually queried on the specified block number.\",\"params\":{\"blockNumber\":\"Block number from which the search will start.\"},\"returns\":{\"nextRandomizeBlock\":\"Block number in which a randomize request got queried just after the specified block.\",\"prevRandomizeBlock\":\"Block number in which a randomize request got queried just before the specified block.\",\"witOracleQueryId\":\"Identifier of the underlying Wit/Oracle query created on the specified block (0 if none).\"}},\"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.\"}},\"getRandomizeQueryId(uint256)\":{\"details\":\"Returns zero if no randomize was request on or after the specified block number.\"},\"getRandomizeQueryParams()\":{\"returns\":{\"callbackGasLimit\":\"Max. expendable gas upon randomness delivery.\",\"extraFeePercentage\":\"Overhead percentage applied when estimating the randomize request fee. \",\"witCommitteeSize\":\"Number of Witnet witnessing nodes required to generate unbiased randomness.\",\"witInclusionFees\":\"Minimum amount of fees in $nanoWIT to be paid on the Witnet blockchain.\"}},\"randomize()\":{\"details\":\"Only one randomize request per block will get ultimately relayed to the Witnet blockchain.\",\"returns\":{\"_0\":\"EVM funds actually paid as randomize fee.\"}}},\"title\":\"The Wit/Randomness V3 appliance interface.\",\"version\":1},\"userdoc\":{\"events\":{\"Randomized(uint256,uint256,bytes32)\":{\"notice\":\"Emitted when some requested randomness gets delivered from Witnet.\"},\"Randomizing(address,uint256,uint64)\":{\"notice\":\"Emitted when a new randomize request gets posted to the Wit/Oracle framework.\"}},\"kind\":\"user\",\"methods\":{\"base()\":{\"notice\":\"Address of the underlying logic contract.\"},\"clone(address)\":{\"notice\":\"Creates a light-proxy clone to the `base()` logic address, to be owned by the specified `curator`address. Curators of cloned instances can optionally settle one single `IWitRandomnessConsumer` consuming contract. The consuming contract, if settled, will be immediately reported every time a new `randomize()` request gets solved and bridged back from Witnet. Either way, randomness resolutions will be reamin stored in the `WitRandomness` storage, as for future reference. \"},\"consumer()\":{\"notice\":\"Returns the consumer address where all valid randomize results will be reported to.\"},\"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 blockchain in response to the first non-failing 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 took place in the Witnet blockchain in response to the first non-failing randomize query solved after the given block number.\"},\"getLastRandomizeBlock()\":{\"notice\":\"Returns last block number on which a randomize was queried.\"},\"getRandomizeData(uint256)\":{\"notice\":\"Retrieves metadata related to the randomize request that got queried to the `WitOracle` contract on the specified block number, if any.\"},\"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.\"},\"getRandomizeQueryErrorDescription(uint256)\":{\"notice\":\"Explains why the last attempt of generating randomness for the specified block number failed.\"},\"getRandomizeQueryId(uint256)\":{\"notice\":\"Returns the identifier of the Wit/Oracle query that has either solved randomness for the specified block number, is currently attending randomness for the specified block number, of the one that attempted to solve it. \"},\"getRandomizeQueryParams()\":{\"notice\":\"Returns security and liveness parameters required to the Witnet blockchain when solving randomness requests, if no others are specified.\"},\"getRandomizeRadonBytecode()\":{\"notice\":\"Returns the immutable bytecode of the Radon Request that's being used for solving randomness requests on the Witnet blockchain.\"},\"getRandomizeRadonHash()\":{\"notice\":\"Returns the unique identifier of the Radon Request that's being used for solving request randomness requests on the Witnet blockchain.\"},\"getRandomizeStatus(uint256)\":{\"notice\":\"Returns status of the first non-errored randomize request queried on or after the given block number. - 0 -> Void: no randomize request was actually queried on or after the given block number. - 1 -> Awaiting: a randomize request was found but it's not yet solved by the Wit/Oracle. - 2 -> Ready: a successfull randomize value was reported and is ready to be read. - 3 -> Error: all attempted randomize requests at or after the given block were solved with errors. - 4 -> Finalizing: a randomize result was relayed already but cannot yet be considered to be final.\"},\"getRandomizeWaitingBlocks()\":{\"notice\":\"Return the number of EVM blocks after a randomize requests that have to elapse before considering such request to be delayed. Results to delayed requests can potentially be provided by later requests, if solved earlier. A value of zero means that randomize requests will never expire. \"},\"isRandomized(uint256)\":{\"notice\":\"Returns `true` only if a successfull resolution from the Witnet blockchain is found for the first non-failing randomize request posted on or after the given block number.\"},\"randomize()\":{\"notice\":\"Requests the Witnet blockchain to generate an unbiased 256-bit random seed.\"},\"verifyRandomnessAfter(uint256,bytes32)\":{\"notice\":\"Verifies that the specified randomness seed was actually generated on the Witnet blockchain and used for producing the randomness value returned by `fetchRandomnessAfter(blockNumber)`.\"},\"witOracle()\":{\"notice\":\"The Wit/Oracle core address accepted as source of entropy.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"project:/contracts/interfaces/IWitRandomness.sol\":\"IWitRandomness\"},\"evmVersion\":\"prague\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"project:/contracts/interfaces/IWitRandomness.sol\":{\"keccak256\":\"0x349b27a7ecb4ca22f87d4ab13714a010668a7014d9c37fdb91caa407981b889a\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://a53b9c8d63c973bb98790ef3305fbc24debaa2dadad1b48b82ffdbfce73e08b6\",\"dweb:/ipfs/QmSue9dMNK1V5ChooMBTtccmpx2JoiyktqTP1Ng6bSuUGx\"]},\"project:/contracts/interfaces/IWitRandomnessAdmin.sol\":{\"keccak256\":\"0xb5b9b2375509f03db5b1e198089f4b0cf4e4ebbd31a2a7b5d2480a743bebbcd2\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://0cade769eec375a3ec1cd4d376be54ee48a0e18786543f6ee396c0debfa4c04c\",\"dweb:/ipfs/QmY7AucsWp54PZVgMFjrJRt1n1DKCXb84ZXzTXnRZULYXF\"]},\"project:/contracts/interfaces/IWitRandomnessConsumer.sol\":{\"keccak256\":\"0x8006c81ac34c0797d31606164e6e0c6a7e97f0ba0f5228505bbc3d4fbcf16cdd\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://8cc71c0afed6dd296a808513b3119840490f76fb884ad35729669201446348bf\",\"dweb:/ipfs/QmQLs5jg8nugFgNu5psvGaCsMC6X1YoD6qV5nt7Gf5iAuk\"]},\"project:/contracts/interfaces/IWitRandomnessEvents.sol\":{\"keccak256\":\"0x005a56891f103c78ce015fbbcb9cf96f64e3810a70cd20dcdcce2963186788fc\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://6365a0bb99b2ac7990b74b33a4df7b045702362baf11998f8345f1a2530c29ae\",\"dweb:/ipfs/QmY2d5m2E7JwFT4EFzbrXZkiL4sSTowmosMHjSE3fTAwXf\"]},\"project:/contracts/interfaces/IWitRandomnessTypes.sol\":{\"keccak256\":\"0x52d825bf6bd6a2515116f993e939108f5412f5a05e304893ba81e9fcbfce4e09\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://60b3db141539544afc2701a873570a7b78639090e36b4bb7a57ae0d0dddeb9f4\",\"dweb:/ipfs/QmTWkwYdF4QMTeCFVcYNi9pWi3PwVeK29xgp946z8xtuiN\"]},\"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.17 <0.9.0;\r\n\r\nimport {IWitRandomnessAdmin} from \"./IWitRandomnessAdmin.sol\";\r\nimport {IWitRandomnessConsumer} from \"./IWitRandomnessConsumer.sol\";\r\nimport {IWitRandomnessEvents} from \"./IWitRandomnessEvents.sol\";\r\nimport {IWitRandomnessTypes, Witnet} from \"./IWitRandomnessTypes.sol\";\r\n\r\n/// @title The Wit/Randomness V3 appliance interface.\r\n/// @author Witnet Foundation.\r\ninterface IWitRandomness\r\n is \r\n IWitRandomnessAdmin,\r\n IWitRandomnessEvents, \r\n IWitRandomnessTypes \r\n{\r\n /// Address of the underlying logic contract.\r\n function base() external view returns (address);\r\n\r\n /// Creates a light-proxy clone to the `base()` logic address, to be owned by the specified `curator`address.\r\n /// Curators of cloned instances can optionally settle one single `IWitRandomnessConsumer` consuming contract.\r\n /// The consuming contract, if settled, will be immediately reported every time a new `randomize()` request\r\n /// gets solved and bridged back from Witnet. Either way, randomness resolutions will be reamin stored in the \r\n /// `WitRandomness` storage, as for future reference. \r\n /// @param curator Address that will have authoritative access to `IWitRandomnessAdmin` methods.\r\n function clone(address curator) external returns (IWitRandomness);\r\n\r\n /// Returns the consumer address where all valid randomize results will be reported to.\r\n /// @dev If zero, generated randomness will not be reported to any other external address. \r\n /// @dev The consumer contract must implement the `IWitRandomnessConsumer` interface, \r\n /// @dev and accept this instance as source of entropy.\r\n /// @dev It can only be settled by a curator on cloned instances.\r\n function consumer() external view returns (IWitRandomnessConsumer);\r\n\r\n /// Returns amount of wei required to be paid as a fee when requesting randomization with a \r\n /// transaction gas price as the one given.\r\n function estimateRandomizeFee(uint256 evmGasPrice) external view returns (uint256);\r\n\r\n /// Retrieves the result of keccak256-hashing the given block number with the randomness value \r\n /// generated by the Witnet blockchain in response to the first non-failing randomize request solved \r\n /// after such block number.\r\n ///\r\n /// @dev Reverts if:\r\n /// i. no `randomize()` was queried on neither the given block, nor afterwards.\r\n /// ii. the first non-failing `randomize()` request found on or after the given block is not solved yet.\r\n /// iii. all `randomize()` requests that took place on or after the given block were solved with errors.\r\n ///\r\n /// @param blockNumber Block number from which the search will start.\r\n function fetchRandomnessAfter(uint256 blockNumber) external view returns (bytes32);\r\n\r\n /// Retrieves the actual random value, unique hash and timestamp of the witnessing commit/reveal act \r\n /// that took place in the Witnet blockchain in response to the first non-failing randomize query\r\n /// solved after the given block number.\r\n ///\r\n /// @dev Reverts if:\r\n /// i. no `randomize()` was queried on neither the given block, nor afterwards.\r\n /// ii. the first non-failing `randomize()` request found on or after the given block is not solved yet.\r\n /// iii. all `randomize()` requests that took place on or after the given block were solved with errors.\r\n ///\r\n /// @param blockNumber Block number from which the search will start.\r\n /// @return witnetQueryUUID Universal identifier of the query posted from this contract that ultimately solved randomness.\r\n /// @return witnetTimestamp Timestamp at which the randomness value was generated by the Witnet blockchain.\r\n /// @return witnetDrTxHash Hash of the witnessing commit/reveal act that took place on the Witnet blockchain.\r\n // @return evmFinalityBlock EVM block number at which the generated randomness can be considered to be final.\r\n function fetchRandomnessAfterProof(uint256 blockNumber) external view returns (\r\n bytes32 witnetQueryUUID,\r\n Witnet.Timestamp witnetTimestamp,\r\n Witnet.TransactionHash witnetDrTxHash,\r\n uint256 evmFinalityBlock\r\n );\r\n \r\n /// Returns last block number on which a randomize was queried.\r\n function getLastRandomizeBlock() external view returns (uint256);\r\n\r\n /// Retrieves metadata related to the randomize request that got queried to the `WitOracle` contract \r\n /// on the specified block number, if any.\r\n ///\r\n /// @dev Returns zero values if no randomize request was actually queried on the specified block number.\r\n ///\r\n /// @param blockNumber Block number from which the search will start.\r\n /// @return witOracleQueryId Identifier of the underlying Wit/Oracle query created on the specified block (0 if none).\r\n /// @return prevRandomizeBlock Block number in which a randomize request got queried just before the specified block.\r\n /// @return nextRandomizeBlock Block number in which a randomize request got queried just after the specified block.\r\n function getRandomizeData(uint256 blockNumber) external view returns (\r\n Witnet.QueryId witOracleQueryId,\r\n uint256 prevRandomizeBlock,\r\n uint256 nextRandomizeBlock\r\n );\r\n \r\n /// Returns the number of the next block in which a randomize request was posted after the given one. \r\n /// @param blockNumber Block number from which the search will start.\r\n /// @return Number of the first block found after the given one, or `0` otherwise.\r\n function getRandomizeNextBlock(uint256 blockNumber) external view returns (uint256); \r\n\r\n /// Returns the number of the previous block in which a randomize request was posted before the given one.\r\n /// @param blockNumber Block number from which the search will start.\r\n /// @return First block found before the given one, or `0` otherwise.\r\n function getRandomizePrevBlock(uint256 blockNumber) external view returns (uint256);\r\n\r\n /// Returns the identifier of the Wit/Oracle query that has either solved randomness\r\n /// for the specified block number, is currently attending randomness for the specified block number,\r\n /// of the one that attempted to solve it. \r\n /// @dev Returns zero if no randomize was request on or after the specified block number.\r\n function getRandomizeQueryId(uint256 blockNumber) external view returns (Witnet.QueryId);\r\n\r\n /// Explains why the last attempt of generating randomness for the specified block number failed.\r\n function getRandomizeQueryErrorDescription(uint256 blockNumber) external view returns (string memory);\r\n\r\n /// Returns security and liveness parameters required to the Witnet blockchain \r\n /// when solving randomness requests, if no others are specified.\r\n /// @return callbackGasLimit Max. expendable gas upon randomness delivery.\r\n /// @return extraFeePercentage Overhead percentage applied when estimating the randomize request fee. \r\n /// @return witCommitteeSize Number of Witnet witnessing nodes required to generate unbiased randomness.\r\n /// @return witInclusionFees Minimum amount of fees in $nanoWIT to be paid on the Witnet blockchain.\r\n function getRandomizeQueryParams()\r\n external view returns (\r\n uint24 callbackGasLimit,\r\n uint16 extraFeePercentage,\r\n uint16 witCommitteeSize,\r\n uint64 witInclusionFees\r\n );\r\n\r\n /// Returns the immutable bytecode of the Radon Request that's being used \r\n /// for solving randomness requests on the Witnet blockchain.\r\n function getRandomizeRadonBytecode() external view returns (bytes memory);\r\n\r\n /// Returns the unique identifier of the Radon Request that's being used \r\n /// for solving request randomness requests on the Witnet blockchain.\r\n function getRandomizeRadonHash() external view returns (Witnet.RadonHash);\r\n\r\n /// @notice Returns status of the first non-errored randomize request queried on or after the given block number.\r\n /// - 0 -> Void: no randomize request was actually queried on or after the given block number.\r\n /// - 1 -> Awaiting: a randomize request was found but it's not yet solved by the Wit/Oracle.\r\n /// - 2 -> Ready: a successfull randomize value was reported and is ready to be read.\r\n /// - 3 -> Error: all attempted randomize requests at or after the given block were solved with errors.\r\n /// - 4 -> Finalizing: a randomize result was relayed already but cannot yet be considered to be final.\r\n function getRandomizeStatus(uint256 blockNumber) external view returns (RandomizeStatus); \r\n\r\n /// Return the number of EVM blocks after a randomize requests that have to elapse before\r\n /// considering such request to be delayed. Results to delayed requests can potentially be\r\n /// provided by later requests, if solved earlier. A value of zero means that randomize \r\n /// requests will never expire. \r\n function getRandomizeWaitingBlocks() external view returns (uint16);\r\n\r\n /// Returns `true` only if a successfull resolution from the Witnet blockchain is found for the \r\n /// first non-failing randomize request posted on or after the given block number.\r\n function isRandomized(uint256 blockNumber) external view returns (bool);\r\n\r\n /// @notice Requests the Witnet blockchain to generate an unbiased 256-bit random seed.\r\n /// @dev Only one randomize request per block will get ultimately relayed to the Witnet blockchain.\r\n /// @return EVM funds actually paid as randomize fee.\r\n function randomize() external payable returns (uint256);\r\n\r\n /// Verifies that the specified randomness seed was actually generated on the Witnet blockchain\r\n /// and used for producing the randomness value returned by `fetchRandomnessAfter(blockNumber)`.\r\n function verifyRandomnessAfter(uint256 blockNumber, bytes32 witnetRandomness) external view returns (bool);\r\n\r\n /// The Wit/Oracle core address accepted as source of entropy.\r\n function witOracle() external view returns (address);\r\n}\r\n",
"sourcePath": "C:\\Users\\guill\\github\\guidiaz\\witnet-solidity-bridge\\contracts\\interfaces\\IWitRandomness.sol",
"ast": {
"absolutePath": "project:/contracts/interfaces/IWitRandomness.sol",
"exportedSymbols": {
"IWitRandomness": [
28351
],
"IWitRandomnessAdmin": [
28395
],
"IWitRandomnessConsumer": [
28425
],
"IWitRandomnessEvents": [
28449
],
"IWitRandomnessTypes": [
28461
],
"Witnet": [
40741
]
},
"id": 28352,
"license": "MIT",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 28158,
"literals": [
"solidity",
">=",
"0.8",
".17",
"<",
"0.9",
".0"
],
"nodeType": "PragmaDirective",
"src": "35:32:85"
},
{
"absolutePath": "project:/contracts/interfaces/IWitRandomnessAdmin.sol",
"file": "./IWitRandomnessAdmin.sol",
"id": 28160,
"nameLocation": "-1:-1:-1",
"nodeType": "ImportDirective",
"scope": 28352,
"sourceUnit": 28396,
"src": "71:62:85",
"symbolAliases": [
{
"foreign": {
"id": 28159,
"name": "IWitRandomnessAdmin",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 28395,
"src": "79:19:85",
"typeDescriptions": {}
},
"nameLocation": "-1:-1:-1"
}
],
"unitAlias": ""
},
{
"absolutePath": "project:/contracts/interfaces/IWitRandomnessConsumer.sol",
"file": "./IWitRandomnessConsumer.sol",
"id": 28162,
"nameLocation": "-1:-1:-1",
"nodeType": "ImportDirective",
"scope": 28352,
"sourceUnit": 28426,
"src": "135:68:85",
"symbolAliases": [
{
"foreign": {
"id": 28161,
"name": "IWitRandomnessConsumer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 28425,
"src": "143:22:85",
"typeDescriptions": {}
},
"nameLocation": "-1:-1:-1"
}
],
"unitAlias": ""
},
{
"absolutePath": "project:/contracts/interfaces/IWitRandomnessEvents.sol",
"file": "./IWitRandomnessEvents.sol",
"id": 28164,
"nameLocation": "-1:-1:-1",
"nodeType": "ImportDirective",
"scope": 28352,
"sourceUnit": 28450,
"src": "205:64:85",
"symbolAliases": [
{
"foreign": {
"id": 28163,
"name": "IWitRandomnessEvents",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 28449,
"src": "213:20:85",
"typeDescriptions": {}
},
"nameLocation": "-1:-1:-1"
}
],
"unitAlias": ""
},
{
"absolutePath": "project:/contracts/interfaces/IWitRandomnessTypes.sol",
"file": "./IWitRandomnessTypes.sol",
"id": 28167,
"nameLocation": "-1:-1:-1",
"nodeType": "ImportDirective",
"scope": 28352,
"sourceUnit": 28462,
"src": "271:70:85",
"symbolAliases": [
{
"foreign": {
"id": 28165,
"name": "IWitRandomnessTypes",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 28461,
"src": "279:19:85",
"typeDescriptions": {}
},
"nameLocation": "-1:-1:-1"
},
{
"foreign": {
"id": 28166,
"name": "Witnet",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 40741,
"src": "300:6:85",
"typeDescriptions": {}
},
"nameLocation": "-1:-1:-1"
}
],
"unitAlias": ""
},
{
"abstract": false,
"baseContracts": [
{
"baseName": {
"id": 28169,
"name": "IWitRandomnessAdmin",
"nameLocations": [
"475:19:85"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 28395,
"src": "475:19:85"
},
"id": 28170,
"nodeType": "InheritanceSpecifier",
"src": "475:19:85"
},
{
"baseName": {
"id": 28171,
"name": "IWitRandomnessEvents",
"nameLocations": [
"505:20:85"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 28449,
"src": "505:20:85"
},
"id": 28172,
"nodeType": "InheritanceSpecifier",
"src": "505:20:85"
},
{
"baseName": {
"id": 28173,
"name": "IWitRandomnessTypes",
"nameLocations": [
"537:19:85"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 28461,
"src": "537:19:85"
},
"id": 28174,
"nodeType": "InheritanceSpecifier",
"src": "537:19:85"
}
],
"canonicalName": "IWitRandomness",
"contractDependencies": [],
"contractKind": "interface",
"documentation": {
"id": 28168,
"nodeType": "StructuredDocumentation",
"src": "345:87:85",
"text": "@title The Wit/Randomness V3 appliance interface.\n @author Witnet Foundation."
},
"fullyImplemented": false,
"id": 28351,
"linearizedBaseContracts": [
28351,
28461,
28449,
28395
],
"name": "IWitRandomness",
"nameLocation": "442:14:85",
"nodeType": "ContractDefinition",
"nodes": [
{
"documentation": {
"id": 28175,
"nodeType": "StructuredDocumentation",
"src": "573:45:85",
"text": "Address of the underlying logic contract."
},
"functionSelector": "5001f3b5",
"id": 28180,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "base",
"nameLocation": "633:4:85",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 28176,
"nodeType": "ParameterList",
"parameters": [],
"src": "637:2:85"
},
"returnParameters": {
"id": 28179,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 28178,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 28180,
"src": "663:7:85",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName":