# GlitchGremlinProgram (On-Chain)

### Program Responsibilities Are as Follows

**Chaos Request Initialization:**&#x20;

• Checks whether the caller has enough $GREMLINAI to pay for the requested chaos.&#x20;

• Transfers (escrows) the required amount from the caller’s wallet into the program’s escrow account.&#x20;

• Creates a *`ChaosRequest`* Account that stores the request parameters and references.

**Chaos Request Finalization:**&#x20;

• Off-chain AI engine calls back with a signed proof of chaos completion.&#x20;

• The program updates the `ChaosRequest` Account to mark the request as “<mark style="background-color:green;">completed</mark>” or “<mark style="background-color:red;">failed.</mark>”&#x20;

• If partial refunds or additional fees are applicable, the program updates token balances accordingly.

**Governance Hooks:**&#x20;

• Integrates with a standard Solana governance module.&#x20;

• Allows for proposals that, if passed, automatically create or fund chaos tests from the protocol treasury.&#x20;

• Potentially triggers special events (e.g., distributing rewards to voters or top community participants).
