calculateRequestPriceNative
function calculateRequestPriceNative (uint256 callbackGasLimit ) external view returns (uint256 payment )
Calculate the payment for a given amount of gas using native currency
Name
Type
Description
callbackGasLimit
uint256
The amount of gas to provide for the callback
Name
Type
Description
payment
uint256
The amount to pay
function fulfillRandomWords (uint256 requestId , address consumer , uint256 callbackGasLimit , uint256 numWords , address refundee , uint256 gasPricePaid , uint256 [2 ] publicKey , uint256 [4 ] proof , uint256 [2 ] uPoint , uint256 [4 ] vComponents , uint8 proofCtr ) external nonpayable returns (bool callSuccess )
Fulfill the request for random words
Name
Type
Description
requestId
uint256
The ID of the request
consumer
address
The amount of gas fees paid to fulfill the request
callbackGasLimit
uint256
undefined
numWords
uint256
The number of words to fulfill
refundee
address
The address to refund the gas fees to
gasPricePaid
uint256
The gas price paid for the request
publicKey
uint256[2]
The public key of the oracle
proof
uint256[4]
The proof of the random words
uPoint
uint256[2]
The u EC point defined as U = s*B - c*Y
vComponents
uint256[4]
The components required to compute v as V = s*H - c*Gamma
proofCtr
uint8
The proof counter
Name
Type
Description
callSuccess
bool
If the fulfillment call succeeded
function isRequestPending (uint256 requestId ) external view returns (bool isPending )
Check to see if a request is pending
Name
Type
Description
requestId
uint256
The ID of the request
Name
Type
Description
isPending
bool
True if the request is pending, false otherwise/does not exist
requestRandomnessPayInNative
function requestRandomnessPayInNative (uint256 callbackGasLimit , uint256 numWords , address refundee ) external payable returns (uint256 requestId )
Request some random words
Name
Type
Description
callbackGasLimit
uint256
The amount of gas to provide for the callback
numWords
uint256
The number of words to request
refundee
address
The address to refund the gas fees to
Name
Type
Description
requestId
uint256
The ID of the request
event ConsumerCallbackFailed (uint256 indexed requestId , uint8 indexed reason , address indexed target , uint256 gasLeft )
Emitted when a consumer callback is not successful
Name
Type
Description
requestId indexed
uint256
undefined
reason indexed
uint8
undefined
target indexed
address
undefined
gasLeft
uint256
undefined
event FulfillmentGasRefunded (uint256 indexed requestId , address indexed refundee , uint256 gasRefunded , bool refundedSuccessfully )
Emitted when the excess gas is refunded to the refundee
Name
Type
Description
requestId indexed
uint256
undefined
refundee indexed
address
undefined
gasRefunded
uint256
undefined
refundedSuccessfully
bool
undefined
GasPriceHistoryWindowUpdated
event GasPriceHistoryWindowUpdated (uint256 newWindow )
Emitted whne the gas price history window is updated
Name
Type
Description
newWindow
uint256
undefined
event OracleRegistered (address indexed oracle )
Emitted when a new oracle is registered
Name
Type
Description
oracle indexed
address
undefined
RandomRequestLimitsUpdated
event RandomRequestLimitsUpdated (uint32 minimumGasLimit , uint32 maximumGasLimit , uint16 maxNumWords )
Emitted when request limits are updated
Name
Type
Description
minimumGasLimit
uint32
undefined
maximumGasLimit
uint32
undefined
maxNumWords
uint16
undefined
event RandomWordsFulfilled (uint256 indexed requestId , uint256 [] randomWords , address indexed oracle , bool callSuccess , uint256 fulfilledAt )
Emitted when PaintswapVRFCoordinator fulfills a request
Name
Type
Description
requestId indexed
uint256
undefined
randomWords
uint256[]
undefined
oracle indexed
address
undefined
callSuccess
bool
undefined
fulfilledAt
uint256
undefined
event RandomWordsRequested (uint256 indexed requestId , uint256 callbackGasLimit , uint256 numWords , address indexed origin , address indexed consumer , uint256 nonce , address refundee , uint256 gasPricePaid , uint256 requestedAt )
Emitted when a request is made to PaintswapVRFCoordinator
Name
Type
Description
requestId indexed
uint256
undefined
callbackGasLimit
uint256
undefined
numWords
uint256
undefined
origin indexed
address
undefined
consumer indexed
address
undefined
nonce
uint256
undefined
refundee
address
undefined
gasPricePaid
uint256
undefined
requestedAt
uint256
undefined
event RequestGasRefunded (uint256 indexed requestId , address indexed refundee , uint256 gasRefunded , bool refundedSuccessfully )
Emitted when excess gas payment is refunded to the refundee
Name
Type
Description
requestId indexed
uint256
undefined
refundee indexed
address
undefined
gasRefunded
uint256
undefined
refundedSuccessfully
bool
undefined
event SignerAddressUpdated (address indexed signerAddress )
Emitted when the signer address is updated
Name
Type
Description
signerAddress indexed
address
undefined
error CommitmentMismatch (uint256 requestId )
Revert when the fufillment call does not match the commitment
Name
Type
Description
requestId
uint256
undefined
error FundingFailed (address oracle , uint256 amount )
Revert when funding has failed
Name
Type
Description
oracle
address
undefined
amount
uint256
undefined
error InsufficientGasLimit (uint256 sent , uint256 required )
Revert when the request has an insufficient gas limit to fulfill
Name
Type
Description
sent
uint256
undefined
required
uint256
undefined
error InsufficientGasPayment (uint256 sent , uint256 required )
Revert when the payment is too low for the requested gas limit
Name
Type
Description
sent
uint256
undefined
required
uint256
undefined
InsufficientOracleBalance
error InsufficientOracleBalance (address oracle , uint256 balance )
Revert when the oracle has an insufficient balance
Name
Type
Description
oracle
address
undefined
balance
uint256
undefined
InvalidGasPriceHistoryWindow
error InvalidGasPriceHistoryWindow (uint256 window )
Revert when the gas price history is invalid
Name
Type
Description
window
uint256
undefined
error InvalidNumWords (uint256 numWords , uint256 max )
Revert when the request has an invalid number of words
Name
Type
Description
numWords
uint256
undefined
max
uint256
undefined
error InvalidProof (uint256 requestId )
Revert when the proof is invalid
Name
Type
Description
requestId
uint256
undefined
error InvalidPublicKey (uint256 requestId , address proofSigner , address vrfSigner )
Revert when the oracle has an invalid public key
Name
Type
Description
requestId
uint256
undefined
proofSigner
address
undefined
vrfSigner
address
undefined
error NotOracle (address invalid )
Revert when the address is not an oracle
Name
Type
Description
invalid
address
undefined
error OracleAlreadyRegistered (address oracle )
Revert when the oracle is already registered
Name
Type
Description
oracle
address
undefined
error OverConsumerGasLimit (uint256 sent , uint256 max )
Revert when the consumer gas limit is too high
Name
Type
Description
sent
uint256
undefined
max
uint256
undefined
error WithdrawFailed (address recipient , uint256 amount )
Revert when the withdraw fails
Name
Type
Description
recipient
address
undefined
amount
uint256
undefined
Revert when submitted address is the zero address