witnet-solidity-bridge
Version:
Witnet Solidity Bridge contracts for EVM-compatible chains
1,021 lines • 58.3 kB
JSON
{
"contractName": "WitRandomness",
"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": [],
"name": "class",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"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": "uint256",
"name": "queryId",
"type": "uint256"
},
{
"internalType": "bytes",
"name": "queryResult",
"type": "bytes"
}
],
"name": "reportWitOracleQueryResult",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"name": "reportableFrom",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"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"
},
{
"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\":\"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\":[],\"name\":\"class\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"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\":\"uint256\",\"name\":\"queryId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"queryResult\",\"type\":\"bytes\"}],\"name\":\"reportWitOracleQueryResult\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"reportableFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"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\":[],\"name\":\"specs\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"pure\",\"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\":{\"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.\"}},\"reportWitOracleQueryResult(uint256,bytes)\":{\"details\":\"It should revert if called from an address different to the WitOracle instance being used by consumer.\",\"params\":{\"queryId\":\"The unique identifier of the Witnet query being reported.\",\"queryResult\":\"Abi-encoded Witnet.DataResult containing the CBOR-encoded query's result, and metadata.\"}},\"reportableFrom(address)\":{\"details\":\"In practice, must only be true on the WitOracle address that's being used bythe WitOracleQueriableConsumer to post queries. \"}},\"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.\"},\"class()\":{\"notice\":\"Returns the name of the actual contract implementing the logic of this Witnet appliance.\"},\"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.\"},\"reportWitOracleQueryResult(uint256,bytes)\":{\"notice\":\"Method to be called from the WitOracle contract as soon as the given Witnet `queryId` gets reported.\"},\"reportableFrom(address)\":{\"notice\":\"Determines if Witnet queries can be reported from given address.\"},\"specs()\":{\"notice\":\"Returns the ERC-165 id of the minimal functionality expected for this appliance.\"},\"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/WitRandomness.sol\":\"WitRandomness\"},\"evmVersion\":\"prague\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"project:/contracts/WitRandomness.sol\":{\"keccak256\":\"0x7accd2d28e3ad04761104048b775576ba5efc212eae4dc2dfe006506d95fb137\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://4daf83555177f9eb9278963a9873c2aaed1b28ad2ba27300b57f3fa195a265bc\",\"dweb:/ipfs/QmRWmasNnkFYfYy563TnGBVFgriNbV57KHTerPZLFYyU1J\"]},\"project:/contracts/interfaces/IWitAppliance.sol\":{\"keccak256\":\"0xd207ca54a1049445a3d99eea497d9b34c6dbdd44d771eee825e4c031bd2f447e\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://f81de32d868ff2881ed6fe97cc897e40b4b11d23cbe53a0e23cf3e68f9c0f0a3\",\"dweb:/ipfs/QmeeXmzmK5MAzt7Hf5DB2L81efKtTzZg9VbQ8sUiTqEk5c\"]},\"project:/contracts/interfaces/IWitOracleQueriable.sol\":{\"keccak256\":\"0xdb0da1e377a35a7d620f43cb583a876750a52d91da2b888f48042483ad9c4910\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://edfcdf3e96ec3c5de7438f82e3d5a1dc9af9eb29080044213dccb26ff978354c\",\"dweb:/ipfs/Qmap2FzSysh2fug88eortbsTM7itFygRzKc9HfV43ePMik\"]},\"project:/contracts/interfaces/IWitOracleQueriableConsumer.sol\":{\"keccak256\":\"0xe8143d2387d674022f453b57652998f53cbe4c21fe35e59421428142355c8ebf\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://6e6c3e3d3e7168a3fb75b1eca23d078d5240e5b02dac8a449d1ddf79256a34d8\",\"dweb:/ipfs/QmbGk4tQzTogTBVYiT8t3Gqtk6qDs5nyp9Z53GryTjKAm5\"]},\"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.0 <0.9.0;\r\n\r\nimport \"./interfaces/IWitAppliance.sol\";\r\nimport \"./interfaces/IWitOracleQueriableConsumer.sol\";\r\nimport \"./interfaces/IWitRandomness.sol\";\r\n\r\nabstract contract WitRandomness\r\n is\r\n IWitAppliance,\r\n IWitOracleQueriableConsumer,\r\n IWitRandomness\r\n{\r\n function specs() virtual override external pure returns (bytes4) {\r\n return (\r\n type(IWitRandomness).interfaceId\r\n );\r\n }\r\n}\r\n",
"sourcePath": "C:\\Users\\guill\\github\\guidiaz\\witnet-solidity-bridge\\contracts\\WitRandomness.sol",
"ast": {
"absolutePath": "project:/contracts/WitRandomness.sol",
"exportedSymbols": {
"Bech32": [
31372
],
"IWitAppliance": [
26514
],
"IWitOracleQueriable": [
26795
],
"IWitOracleQueriableConsumer": [
26815
],
"IWitRandomness": [
28351
],
"IWitRandomnessAdmin": [
28395
],
"IWitRandomnessConsumer": [
28425
],
"IWitRandomnessEvents": [
28449
],
"IWitRandomnessTypes": [
28461
],
"Secp256k1": [
32535
],
"WitRandomness": [
879
],
"Witnet": [
40741
],
"WitnetBuffer": [
42631
],
"WitnetCBOR": [
44174
]
},
"id": 880,
"license": "MIT",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 856,
"literals": [
"solidity",
">=",
"0.8",
".0",
"<",
"0.9",
".0"
],
"nodeType": "PragmaDirective",
"src": "35:31:14"
},
{
"absolutePath": "project:/contracts/interfaces/IWitAppliance.sol",
"file": "./interfaces/IWitAppliance.sol",
"id": 857,
"nameLocation": "-1:-1:-1",
"nodeType": "ImportDirective",
"scope": 880,
"sourceUnit": 26515,
"src": "70:40:14",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "project:/contracts/interfaces/IWitOracleQueriableConsumer.sol",
"file": "./interfaces/IWitOracleQueriableConsumer.sol",
"id": 858,
"nameLocation": "-1:-1:-1",
"nodeType": "ImportDirective",
"scope": 880,
"sourceUnit": 26816,
"src": "112:54:14",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "project:/contracts/interfaces/IWitRandomness.sol",
"file": "./interfaces/IWitRandomness.sol",
"id": 859,
"nameLocation": "-1:-1:-1",
"nodeType": "ImportDirective",
"scope": 880,
"sourceUnit": 28352,
"src": "168:41:14",
"symbolAliases": [],
"unitAlias": ""
},
{
"abstract": true,
"baseContracts": [
{
"baseName": {
"id": 860,
"name": "IWitAppliance",
"nameLocations": [
"262:13:14"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 26514,
"src": "262:13:14"
},
"id": 861,
"nodeType": "InheritanceSpecifier",
"src": "262:13:14"
},
{
"baseName": {
"id": 862,
"name": "IWitOracleQueriableConsumer",
"nameLocations": [
"286:27:14"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 26815,
"src": "286:27:14"
},
"id": 863,
"nodeType": "InheritanceSpecifier",
"src": "286:27:14"
},
{
"baseName": {
"id": 864,
"name": "IWitRandomness",
"nameLocations": [
"324:14:14"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 28351,
"src": "324:14:14"
},
"id": 865,
"nodeType": "InheritanceSpecifier",
"src": "324:14:14"
}
],
"canonicalName": "WitRandomness",
"contractDependencies": [],
"contractKind": "contract",
"fullyImplemented": false,
"id": 879,
"linearizedBaseContracts": [
879,
28351,
28461,
28449,
28395,
26815,
26514
],
"name": "WitRandomness",
"nameLocation": "231:13:14",
"nodeType": "ContractDefinition",
"nodes": [
{
"baseFunctions": [
26478
],
"body": {
"id": 877,
"nodeType": "Block",
"src": "412:84:14",
"statements": [
{
"expression": {
"components": [
{
"expression": {
"arguments": [
{
"id": 872,
"name": "IWitRandomness",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 28351,
"src": "450:14:14",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IWitRandomness_$28351_$",
"typeString": "type(contract IWitRandomness)"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_type$_t_contract$_IWitRandomness_$28351_$",
"typeString": "type(contract IWitRandomness)"
}
],
"id": 871,
"name": "type",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 4294967269,
"src": "445:4:14",
"typeDescriptions": {
"typeIdentifier": "t_function_metatype_pure$__$returns$__$",
"typeString": "function () pure"
}
},
"id": 873,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "functionCall",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "445:20:14",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_magic_meta_type_t_contract$_IWitRandomness_$28351",
"typeString": "type(contract IWitRandomness)"
}
},
"id": 874,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"memberLocation": "466:11:14",
"memberName": "interfaceId",
"nodeType": "MemberAccess",
"src": "445:32:14",
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
}
}
],
"id": 875,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "430:58:14",
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
}
},
"functionReturnParameters": 870,
"id": 876,
"nodeType": "Return",
"src": "423:65:14"
}
]
},
"functionSelector": "adb7c3f7",
"id": 878,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "specs",
"nameLocation": "356:5:14",
"nodeType": "FunctionDefinition",
"overrides": {
"id": 867,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "372:8:14"
},
"parameters": {
"id": 866,
"nodeType": "ParameterList",
"parameters": [],
"src": "361:2:14"
},
"returnParameters": {
"id": 870,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 869,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 878,
"src": "404:6:14",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
},
"typeName": {
"id": 868,
"name": "bytes4",
"nodeType": "ElementaryTypeName",
"src": "404:6:14",
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
}
},
"visibility": "internal"
}
],
"src": "403:8:14"
},
"scope": 879,
"src": "347:149:14",
"stateMutability": "pure",
"virtual": true,
"visibility": "external"
}
],
"scope": 880,
"src": "213:286:14",
"usedErrors": [],
"usedEvents": [
28439,
28448
]
}
],
"src": "35:466:14"
},
"compiler": {
"name": "solc",
"version": "0.8.30+commit.73712a01.Emscripten.clang"
},
"networks": {
"84532": {
"events": {},
"links": {},
"address": "0xC0FFee84CC8a7A033B55fFc0cc6Bf3087136d391"
},
"11142220": {
"events": {},
"links": {},
"address": "0xC0FFEE00B76e0E48b967f2963ae6190dA32a536C"
},
"11155111": {
"events": {},
"links": {},
"address": "0xC0FFee84CC8a7A033B55fFc0cc6Bf3087136d391"
},
"11155420": {
"events": {},
"links": {},
"address": "0xC0FFee84CC8a7A033B55fFc0cc6Bf3087136d391"
}
},
"schemaVersion": "3.4.16",
"updatedAt": "2025-10-15T14:34:45.329Z",
"devdoc": {
"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 rando