Skip to content

Commit fae7b07

Browse files
authored
chore(entropy) Refactor guide (#437)
* chore(entropy) Refactor guide * imporvements * requested changes
1 parent 1defedd commit fae7b07

File tree

5 files changed

+172
-48
lines changed

5 files changed

+172
-48
lines changed

components/EntropyDeployments.tsx

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export interface EntropyDeployment {
55
delay: string;
66
gasLimit: string;
77
rpc: string;
8+
nativeCurrency: string;
89
}
910

1011
export const EntropyDeployments: Record<string, EntropyDeployment> = {
@@ -15,6 +16,7 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
1516
delay: "1 block",
1617
gasLimit: "500K",
1718
rpc: "https://rpc.blast.io",
19+
nativeCurrency: "ETH",
1820
},
1921
"lightlink-phoenix": {
2022
address: "0x98046Bd286715D3B0BC227Dd7a956b83D8978603",
@@ -23,6 +25,7 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
2325
delay: "1 block",
2426
gasLimit: "500K",
2527
rpc: "https://replicator.phoenix.lightlink.io/rpc/v1",
28+
nativeCurrency: "ETH",
2629
},
2730
chiliz: {
2831
address: "0x0708325268dF9F66270F1401206434524814508b",
@@ -31,6 +34,7 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
3134
delay: "12 blocks",
3235
gasLimit: "500K",
3336
rpc: "https://rpc.ankr.com/chiliz",
37+
nativeCurrency: "CHZ",
3438
},
3539
arbitrum: {
3640
address: "0x7698E925FfC29655576D0b361D75Af579e20AdAc",
@@ -39,6 +43,7 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
3943
delay: "6 blocks",
4044
gasLimit: "2.5M",
4145
rpc: "https://arb1.arbitrum.io/rpc",
46+
nativeCurrency: "ETH",
4247
},
4348
optimism: {
4449
address: "0xdF21D137Aadc95588205586636710ca2890538d5",
@@ -47,6 +52,7 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
4752
delay: "2 blocks",
4853
gasLimit: "500K",
4954
rpc: "https://rpc.ankr.com/optimism",
55+
nativeCurrency: "ETH",
5056
},
5157
mode: {
5258
address: "0x8D254a21b3C86D32F7179855531CE99164721933",
@@ -55,6 +61,7 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
5561
delay: "2 blocks",
5662
gasLimit: "500K",
5763
rpc: "https://mainnet.mode.network/",
64+
nativeCurrency: "ETH",
5865
},
5966
zetachain: {
6067
address: "0x36825bf3Fbdf5a29E2d5148bfe7Dcf7B5639e320",
@@ -63,6 +70,7 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
6370
delay: "0 block",
6471
gasLimit: "500K",
6572
rpc: "https://zetachain-evm.blockpi.network/v1/rpc/public",
73+
nativeCurrency: "ZETA",
6674
},
6775
base: {
6876
address: "0x6E7D74FA7d5c90FEF9F0512987605a6d546181Bb",
@@ -71,6 +79,7 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
7179
delay: "1 block",
7280
gasLimit: "500K",
7381
rpc: "https://developer-access-mainnet.base.org/",
82+
nativeCurrency: "ETH",
7483
},
7584
"lightlink-pegasus": {
7685
rpc: "https://replicator.pegasus.lightlink.io/rpc/v1",
@@ -79,6 +88,7 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
7988
address: "0x8250f4aF4B972684F7b336503E2D6dFeDeB1487a",
8089
explorer: "https://pegasus.lightlink.io/address/$ADDRESS",
8190
gasLimit: "500K",
91+
nativeCurrency: "ETH",
8292
},
8393
"chiliz-spicy": {
8494
rpc: "https://spicy-rpc.chiliz.com",
@@ -87,6 +97,7 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
8797
address: "0xD458261E832415CFd3BAE5E416FdF3230ce6F134",
8898
explorer: "https://spicy-explorer.chiliz.com/address/$ADDRESS",
8999
gasLimit: "500K",
100+
nativeCurrency: "CHZ",
90101
},
91102
"conflux-espace-testnet": {
92103
rpc: "https://evmtestnet.confluxrpc.com",
@@ -95,6 +106,7 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
95106
address: "0xdF21D137Aadc95588205586636710ca2890538d5",
96107
explorer: "https://evmtestnet.confluxscan.io/address/$ADDRESS",
97108
gasLimit: "500K",
109+
nativeCurrency: "CFX",
98110
},
99111
"mode-sepolia": {
100112
rpc: "https://sepolia.mode.network/",
@@ -103,6 +115,7 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
103115
address: "0x98046Bd286715D3B0BC227Dd7a956b83D8978603",
104116
explorer: "https://sepolia.explorer.mode.network/address/$ADDRESS",
105117
gasLimit: "500K",
118+
nativeCurrency: "ETH",
106119
},
107120
"sei-evm-testnet": {
108121
rpc: "https://evm-rpc-testnet.sei-apis.com",
@@ -111,6 +124,7 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
111124
address: "0x36825bf3Fbdf5a29E2d5148bfe7Dcf7B5639e320",
112125
explorer: "https://seitrace.com/address/$ADDRESS?chain=atlantic-2",
113126
gasLimit: "500K",
127+
nativeCurrency: "SEI",
114128
},
115129
"arbitrum-sepolia": {
116130
rpc: "https://sepolia-rollup.arbitrum.io/rpc",
@@ -119,6 +133,7 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
119133
address: "0x549Ebba8036Ab746611B4fFA1423eb0A4Df61440",
120134
explorer: "https://sepolia.arbiscan.io/address/$ADDRESS",
121135
gasLimit: "2.5M",
136+
nativeCurrency: "ETH",
122137
},
123138
"fantom-sonic": {
124139
rpc: "https://rpc.testnet.soniclabs.com",
@@ -127,6 +142,7 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
127142
address: "0x5124FAE0890dE83B3bb2cc30Bb3EDAfFc07Da744",
128143
explorer: "https://testnet.soniclabs.com/address/$ADDRESS",
129144
gasLimit: "500K",
145+
nativeCurrency: "S",
130146
},
131147
"blast-testnet": {
132148
rpc: "https://sepolia.blast.io",
@@ -135,6 +151,7 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
135151
address: "0x98046Bd286715D3B0BC227Dd7a956b83D8978603",
136152
explorer: "https://testnet.blastscan.io/address/$ADDRESS",
137153
gasLimit: "500K",
154+
nativeCurrency: "ETH",
138155
},
139156
"optimism-sepolia": {
140157
rpc: "https://sepolia.optimism.io",
@@ -143,6 +160,7 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
143160
address: "0x4821932D0CDd71225A6d914706A621e0389D7061",
144161
explorer: "https://optimism-sepolia.blockscout.com/address/$ADDRESS",
145162
gasLimit: "500K",
163+
nativeCurrency: "ETH",
146164
},
147165
"base-sepolia": {
148166
rpc: "https://sepolia.base.org",
@@ -151,6 +169,7 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
151169
address: "0x41c9e39574F40Ad34c79f1C99B66A45eFB830d4c",
152170
explorer: "https://base-sepolia.blockscout.com/address/$ADDRESS",
153171
gasLimit: "500K",
172+
nativeCurrency: "ETH",
154173
},
155174
"berachain-testnet-v2": {
156175
rpc: "https://evm-rpc-bera.rhino-apis.com/",
@@ -159,6 +178,7 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
159178
address: "0x36825bf3Fbdf5a29E2d5148bfe7Dcf7B5639e320",
160179
explorer: "https://bartio.beratrail.io/address/$ADDRESS",
161180
gasLimit: "500K",
181+
nativeCurrency: "BERA",
162182
},
163183
"coredao-testnet": {
164184
rpc: "https://rpc.test.btcs.network",
@@ -167,6 +187,7 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
167187
address: "0xf0a1b566B55e0A0CB5BeF52Eb2a57142617Bee67",
168188
explorer: "https://scan.test.btcs.network/address/$ADDRESS",
169189
gasLimit: "500K",
190+
nativeCurrency: "tCORE",
170191
},
171192
"zetachain-testnet": {
172193
rpc: "https://zetachain-athens-evm.blockpi.network/v1/rpc/public",
@@ -175,6 +196,7 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
175196
address: "0x4374e5a8b9C22271E9EB878A2AA31DE97DF15DAF",
176197
explorer: "https://explorer.zetachain.com/address/$ADDRESS",
177198
gasLimit: "500K",
199+
nativeCurrency: "ZETA",
178200
},
179201
"taiko-hekla": {
180202
rpc: "https://rpc.hekla.taiko.xyz/",
@@ -183,6 +205,7 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
183205
address: "0x98046Bd286715D3B0BC227Dd7a956b83D8978603",
184206
explorer: "https://hekla.taikoscan.network/address/$ADDRESS",
185207
gasLimit: "500K",
208+
nativeCurrency: "ETH",
186209
},
187210
"orange-testnet": {
188211
address: "0x98046Bd286715D3B0BC227Dd7a956b83D8978603",
@@ -191,6 +214,7 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
191214
gasLimit: "500K",
192215
network: "testnet",
193216
rpc: "https://subnets.avax.network/orangetest/testnet/rpc",
217+
nativeCurrency: "JUICE",
194218
},
195219
"sei-evm-mainnet": {
196220
address: "0x98046Bd286715D3B0BC227Dd7a956b83D8978603",
@@ -199,6 +223,7 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
199223
gasLimit: "500K",
200224
network: "mainnet",
201225
rpc: "https://evm-rpc.sei-apis.com",
226+
nativeCurrency: "SEI",
202227
},
203228
merlin: {
204229
address: "0x36825bf3Fbdf5a29E2d5148bfe7Dcf7B5639e320",
@@ -207,6 +232,7 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
207232
gasLimit: "500K",
208233
network: "mainnet",
209234
rpc: "https://rpc.merlinchain.io",
235+
nativeCurrency: "BTC",
210236
},
211237
"merlin-testnet": {
212238
address: "0x5744Cbf430D99456a0A8771208b674F27f8EF0Fb",
@@ -215,6 +241,7 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
215241
gasLimit: "500K",
216242
network: "testnet",
217243
rpc: "https://testnet-rpc.merlinchain.io/",
244+
nativeCurrency: "BTC",
218245
},
219246
taiko: {
220247
address: "0x26DD80569a8B23768A1d80869Ed7339e07595E85",
@@ -223,6 +250,7 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
223250
gasLimit: "500K",
224251
network: "mainnet",
225252
rpc: "https://rpc.mainnet.taiko.xyz",
253+
nativeCurrency: "ETH",
226254
},
227255
"etherlink-testnet": {
228256
address: "0x23f0e8FAeE7bbb405E7A7C3d60138FCfd43d7509",
@@ -231,6 +259,7 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
231259
gasLimit: "15M",
232260
network: "testnet",
233261
rpc: "https://node.ghostnet.etherlink.com",
262+
nativeCurrency: "XTZ",
234263
},
235264
etherlink: {
236265
address: "0x23f0e8FAeE7bbb405E7A7C3d60138FCfd43d7509",
@@ -239,6 +268,7 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
239268
gasLimit: "15M",
240269
network: "mainnet",
241270
rpc: "https://node.mainnet.etherlink.com/",
271+
nativeCurrency: "XTZ",
242272
},
243273
klaytn: {
244274
address: "0x36825bf3Fbdf5a29E2d5148bfe7Dcf7B5639e320",
@@ -247,6 +277,7 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
247277
gasLimit: "500K",
248278
network: "mainnet",
249279
rpc: "https://rpc.ankr.com/klaytn",
280+
nativeCurrency: "KLAY",
250281
},
251282
"klaytn-testnet": {
252283
address: "0x36825bf3Fbdf5a29E2d5148bfe7Dcf7B5639e320",
@@ -255,6 +286,7 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
255286
gasLimit: "500K",
256287
network: "testnet",
257288
rpc: "https://rpc.ankr.com/klaytn_testnet",
289+
nativeCurrency: "KLAY",
258290
},
259291
"tabi-testnet": {
260292
address: "0x36825bf3Fbdf5a29E2d5148bfe7Dcf7B5639e320",
@@ -263,6 +295,7 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
263295
gasLimit: "500K",
264296
network: "testnet",
265297
rpc: "https://rpc-internal.testnet.tabichain.com/",
298+
nativeCurrency: "TABI",
266299
},
267300
"b3-testnet": {
268301
address: "0x5744Cbf430D99456a0A8771208b674F27f8EF0Fb",
@@ -271,6 +304,7 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
271304
gasLimit: "500K",
272305
network: "testnet",
273306
rpc: "https://sepolia.b3.fun/http/",
307+
nativeCurrency: "ETH",
274308
},
275309
"b3-mainnet": {
276310
address: "0x5744Cbf430D99456a0A8771208b674F27f8EF0Fb",
@@ -279,6 +313,7 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
279313
gasLimit: "500K",
280314
network: "mainnet",
281315
rpc: "https://mainnet-rpc.b3.fun/http",
316+
nativeCurrency: "ETH",
282317
},
283318
"apechain-testnet": {
284319
address: "0x23f0e8FAeE7bbb405E7A7C3d60138FCfd43d7509",
@@ -287,6 +322,7 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
287322
gasLimit: "500K",
288323
network: "testnet",
289324
rpc: "https://curtis.rpc.caldera.xyz/http",
325+
nativeCurrency: "APE",
290326
},
291327
"soneium-minato-testnet": {
292328
address: "0x23f0e8FAeE7bbb405E7A7C3d60138FCfd43d7509",
@@ -295,5 +331,6 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
295331
gasLimit: "500K",
296332
network: "testnet",
297333
rpc: "https://rpc.minato.soneium.org/",
334+
nativeCurrency: "ETH",
298335
},
299336
};

