Skip to content

Commit 30dde95

Browse files
authored
Merge branch 'main' into fix-market-hours
2 parents 02b7a06 + dcfddd8 commit 30dde95

File tree

21 files changed

+303
-98
lines changed

21 files changed

+303
-98
lines changed

.github/pull_request_template.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
## Description
2+
3+
<!-- Provide a clear and concise description of your documentation changes -->
4+
5+
## Type of Change
6+
7+
<!-- Check relevant options by putting an x in the brackets -->
8+
9+
- [ ] New Page
10+
- [ ] Page update/improvement
11+
- [ ] Fix typo/grammar
12+
- [ ] Restructure/reorganize content
13+
- [ ] Update links/references
14+
- [ ] Other (please describe):
15+
16+
## Areas Affected
17+
18+
## <!-- List the documentation sections/pages that have been modified -->
19+
20+
## Checklist
21+
22+
<!-- Check items by putting an x in the brackets -->
23+
24+
- [ ] I ran `pre-commit run --all-files` to check for linting errors
25+
- [ ] I have reviewed my changes for clarity and accuracy
26+
- [ ] All links are valid and working
27+
- [ ] Images (if any) are properly formatted and include alt text
28+
- [ ] Code examples (if any) are complete and functional
29+
- [ ] Content follows the established style guide
30+
- [ ] Changes are properly formatted in Markdown
31+
- [ ] Preview renders correctly in development environment
32+
33+
## Related Issues
34+
35+
<!-- Link any related issues using #issue_number -->
36+
37+
Closes #
38+
39+
## Additional Notes
40+
41+
<!-- Add any other context about your documentation changes -->
42+
43+
## Contributor Information
44+
45+
<!-- Please provide your contact information -->
46+
47+
- Name:
48+
- Email:
49+
50+
## Screenshots
51+
52+
<!-- If applicable, add screenshots to help explain your changes -->

components/EntropyDeployments.tsx

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -135,15 +135,6 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
135135
gasLimit: "2.5M",
136136
nativeCurrency: "ETH",
137137
},
138-
"fantom-sonic": {
139-
rpc: "https://rpc.testnet.soniclabs.com",
140-
network: "testnet",
141-
delay: "",
142-
address: "0x5124FAE0890dE83B3bb2cc30Bb3EDAfFc07Da744",
143-
explorer: "https://testnet.soniclabs.com/address/$ADDRESS",
144-
gasLimit: "500K",
145-
nativeCurrency: "S",
146-
},
147138
"blast-testnet": {
148139
rpc: "https://sepolia.blast.io",
149140
network: "testnet",
@@ -289,12 +280,12 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
289280
nativeCurrency: "KLAY",
290281
},
291282
"tabi-testnet": {
292-
address: "0x36825bf3Fbdf5a29E2d5148bfe7Dcf7B5639e320",
293-
explorer: "https://testnet.tabiscan.com/address/$ADDRESS",
283+
address: "0xEbe57e8045F2F230872523bbff7374986E45C486",
284+
explorer: "https://testnetv2.tabiscan.com/address/$ADDRESS",
294285
delay: "",
295286
gasLimit: "500K",
296287
network: "testnet",
297-
rpc: "https://rpc-internal.testnet.tabichain.com/",
288+
rpc: "https://rpc.testnetv2.tabichain.com",
298289
nativeCurrency: "TABI",
299290
},
300291
"b3-testnet": {
@@ -369,7 +360,7 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
369360
rpc: "https://api.testnet.abs.xyz",
370361
nativeCurrency: "ETH",
371362
},
372-
"fantom-sonic-devnet": {
363+
"sonic-fantom-testnet": {
373364
address: "0xebe57e8045f2f230872523bbff7374986e45c486",
374365
explorer: "https://blaze.soniclabs.com/address/$ADDRESS",
375366
delay: "",
@@ -387,4 +378,13 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
387378
rpc: "https://sepolia.unichain.org",
388379
nativeCurrency: "ETH",
389380
},
381+
"sonic-fantom": {
382+
address: "0x36825bf3fbdf5a29e2d5148bfe7dcf7b5639e320",
383+
explorer: "https://sonicscan.org/address/$ADDRESS",
384+
delay: "1 block",
385+
gasLimit: "500K",
386+
network: "mainnet",
387+
rpc: "https://rpc.soniclabs.com",
388+
nativeCurrency: "S",
389+
},
390390
};

pages/benchmarks/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Benchmarks
22

3-
Pyth benchmarks allows users to query a historical archive of prices from [Price Feeds](price-feeds).
3+
Pyth Benchmarks allows users to query a historical archive of prices from [Price Feeds](price-feeds).
44
For example, applications can retrieve the price of BTC/USD as of last Friday at 8:00 AM UTC.
55
This price can be used for contract settlement or any other application that requires historical price data.
66
Benchmarks data is signed and verifiable on-chain with the same trust assumptions as Price Feeds.

pages/entropy/_meta.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"href": "https://fortuna.dourolabs.app/docs/",
3939
"newWindow": true
4040
},
41+
"error-codes": "Error Codes",
4142
"examples": "Example Applications",
4243

4344
"-- Understanding Entropy": {

pages/entropy/debug-callback-failures.mdx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Debug Callback Failures
22

3+
import { Callout } from "nextra/components";
4+
35
This guide explains how to identify and resolve issues with the Entropy callback.
46
The intended audience for this guide is developers who have made an Entropy random number request, but their application hasn't received a callback.
57

@@ -57,7 +59,11 @@ Retrieve the `/v1/chains/$CHAIN_ID/revelations/$SEQUENCE_NUMBER` endpoint from t
5759
curl https://fortuna.dourolabs.app/v1/chains/$CHAIN_ID/revelations/$SEQUENCE_NUMBER
5860
```
5961

60-
N.B. The chain ID is the string name of the chain and not the EVM chain ID. The chain ids are available [here](https://fortuna.dourolabs.app/docs/#/crate%3A%3Aapi/chain_ids)
62+
<Callout type="warning" emoji="⚠️">
63+
The chain ID is the string name of the chain and not the EVM chain ID. The
64+
chain ids are available
65+
[here](https://fortuna.dourolabs.app/docs/#/crate%3A%3Aapi/chain_ids).
66+
</Callout>
6167

6268
This endpoint will return the provider's revelation as a hexadecimal value, such as:
6369

pages/entropy/error-codes.mdx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Error Codes
2+
3+
The following table contains the errors used in the Pyth Network's Entropy [EVM contracts](https://github.com/pyth-network/pyth-crosschain/blob/d290f4ec47a73636cf77711f5f68c3455bb8a8ca/target_chains/ethereum/contracts/contracts/entropy/Entropy.sol).
4+
This information is derived from [EntropyErrors.sol](https://github.com/pyth-network/pyth-crosschain/blob/d290f4ec47a73636cf77711f5f68c3455bb8a8ca/target_chains/ethereum/entropy_sdk/solidity/EntropyErrors.sol)
5+
in the Pyth EntropySDK and can be used to decode error codes programmatically.
6+
7+
| Error Codes | Error | Error Description |
8+
| ----------- | --------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
9+
| 0xd82dd966 | AssertionFailure() | Contract invariant failed. |
10+
| 0xda041bdf | ProviderAlreadyRegistered() | Provider already registered. |
11+
| 0xdf51c431 | NoSuchProvider() | Requested Provider does not exist. |
12+
| 0xc4237352 | NoSuchRequest() | Request does not exist or the request has been fulfilled. |
13+
| 0x3e515085 | OutOfRandomness() | Provider is out of committed random numbers. |
14+
| 0x025dbdd4 | InsufficientFee() | Request fee is insufficient. |
15+
| 0xb8be1a8d | IncorrectRevelation() | Revelation does not match commitment. |
16+
| 0xb463ce7a | InvalidUpgradeMagic() | Governance message is invalid. |
17+
| 0x82b42900 | Unauthorized() | `msg.sender` is not allowed to invoke this method. |
18+
| 0x92555c0e | BlockhashUnavailable() | Blockhash is unavailable. |
19+
| 0x50f0dc92 | InvalidRevealCall() | Invalid reveal call method. If a request was made using `requestWithCallback`, request should be fulfilled using `revealWithCallback`else if a request was made using `request`, request should be fulfilled using `reveal` |
20+
| 0xb28d9c76 | LastRevealedTooOld() | Last random number revealed is too old. |
21+
| 0x5e5b3f1b | UpdateTooOld() | More recent commitment already revealed on-chain. |

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

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ This method returns a sequence number and emits a [`RequestedWithCallback`](http
119119

120120
### 3. Implement callback for Entropy
121121

122-
```solidity {28-38} copy
122+
```solidity {28-42} copy
123123
pragma solidity ^0.8.0;
124124
125125
import { IEntropyConsumer } from "@pythnetwork/entropy-sdk-solidity/IEntropyConsumer.sol";
@@ -151,6 +151,10 @@ contract YourContract is IEntropyConsumer {
151151
// @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.
152152
// @param randomNumber The generated random number.
153153
// This method is called by the entropy contract when a random number is generated.
154+
// This method **must** be implemented on the same contract that requested the random number.
155+
// This method should **never** return an error -- if it returns an error, then the keeper will not be able to invoke the callback.
156+
// If you are having problems receiving the callback, the most likely cause is that the callback is erroring.
157+
// See the callback debugging guide here to identify the error https://docs.pyth.network/entropy/debug-callback-failures
154158
function entropyCallback(
155159
uint64 sequenceNumber,
156160
address provider,
@@ -170,7 +174,12 @@ contract YourContract is IEntropyConsumer {
170174

171175
When the final random number is ready to use, the entropyCallback function will be called by the Entropy contract. This will happen in a separate transaction submitted by the requested provider.
172176

173-
**The entropyCallback function should be implemented in the same contract that is requesting the random number.**
177+
<Callout type="warning" emoji="⚠️">
178+
The `entropyCallback` function should **never** return an error. If it returns
179+
an error, the keeper will not be able to invoke the callback. If you are
180+
having problems receiving the callback, please see [Debugging Callback
181+
Failures](/entropy/debug-callback-failures).
182+
</Callout>
174183

175184
## Additional Resources
176185

pages/express-relay/integrate-as-searcher/evm.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ Pyth provides a Typescript SDK, which allows searchers to subscribe to opportuni
1717
```typescript
1818
import { Client, Opportunity } from "@pythnetwork/express-relay-js";
1919

20-
const handleOpporunity = async (opportunity: Opportunity) => {
20+
const handleOpportunity = async (opportunity: Opportunity) => {
2121
// Implement your opportunity handler here
2222
};
2323

2424
const client = new Client(
2525
{ baseUrl: "https://pyth-express-relay-mainnet.asymmetric.re" },
2626
undefined, // Default WebSocket options
27-
handleOpporunity
27+
handleOpportunity
2828
);
2929
await client.subscribeChains(["op_sepolia"]);
3030
```
@@ -175,7 +175,7 @@ Searchers can submit the constructed bids to Express Relay via the SDKs, an HTTP
175175
The code snippet below demonstrates how to submit a bid using the Typescript SDK:
176176

177177
```typescript {4} copy
178-
const handleOpporunity = async (opportunity: Opportunity) => {
178+
const handleOpportunity = async (opportunity: Opportunity) => {
179179
...
180180
const bid = await client.signBid(opportunity, {amount, nonce, deadline}, privateKey)
181181
await client.submitBid(bid)

0 commit comments

Comments
 (0)