feat: runnable code & sandbox embeds across the EVM docs#32
feat: runnable code & sandbox embeds across the EVM docs#32alexander-sei wants to merge 2 commits into
Conversation
Close the "static vs interactive" gap with Solana's docs (roadmap P0.2) by making the EVM example pages runnable. - RunSnippet: click-to-run read-only JSON-RPC straight against Sei's public RPC (CORS-open, no proxy), with hex->decimal decoding. Wired into the viem and ethers quickstarts as "Try It Live". - SandboxEmbed: click-to-load iframe wrapper for external sandboxes. Tier 2 (CodeSandbox) on the viem/ethers quickstarts for editable, anonymously-runnable viem/ethers TypeScript; Tier 3 (Remix) on deploy-verify/erc20/erc721 to compile + deploy Solidity to Sei testnet, paired with AddSeiButton. Surfaces use theme-agnostic translucent styles (Mintlify does not apply dark:bg-* to custom-snippet divs). No npm imports; all declarations live inside the component per Mintlify's runtime rules. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
PR SummaryLow Risk Overview Those widgets are wired through a broad set of EVM MDX pages—quickstarts (viem, ethers, Python), parity examples (multicall, precompiles, wagmi, errors, tx lifecycle), toolchain guides (Foundry, Hardhat, general), debugging Reviewed by Cursor Bugbot for commit 0a5a915. Bugbot is set up for automated code reviews on this repo. Configure here. |
…M pages Extends the Tier-1 RunSnippet (read-only JSON-RPC) and Tier-3 Remix deploy embeds beyond the initial 5 example pages: - examples: erc1155 (Remix deploy), transaction-lifecycle, multicall, error-handling, wagmi-react, sei-precompiles (RunSnippet) - smart contracts: evm-general, evm-hardhat, evm-foundry, evm-wizard, evm-verify-contracts (Remix deploy), python-quickstart (RunSnippet) - debugging-contracts: RunSnippet diagnostics mapping cast chain-id/gas-price/nonce/balance All RPC calls verified live against Sei mainnet; all pages render with zero errors via mint dev. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 0a5a915. Configure here.
|
|
||
| <RunSnippet | ||
| method="eth_call" | ||
| params={[{ to: '0x0000000000000000000000000000000000001001', data: '0x5b43bc99000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000047573656900000000000000000000000000000000000000000000000000000000' }, 'latest']} |
There was a problem hiding this comment.
Bank precompile call data wrong
Medium Severity
The RunSnippet eth_call data for Bank.name('usei') is not valid ABI encoding: the string length word and the "usei" bytes are merged (…000475736569… instead of a 0x04 length word followed by 75736569), so the live widget is unlikely to succeed or match the page’s description of a SEI name response.
Reviewed by Cursor Bugbot for commit 0a5a915. Configure here.


What is the purpose of the change?
Adds interactive, runnable content across the EVM docs — read-only "Run" buttons and click-to-load editor/deploy embeds — so developers can try JSON-RPC calls and deploy contracts without leaving the docs.
Originally scoped to 5 example pages; now extended across the EVM examples, the Smart Contracts group, and the debugging page — 18 pages total, built from two self-contained Mintlify snippets plus the existing
AddSeiButton.Snippets
snippets/run-snippet.jsx— Tier 1: read-only "Run" buttonsaccess-control-allow-origin: *, so no proxy is needed). Hex results auto-decode to decimal; copy + request-timing included; RPC errors surface in a dedicated panel.snippets/sandbox-embed.jsx— Tier 2 & 3: click-to-load editor embedsAddSeiButton.srcis deferred until the reader clicks, so pages pay nothing on load.Pages wired
Examples (
evm/evm-parity/examples/)eth_callto Multicall3 at0xcA11…CA11), error-handling (a real revert + a real RPC argument error), wagmi-react, sei-precompiles (Bank precompile)Smart Contracts group (
evm/*)eth_chainIdchecks (testnet + mainnet, to validate the RPC endpoints used in config) + Tier-3 Remix "no-install deploy" (Counter)chain_id/block_number/get_balance)Debugging (
evm/debugging-contracts)castcommands:cast chain-id/gas-price/nonce/balanceIntentionally skipped: pointer-contracts (no clean anonymous read — needs a user-supplied CosmWasm address) and solidity-resources (links page). No new Tier-2 (CodeSandbox) embeds were added on the additional pages.
Notes / verification
mint dev+ headless Chrome: all 18 pages return HTTP 200, every component mounts, zero page errors, zero console errors. Interactive checks: multicall Run → liveeth_calldecoded to the current block number (~300 ms); error-handling Run → red "execution reverted" panel; Remix embeds load the preloaded contract and frame inside Mintlify with no CSP/X-Frame refusal. Every wired RPC call confirmed live against Sei mainnet/testnet.dark:bg-*/dark:border-*to custom-snippet container<div>s (onlydark:text-*works).cgtx45,qs82lw) were created anonymously via the Define API and should be re-created under a Sei-owned CodeSandbox account for durability/branding. Tier-2 for the python quickstart is deferred (web3.py can't run in CodeSandbox's JS-only browser bundler).🤖 Generated with Claude Code