Skip to content

refactor: migrate all ethers users → viem, drop ethers dep (CC-43) - #434

Open
jhfnetboy wants to merge 1 commit into
feat/cc33-credibility-pagefrom
feat/cc43-ethers-viem
Open

refactor: migrate all ethers users → viem, drop ethers dep (CC-43)#434
jhfnetboy wants to merge 1 commit into
feat/cc33-credibility-pagefrom
feat/cc43-ethers-viem

Conversation

@jhfnetboy

Copy link
Copy Markdown
Member

What

Unify YAA on viem, drop ethers. Migrates the 8 CC-43 inherited files plus 4 more ethers users the initial scope missed (surfaced in Codex review), so the ethers dep can be removed cleanly.

8 inherited files (Codex: all 6 correctness points PASS)

Backend services (JsonRpcProvidercreatePublicClient; ethers.Contract reads→readContract; ethers.WalletprivateKeyToAccount+createWalletClient; recovery writes→writeContract+waitForTransactionReceipt; formatGwei/formatEther/parseEther/isAddress/zeroAddress; auth recoverAddress; paymaster tx.input/effectiveGasPrice/decodeFunctionData) + frontend guardian-sign (createWalletClient+custom(window.ethereum), EOA track kept; hashMessage({raw}) reproduces the EIP-191 digest). guardian placeholder guard builds the sentinel at runtime (dodges secret-scan false positive).

+4 additional ethers users → viem

  • aastar/check-account.js, aastar/test-userop-hash.js — dev/debug scripts → viem CJS; run-verified against Sepolia public RPC.
  • scripts/update-superpaymaster-price.js — ops cron script → viem CJS; also fixed a pre-existing JSDoc bug (*/50 closed the block comment → syntax error).
  • sdk/src/server/services/guard-checker.ts — orphaned legacy source (non-workspace sdk/, unused, already unbuildable via a missing import); only its ethers usage migrated to viem. Pre-existing missing-import breakage is out of scope.

Dep removal

Dropped "ethers": "^6.15.0" from aastar/package.json; npm removed ethers + its 7 unique transitive deps (only the ethers subtree; next/SDK/viem untouched). No live ethers reference remains in the repo.

Review

Codex (fresh) → CHANGES REQUESTED (4 missed ethers users) → all migrated → re-review APPROVE.

Gates

backend type-check/build/41 tests + frontend type-check/build/lint --max-warnings 0 green; 3 migrated scripts node --check + run-verified.

Note

Stacked on feat/cc33-credibility-pagechore/bump-sdk-0.43.0. Rebase to master as the stack merges.

https://claude.ai/code/session_01RajETCvboSvhadpqMbekNx

YAA unifies on viem and drops ethers. The 8 inherited YAA files named in CC-43
are migrated (JsonRpcProvider→createPublicClient; ethers.Contract reads→
readContract; ethers.Wallet→privateKeyToAccount+createWalletClient; recovery
writes→writeContract+waitForTransactionReceipt; format/parse/isAddress/
ZeroAddress→viem; auth recoverAddress; paymaster tx.input/effectiveGasPrice/
decodeFunctionData; guardian-sign personal_sign via createWalletClient+custom,
EOA track kept). guardian ETH_PRIVATE_KEY placeholder guard now builds the
sentinel at runtime (no 64-hex literal, dodges secret-scan false positive).

Also migrated the remaining ethers users the initial scope missed (found in
Codex review) so the ethers dep can actually be removed without breaking them:
- aastar/check-account.js, aastar/test-userop-hash.js — dev/debug scripts →
  viem CJS (createPublicClient/readContract/encodeAbiParameters/keccak256);
  run-verified against Sepolia public RPC.
- scripts/update-superpaymaster-price.js — ops cron script → viem CJS
  (writeContract+waitForTransactionReceipt); also fixed a pre-existing JSDoc bug
  where "*/50" closed the block comment early (syntax error).
- sdk/src/server/services/guard-checker.ts — orphaned legacy source in the
  non-workspace sdk/ tree (unused, and already unbuildable: imports a missing
  ../providers/ethereum-provider); only its ethers usage was migrated to viem
  (readContract + zeroAddress) to clear the dep — its pre-existing missing-import
  breakage is out of CC-43 scope.

Dropped "ethers": "^6.15.0" from aastar/package.json; npm removed ethers + its 7
unique transitive deps from the lockfile (only the ethers subtree; next / SDK /
viem untouched). No live "ethers" reference remains anywhere in the repo.

Gates: backend type-check/build/41 tests + frontend type-check/build/lint
--max-warnings 0 green; 3 migrated scripts node --check + run-verified.

Claude-Session: https://claude.ai/code/session_01RajETCvboSvhadpqMbekNx
@jhfnetboy
jhfnetboy requested a review from fanhousanbu as a code owner July 14, 2026 07:23
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

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