You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pages/entropy/generate-random-numbers/evm.mdx
+7-11Lines changed: 7 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -65,9 +65,11 @@ To generate a random number, follow these steps.
65
65
Invoke the [`requestV2`](https://github.com/pyth-network/pyth-crosschain/blob/main/target_chains/ethereum/entropy_sdk/solidity/IEntropy.sol#L83) method of the `IEntropyV2` contract.
66
66
The `requestV2` method requires paying a fee in native gas tokens which is configured per-provider.
67
67
68
-
The fees differs for every chain and also varies over time depending on the chain's current gas price.
68
+
The fee differs for every chain and also varies over time depending on the chain's current gas price.
69
69
The current value for each chain can be found on the [Current Fees](../current-fees) page.
70
-
However, you should use the on-chain method [`getFeeV2`](https://github.com/pyth-network/pyth-crosschain/blob/main/target_chains/ethereum/entropy_sdk/solidity/IEntropy.sol#L101) to compute the required fee and send it as the value of the `requestV2` call:
70
+
However, you should use the on-chain method [`getFeeV2`](https://github.com/pyth-network/pyth-crosschain/blob/main/target_chains/ethereum/entropy_sdk/solidity/IEntropy.sol#L101) to compute the required fee and send it as the value of the `requestV2` call.
71
+
72
+
These methods use the default randomness provider ([see here](#randomness-providers) for more info on providers).
71
73
72
74
```solidity copy
73
75
function requestRandomNumber() external payable {
@@ -162,18 +164,12 @@ Check the [Current Fees](../current-fees) to find the current fee for each provi
162
164
163
165
Check out the [Best Practices](../best-practices) guide for tips to limit gas usage, or generate multiple random numbers in a single transaction.
164
166
165
-
<Callouttype="info">
166
-
Entropy also requires selecting a **randomness provider**. The randomness provider is a third-party
167
+
### Randomness providers
168
+
Some methods on Entropy require selecting a **randomness provider**. The randomness provider is a third-party
167
169
who participates in the generation process. Each provider is identified by an address and hosts
168
170
a keeper service for fullfilling requests.
169
171
170
-
The simplest way to choose a provider is to use the [default provider](../contract-addresses).
171
-
The default provider for each contract and their corresponding URI is also listed in the
You can also get the default provider's address by calling the [`getDefaultProvider`](https://github.com/pyth-network/pyth-crosschain/blob/f8ebeb6af31d98f94ce73edade6da2ebab7b2456/target_chains/ethereum/entropy_sdk/solidity/IEntropy.sol#L94) method:
172
+
You can get the default provider's address by calling the [`getDefaultProvider`](https://github.com/pyth-network/pyth-crosschain/blob/f8ebeb6af31d98f94ce73edade6da2ebab7b2456/target_chains/ethereum/entropy_sdk/solidity/IEntropy.sol#L94) method:
0 commit comments