Skip to content

feat(sdk-coin-starknet): add UDC deploy builder for master-wallet auto-init#9219

Merged
shubham-damkondwar merged 1 commit into
masterfrom
CECHO-1616
Jul 9, 2026
Merged

feat(sdk-coin-starknet): add UDC deploy builder for master-wallet auto-init#9219
shubham-damkondwar merged 1 commit into
masterfrom
CECHO-1616

Conversation

@shubham-damkondwar

@shubham-damkondwar shubham-damkondwar commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Add UdcDeployBuilder to produce INVOKE v3 calls to UDC deployContract (unique=0) so WP can deploy user Starknet OZ EthAccounts from a master wallet.

CECHO-1616

TICKET: CECHO-1616

@linear-code

linear-code Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

CECHO-1616

@shubham-damkondwar

Copy link
Copy Markdown
Contributor Author

@claude please review

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Claude finished @shubham-damkondwar's task —— View job


Code Review for UDC Deploy Builder ✅

I've completed my review of the UdcDeployBuilder implementation for INVOKE v3 calls to UDC deployContract. Here's my comprehensive analysis:

Todo List:

  • Read repository guidelines from CLAUDE.md
  • Analyze main implementation files
  • Review UdcDeployBuilder class implementation
  • Check transaction handling updates
  • Review utility functions and constants
  • Examine test coverage and quality
  • Provide comprehensive feedback

Overall Assessment: LGTM

This is a well-implemented feature that properly integrates UDC (Universal Deployer Contract) deployment functionality into the Starknet SDK. The code follows BitGo's architecture patterns and includes comprehensive validation and testing.

🎯 Strengths

  1. Clean Architecture:

    • Properly extends TransactionBuilder following established patterns
    • Consistent with existing builders (TransferBuilder, WalletInitializationBuilder)
    • Factory pattern integration in transactionBuilderFactory.ts:24-26
  2. Comprehensive Validation:

    • Input validation for class hash, salt, and constructor calldata (udcDeployBuilder.ts:30-43)
    • Address validation using existing utility functions
    • Proper error messages using BuildTransactionError
  3. Security-Conscious Design:

    • Forces unique=0 to ensure deterministic addresses (udcDeployBuilder.ts:92-93)
    • Validates sender address is set before building (udcDeployBuilder.ts:126-131)
    • Proper BigInt handling for felt252 values
  4. Excellent Test Coverage:

    • Round-trip testing (build → serialize → parse → build)
    • Address consistency validation
    • Edge case testing for invalid inputs
    • Integration with transaction factory

🔍 Code Quality Observations

UdcDeployBuilder (udcDeployBuilder.ts)

  • Good: Clear separation of concerns with deployParams() and fromPublicKey() methods
  • Good: Proper inheritance and method overrides (initBuilder, buildImplementation)
  • Good: Comprehensive input validation with specific error messages

Utility Functions (utils.ts)

  • Good: calculateContractAddressFromHash() replicates starknet.js behavior using @scure/starknet
  • Good: isUdcDeployCall() and parseUdcDeployCall() provide robust call detection and parsing
  • Good: Proper export organization in default export object

Transaction Factory Integration (transactionBuilderFactory.ts:24-26)

  • Good: Clean integration with existing transaction type detection
  • Good: Fallback logic maintains backward compatibility

🏗️ Architecture Decisions

  1. Address Calculation: Uses deployer=0 to match BitGo's counterfactual address computation - excellent design choice
  2. Unique Parameter: Enforces unique=false to ensure deterministic deployment addresses - critical for wallet infrastructure
  3. Public Key Handling: Supports both compressed and uncompressed public keys with proper conversion

🧪 Test Quality

The test suite is comprehensive and well-structured:

  • Tests both deployParams() and fromPublicKey() code paths
  • Validates round-trip serialization/deserialization
  • Checks address consistency with existing computeStarknetAddress()
  • Tests broadcast format compatibility

💡 Minor Suggestions

  1. Type Safety Enhancement: Consider making _targetAddress non-optional after successful deployParams() call
  2. Documentation: The JSDoc comments are good, but could include usage examples
  3. Error Context: Some error messages could include more context about expected vs actual values

🔒 Security Considerations

  • ✅ Proper input validation prevents malformed transactions
  • ✅ Forces deterministic deployment (unique=false)
  • ✅ Validates all required parameters before transaction construction
  • ✅ No exposure of private keys or sensitive data

📋 Compliance with BitGoJS Standards

  • ✅ Follows conventional commit format
  • ✅ Avoids any types (uses proper TypeScript interfaces)
  • ✅ Consistent with existing transaction builder patterns
  • ✅ Proper error handling using BitGo error types

🎯 Recommendation: APPROVE

This PR successfully implements the UDC deploy builder functionality with proper architecture, comprehensive testing, and security considerations. The implementation is ready for production use.


Job Run | Branch: CECHO-1616

@shubham-damkondwar shubham-damkondwar marked this pull request as ready for review July 9, 2026 10:56
@shubham-damkondwar shubham-damkondwar requested a review from a team as a code owner July 9, 2026 10:56
…o-init

Add UdcDeployBuilder to produce INVOKE v3 calls to UDC deployContract
(unique=0) so WP can deploy user EthAccounts from a master wallet.

CECHO-1616

TICKET: CECHO-1616
@shubham-damkondwar shubham-damkondwar merged commit 9fb8fca into master Jul 9, 2026
24 checks passed
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.

2 participants