# VORCoordinator
Coordinates on-chain verifiable-randomness requests
# Functions:
constructor(address _xfund, address _blockHashStore) public
getProviderAddress(bytes32 _keyHash) external
getProviderFee(bytes32 _keyHash) external
getProviderGranularFee(bytes32 _keyHash, address _consumer) external
registerProvingKey(uint256 _fee, address payable _oracle, uint256[2] _publicProvingKey) external
changeFee(uint256[2] _publicProvingKey, uint256 _fee) external
changeGranularFee(uint256[2] _publicProvingKey, uint256 _fee, address _consumer) external
withdraw(address _recipient, uint256 _amount) external
randomnessRequest(bytes32 _keyHash, uint256 _consumerSeed, uint256 _feePaid) external
hashOfKey(uint256[2] _publicKey) public
fulfillRandomnessRequest(bytes _proof) public
callBackWithRandomness(bytes32 requestId, uint256 randomness, address consumerContract) internal
getRandomnessFromProof(bytes _proof) internal
# Events:
RandomnessRequest(bytes32 keyHash, uint256 seed, address sender, uint256 fee, bytes32 requestID)
NewServiceAgreement(bytes32 keyHash, uint256 fee)
ChangeFee(bytes32 keyHash, uint256 fee)
ChangeGranularFee(bytes32 keyHash, address consumer, uint256 fee)
RandomnessRequestFulfilled(bytes32 requestId, uint256 output)
# Modifiers:
# Function constructor(address _xfund, address _blockHashStore) public
# Function getProviderAddress(bytes32 _keyHash) external -> address
getProviderAddress - get provider address
# Parameters:
_keyHash
: ID of the VOR public key
# Function getProviderFee(bytes32 _keyHash) external -> uint96
getProviderFee - get provider's base fee
# Parameters:
_keyHash
: ID of the VOR public key
# Function getProviderGranularFee(bytes32 _keyHash, address _consumer) external -> uint96
getProviderGranularFee - get provider's granular fee for selected consumer
# Parameters:
_keyHash
: ID of the VOR public key_consumer
: address of the consumer smart contract
# Function registerProvingKey(uint256 _fee, address payable _oracle, uint256[2] _publicProvingKey) external
No description
# Parameters:
_fee
: minimum xFUND payment required to serve randomness_oracle
: the address of the node with the proving key
# Function changeFee(uint256[2] _publicProvingKey, uint256 _fee) external
No description
# Parameters:
_publicProvingKey
: public key used to prove randomness
# Function changeGranularFee(uint256[2] _publicProvingKey, uint256 _fee, address _consumer) external
No description
# Parameters:
_publicProvingKey
: public key used to prove randomness
# Function withdraw(address _recipient, uint256 _amount) external
Allows the oracle operator to withdraw their xFUND
# Parameters:
_recipient
: is the address the funds will be sent to_amount
: is the amount of xFUND transferred from the Coordinator contract
# Function randomnessRequest(bytes32 _keyHash, uint256 _consumerSeed, uint256 _feePaid) external
_consumerSeed is mixed with key hash, sender address and nonce to obtain preSeed, which is passed to VOR oracle, which mixes it with the hash of the block containing this request, to compute the final seed.
The requestId used to store the request data is constructed from the preSeed and keyHash.
# Parameters:
_keyHash
: ID of the VOR public key against which to generate output_consumerSeed
: Input to the VOR, from which randomness is generated_feePaid
: Amount of xFUND sent with request. Must exceed fee for key
# Function hashOfKey(uint256[2] _publicKey) public -> bytes32
No description
# Parameters:
# Function fulfillRandomnessRequest(bytes _proof) public
No description
# Parameters:
# Function callBackWithRandomness(bytes32 requestId, uint256 randomness, address consumerContract) internal
# Function getRandomnessFromProof(bytes _proof) internal -> bytes32 currentKeyHash, struct VORCoordinator.Callback callback, bytes32 requestId, uint256 randomness
No description
# Event RandomnessRequest(bytes32 keyHash, uint256 seed, address sender, uint256 fee, bytes32 requestID)
# Event NewServiceAgreement(bytes32 keyHash, uint256 fee)
# Event ChangeFee(bytes32 keyHash, uint256 fee)
# Event ChangeGranularFee(bytes32 keyHash, address consumer, uint256 fee)
# Event RandomnessRequestFulfilled(bytes32 requestId, uint256 output)
No description
# Modifier sufficientXFUND(uint256 _feePaid, bytes32 _keyHash)
Reverts if amount is not at least what was agreed upon in the service agreement
# Parameters:
# Modifier hasAvailableFunds(uint256 _amount)
Reverts if amount requested is greater than withdrawable balance
# Parameters:
_amount
: The given amount to compare towithdrawableTokens