0%
SupportWallet Services
How to get the initCode of a smart contract account

How to get the initCode of a smart contract account

Written byAuthor headshotLiang
Published on August 1, 2024

Here are two ways to get the initCode of a smart contract account using our Account Kit SDK

Option 1: using AccountKit SDK

With our AccountKit SDK, obtaining the account initCode is straightforward.

Simply use the following command:


await provider.account.getInitCode()

Option 2: not using the AccountKit SDK

If you choose not to use our AccountKit SDK, you can still retrieve the initCode by following the ERC-4337 Specification.

Key Points from the specification:

  • The definition of initCode is detailed in the linked document.
  • initCode is described as the "concatenation of factory address and factoryData (or empty)."
  • If the account is not yet deployed, you must create the initCode according to this specification.
Was this article helpful?
Support banner background

Not finding what you need?

Open a Support Ticket