Skip to main content
Sets the admin address and initializes the auto-incrementing counters (NextPlanId = 1, NextSubId = 1). This function can only be called once - subsequent calls will fail with AlreadyInitialized.
This is a one-time setup function. Once called, it cannot be called again. Make sure the admin address is correct before deploying.

Parameters


Authorization

None. This function has no require_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


Examples

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.