Skip to content

chore(entropy) Refactor guide #437

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 3, 2024
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
37 changes: 37 additions & 0 deletions components/EntropyDeployments.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export interface EntropyDeployment {
delay: string;
gasLimit: string;
rpc: string;
nativeCurrency: string;
}

export const EntropyDeployments: Record<string, EntropyDeployment> = {
Expand All @@ -15,6 +16,7 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
delay: "1 block",
gasLimit: "500K",
rpc: "https://rpc.blast.io",
nativeCurrency: "ETH",
},
"lightlink-phoenix": {
address: "0x98046Bd286715D3B0BC227Dd7a956b83D8978603",
Expand All @@ -23,6 +25,7 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
delay: "1 block",
gasLimit: "500K",
rpc: "https://replicator.phoenix.lightlink.io/rpc/v1",
nativeCurrency: "ETH",
},
chiliz: {
address: "0x0708325268dF9F66270F1401206434524814508b",
Expand All @@ -31,6 +34,7 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
delay: "12 blocks",
gasLimit: "500K",
rpc: "https://rpc.ankr.com/chiliz",
nativeCurrency: "CHZ",
},
arbitrum: {
address: "0x7698E925FfC29655576D0b361D75Af579e20AdAc",
Expand All @@ -39,6 +43,7 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
delay: "6 blocks",
gasLimit: "2.5M",
rpc: "https://arb1.arbitrum.io/rpc",
nativeCurrency: "ETH",
},
optimism: {
address: "0xdF21D137Aadc95588205586636710ca2890538d5",
Expand All @@ -47,6 +52,7 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
delay: "2 blocks",
gasLimit: "500K",
rpc: "https://rpc.ankr.com/optimism",
nativeCurrency: "ETH",
},
mode: {
address: "0x8D254a21b3C86D32F7179855531CE99164721933",
Expand All @@ -55,6 +61,7 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
delay: "2 blocks",
gasLimit: "500K",
rpc: "https://mainnet.mode.network/",
nativeCurrency: "ETH",
},
zetachain: {
address: "0x36825bf3Fbdf5a29E2d5148bfe7Dcf7B5639e320",
Expand All @@ -63,6 +70,7 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
delay: "0 block",
gasLimit: "500K",
rpc: "https://zetachain-evm.blockpi.network/v1/rpc/public",
nativeCurrency: "ZETA",
},
base: {
address: "0x6E7D74FA7d5c90FEF9F0512987605a6d546181Bb",
Expand All @@ -71,6 +79,7 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
delay: "1 block",
gasLimit: "500K",
rpc: "https://developer-access-mainnet.base.org/",
nativeCurrency: "ETH",
},
"lightlink-pegasus": {
rpc: "https://replicator.pegasus.lightlink.io/rpc/v1",
Expand All @@ -79,6 +88,7 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
address: "0x8250f4aF4B972684F7b336503E2D6dFeDeB1487a",
explorer: "https://pegasus.lightlink.io/address/$ADDRESS",
gasLimit: "500K",
nativeCurrency: "ETH",
},
"chiliz-spicy": {
rpc: "https://spicy-rpc.chiliz.com",
Expand All @@ -87,6 +97,7 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
address: "0xD458261E832415CFd3BAE5E416FdF3230ce6F134",
explorer: "https://spicy-explorer.chiliz.com/address/$ADDRESS",
gasLimit: "500K",
nativeCurrency: "CHZ",
},
"conflux-espace-testnet": {
rpc: "https://evmtestnet.confluxrpc.com",
Expand All @@ -95,6 +106,7 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
address: "0xdF21D137Aadc95588205586636710ca2890538d5",
explorer: "https://evmtestnet.confluxscan.io/address/$ADDRESS",
gasLimit: "500K",
nativeCurrency: "CFX",
},
"mode-sepolia": {
rpc: "https://sepolia.mode.network/",
Expand All @@ -103,6 +115,7 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
address: "0x98046Bd286715D3B0BC227Dd7a956b83D8978603",
explorer: "https://sepolia.explorer.mode.network/address/$ADDRESS",
gasLimit: "500K",
nativeCurrency: "ETH",
},
"sei-evm-testnet": {
rpc: "https://evm-rpc-testnet.sei-apis.com",
Expand All @@ -111,6 +124,7 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
address: "0x36825bf3Fbdf5a29E2d5148bfe7Dcf7B5639e320",
explorer: "https://seitrace.com/address/$ADDRESS?chain=atlantic-2",
gasLimit: "500K",
nativeCurrency: "SEI",
},
"arbitrum-sepolia": {
rpc: "https://sepolia-rollup.arbitrum.io/rpc",
Expand All @@ -119,6 +133,7 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
address: "0x549Ebba8036Ab746611B4fFA1423eb0A4Df61440",
explorer: "https://sepolia.arbiscan.io/address/$ADDRESS",
gasLimit: "2.5M",
nativeCurrency: "ETH",
},
"fantom-sonic": {
rpc: "https://rpc.sonic.fantom.network/",
Expand All @@ -127,6 +142,7 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
address: "0xb27e5ca259702f209a29225d0eDdC131039C9933",
explorer: "https://public-sonic.fantom.network/address/$ADDRESS",
gasLimit: "500K",
nativeCurrency: "S",
},
"blast-testnet": {
rpc: "https://sepolia.blast.io",
Expand All @@ -135,6 +151,7 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
address: "0x98046Bd286715D3B0BC227Dd7a956b83D8978603",
explorer: "https://testnet.blastscan.io/address/$ADDRESS",
gasLimit: "500K",
nativeCurrency: "ETH",
},
"optimism-sepolia": {
rpc: "https://sepolia.optimism.io",
Expand All @@ -143,6 +160,7 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
address: "0x4821932D0CDd71225A6d914706A621e0389D7061",
explorer: "https://optimism-sepolia.blockscout.com/address/$ADDRESS",
gasLimit: "500K",
nativeCurrency: "ETH",
},
"base-sepolia": {
rpc: "https://sepolia.base.org",
Expand All @@ -151,6 +169,7 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
address: "0x41c9e39574F40Ad34c79f1C99B66A45eFB830d4c",
explorer: "https://base-sepolia.blockscout.com/address/$ADDRESS",
gasLimit: "500K",
nativeCurrency: "ETH",
},
"berachain-testnet-v2": {
rpc: "https://evm-rpc-bera.rhino-apis.com/",
Expand All @@ -159,6 +178,7 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
address: "0x36825bf3Fbdf5a29E2d5148bfe7Dcf7B5639e320",
explorer: "https://bartio.beratrail.io/address/$ADDRESS",
gasLimit: "500K",
nativeCurrency: "BERA",
},
"coredao-testnet": {
rpc: "https://rpc.test.btcs.network",
Expand All @@ -167,6 +187,7 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
address: "0xf0a1b566B55e0A0CB5BeF52Eb2a57142617Bee67",
explorer: "https://scan.test.btcs.network/address/$ADDRESS",
gasLimit: "500K",
nativeCurrency: "tCORE",
},
"zetachain-testnet": {
rpc: "https://zetachain-athens-evm.blockpi.network/v1/rpc/public",
Expand All @@ -175,6 +196,7 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
address: "0x4374e5a8b9C22271E9EB878A2AA31DE97DF15DAF",
explorer: "https://explorer.zetachain.com/address/$ADDRESS",
gasLimit: "500K",
nativeCurrency: "ZETA",
},
"taiko-hekla": {
rpc: "https://rpc.hekla.taiko.xyz/",
Expand All @@ -183,6 +205,7 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
address: "0x98046Bd286715D3B0BC227Dd7a956b83D8978603",
explorer: "https://hekla.taikoscan.network/address/$ADDRESS",
gasLimit: "500K",
nativeCurrency: "ETH",
},
"orange-testnet": {
address: "0x98046Bd286715D3B0BC227Dd7a956b83D8978603",
Expand All @@ -191,6 +214,7 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
gasLimit: "500K",
network: "testnet",
rpc: "https://subnets.avax.network/orangetest/testnet/rpc",
nativeCurrency: "JUICE",
},
"sei-evm-mainnet": {
address: "0x98046Bd286715D3B0BC227Dd7a956b83D8978603",
Expand All @@ -199,6 +223,7 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
gasLimit: "500K",
network: "mainnet",
rpc: "https://evm-rpc.sei-apis.com",
nativeCurrency: "SEI",
},
merlin: {
address: "0x36825bf3Fbdf5a29E2d5148bfe7Dcf7B5639e320",
Expand All @@ -207,6 +232,7 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
gasLimit: "500K",
network: "mainnet",
rpc: "https://rpc.merlinchain.io",
nativeCurrency: "BTC",
},
"merlin-testnet": {
address: "0x5744Cbf430D99456a0A8771208b674F27f8EF0Fb",
Expand All @@ -215,6 +241,7 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
gasLimit: "500K",
network: "testnet",
rpc: "https://testnet-rpc.merlinchain.io/",
nativeCurrency: "BTC",
},
taiko: {
address: "0x26DD80569a8B23768A1d80869Ed7339e07595E85",
Expand All @@ -223,6 +250,7 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
gasLimit: "500K",
network: "mainnet",
rpc: "https://rpc.mainnet.taiko.xyz",
nativeCurrency: "ETH",
},
"etherlink-testnet": {
address: "0x23f0e8FAeE7bbb405E7A7C3d60138FCfd43d7509",
Expand All @@ -231,6 +259,7 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
gasLimit: "15M",
network: "testnet",
rpc: "https://node.ghostnet.etherlink.com",
nativeCurrency: "XTZ",
},
etherlink: {
address: "0x23f0e8FAeE7bbb405E7A7C3d60138FCfd43d7509",
Expand All @@ -239,6 +268,7 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
gasLimit: "15M",
network: "mainnet",
rpc: "https://node.mainnet.etherlink.com/",
nativeCurrency: "XTZ",
},
klaytn: {
address: "0x36825bf3Fbdf5a29E2d5148bfe7Dcf7B5639e320",
Expand All @@ -247,6 +277,7 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
gasLimit: "500K",
network: "mainnet",
rpc: "https://rpc.ankr.com/klaytn",
nativeCurrency: "KLAY",
},
"klaytn-testnet": {
address: "0x36825bf3Fbdf5a29E2d5148bfe7Dcf7B5639e320",
Expand All @@ -255,6 +286,7 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
gasLimit: "500K",
network: "testnet",
rpc: "https://rpc.ankr.com/klaytn_testnet",
nativeCurrency: "KLAY",
},
"tabi-testnet": {
address: "0x36825bf3Fbdf5a29E2d5148bfe7Dcf7B5639e320",
Expand All @@ -263,6 +295,7 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
gasLimit: "500K",
network: "testnet",
rpc: "https://rpc-internal.testnet.tabichain.com/",
nativeCurrency: "TABI",
},
"b3-testnet": {
address: "0x5744Cbf430D99456a0A8771208b674F27f8EF0Fb",
Expand All @@ -271,6 +304,7 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
gasLimit: "500K",
network: "testnet",
rpc: "https://sepolia.b3.fun/http/",
nativeCurrency: "ETH",
},
"b3-mainnet": {
address: "0x5744Cbf430D99456a0A8771208b674F27f8EF0Fb",
Expand All @@ -279,6 +313,7 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
gasLimit: "500K",
network: "mainnet",
rpc: "https://mainnet-rpc.b3.fun/http",
nativeCurrency: "ETH",
},
"apechain-testnet": {
address: "0x23f0e8FAeE7bbb405E7A7C3d60138FCfd43d7509",
Expand All @@ -287,6 +322,7 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
gasLimit: "500K",
network: "testnet",
rpc: "https://curtis.rpc.caldera.xyz/http",
nativeCurrency: "APE",
},
"soneium-minato-testnet": {
address: "0x23f0e8FAeE7bbb405E7A7C3d60138FCfd43d7509",
Expand All @@ -295,5 +331,6 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
gasLimit: "500K",
network: "testnet",
rpc: "https://rpc.minato.soneium.org/",
nativeCurrency: "ETH",
},
};
8 changes: 7 additions & 1 deletion components/FeeTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,13 @@ const FeeTable = ({
</a>
</StyledTd>
<StyledTd>
{fees[name] === undefined ? "Loading..." : fees[name]}
{fees[name] === undefined ? (
"Loading..."
) : (
<>
{fees[name]} <b>{deployment.nativeCurrency}</b>
</>
)}
</StyledTd>
</tr>
))}
Expand Down
6 changes: 3 additions & 3 deletions pages/entropy/contract-addresses.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import EntropyDeploymentTable from "../../components/EntropyDeploymentTable";
showReveal={true}
/>

The default provider for above mainnet chains is `0x52DeaA1c84233F7bb8C8A45baeDE41091c616506`.
**The default provider for above mainnet chains is `0x52DeaA1c84233F7bb8C8A45baeDE41091c616506`.**

The default provider on mainnet has a reveal delay to avoid changes on the outcome of the Entropy request because of block reorgs.
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.
Expand All @@ -33,8 +33,8 @@ The default provider fulfills the request by sending a transaction with a gas li
showReveal={false}
/>

The default provider for above testnet chains is `0x6CC14824Ea2918f5De5C2f75A9Da968ad4BD6344`.
**The default provider for above testnet chains is `0x6CC14824Ea2918f5De5C2f75A9Da968ad4BD6344`.**

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.
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.

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.
6 changes: 2 additions & 4 deletions pages/entropy/generate-random-numbers.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Generate Random Numbers
# How to Generate Random Numbers

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

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