Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,13 @@ export PRIVATE_KEY=<your private key from above>
export RPC_URL="https://sepolia.optimism.io"
```

Next, use the [Superchain Faucet](https://app.optimism.io/faucet?utm_source=docs) to claim some test Sepolia ETH. Paste the address from the command above into the faucet to get your ETH. You can verify that the ETH has arrived in your wallet by running the command
Next, use the [Superchain Faucet](https://console.optimism.io/faucet) to claim some test Sepolia ETH. Paste the address from the command above into the faucet to get your ETH. You can verify that the ETH has arrived in your wallet by running the command

```bash copy
cast balance $ADDRESS -r $RPC_URL -e
```

The final step before deploying is to get the arguments for the contract's constructor: the [Entropy contract address](./entropy/chainlist) for Optimism Sepolia and [the Provider address](./entropy/chainlist). We will also export these values as environment variables for convenience:
The final step before deploying is to get the arguments for the contract's constructor: the [Entropy contract address](./chainlist) for Optimism Sepolia and [the Provider address](./chainlist). We will also export these values as environment variables for convenience:

```bash copy
export ENTROPY_ADDRESS=0x4821932D0CDd71225A6d914706A621e0389D7061
Expand Down Expand Up @@ -324,5 +324,5 @@ Congratulations! You've built your first app using Entropy. In this tutorial, we

You can learn more about Entropy from the following links:

