close_state
Closes a disabled GLAM state account that is not linked to a mint.
Handler narrative
- Load the GLAM state or program account required by the instruction and verify the signer.
- Apply the requested state, policy, pricing, or system action after enforcing owner/delegate checks.
Required conditions
- The submitted accounts must match the declared account list, signer requirements, writable requirements, fixed program addresses, and account relationships shown below.
- The GLAM state account is the source of truth for owner, enabled integrations, delegate permissions, policies, assets, borrowable assets, timelock settings, mint linkage, and pricing records.
- The vault account must be the PDA controlled by the core protocol program and derived conceptually from the state account; instructions use it as the vault authority for SOL, token accounts, and external positions.
- Owner-level actions must be signed by the state owner unless the instruction is explicitly an integration callback, mint-authority callback, delegate action, or emergency access update.
- The state owner must sign; this owner check is defined by the close-state account constraints.
- The state must not be linked to a GLAM mint; the handler checks that the mint field is the default public key before closure.
- The state must already be disabled; the handler rejects closure while the state enabled flag is true.
- The vault PDA must be writable so any remaining SOL balance can be transferred to the signer before the state account is closed.
Accounts
| Account | Role | Description |
|---|---|---|
| glam_state | writable | State account owned by the GLAM Protocol program; it records vault configuration, policies, and pricing records. |
| glam_vault | writable | Vault account controlled by the GLAM Protocol program; conceptually derived from the state account and used as the vault authority. |
| glam_signer | signer, writable | Calling authority. It must be the owner or a delegate with the explicit permission required by this instruction. |
| system_program | read-only | Standard Solana program account required by the instruction. |
Arguments
No arguments.
Policy & permissions
- No external integration enablement is required beyond the program-level functionality involved in this instruction.
- Only the owner is expected. Delegates do not receive this capability by being added; it must be granted explicitly if supported.
Cross-instruction constraints
- No additional cross-instruction constraint is documented beyond account initialization, authority checks, and policy validation.