-
Notifications
You must be signed in to change notification settings - Fork 3
feat: SDK upgrade with the ModularEtherspotWalletFactory contracts (on all chains) with latest IHook #64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Updated factory, bootstrap and MOECDSA validator contract addresses. - Updated CHANGLOG.md with changes. - Bumped version from 5.1.2 to 6.0.0.
WalkthroughThis update introduces breaking changes by updating the contract addresses for Wallet Factory, Bootstrap, and Multiple Owner ECDSA Validator across the SDK, examples, and constants. The package version is incremented to 6.0.0, and minor formatting improvements are applied throughout the affected files. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant ModularSdk
participant NetworkConstants
User->>ModularSdk: Initialize with network/chain info
ModularSdk->>NetworkConstants: Retrieve contract addresses
NetworkConstants-->>ModularSdk: Return updated addresses (walletFactory, bootstrap, validator)
ModularSdk-->>User: SDK ready with new contract addresses
Possibly related PRs
Suggested reviewers
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
examples/basics/transfer-erc20.tsOops! Something went wrong! :( ESLint: 8.28.0 ReferenceError: Cannot read config file: /.eslintrc.js examples/basics/custom-chain.tsOops! Something went wrong! :( ESLint: 8.28.0 ReferenceError: Cannot read config file: /.eslintrc.js src/sdk/network/constants.tsOops! Something went wrong! :( ESLint: 8.28.0 ReferenceError: Cannot read config file: /.eslintrc.js ✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
CHANGELOG.md
(1 hunks)examples/basics/custom-chain.ts
(2 hunks)examples/basics/transfer-erc20.ts
(1 hunks)package.json
(1 hunks)src/sdk/network/constants.ts
(37 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
src/sdk/network/constants.ts (1)
src/sdk/network/interfaces.ts (1)
NetworkConfig
(9-20)
🔇 Additional comments (8)
src/sdk/network/constants.ts (2)
45-48
: Approve formatting improvements.The conversion to multiline format with trailing commas improves readability and maintainability.
544-545
: Verify consistency of default exported constants.The default constants have been updated to match the new addresses. Ensure these align with the addresses used in the Networks object.
package.json (1)
3-3
: Appropriate major version bump for breaking changes.The version increment from 5.1.2 to 6.0.0 correctly follows semantic versioning for breaking changes, as the contract address updates will affect precomputed modular account addresses.
CHANGELOG.md (1)
2-8
: Comprehensive breaking changes documentation.The changelog properly documents the breaking changes with clear before/after contract addresses and explains the impact on precomputed modular account addresses. This will help users understand the migration requirements.
examples/basics/custom-chain.ts (4)
15-17
: Contract addresses updated correctly.The contract addresses have been properly updated to match the new deployed contracts:
- Wallet Factory:
0x38CC0EDdD3a944CA17981e0A19470d2298B8d43a
- Bootstrap:
0xCF2808eA7d131d96E5C73Eb0eCD8Dc84D33905C7
- Multiple Owner ECDSA Validator:
0x0eA25BF9F313344d422B513e1af679484338518E
These align with the breaking changes documented in the PR objectives.
24-35
: Good formatting improvements.The consistent use of single quotes, trailing commas, and proper formatting enhances code readability and maintainability.
37-47
: Excellent refactoring to options object pattern.The refactoring from multi-line constructor arguments to a single options object significantly improves readability while maintaining all the same parameters and functionality. This follows modern JavaScript/TypeScript best practices.
77-77
: Minor improvement to while loop condition.Removing the redundant parentheses simplifies the condition without changing its logic. Good cleanup.
walletFactory: '0x38CC0EDdD3a944CA17981e0A19470d2298B8d43a', | ||
bootstrap: '0xCF2808eA7d131d96E5C73Eb0eCD8Dc84D33905C7', | ||
multipleOwnerECDSAValidator: '0x0eA25BF9F313344d422B513e1af679484338518E', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Verify new contract addresses are deployed and functional.
The contract addresses for walletFactory
, bootstrap
, and multipleOwnerECDSAValidator
have been systematically updated across all networks. Ensure these new addresses correspond to deployed and functional contracts.
Also applies to: 112-114, 125-127, 137-139, 149-151, 161-163
🏁 Script executed:
#!/bin/bash
# Description: Verify that the new contract addresses are deployed on multiple chains
# Expected: Contract code should exist at these addresses
# Check a few key networks for contract deployment
declare -A networks=(
["1"]="https://eth-mainnet.g.alchemy.com/v2/demo"
["10"]="https://opt-mainnet.g.alchemy.com/v2/demo"
["137"]="https://polygon-mainnet.g.alchemy.com/v2/demo"
["42161"]="https://arb-mainnet.g.alchemy.com/v2/demo"
)
addresses=(
"0x38CC0EDdD3a944CA17981e0A19470d2298B8d43a" # walletFactory
"0xCF2808eA7d131d96E5C73Eb0eCD8Dc84D33905C7" # bootstrap
"0x0eA25BF9F313344d422B513e1af679484338518E" # multipleOwnerECDSAValidator
)
for chain_id in "${!networks[@]}"; do
rpc_url="${networks[$chain_id]}"
echo "Checking chain $chain_id..."
for address in "${addresses[@]}"; do
echo " Checking address $address"
response=$(curl -s -X POST \
-H "Content-Type: application/json" \
-d "{\"jsonrpc\":\"2.0\",\"method\":\"eth_getCode\",\"params\":[\"$address\",\"latest\"],\"id\":1}" \
"$rpc_url")
code=$(echo "$response" | jq -r '.result')
if [ "$code" = "0x" ] || [ "$code" = "null" ]; then
echo " ❌ No contract code found at $address on chain $chain_id"
else
echo " ✅ Contract deployed at $address on chain $chain_id"
fi
done
done
Length of output: 9786
Improve verification script and validate contract deployments
The current script treats RPC errors (e.g. “error code: 1015”) as successful deployments because an empty result doesn’t equal “0x” or “null”. Please update your checks and verify each new address truly hosts bytecode:
• Handle JSON-RPC errors: fail when the response contains an "error"
field.
• Ensure eth_getCode
returns non-empty bytecode (length > 2, not just prefix “0x”).
• Use valid provider API keys (avoid demo/rate-limited endpoints).
• Manually confirm on block explorers (Etherscan, Polygonscan, Arbiscan, Optimism Explorer).
Example snippet update:
- code=$(echo "$response" | jq -r '.result')
- if [ "$code" = "0x" ] || [ "$code" = "null" ]; then
+ if echo "$response" | jq -e 'has("error") or .result == "0x" or .result == "null"' >/dev/null; then
echo " ❌ No contract code found at $address on chain $chain_id"
else
echo " ✅ Contract deployed at $address on chain $chain_id"
Apply these fixes to lines 100–102, 112–114, 125–127, 137–139, 149–151, and 161–163.
🤖 Prompt for AI Agents
In src/sdk/network/constants.ts around lines 100 to 102 and also at lines
112-114, 125-127, 137-139, 149-151, and 161-163, the verification script for
contract addresses does not properly handle JSON-RPC errors and may incorrectly
treat error responses as successful deployments. Update the script to check if
the JSON response contains an "error" field and fail if it does. Also, ensure
that the returned bytecode from eth_getCode is longer than just the "0x" prefix
(length > 2) to confirm actual contract deployment. Replace demo API keys with
valid provider keys to avoid rate limits and manually verify addresses on block
explorers for completeness.
@@ -13,7 +13,7 @@ dotenv.config(); | |||
// add/change these values | |||
const recipient = '0x80a1874E1046B1cc5deFdf4D3153838B72fF94Ac'; // recipient wallet address | |||
const value = '0.1'; // transfer value | |||
const tokenAddress = process.env.TOKEN_ADDRESS as string; // token address | |||
const tokenAddress = '0xf7e6a76F138817c39dC0b5fCb409f642490CcEdD'; // token address |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Consider reverting to environment variable for token address.
Hardcoding the token address reduces flexibility and may cause issues if this address is not valid across all supported chains or becomes outdated. The previous approach using process.env.TOKEN_ADDRESS
was more flexible for users.
-const tokenAddress = '0xf7e6a76F138817c39dC0b5fCb409f642490CcEdD'; // token address
+const tokenAddress = process.env.TOKEN_ADDRESS || '0xf7e6a76F138817c39dC0b5fCb409f642490CcEdD'; // token address
This provides the hardcoded address as a fallback while maintaining the flexibility of environment variable configuration.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
const tokenAddress = '0xf7e6a76F138817c39dC0b5fCb409f642490CcEdD'; // token address | |
- const tokenAddress = '0xf7e6a76F138817c39dC0b5fCb409f642490CcEdD'; // token address | |
+ const tokenAddress = process.env.TOKEN_ADDRESS || '0xf7e6a76F138817c39dC0b5fCb409f642490CcEdD'; // token address |
🤖 Prompt for AI Agents
In examples/basics/transfer-erc20.ts at line 16, replace the hardcoded token
address with a reference to an environment variable, such as
process.env.TOKEN_ADDRESS, to improve flexibility. Keep the current hardcoded
address as a fallback default in case the environment variable is not set,
ensuring the code works across different environments and chains without manual
changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description
SmartContract Change Details
SDK updates
Updated contract addresses for all chains
release version of sdk upgraded from
6.0.1
to7.0.0
contract Address updates
0x2A40091f044e48DEB5C0FCbc442E443F3341B451
to0x38CC0EDdD3a944CA17981e0A19470d2298B8d43a
0x0D5154d7751b6e2fDaa06F0cC9B400549394C8AA
to0xCF2808eA7d131d96E5C73Eb0eCD8Dc84D33905C7
0x0740Ed7c11b9da33d9C80Bd76b826e4E90CC1906
to0x0eA25BF9F313344d422B513e1af679484338518E
0xDcA918dd23456d321282DF9507F6C09A50522136
.enhance
getInitCode
function to include theHookMultiplexer
address set as default HookTypes of changes