ScaledEntropyProvider
State Variables
Variable
Type
Description
Structs
SetRequest
struct SetRequest {
uint8 samples; // Number of random values to generate
uint256 minRange; // Minimum value (inclusive)
uint256 maxRange; // Maximum value (inclusive)
bool withReplacement; // Allow duplicate values
}PendingRequest (internal)
struct PendingRequest {
address callback; // Contract to call with results
bytes4 selector; // Function selector for callback
bytes context; // Additional data for callback
bytes32 userRandomNumber; // User-provided randomness
SetRequest[] setRequests; // Randomness specifications
}Events
ScaledRandomnessDelivered
EntropyFulfilled
Functions
getFee
Name
Type
Description
Type
Description
getEntropyContract
Type
Description
getEntropyProvider
Type
Description
getPendingRequest
Name
Type
Description
Type
Description
How Pyth Entropy Works
Request Flow
Lottery Drawing Example
Randomness Methods
Fisher-Yates Shuffle
Rejection Sampling
Security Properties
Cryptographic Security
Bias Prevention
Provable Fairness
Last updated
