0%
How to Get the initCode of a Smart Contract Account
How to Get the initCode of a Smart Contract Account
Written by Liang
Published on August 1, 20241 min read
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:
js-templates
Copied
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?
Related FAQs
Wallet Services
Best practices to limit Gas Manager spend
Configure spend limits, allow/blocklists, and secure API keys with Alchemy’s Gas Manager. Protect your app from misuse and Sybil attacks with best practices!Wallet Services
How to Fix Gas Manager Errors
How to understand Gas Manager errors and resolve them.Wallet Services
How to Fix Precheck failed Errors
How to resolve precheck failed error