Skip to content

Conversation

@0xRAG
Copy link
Contributor

@0xRAG 0xRAG commented Aug 21, 2025

Description

This PR adds support for multiple owners in EVM smart accounts. It updates the API to allow specifying multiple owners when creating, retrieving, or using smart accounts, while maintaining backward compatibility with the existing single-owner approach.

Key changes:

  • Added owners parameter to complement the existing owner parameter in account creation and retrieval methods
  • Updated toEvmSmartAccount and toNetworkScopedEvmSmartAccount to support multiple owners
  • Added ability to specify a custom signer for user operations, allowing any of the account owners to sign transactions
  • Added validation to ensure at least one owner is provided
  • Updated error messages to be more descriptive when owner validation fails

Tests

Running new example: pnpm tsx evm/smart-accounts/multiOwner.ts

Smart account address: 0x351e92DF2a15638163B0B223b16F76017D2Fb5ea
Smart account owners: [
  {
    address: '0xea833DBe6daFB8abF0828FAEFBcBEB2E23Eb7375',
    signMessage: [AsyncFunction: signMessage],
    sign: [AsyncFunction: sign],
    signTransaction: [AsyncFunction: signTransaction],
    signTypedData: [AsyncFunction: signTypedData],
    transfer: [AsyncFunction: transfer],
    listTokenBalances: [AsyncFunction: listTokenBalances],
    requestFaucet: [AsyncFunction: requestFaucet],
    sendTransaction: [AsyncFunction: sendTransaction],
    quoteFund: [AsyncFunction: quoteFund],
    fund: [AsyncFunction: fund],
    waitForFundOperationReceipt: [AsyncFunction: waitForFundOperationReceipt],
    quoteSwap: [AsyncFunction: quoteSwap],
    swap: [AsyncFunction: swap],
    useSpendPermission: [AsyncFunction: useSpendPermission],
    name: 'Owner-1',
    type: 'evm-server',
    policies: undefined,
    useNetwork: [AsyncFunction: useNetwork]
  },
  {
    address: '0xc730aaEE6Ef51C931e216297B08b260235aFfd91',
    signMessage: [AsyncFunction: signMessage],
    sign: [AsyncFunction: sign],
    signTransaction: [AsyncFunction: signTransaction],
    signTypedData: [AsyncFunction: signTypedData],
    transfer: [AsyncFunction: transfer],
    listTokenBalances: [AsyncFunction: listTokenBalances],
    requestFaucet: [AsyncFunction: requestFaucet],
    sendTransaction: [AsyncFunction: sendTransaction],
    quoteFund: [AsyncFunction: quoteFund],
    fund: [AsyncFunction: fund],
    waitForFundOperationReceipt: [AsyncFunction: waitForFundOperationReceipt],
    quoteSwap: [AsyncFunction: quoteSwap],
    swap: [AsyncFunction: swap],
    useSpendPermission: [AsyncFunction: useSpendPermission],
    name: 'Owner-2',
    type: 'evm-server',
    policies: undefined,
    useNetwork: [AsyncFunction: useNetwork]
  }
]
User operation hash with default owner: 0x3de322ecdbeb73d2f5d35ca2b6977da1641d1a8875c5d738e2c35f8c2b8dd46c
User operation result: {
  smartAccountAddress: '0x351e92DF2a15638163B0B223b16F76017D2Fb5ea',
  transactionHash: '0xea005e8305762f9767b475a77675a467ab3a56b9a5fe5288fc98910502f13936',
  status: 'complete',
  userOpHash: '0x3de322ecdbeb73d2f5d35ca2b6977da1641d1a8875c5d738e2c35f8c2b8dd46c'
}
User operation hash with second owner: 0x15bbe5675f89b5721ce295242fb3723c3bed4eb19df16eecdb2ad8ad56592053
User operation result with second owner: {
  smartAccountAddress: '0x351e92DF2a15638163B0B223b16F76017D2Fb5ea',
  transactionHash: '0x815818229f3f0c29a20e10eaa568ed407cbbc566f7989664bd72575f680e1fb7',
  status: 'complete',
  userOpHash: '0x15bbe5675f89b5721ce295242fb3723c3bed4eb19df16eecdb2ad8ad56592053'
}

Checklist

  • Updated the typescript README if relevant
  • Added a changelog entry
  • Added e2e tests if introducing new functionality

@linear
Copy link

linear bot commented Aug 21, 2025

@cb-heimdall
Copy link

cb-heimdall commented Aug 21, 2025

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

@0xRAG
Copy link
Contributor Author

0xRAG commented Aug 21, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

@0xRAG 0xRAG force-pushed the CDPSDK-1519 branch 2 times, most recently from 03a8173 to 0a6537f Compare August 22, 2025 04:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants