Skip to content

Commit 18331c8

Browse files
committed
requested changes
1 parent aa31023 commit 18331c8

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# How to Generate Random Numbers
22

3-
Integrating Pyth Entropy requires a simple call an onchain function to request a random number from Entropy. The function takes a random number that one can generate offchain and pass it to the onchain function which returns a sequence number. Pyth Entropy will then callback your contract with the generated random number once the request is fulfilled.
3+
Integrating Pyth Entropy requires calling an onchain function to request a random number from Entropy. The function takes a random number that one can generate offchain and pass it to the Entropy contract which returns a sequence number. Pyth Entropy will then callback your contract with the generated random number once the request is fulfilled.
44

55
See [How to Generate Random numbers in EVM dApps](generate-random-numbers/evm.mdx) to integrate your application with Pyth Entropy.

pages/entropy/generate-random-numbers/evm.mdx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,13 @@ Entropy also requires selecting a **randomness provider**. The randomness provid
5656
who participates in the generation process. Each provider is identified by an address and hosts
5757
a keeper service for fullfilling requests.
5858

59-
The simplest way to choose a provider is to use the default provider called [**Fortuna**](https://github.com/pyth-network/pyth-crosschain/tree/main/apps/fortuna).
59+
The simplest way to choose a provider is to use the [default provider](../contract-addresses).
6060
The default provider for each contract and their corresponding URI is also listed in the
6161
[Entropy contract addresses](../contract-addresses).
6262

6363
</Callout>
6464

65-
You can also get the default provider's address by calling the [`getDefaultProvider`](https://github.com/pyth-network/pyth-crosschain/blob/main/target_chains/ethereum/entropy_sdk/solidity/IEntropy.sol#L94) method:
65+
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:
6666

6767
```solidity copy
6868
address provider = entropy.getDefaultProvider();
@@ -110,7 +110,7 @@ This method returns a sequence number and emits a [`RequestedWithCallback`](http
110110

111111
### 3. Implement callback for Entropy
112112

113-
```solidity {28-37} copy
113+
```solidity {28-38} copy
114114
pragma solidity ^0.8.0;
115115
116116
import { IEntropyConsumer } from "@pythnetwork/entropy-sdk-solidity/IEntropyConsumer.sol";
@@ -138,11 +138,12 @@ contract YourContract is IEntropyConsumer {
138138
// Store the sequence number to identify the callback request
139139
}
140140
141-
// It is called by the entropy contract when a random number is generated.
141+
// @param sequenceNumber The sequence number of the request.
142+
// @param provider The address of the provider that generated the random number. If your app uses multiple providers, you can use this argument to distinguish which one is calling the app back.
143+
// @param randomNumber The generated random number.
144+
// This method is called by the entropy contract when a random number is generated.
142145
function entropyCallback(
143146
uint64 sequenceNumber,
144-
// If your app uses multiple providers, you can use this argument to
145-
// distinguish which one is calling the app back.
146147
address provider,
147148
bytes32 randomNumber
148149
) internal override {
@@ -168,7 +169,7 @@ You may find these additional resources helpful while integrating Pyth Entropy i
168169

169170
### Debug Callback Failures
170171

171-
Check how to [Debug Callback Failures](/entropy/debug-callback-failures) if you are having trouble getting the callback to run.
172+
Check how to [Debug Callback Failures](../debug-callback-failures) if you are having trouble getting the callback to run.
172173

173174
### Pyth Entropy Contract Addresses
174175

@@ -180,4 +181,4 @@ Check the [Current Fees](../current-fees) to find the current fee for each provi
180181

181182
### Best Practices
182183

183-
Check out the [Best Practices](/entropy/best-practices) guide for tips to limit gas usage, or generate multiple random numbers in a single transaction.
184+
Check out the [Best Practices](../best-practices) guide for tips to limit gas usage, or generate multiple random numbers in a single transaction.

0 commit comments

Comments
 (0)