- [Protocol Design](./entropy/protocol-design)
- [How to Transform Entropy Results](./entropy/transform-entropy-results)
- [Protocol Design](./protocol-design)
- [How to Transform Entropy Results](./transform-entropy-results)
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function revealWithCallback(
```

This call requires the chain ID, contract address, and four other arguments.
The chain ID and contract address can be retrieved from [Chainlist and Fee Details](./entropy/chainlist) page.
The chain ID and contract address can be retrieved from [Chainlist and Fee Details](./chainlist) page.
Export these values as environment variables for later use:

```bash copy
Expand Down Expand Up @@ -62,10 +62,10 @@ There are a few common issues that can cause the callback to fail.

### Gas Limit Exceeded

If your callback function uses too much gas, the transaction will fail. Check the gas limit for your chain on the [chainlist](./entropy/chainlist) page and ensure your callback function uses less gas.
If your callback function uses too much gas, the transaction will fail. Check the gas limit for your chain on the [chainlist](./chainlist) page and ensure your callback function uses less gas.

> 💡 **Tip**
> Refer to the [Set Custom Gas Limits](./entropy/set-custom-gas-limits) guide to set a custom gas limit for your callback function.
> Refer to the [Set Custom Gas Limits](./set-custom-gas-limits) guide to set a custom gas limit for your callback function.

### Callback Function Errors

Expand All @@ -79,4 +79,4 @@ Your callback function might contain logic that throws an error. Review your cal
### Transaction Timing

Make sure you're attempting the callback after the reveal delay has passed. The reveal delay varies by network and helps prevent MEV attacks.
Refer to the [chainlist](./entropy/chainlist) page for the reveal delay for each network.
Refer to the [chainlist](./chainlist) page for the reveal delay for each network.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ The Solidity SDK exports two interfaces:
- [`IEntropyConsumer`](https://github.com/pyth-network/pyth-crosschain/blob/main/target_chains/ethereum/entropy_sdk/solidity/IEntropyConsumer.sol) - The interface that your contract should implement. It makes sure that your contract is compliant with the Entropy contract.
- [`IEntropyV2`](https://github.com/pyth-network/pyth-crosschain/blob/main/target_chains/ethereum/entropy_sdk/solidity/IEntropyV2.sol) - The interface to interact with the Entropy contract.
You will need the address of an Entropy contract on your blockchain.
Consult the current [Entropy contract addresses](./entropy/chainlist) to find the address on your chain.
Consult the current [Entropy contract addresses](./chainlist) to find the address on your chain.
Once you have a contract address, instantiate an `console.log("IEntropyV2"){:bash}` contract in your solidity contract:

```solidity copy
Expand Down Expand Up @@ -70,7 +70,7 @@ Invoke the [`requestV2`](https://github.com/pyth-network/pyth-crosschain/blob/ma
The `console.log("requestV2"){:bash}` method requires paying a fee in native gas tokens which is configured per-provider.

The fee differs for every chain and also varies over time depending on the chain's current gas price.
The current value for each chain can be found on the [chainlist and fee details](./entropy/chainlist) page.
The current value for each chain can be found on the [chainlist and fee details](./chainlist) page.
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{:bash}` call.

These methods use the default randomness provider.
Expand All @@ -84,7 +84,7 @@ function requestRandomNumber() external payable {

This method returns a sequence number and emits a [`Requested`](https://github.com/pyth-network/pyth-crosschain/blob/main/target_chains/ethereum/entropy_sdk/solidity/EntropyEventsV2.sol#L30) event. You can store this sequence number to identify the request in next step.

Note that there are several variants of `requestV2` that allow the caller to configure the provider fulfilling the request and the gas limit for the callback. Refer [request callback variants](./entropy/request-callback-variants) for more details.
Note that there are several variants of `requestV2` that allow the caller to configure the provider fulfilling the request and the gas limit for the callback. Refer [request callback variants](./request-callback-variants) for more details.

Please see the method documentation in the [IEntropyV2 interface](https://github.com/pyth-network/pyth-crosschain/blob/main/target_chains/ethereum/entropy_sdk/solidity/IEntropyV2.sol).

Expand Down Expand Up @@ -151,7 +151,7 @@ When the final random number is ready to use, the entropyCallback function will
The `entropyCallback` function on your contract should **never** return an
error. If it returns an error, the keeper will not be able to invoke the
callback. If you are having problems receiving the callback, please see
[Debugging Callback Failures](./entropy/debug-callback-failures).
[Debugging Callback Failures](./debug-callback-failures).
</Callout>

## Additional Resources
Expand All @@ -160,19 +160,19 @@ You may find these additional resources helpful while integrating Pyth Entropy i

### Debug Callback Failures

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

### Pyth Entropy Contract Addresses

Consult the [Entropy contract addresses](./entropy/chainlist) to find the Entropy contract address on your chain.
Consult the [Entropy contract addresses](./chainlist) to find the Entropy contract address on your chain.

### Current Fees

Check the [Current Fees](./entropy/current-fees) to find the current fee for each provider on your chain.
Check the [chainlist and fee details](./chainlist) to find the current fee for each provider on your chain.

### Transform Entropy Results

Check out the [Transform Entropy Results](./entropy/transform-entropy-results) guide for tips to limit gas usage, or generate multiple random numbers in a single transaction.
Check out the [Transform Entropy Results](./transform-entropy-results) guide for tips to limit gas usage, or generate multiple random numbers in a single transaction.

### Randomness providers

Expand Down
2 changes: 1 addition & 1 deletion apps/developer-hub/content/docs/entropy/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"error-codes",
"[Example Applications](https://github.com/pyth-network/pyth-examples/tree/main/entropy)",
"[Entropy Explorer](https://entropy-explorer.pyth.network/)",
"[Fortuna API Reference](/openapi/fortuna)",
"![Fortuna API Reference](/openapi/fortuna)",
"---Understanding Entropy---",
"protocol-design",
"fees"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ icon: Gauge

import { Step, Steps } from "fumadocs-ui/components/steps";

Custom gas limits are useful when your callback function requires more gas than the [default provider limit](./entropy/chainlist), or when you want to optimize gas costs for simpler callbacks.
Custom gas limits are useful when your callback function requires more gas than the [default provider limit](./chainlist), or when you want to optimize gas costs for simpler callbacks.

## Prerequisites

Before following this guide, you should first complete the basic setup from the [Generate Random Numbers in EVM Contracts](./entropy/generate-random-numbers-evm) guide. This guide builds upon that foundation and assumes you have:
Before following this guide, you should first complete the basic setup from the [Generate Random Numbers in EVM Contracts](./generate-random-numbers-evm) guide. This guide builds upon that foundation and assumes you have:

- Installed the Pyth Entropy Solidity SDK
- Set up your contract with the `IEntropyConsumer` interface
Expand Down Expand Up @@ -194,10 +194,10 @@ If you're experiencing issues with custom gas limits:
2. **High fees**: Consider optimizing your callback or using a lower gas limit
3. **Reverts**: Check that your gas limit doesn't exceed the maximum allowed

For more debugging help, see the [Debug Callback Failures](./entropy/debug-callback-failures) guide.
For more debugging help, see the [Debug Callback Failures](./debug-callback-failures) guide.

## Additional Resources

- [Generate Random Numbers in EVM Contracts](./entropy/generate-random-numbers-evm) - Basic setup guide
- [Transform Entropy Results](./entropy/transform-entropy-results) - General optimization tips
- [Contract Addresses and Fee Details](./entropy/chainlist) - Entropy contract deployments and fee details
- [Generate Random Numbers in EVM Contracts](./generate-random-numbers-evm) - Basic setup guide
- [Transform Entropy Results](./transform-entropy-results) - General optimization tips
- [Contract Addresses and Fee Details](./chainlist) - Entropy contract deployments and fee details
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Entropy v2 provides multiple ways to request random numbers:
- **Custom Provider**: Choose specific entropy providers
- **Full Control**: Specify all parameters (provider, gas limit, user random number)

Each of these request types is described in more detail with examples in [Request Callback Variants](./entropy/request-callback-variants).
Each of these request types is described in more detail with examples in [Request Callback Variants](./request-callback-variants).

### 2. Enhanced Callback Status

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import { Callout } from "fumadocs-ui/components/callout";
which is used to construct and deliver Pyth prices to other blockchains. If
you are building an application on EVM, Solana, SVM, or another chain, you
should use the Pyth program deployed on your target chain instead. Please
refer to the [Contract Addresses](/price-feeds/core/contract-addresses) page and
select your specific blockchain environment.
refer to the [Contract Addresses](/price-feeds/core/contract-addresses) page
and select your specific blockchain environment.
</Callout>

The following tables contain the addresses of the programs deployed on Pythnet environments that operate together to construct Pyth prices and deliver them to other blockchains:
Expand Down
Loading