Skip to content

Commit 38e8915

Browse files
authored
feat(entropy): Show deployment fees for entropy (#311)
* Show deployment fees for entropy
1 parent 0577149 commit 38e8915

9 files changed

+1188
-27
lines changed

Diff for: abis/IEntropy.json

+820
Large diffs are not rendered by default.

Diff for: components/EntropyDeploymentTable.tsx

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
import { EntropyDeployment } from "./EntropyDeployments";
2+
import { StyledTd } from "./Table";
3+
4+
const EntropyDeploymentTable = ({
5+
deployments,
6+
showReveal,
7+
}: {
8+
deployments: Record<string, EntropyDeployment>;
9+
showReveal: boolean;
10+
}) => {
11+
return (
12+
<table>
13+
<thead>
14+
<tr>
15+
<th>Chain Id</th>
16+
<th>Entropy Contract Address</th>
17+
{showReveal && <th>Reveal Delay</th>}
18+
<th>Gas Limit</th>
19+
</tr>
20+
</thead>
21+
<tbody>
22+
{Object.entries(deployments).map(([name, deployment]) => (
23+
<tr key={name}>
24+
<StyledTd>{name}</StyledTd>
25+
<StyledTd>
26+
<a
27+
href={deployment.explorer.replace(
28+
"$ADDRESS",
29+
deployment.address
30+
)}
31+
className={
32+
"nx-text-primary-600 nx-underline nx-decoration-from-font [text-underline-position:from-font]"
33+
}
34+
target={"_blank"}
35+
>
36+
<code
37+
className={
38+
"nx-border-black nx-border-opacity-[0.04] nx-bg-opacity-[0.03] nx-bg-black nx-break-words nx-rounded-md nx-border nx-py-0.5 nx-px-[.25em] nx-text-[.9em] dark:nx-border-white/10 dark:nx-bg-white/10 "
39+
}
40+
>
41+
{deployment.address}
42+
</code>
43+
</a>
44+
</StyledTd>
45+
{showReveal && <StyledTd>{deployment.delay}</StyledTd>}
46+
<StyledTd>{deployment.gasLimit}</StyledTd>
47+
</tr>
48+
))}
49+
</tbody>
50+
</table>
51+
);
52+
};
53+
54+
export default EntropyDeploymentTable;

Diff for: components/EntropyDeployments.tsx

+195
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,195 @@
1+
export interface EntropyDeployment {
2+
address: string;
3+
network: "mainnet" | "testnet";
4+
explorer: string;
5+
delay: string;
6+
gasLimit: string;
7+
rpc: string;
8+
}
9+
10+
export const EntropyDeployments: Record<string, EntropyDeployment> = {
11+
blast: {
12+
address: "0x5744Cbf430D99456a0A8771208b674F27f8EF0Fb",
13+
network: "mainnet",
14+
explorer: "https://blastscan.io/address/$ADDRESS",
15+
delay: "1 block",
16+
gasLimit: "500K",
17+
rpc: "https://rpc.blast.io",
18+
},
19+
"lightlink-phoenix": {
20+
address: "0x98046Bd286715D3B0BC227Dd7a956b83D8978603",
21+
network: "mainnet",
22+
explorer: "https://phoenix.lightlink.io/address/$ADDRESS",
23+
delay: "1 block",
24+
gasLimit: "500K",
25+
rpc: "https://replicator.phoenix.lightlink.io/rpc/v1",
26+
},
27+
chiliz: {
28+
address: "0x0708325268dF9F66270F1401206434524814508b",
29+
network: "mainnet",
30+
explorer: "https://scan.chiliz.com/address/$ADDRESS",
31+
delay: "12 blocks",
32+
gasLimit: "500K",
33+
rpc: "https://rpc.ankr.com/chiliz",
34+
},
35+
arbitrum: {
36+
address: "0x7698E925FfC29655576D0b361D75Af579e20AdAc",
37+
network: "mainnet",
38+
explorer: "https://arbiscan.io/address/$ADDRESS",
39+
delay: "6 blocks",
40+
gasLimit: "500K",
41+
rpc: "https://arb1.arbitrum.io/rpc",
42+
},
43+
optimism: {
44+
address: "0xdF21D137Aadc95588205586636710ca2890538d5",
45+
network: "mainnet",
46+
explorer: "https://optimistic.etherscan.io/address/$ADDRESS",
47+
delay: "Until safe",
48+
gasLimit: "500K",
49+
rpc: "https://rpc.ankr.com/optimism",
50+
},
51+
mode: {
52+
address: "0x8D254a21b3C86D32F7179855531CE99164721933",
53+
network: "mainnet",
54+
explorer: "https://explorer.mode.network/address/$ADDRESS",
55+
delay: "Until safe",
56+
gasLimit: "500K",
57+
rpc: "https://mainnet.mode.network/",
58+
},
59+
zetachain: {
60+
address: "0x36825bf3Fbdf5a29E2d5148bfe7Dcf7B5639e320",
61+
network: "mainnet",
62+
explorer: "https://zetachain.blockscout.com/address/$ADDRESS",
63+
delay: "0 block",
64+
gasLimit: "500K",
65+
rpc: "https://zetachain-evm.blockpi.network/v1/rpc/public",
66+
},
67+
base: {
68+
address: "0x6E7D74FA7d5c90FEF9F0512987605a6d546181Bb",
69+
network: "mainnet",
70+
explorer: "https://basescan.org/address/$ADDRESS",
71+
delay: "1 block",
72+
gasLimit: "500K",
73+
rpc: "https://developer-access-mainnet.base.org/",
74+
},
75+
"lightlink-pegasus": {
76+
rpc: "https://replicator.pegasus.lightlink.io/rpc/v1",
77+
network: "testnet",
78+
delay: "",
79+
address: "0x8250f4aF4B972684F7b336503E2D6dFeDeB1487a",
80+
explorer: "https://pegasus.lightlink.io/address/$ADDRESS",
81+
gasLimit: "500K",
82+
},
83+
"chiliz-spicy": {
84+
rpc: "https://spicy-rpc.chiliz.com",
85+
network: "testnet",
86+
delay: "",
87+
address: "0xD458261E832415CFd3BAE5E416FdF3230ce6F134",
88+
explorer: "https://spicy-explorer.chiliz.com/address/$ADDRESS",
89+
gasLimit: "500K",
90+
},
91+
"conflux-espace-testnet": {
92+
rpc: "https://evmtestnet.confluxrpc.com",
93+
network: "testnet",
94+
delay: "",
95+
address: "0xdF21D137Aadc95588205586636710ca2890538d5",
96+
explorer: "https://evmtestnet.confluxscan.io/address/$ADDRESS",
97+
gasLimit: "500K",
98+
},
99+
"mode-sepolia": {
100+
rpc: "https://sepolia.mode.network/",
101+
network: "testnet",
102+
delay: "",
103+
address: "0x98046Bd286715D3B0BC227Dd7a956b83D8978603",
104+
explorer: "https://sepolia.explorer.mode.network/address/$ADDRESS",
105+
gasLimit: "500K",
106+
},
107+
"sei-evm-devnet": {
108+
rpc: "https://evm-rpc-arctic-1.sei-apis.com",
109+
network: "testnet",
110+
delay: "",
111+
address: "0x23f0e8FAeE7bbb405E7A7C3d60138FCfd43d7509",
112+
explorer: "https://seitrace.com/address/$ADDRESS",
113+
gasLimit: "500K",
114+
},
115+
"arbitrum-sepolia": {
116+
rpc: "https://sepolia-rollup.arbitrum.io/rpc",
117+
network: "testnet",
118+
delay: "",
119+
address: "0x549Ebba8036Ab746611B4fFA1423eb0A4Df61440",
120+
explorer: "https://sepolia.arbiscan.io/address/$ADDRESS",
121+
gasLimit: "500K",
122+
},
123+
"fantom-sonic": {
124+
rpc: "https://rpc.sonic.fantom.network/",
125+
network: "testnet",
126+
delay: "",
127+
address: "0xb27e5ca259702f209a29225d0eDdC131039C9933",
128+
explorer: "https://public-sonic.fantom.network/address/$ADDRESS",
129+
gasLimit: "500K",
130+
},
131+
"blast-testnet": {
132+
rpc: "https://sepolia.blast.io",
133+
network: "testnet",
134+
delay: "",
135+
address: "0x98046Bd286715D3B0BC227Dd7a956b83D8978603",
136+
explorer: "https://testnet.blastscan.io/address/$ADDRESS",
137+
gasLimit: "500K",
138+
},
139+
"optimism-sepolia": {
140+
rpc: "https://sepolia.optimism.io",
141+
network: "testnet",
142+
delay: "",
143+
address: "0x4821932D0CDd71225A6d914706A621e0389D7061",
144+
explorer: "https://optimism-sepolia.blockscout.com/address/$ADDRESS",
145+
gasLimit: "500K",
146+
},
147+
"base-sepolia": {
148+
rpc: "https://sepolia.base.org",
149+
network: "testnet",
150+
delay: "",
151+
address: "0x41c9e39574F40Ad34c79f1C99B66A45eFB830d4c",
152+
explorer: "https://base-sepolia.blockscout.com/address/$ADDRESS",
153+
gasLimit: "500K",
154+
},
155+
"berachain-testnet": {
156+
rpc: "https://rpc.ankr.com/berachain_testnet",
157+
network: "testnet",
158+
delay: "",
159+
address: "0x26DD80569a8B23768A1d80869Ed7339e07595E85",
160+
explorer: "https://artio.beratrail.io/address/$ADDRESS",
161+
gasLimit: "500K",
162+
},
163+
"coredao-testnet": {
164+
rpc: "https://rpc.test.btcs.network",
165+
network: "testnet",
166+
delay: "",
167+
address: "0xf0a1b566B55e0A0CB5BeF52Eb2a57142617Bee67",
168+
explorer: "https://scan.test.btcs.network/address/$ADDRESS",
169+
gasLimit: "500K",
170+
},
171+
"zetachain-testnet": {
172+
rpc: "https://zetachain-athens-evm.blockpi.network/v1/rpc/public",
173+
network: "testnet",
174+
delay: "",
175+
address: "0x4374e5a8b9C22271E9EB878A2AA31DE97DF15DAF",
176+
explorer: "https://explorer.zetachain.com/address/$ADDRESS",
177+
gasLimit: "500K",
178+
},
179+
"taiko-hekla": {
180+
rpc: "https://rpc.hekla.taiko.xyz/",
181+
network: "testnet",
182+
delay: "",
183+
address: "0x98046Bd286715D3B0BC227Dd7a956b83D8978603",
184+
explorer: "https://hekla.taikoscan.network/address/$ADDRESS",
185+
gasLimit: "500K",
186+
},
187+
"orange-testnet": {
188+
address: "0x98046Bd286715D3B0BC227Dd7a956b83D8978603",
189+
explorer: "https://subnets-test.avax.network/orangetest/address/$ADDRESS",
190+
delay: "",
191+
gasLimit: "500K",
192+
network: "testnet",
193+
rpc: "https://subnets.avax.network/orangetest/testnet/rpc",
194+
},
195+
};

Diff for: components/FeeTable.tsx

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
import { EntropyDeployment } from "./EntropyDeployments";
2+
import { useEffect, useState } from "react";
3+
import { ethers } from "ethers";
4+
import EntropyAbi from "../abis/IEntropy.json";
5+
import { StyledTd } from "./Table";
6+
7+
const FeeTable = ({
8+
deployments,
9+
}: {
10+
deployments: Record<string, EntropyDeployment>;
11+
}) => {
12+
const [fees, setFees] = useState<Record<string, string>>({});
13+
14+
useEffect(() => {
15+
for (const [name, deployment] of Object.entries(deployments)) {
16+
const contract = new ethers.Contract(
17+
deployment.address,
18+
EntropyAbi,
19+
ethers.getDefaultProvider(deployment.rpc)
20+
);
21+
contract.getDefaultProvider().then((defaultProvider: string) => {
22+
contract.getFee(defaultProvider).then((fee: bigint) => {
23+
const formattedFee = ethers.formatEther(fee);
24+
setFees((prev) => ({ ...prev, [name]: formattedFee }));
25+
});
26+
});
27+
}
28+
}, [deployments]);
29+
30+
return (
31+
<table>
32+
<thead>
33+
<tr>
34+
<th>Chain Id</th>
35+
<th>Fee</th>
36+
</tr>
37+
</thead>
38+
<tbody>
39+
{Object.entries(deployments).map(([name, deployment]) => (
40+
<tr key={name}>
41+
<StyledTd>
42+
<a
43+
href={deployment.explorer.replace(
44+
"$ADDRESS",
45+
deployment.address
46+
)}
47+
target={"_blank"}
48+
>
49+
{name}
50+
</a>
51+
</StyledTd>
52+
<StyledTd>
53+
{fees[name] === undefined ? "Loading..." : fees[name]}
54+
</StyledTd>
55+
</tr>
56+
))}
57+
</tbody>
58+
</table>
59+
);
60+
};
61+
62+
export default FeeTable;

Diff for: components/Table.tsx

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
export const StyledTd = ({ children }: { children: React.ReactNode }) => {
2+
return (
3+
<td
4+
className={
5+
"nx-m-0 nx-border nx-border-gray-300 nx-px-4 nx-py-2 dark:nx-border-gray-600"
6+
}
7+
>
8+
{children}
9+
</td>
10+
);
11+
};

Diff for: pages/entropy/_meta.json

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
},
3838
"contract-addresses": "Contract & Provider Addresses",
3939
"examples": "Example Applications",
40+
"current-fees": "Current Fees",
4041

4142
"-- Understanding Entropy": {
4243
"title": "Understanding Entropy",

Diff for: pages/entropy/contract-addresses.mdx

+19-27
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
1+
import { EntropyDeployments } from "../../components/EntropyDeployments";
2+
import EntropyDeploymentTable from "../../components/EntropyDeploymentTable";
3+
14
# Entropy Contract Addresses on EVM
25

36
## Mainnets
47

5-
| Chain Id | Entropy Contract Address | Reveal Delay | Gas Limit |
6-
| ----------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ------------ | --------- |
7-
| lightlink-phoenix | [`0x98046Bd286715D3B0BC227Dd7a956b83D8978603`](https://phoenix.lightlink.io/address/0x98046Bd286715D3B0BC227Dd7a956b83D8978603) | 1 block | 500K |
8-
| chiliz | [`0x0708325268dF9F66270F1401206434524814508b`](https://scan.chiliz.com/address/0x0708325268dF9F66270F1401206434524814508b) | 12 blocks | 500K |
9-
| arbitrum | [`0x7698E925FfC29655576D0b361D75Af579e20AdAc`](https://arbiscan.io/address/0x7698E925FfC29655576D0b361D75Af579e20AdAc) | 6 blocks | 500K |
10-
| optimism | [`0xdF21D137Aadc95588205586636710ca2890538d5`](https://optimistic.etherscan.io/address/0xdF21D137Aadc95588205586636710ca2890538d5) | Until `safe` | 500K |
11-
| mode | [`0x8D254a21b3C86D32F7179855531CE99164721933`](https://explorer.mode.network/address/0x8D254a21b3C86D32F7179855531CE99164721933) | Until `safe` | 500K |
12-
| blast | [`0x5744Cbf430D99456a0A8771208b674F27f8EF0Fb`](https://blastscan.io/address/0x5744Cbf430D99456a0A8771208b674F27f8EF0Fb) | 1 block | 500K |
13-
| zetachain | [`0x36825bf3Fbdf5a29E2d5148bfe7Dcf7B5639e320`](https://zetachain.blockscout.com/address/0x36825bf3Fbdf5a29E2d5148bfe7Dcf7B5639e320) | 0 block | 500K |
14-
| base | [`0x6E7D74FA7d5c90FEF9F0512987605a6d546181Bb`](https://basescan.org/address/0x6E7D74FA7d5c90FEF9F0512987605a6d546181Bb) | 1 block | 500K |
8+
<EntropyDeploymentTable
9+
deployments={Object.fromEntries(
10+
Object.entries(EntropyDeployments).filter(
11+
([k, v]) => v.network === "mainnet"
12+
)
13+
)}
14+
showReveal={true}
15+
/>
1516

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

@@ -23,23 +24,14 @@ The default provider fulfills the request by sending a transaction with a gas li
2324

2425
## Testnets
2526

26-
| Chain Id | Entropy Contract Address | Gas Limit |
27-
| ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | --------- |
28-
| lightlink-pegasus | [`0x8250f4aF4B972684F7b336503E2D6dFeDeB1487a`](https://pegasus.lightlink.io/address/0x8250f4aF4B972684F7b336503E2D6dFeDeB1487a) | 500K |
29-
| chiliz-spicy | [`0xD458261E832415CFd3BAE5E416FdF3230ce6F134`](https://spicy-explorer.chiliz.com/address/0xD458261E832415CFd3BAE5E416FdF3230ce6F134) | 500K |
30-
| conflux-espace-testnet | [`0xdF21D137Aadc95588205586636710ca2890538d5`](https://evmtestnet.confluxscan.io/address/0xdF21D137Aadc95588205586636710ca2890538d5) | 500K |
31-
| mode-sepolia | [`0x98046Bd286715D3B0BC227Dd7a956b83D8978603`](https://sepolia.explorer.mode.network/address/0x98046Bd286715D3B0BC227Dd7a956b83D8978603) | 500K |
32-
| sei-evm-devnet | [`0x23f0e8FAeE7bbb405E7A7C3d60138FCfd43d7509`](https://seitrace.com/address/0x23f0e8FAeE7bbb405E7A7C3d60138FCfd43d7509) | 500K |
33-
| arbitrum-sepolia | [`0x549Ebba8036Ab746611B4fFA1423eb0A4Df61440`](https://sepolia.arbiscan.io/address/0x549Ebba8036Ab746611B4fFA1423eb0A4Df61440) | 500K |
34-
| fantom-sonic | [`0xb27e5ca259702f209a29225d0eDdC131039C9933`](https://public-sonic.fantom.network/address/0xb27e5ca259702f209a29225d0eddc131039c9933) | 500K |
35-
| blast-testnet | [`0x98046Bd286715D3B0BC227Dd7a956b83D8978603`](https://testnet.blastscan.io/address/0x98046Bd286715D3B0BC227Dd7a956b83D8978603) | 500K |
36-
| optimism-sepolia | [`0x4821932D0CDd71225A6d914706A621e0389D7061`](https://optimism-sepolia.blockscout.com/address/0x4821932D0CDd71225A6d914706A621e0389D7061) | 500K |
37-
| base-sepolia | [`0x41c9e39574F40Ad34c79f1C99B66A45eFB830d4c`](https://base-sepolia.blockscout.com/address/0x41c9e39574F40Ad34c79f1C99B66A45eFB830d4c) | 500K |
38-
| berachain-testnet | [`0x26DD80569a8B23768A1d80869Ed7339e07595E85`](https://artio.beratrail.io/address/0x26DD80569a8B23768A1d80869Ed7339e07595E85) | 500K |
39-
| coredao-testnet | [`0xf0a1b566B55e0A0CB5BeF52Eb2a57142617Bee67`](https://scan.test.btcs.network/address/0xf0a1b566B55e0A0CB5BeF52Eb2a57142617Bee67) | 500K |
40-
| zetachain-testnet | [`0x4374e5a8b9C22271E9EB878A2AA31DE97DF15DAF`](https://explorer.zetachain.com/address/0x4374e5a8b9C22271E9EB878A2AA31DE97DF15DAF) | 500K |
41-
| taiko-hekla | [`0x98046Bd286715D3B0BC227Dd7a956b83D8978603`](https://hekla.taikoscan.network/address/0x98046Bd286715D3B0BC227Dd7a956b83D8978603) | 500K |
42-
| orange-testnet | [`0x98046Bd286715D3B0BC227Dd7a956b83D8978603`](https://subnets-test.avax.network/orangetest/address/0x98046Bd286715D3B0BC227Dd7a956b83D8978603) | 500K |
27+
<EntropyDeploymentTable
28+
deployments={Object.fromEntries(
29+
Object.entries(EntropyDeployments).filter(
30+
([k, v]) => v.network === "testnet"
31+
)
32+
)}
33+
showReveal={false}
34+
/>
4335

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

0 commit comments

Comments
 (0)