> For the complete documentation index, see [llms.txt](https://docs.ybx.script3.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ybx.script3.io/technical-docs/protocol/governance-contract.md).

# Governance Contract

Governance Proposals are submitted and managed using the Governance Contracts. There are two governance contracts, the Proposal Create contract and the Proposal Update contract.

### Proposal Create

Handles governance proposal creation.

**Request**

```
{
    userPublicKey: string,
    timestamp: number,
    type: ProtocolEventTypes,
    fee: string,
    proposalAccountId: string,
    proposalType: ProposalType
    params: CouncilLockParams | CouncilSwapParams | undefined

}
```

***Fields:***

* proposalAccountId: The public key of the account being created as the proposal account.
* proposalType: Represents the governance proposal type using the following enum

  ```
  ProposalType {
   ALLOCATION = 0,
   CUSTOM = 1,
   COUNCIL_SWAP_SIGNER = 2,
   COUNCIL_LOCK_CONTRACT = 3
  }
  ```
* params: undefined if the proposal is custom or an allocation proposal, otherwise related to council lock or swap proposals.

  ```
  CouncilLockParams: {
     lockedContracts: ProtocolEventTypes[]
     }
  ```

  * lockedContracts: array of enums that represent the different protocol event types (Mint, Burn, etc...)

  ```
  CouncilSwapParams: {
     addTurret: string;
     addSigner: string;
     removeSigner: string;
     }
  ```

  * addTurret: Public key of the turret sponsor account being added
  * addSigner: Public key of the turret signer account being added
  * removeSigner: Public key of the signer being removed

#### High-Level Contract Process Flow

This contract has been modified recently, an updated Contract Flow will be added shortly

### Proposal Update

Handles updating proposals by tallying their votes, submitting them, or deleting them.

**Request**

```
{
    userPublicKey: string,
    timestamp: number,
    fee: string,
    type: ProtocolEventTypes,
    proposalAccountId: string,
    proposalType: ProposalType
}
```

**Fields:**

* proposalAccountId: The public key of the account being created as the proposal account.
* proposalType: Represents the governance proposal type using the following enum

  ```
  ProposalType {
   ALLOCATION = 0,
   CUSTOM = 1,
   COUNCIL_SWAP_SIGNER = 2,
   COUNCIL_LOCK_CONTRACT = 3
  }
  ```

#### High-Level Contract Process Flow (MAY BE OUT OF DATE)

This contract has been modified recently, an updated Contract Flow will be added shortly


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.ybx.script3.io/technical-docs/protocol/governance-contract.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
