Skip to content

docs(evm): fix broken viem import, migrate Hardhat guide to v3, add Python quickstart#14

Open
alexander-sei wants to merge 1 commit into
mainfrom
docs/evm-fixes-hardhat-v3
Open

docs(evm): fix broken viem import, migrate Hardhat guide to v3, add Python quickstart#14
alexander-sei wants to merge 1 commit into
mainfrom
docs/evm-fixes-hardhat-v3

Conversation

@alexander-sei
Copy link
Copy Markdown
Collaborator

What & why

Several EVM docs shipped code that fails when run verbatim. These fixes were verified against the live Sei RPC and a fresh hardhat@3.7.0 project.

Fixes

  • Broken viem chain import (16 files). import { sei } from '@sei-js/precompiles/viem' doesn't resolve — the published @sei-js/precompiles has no /viem subpath and no sei export, so every viem snippet throws on import. Switched to viem's built-in import { sei } from 'viem/chains' and tightened the viem-quickstart install to npm install viem.
  • Unrunnable read snippets. The viem/ethers "first milestone" used an invalid '0xYourAddress' placeholder that throws; replaced with a real example address.
  • Hardhat guide migrated to Hardhat 3. The guide shipped a Hardhat 2 config that fails to compile under the Hardhat 3 it tells you to install. Now uses plugins: [hardhatToolboxMochaEthers], type: 'http' networks, configVariable + keystore for secrets, and network.getOrCreate() in tests and scripts.
  • UUPS upgrades, plugin-free. @openzeppelin/hardhat-upgrades is Hardhat 2-only, so the upgradeable flow now deploys an ERC1967 proxy directly and upgrades via UUPS upgradeToAndCall. Also dropped __UUPSUpgradeable_init(), which was removed in OpenZeppelin v5 and no longer compiles.
  • networks.mdx now links plain-text RPC endpoints (/learn/dev-chains, /learn/rpc-providers) alongside the interactive widget.
  • New Python (web3.py) quickstart page wired into the nav; removed the duplicated inline Python sections from the viem/ethers quickstarts.
  • npx tsx run instructions added to the TypeScript quickstarts.

Verification

  • viem / ethers / web3.py read snippets run against live mainnet (chain ID 1329).
  • Hardhat 3 guide verified on hardhat@3.7.0: compile, test, ERC20 Ignition deploy, ERC721 script run, and the full UUPS deploy → upgradeToAndCall → V2 cycle.

🤖 Generated with Claude Code

…ython quickstart

Several EVM docs shipped code that fails when run verbatim. The fixes were
verified against the live Sei RPC and a fresh hardhat@3.7.0 project.

- viem examples (16 files): import { sei } from 'viem/chains'. The documented
  '@sei-js/precompiles/viem' subpath/export does not exist in the published
  package, so every viem snippet threw on import. Tighten the viem-quickstart
  install to `npm install viem`.
- viem/ethers read snippets: replace the invalid '0xYourAddress' placeholder
  with a real example address so the first milestone runs as written.
- Hardhat guide -> Hardhat 3: plugins array with hardhat-toolbox-mocha-ethers,
  type:'http' networks, configVariable + keystore for secrets, and
  network.getOrCreate() in tests and scripts (the shipped HH2 config fails to
  compile under the HH3 the guide installs).
- UUPS upgrades -> plugin-free ERC1967 proxy + upgradeToAndCall (the
  @openzeppelin/hardhat-upgrades plugin is HH2-only); drop
  __UUPSUpgradeable_init() (removed in OpenZeppelin v5).
- networks.mdx: link plain-text RPC endpoints alongside the widget.
- Add a Python (web3.py) quickstart page + nav entry; de-duplicate the inline
  Python sections from the viem/ethers quickstarts.
- Add `npx tsx` run instructions to the TypeScript quickstarts.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@mintlify
Copy link
Copy Markdown
Contributor

mintlify Bot commented May 30, 2026

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
sei-docs 🟢 Ready View Preview May 30, 2026, 10:47 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@cursor
Copy link
Copy Markdown

cursor Bot commented May 30, 2026

PR Summary

Low Risk
Documentation-only changes with no runtime or on-chain behavior; residual risk is outdated snippets elsewhere (e.g. deploy-verify still shows Hardhat 2-style config) confusing readers.

Overview
This PR fixes copy-pasteable Sei EVM docs: broken viem chain imports, a Hardhat guide that didn’t match Hardhat 3, and clearer onboarding for Python and network RPCs.

viem / wagmi examples (many files) now use import { sei } from 'viem/chains' instead of @sei-js/precompiles/viem, and the viem quickstart install is npm install viem only. “First milestone” read snippets use a valid example address instead of 0xYourAddress. viem/ethers quickstarts add npx tsx run instructions and drop duplicated inline Python in favor of the new page.

Hardhat (evm-hardhat.mdx) is rewritten for Hardhat 3: npx hardhat --init, ESM, plugins: [hardhatToolboxMochaEthers], HTTP networks with configVariable('SEI_PRIVATE_KEY') + keystore (replacing .env/dotenv), and scripts/tests via network.getOrCreate(). UUPS no longer depends on @openzeppelin/hardhat-upgrades; it documents manual ERC1967 deploy and upgradeToAndCall, and removes __UUPSUpgradeable_init for OpenZeppelin v5.

New evm/python-quickstart.mdx (web3.py read/send/contract) is added to Smart Contracts nav in docs.json. networks.mdx links plain-text RPC docs alongside the widget.

Reviewed by Cursor Bugbot for commit ca896c4. Bugbot is set up for automated code reviews on this repo. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant