NextPlanId = 1, NextSubId = 1). This function can only be called once - subsequent calls will fail with AlreadyInitialized.
Parameters
| Name | Type | Description |
|---|---|---|
admin | Address | The admin address that will be stored in instance storage. |
Authorization
None. This function has norequire_auth() call - it relies on the fact that it can only succeed once. The first caller sets the admin.
Return value
None (void).
Events emitted
None.Error cases
| Code | Name | Description |
|---|---|---|
| 1 | AlreadyInitialized | The contract has already been initialized. |
Examples
- Soroban CLI
- SDK
This is typically a one-time setup performed via the CLI immediately after contract deployment.
After initialization, the admin address is stored in instance storage and shares the contract’s TTL. The counters start at 1, so the first plan created will have
plan_id = 1 and the first subscription will have sub_id = 1.