components/FeeTable.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,13 @@ const FeeTable = ({
5151
</a>
5252
</StyledTd>
5353
<StyledTd>
54-
{fees[name] === undefined ? "Loading..." : fees[name]}
54+
{fees[name] === undefined ? (
55+
"Loading..."
56+
) : (
57+
<>
58+
{fees[name]} <b>{deployment.nativeCurrency}</b>
59+
</>
60+
)}
5561
</StyledTd>
5662
</tr>
5763
))}

pages/entropy/contract-addresses.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import EntropyDeploymentTable from "../../components/EntropyDeploymentTable";
1414
showReveal={true}
1515
/>
1616

17-
The default provider for above mainnet chains is `0x52DeaA1c84233F7bb8C8A45baeDE41091c616506`.
17+
**The default provider for above mainnet chains is `0x52DeaA1c84233F7bb8C8A45baeDE41091c616506`.**
1818

1919
The default provider on mainnet has a reveal delay to avoid changes on the outcome of the Entropy request because of block reorgs.
2020
The reveal delay can be a number of blocks (measured from the `latest` block) or `safe` which means the reveal will be delayed until the request transaction is included in a block with `safe` tag.
@@ -33,8 +33,8 @@ The default provider fulfills the request by sending a transaction with a gas li
3333
showReveal={false}
3434
/>
3535

36-
The default provider for above testnet chains is `0x6CC14824Ea2918f5De5C2f75A9Da968ad4BD6344`.
36+
**The default provider for above testnet chains is `0x6CC14824Ea2918f5De5C2f75A9Da968ad4BD6344`.**
3737

38-
The default provider on testnet doesn't have a reveal delay. It reveals the commitment as soon as the request transaction is included in a block.
38+
The default provider on testnet **doesn't have a reveal delay**. It reveals the commitment as soon as the request transaction is included in a block.
3939

4040
The default provider fulfills the request by sending a transaction with a gas limit as mentioned in above table. Entropy callbacks the consumer as part of this transaction.
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
# Generate Random Numbers
1+
# How to Generate Random Numbers
22

3-
Integrations simply call an on-chain function to request a random number from Entropy.
4-
This function takes a random number that you have generated off-chain and returns a sequence number.
5-
Entropy will then callback your contract with the generated random number once the request is fullfilled by the provider.
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.
64

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

0 commit comments

Comments
 (0)