Conversation
cgilbe27
commented
Nov 3, 2025
- Closes evm-core-ts should use viem/wagmi over typechain #411
- Closes Move evm-core-ts to ts-sdk #410
|
Warning Rate limit exceeded@cgilbe27 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 9 minutes and 43 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughThis PR replaces TypeChain code generation with Wagmi/Viem codegen for the evm-core module. Changes include adding Wagmi dependencies, configuring the Wagmi CLI, defining precompile contract ABIs and addresses, and generating Wagmi-based contract wrappers and React hooks. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
src/evm-core/precompile/funtoken.ts (1)
1-1: Document the reason for disabling ESLint.Consider documenting why ESLint is disabled for this file, or enable it with specific rule overrides if only certain rules are problematic.
-/* eslint-disable */ +/* eslint-disable @typescript-eslint/naming-convention */ +// Note: Disabled naming convention checks for ABI constants that follow Solidity conventions
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
yarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (13)
nibiru(1 hunks)package.json(4 hunks)scripts/build.sh(1 hunks)src/evm-core/const.ts(1 hunks)src/evm-core/generated.ts(1 hunks)src/evm-core/index.ts(1 hunks)src/evm-core/precompile/funtoken.ts(1 hunks)src/evm-core/precompile/index.ts(1 hunks)src/evm-core/precompile/oracle.ts(1 hunks)src/evm-core/precompile/precompile.ts(1 hunks)src/evm-core/precompile/wasm.ts(1 hunks)src/index.ts(1 hunks)wagmi.config.ts(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2024-10-16T16:15:54.452Z
Learnt from: Unique-Divine
Repo: NibiruChain/ts-sdk PR: 254
File: packages/nibijs/src/chain/types.ts:0-0
Timestamp: 2024-10-16T16:15:54.452Z
Learning: The user Unique-Divine has updated the code to remove the export of `newCoin` and `newCoins` from `cosmjs/proto-signing` to align with the PR objectives of not exporting third-party packages directly and avoiding unnecessary aliasing.
Applied to files:
src/evm-core/precompile/index.tssrc/evm-core/index.tssrc/index.ts
🧬 Code graph analysis (4)
src/evm-core/precompile/funtoken.ts (1)
src/evm-core/precompile/precompile.ts (1)
HexAddr(1-1)
src/evm-core/precompile/wasm.ts (1)
src/evm-core/precompile/precompile.ts (1)
HexAddr(1-1)
src/evm-core/precompile/oracle.ts (1)
src/evm-core/precompile/precompile.ts (1)
HexAddr(1-1)
wagmi.config.ts (4)
src/evm-core/precompile/wasm.ts (1)
ADDR_WASM_PRECOMPILE(4-5)src/evm-core/precompile/oracle.ts (1)
ADDR_ORACLE_PRECOMPILE(4-5)src/evm-core/precompile/funtoken.ts (1)
ADDR_FUNTOKEN_PRECOMPILE(5-6)src/evm-core/const.ts (2)
ADDR_ERIS_EVM(7-7)ADDR_WNIBI(1-1)
🔇 Additional comments (12)
nibiru (1)
1-1: Submodule commit does not align with stated PR objectives—manual verification required.The nibiru submodule pointer update references commit
4abe1407f538470e1bf790eb9fa9340bae01802b, which is a valid, reachable commit. However, the commit message is "docs(bank): README fixes"—a documentation-only change unrelated to the stated PR objectives (TypeChain → Wagmi/Viem migration, evm-core relocation).Concerns:
- The submodule commit contains no code changes supporting the PR's stated refactoring goals
- No related changes detected in parent repository (wagmi.config.ts, package.json updates, evm-core exports)
- This suggests either incomplete integration or misaligned submodule targeting
Action: Confirm that:
- This submodule update is intentional and necessary for the PR
- Supporting integration changes (wagmi config, evm-core exports, dependency updates) exist in the parent ts-sdk repository
- The submodule pointer targets the correct nibiru commit with the required functionality
src/index.ts (1)
4-4: Root barrel now surfacesevm-coreAPIs.
This keeps the relocation effort cohesive—consumers can reach the new Wagmi-powered surface from the canonical entrypoint without path rewrites.src/evm-core/precompile/precompile.ts (1)
1-1: LocalHexAddrtemplate keeps address typing self-contained.
Nice way to gate precompile constants behind a 0x-prefixed contract address type without leaking external typings—exactly in line with prior feedback on third-party exports. Based on learningssrc/evm-core/precompile/index.ts (1)
1-4: Unified precompile barrel keeps imports tidy.
Pulling the concrete precompile modules plus the shared types into one surface simplifies migration for downstream callers.scripts/build.sh (1)
7-7: Early Wagmi codegen keeps build deterministic.
Runningyarn wagmi:generateup front guarantees the generated contracts land before the GraphQL/proto pipelines kick in, sobuild:tscand docgen never compile against stale stubs.src/evm-core/index.ts (1)
1-3: Barrel completes the evm-core surface.
Exporting precompile, const, and generated modules together exposes the whole Wagmi toolset through one entry, matching the repository move objective.wagmi.config.ts (2)
11-16: LGTM! Flexible ABI parsing.The
readAbihelper correctly handles both pure ABI arrays and Hardhat-style artifacts with anabifield, providing good flexibility for different ABI sources.
42-46: Verify WNIBI artifact exists in nibiru Git submodule or migrate to npm package.The WNIBI artifact path
./nibiru/x/evm/embeds/artifacts/contracts/WNIBI.sol/WNIBI.jsonreferences a Git submodule (nibiru is defined in.gitmodules) that is not initialized in the current repository state. Unlike other ABIs which reference./node_modules/@nibiruchain/solidity/abi/, the WNIBI path points to a local submodule artifact that may not be available at build time.Ensure: (1) the nibiru submodule is properly initialized during the build process, (2) the artifact exists at that path in the nibiru repository, or (3) migrate WNIBI to use the npm package path like other ABIs for consistency.
src/evm-core/precompile/wasm.ts (1)
1-221: LGTM! Well-structured precompile definition.The Wasm precompile address and ABI are correctly defined with proper type safety using
as const. The ABI includes all necessary functions (execute, executeMulti, instantiate, query, queryRaw) with appropriate input/output types and state mutability.src/evm-core/precompile/funtoken.ts (1)
4-251: LGTM! Complete FunToken precompile definition.The FunToken precompile address and ABI are well-defined with comprehensive functions for token operations (balance queries, bank interactions, address conversion). The tuple structures for
FunTokenandNibiruAccountare properly specified.src/evm-core/precompile/oracle.ts (1)
1-77: LGTM! Clean Oracle precompile definition.The Oracle precompile address and ABI are correctly defined with two view functions for querying price data. The function signatures match standard oracle interfaces (ChainLink-style round data and exchange rate queries).
package.json (1)
39-39: Dependencies are already at current versions.The package.json contains:
- wagmi: 2.19.2 (matches latest)
- @wagmi/cli: 2.7.1 (exceeds latest reported 1.5.0)
- @nibiruchain/solidity: 0.0.7 (matches latest)
No version updates needed.