Skip to content

Commit e724fc5

Browse files
committed
Show trace supported chains in the chains table
1 parent 2e26e6e commit e724fc5

File tree

2 files changed

+512
-19
lines changed

2 files changed

+512
-19
lines changed

docs/supportedChainsTable.tsx

+60-12
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,10 @@ const Table = () => {
6060
const [stats, setStats] = useState<any>();
6161

6262
const sourcifyChainMap = useMemo(() => {
63-
return sourcifyChains?.reduce(function (
64-
acc,
65-
currentChain
66-
) {
63+
return sourcifyChains?.reduce(function (acc, currentChain) {
6764
acc[currentChain.chainId] = currentChain;
6865
return acc;
69-
},
70-
{});
66+
}, {});
7167
}, [sourcifyChains]);
7268

7369
const addMonitoredSupportFrom = async (url, supportedChains) => {
@@ -143,6 +139,26 @@ const Table = () => {
143139
return 1;
144140
}
145141

142+
// Chains with trace support come next
143+
const hasTraceA = a?.traceSupportedRPCs?.length > 0;
144+
const hasTraceB = b?.traceSupportedRPCs?.length > 0;
145+
146+
if (hasTraceA && !hasTraceB) {
147+
return -1;
148+
} else if (!hasTraceA && hasTraceB) {
149+
return 1;
150+
}
151+
152+
// Chains with Etherscan API come next
153+
const hasEtherscanA = a?.etherscanAPI;
154+
const hasEtherscanB = b?.etherscanAPI;
155+
156+
if (hasEtherscanA && !hasEtherscanB) {
157+
return -1;
158+
} else if (!hasEtherscanA && hasEtherscanB) {
159+
return 1;
160+
}
161+
146162
// Sort the rest alphabetically by chain.name
147163
return a.name.localeCompare(b.name);
148164
});
@@ -203,6 +219,7 @@ const Table = () => {
203219
{chain.supported ? "Verification" : "Not Supported"} <br />
204220
{chain.monitored ? "Monitoring" : ""}
205221
</td>
222+
<td style={{ textAlign: "center" }}>{chain?.traceSupportedRPCs?.length > 0 ? "✅" : ""}</td>
206223
<td style={{ textAlign: "center" }}>{chain.etherscanAPI ? "✅" : ""}</td>
207224
<td>
208225
{
@@ -235,14 +252,10 @@ const Table = () => {
235252
<ReactTooltip effect="solid" />
236253
<div>
237254
<h2>Chains by Verified Contracts</h2>
238-
<Chart
239-
stats={stats}
240-
sourcifyChainMap={sourcifyChainMap}
241-
sourcifyChains={sourcifyChains}
242-
/>
255+
<Chart stats={stats} sourcifyChainMap={sourcifyChainMap} sourcifyChains={sourcifyChains} />
243256
</div>
244257
<div>
245-
<h2>Chains by Type of Support</h2>
258+
<h2>Chains by Type of Support</h2>
246259
{error && <div style={{ textAlign: "center", color: "indianRed" }}>{error}</div>}
247260
{sourcifyChains.length > 0 && (
248261
<div style={{ marginBottom: "16px" }}>
@@ -256,6 +269,10 @@ const Table = () => {
256269
<li>
257270
Verification support: <b>{sourcifyChains.filter((c) => c.supported).length}</b>
258271
</li>
272+
<li>
273+
That has an RPC with trace support:{" "}
274+
<b>{sourcifyChains.filter((c) => c.traceSupportedRPCs?.length > 0).length}</b>
275+
</li>
259276
<li>
260277
Not Supported (deprecated): <b>{sourcifyChains.filter((c) => !c.supported).length}</b>
261278
</li>
@@ -265,12 +282,43 @@ const Table = () => {
265282
</ul>
266283
</div>
267284
)}
285+
<ReactTooltip effect="solid" delayHide={500} clickable={true} id="rpc-trace-support" />
268286
<table>
269287
<thead>
270288
<tr>
271289
<th>Chain</th>
272290
<th>Chain ID</th>
273291
<th>Support Type</th>
292+
<th
293+
data-html={true}
294+
data-tip={renderToString(
295+
<div style={{ maxWidth: "300px" }}>
296+
<p>This allows verifying contracts created with factories with the creation bytecode.</p>
297+
<p>
298+
If not supported, contracts can be verified normally with the runtime bytecode, but also with the
299+
creation bytecode if they were created by an EOA, ie. the creation bytecode is in the transaction
300+
payload that created the contract.
301+
</p>
302+
</div>
303+
)}
304+
data-for="rpc-trace-support"
305+
>
306+
RPCs with trace support{" "}
307+
<span
308+
style={{
309+
border: "1px solid",
310+
borderRadius: "100%",
311+
width: "20px",
312+
height: "20px",
313+
display: "inline-flex",
314+
alignItems: "center",
315+
justifyContent: "center",
316+
color: "gray",
317+
}}
318+
>
319+
?
320+
</span>
321+
</th>
274322
<th>Import from Etherscan</th>
275323
<th>Verification Tests</th>
276324
</tr>

0 commit comments

Comments
 (0)