refactor: migrate all ethers users → viem, drop ethers dep (CC-43) - #434
Open
jhfnetboy wants to merge 1 commit into
Open
refactor: migrate all ethers users → viem, drop ethers dep (CC-43)#434jhfnetboy wants to merge 1 commit into
jhfnetboy wants to merge 1 commit into
Conversation
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
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 (
JsonRpcProvider→createPublicClient;ethers.Contractreads→readContract;ethers.Wallet→privateKeyToAccount+createWalletClient; recovery writes→writeContract+waitForTransactionReceipt;formatGwei/formatEther/parseEther/isAddress/zeroAddress; authrecoverAddress; paymastertx.input/effectiveGasPrice/decodeFunctionData) + frontendguardian-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 (*/50closed the block comment → syntax error).sdk/src/server/services/guard-checker.ts— orphaned legacy source (non-workspacesdk/, 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"fromaastar/package.json; npm removed ethers + its 7 unique transitive deps (only the ethers subtree; next/SDK/viem untouched). No liveethersreference 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 0green; 3 migrated scriptsnode --check+ run-verified.Note
Stacked on
feat/cc33-credibility-page→chore/bump-sdk-0.43.0. Rebase to master as the stack merges.https://claude.ai/code/session_01RajETCvboSvhadpqMbekNx