fix: correct all deployment configs, add dev presets#7
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly refines the deployment configurations by correcting critical mainnet pool IDs and updating service URLs to the new prod3 environment. It also expands support for Base mainnet by populating its token configurations. A major improvement for developers is the introduction of comprehensive development chain presets, simplifying setup across various networks. These changes collectively enhance the accuracy and usability of the SDK's deployment configurations, ensuring correct interaction with the underlying blockchain infrastructure for both production and development workflows. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces several important updates to the deployment configurations. Key changes include correcting mainnet pool IDs for ETH, BSC, and Base, updating service URLs to *.2.o.cash (prod3), and populating the Base mainnet tokens which were previously empty. Additionally, new development chain presets (ETH_DEV, BSC_DEV, BASE_DEV, SEPOLIA_DEV, BSC_TESTNET_DEV) have been added, and unused MAINNET_CHAINS and TESTNET_CHAINS arrays have been removed for better code hygiene. The README Quick Start has also been updated to reflect these changes. Overall, these changes improve the correctness and flexibility of the SDK's deployment configurations.
src/deployments.ts
Outdated
| ocashContractAddress: DEV_CONTRACT, | ||
| relayerUrl: devRelayer('eth'), | ||
| merkleProofUrl: devFreezer('eth'), | ||
| tokens: ETH_MAINNET.tokens!.map((t) => ({ ...t, depositFeeBps: 0, withdrawFeeBps: 0 })), |
There was a problem hiding this comment.
The non-null assertion operator (!) is used here, assuming ETH_MAINNET.tokens will always be defined. While this might be true in the current deployments.ts file, the ChainConfigInput type defines tokens as optional (tokens?: TokenMetadata[]). If ETH_MAINNET.tokens were ever undefined, this would lead to a runtime error. Consider using optional chaining with a fallback to an empty array for more robust handling.
| tokens: ETH_MAINNET.tokens!.map((t) => ({ ...t, depositFeeBps: 0, withdrawFeeBps: 0 })), | |
| tokens: (ETH_MAINNET.tokens || []).map((t) => ({ ...t, depositFeeBps: 0, withdrawFeeBps: 0 })), |
src/deployments.ts
Outdated
| ocashContractAddress: DEV_CONTRACT, | ||
| relayerUrl: devRelayer('bsc'), | ||
| merkleProofUrl: devFreezer('bsc'), | ||
| tokens: BSC_MAINNET.tokens!.map((t) => ({ ...t, depositFeeBps: 0, withdrawFeeBps: 0 })), |
There was a problem hiding this comment.
Similar to the previous comment, using the non-null assertion operator (!) on BSC_MAINNET.tokens can introduce a potential runtime error if tokens is ever undefined. It's safer to provide a fallback for optional properties.
| tokens: BSC_MAINNET.tokens!.map((t) => ({ ...t, depositFeeBps: 0, withdrawFeeBps: 0 })), | |
| tokens: (BSC_MAINNET.tokens || []).map((t) => ({ ...t, depositFeeBps: 0, withdrawFeeBps: 0 })), |
src/deployments.ts
Outdated
| ocashContractAddress: DEV_CONTRACT, | ||
| relayerUrl: devRelayer('base'), | ||
| merkleProofUrl: devFreezer('base'), | ||
| tokens: BASE_MAINNET.tokens!.map((t) => ({ ...t, depositFeeBps: 0, withdrawFeeBps: 0 })), |
There was a problem hiding this comment.
The non-null assertion operator (!) on BASE_MAINNET.tokens could lead to a runtime error if tokens is undefined. A more defensive approach would be to use optional chaining or a default empty array.
| tokens: BASE_MAINNET.tokens!.map((t) => ({ ...t, depositFeeBps: 0, withdrawFeeBps: 0 })), | |
| tokens: (BASE_MAINNET.tokens || []).map((t) => ({ ...t, depositFeeBps: 0, withdrawFeeBps: 0 })), |
src/deployments.ts
Outdated
| ocashContractAddress: DEV_CONTRACT, | ||
| relayerUrl: devRelayer('sepolia'), | ||
| merkleProofUrl: devFreezer('sepolia'), | ||
| tokens: SEPOLIA_TESTNET.tokens!.map((t) => ({ ...t, depositFeeBps: 0, withdrawFeeBps: 0 })), |
There was a problem hiding this comment.
Using the non-null assertion operator (!) on SEPOLIA_TESTNET.tokens is brittle. If tokens is undefined, this will cause a runtime error. Consider a more robust way to handle this optional property.
| tokens: SEPOLIA_TESTNET.tokens!.map((t) => ({ ...t, depositFeeBps: 0, withdrawFeeBps: 0 })), | |
| tokens: (SEPOLIA_TESTNET.tokens || []).map((t) => ({ ...t, depositFeeBps: 0, withdrawFeeBps: 0 })), |
src/deployments.ts
Outdated
| ocashContractAddress: DEV_CONTRACT, | ||
| relayerUrl: devRelayer('bsctestnet'), | ||
| merkleProofUrl: devFreezer('bsctestnet'), | ||
| tokens: BSC_TESTNET.tokens!.map((t) => ({ ...t, depositFeeBps: 0, withdrawFeeBps: 0 })), |
There was a problem hiding this comment.
The non-null assertion operator (!) on BSC_TESTNET.tokens carries the same risk as noted in previous comments. It's generally safer to explicitly handle cases where tokens might be undefined to prevent potential runtime issues.
| tokens: BSC_TESTNET.tokens!.map((t) => ({ ...t, depositFeeBps: 0, withdrawFeeBps: 0 })), | |
| tokens: (BSC_TESTNET.tokens || []).map((t) => ({ ...t, depositFeeBps: 0, withdrawFeeBps: 0 })), |
- Fix all mainnet pool IDs (ETH, BSC, Base) — verified via cast call on-chain - Update all URLs to *.2.o.cash (prod3) - Populate Base mainnet tokens (ETH + USDC, was empty) - Add dev presets: ETH_DEV, BSC_DEV, BASE_DEV, SEPOLIA_DEV, BSC_TESTNET_DEV with hardcoded token metadata (independent from prod configs) - Remove unused MAINNET_CHAINS/TESTNET_CHAINS arrays - Improve seed validation error message - Update README Quick Start to use SEPOLIA_TESTNET preset Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
4bd9872 to
6b36bc9
Compare
Summary
cast callon-chain*.o.cashto*.2.o.cash(prod3)tokens: []ETH_DEV,BSC_DEV,BASE_DEV,SEPOLIA_DEV,BSC_TESTNET_DEVMAINNET_CHAINS/TESTNET_CHAINSarraysSEPOLIA_TESTNETpreset instead of placeholder URLsTest plan
pnpm run type-checkpassespnpm run test— 37/37 files, 115/115 tests pass🤖 Generated with Claude Code