> ## Documentation Index
> Fetch the complete documentation index at: https://docs.notareum.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Governance

# TypeScript: Governance

`GovernanceClient` is the front end to the `veNOTA` contract: lock NOTA to mint non-transferable veNOTA, use veNOTA balances to vote on protocol proposals, and unlock when your lock matures. Access as `ntm.governance`.

## The veNOTA model

Locking longer grants more voting power. The contract implements a linear decay: 1 NOTA locked for the maximum duration yields 1 veNOTA; 1 NOTA locked for half the maximum yields 0.5 veNOTA. See [veNOTA](../../token/venota.md) for the exact decay curve and maximum lock duration.

veNOTA is not transferable, is not ERC-20 fungible, and decays continuously toward zero over the lock's life. Voting power is always read-time.

## Write methods

### `lock(amount, duration)`

Creates a new lock. `duration` is in seconds; the contract rejects values below the configured minimum or above the configured maximum. Requires a prior ERC-20 approval on NOTA for the `veNOTA` contract:

```typescript theme={"system"}
async lock(amount: bigint, duration: bigint): Promise<string>
```

Returns the transaction hash. The `lockId` is emitted in the `LockCreated` event.

### `extendLock(lockId, additionalDuration)`

Extends an existing lock by adding to its duration. Useful to boost voting power without adding NOTA:

```typescript theme={"system"}
async extendLock(lockId: bigint, additionalDuration: bigint): Promise<string>
```

### `unlock(lockId)`

Unlocks a matured lock, returning the underlying NOTA to the owner. Reverts if the lock has not yet matured:

```typescript theme={"system"}
async unlock(lockId: bigint): Promise<string>
```

## Read methods

### `getVotingPower(address)`

Returns the current veNOTA voting power for an address, summed across all of its locks and decayed to "now":

```typescript theme={"system"}
async getVotingPower(address: string): Promise<bigint>
```

### `getLock(lockId)`

Fetches a single lock record:

```typescript theme={"system"}
async getLock(lockId: bigint): Promise<VeNOTALock>
```

`VeNOTALock` fields include `owner`, `amount`, `startTime`, `endTime`, and `isActive`.

### `getTotalSupply()`

Returns the total veNOTA supply (sum of live voting power across all addresses) at this moment:

```typescript theme={"system"}
async getTotalSupply(): Promise<bigint>
```

## Full example

```typescript theme={"system"}
import { Notareum } from "@notareum/sdk";
import { Contract, parseUnits } from "ethers";

const ntm = Notareum({ provider, signer, contracts });

const me = await signer.getAddress();

// 1. Approve NOTA for veNOTA
const notaAbi = ["function approve(address,uint256) returns (bool)"];
const amount = parseUnits("5000", 18); // 5,000 NOTA
const nota = new Contract(contracts.notaToken, notaAbi, signer);
await (await nota.approve(contracts.veNota, amount)).wait();

// 2. Lock for 2 years
const twoYears = 2n * 365n * 24n * 60n * 60n;
const lockTx = await ntm.governance.lock(amount, twoYears);
console.log("Locked:", lockTx);

// 3. Check voting power now vs. later
const nowPower = await ntm.governance.getVotingPower(me);
console.log("veNOTA now:", nowPower.toString());
```

## Voting on proposals

The `veNOTA` contract exposes voting power queries that the protocol's governance module reads. The proposal creation and voting UI is the Notareum governance portal, not part of this SDK directly. For on-chain proposal execution see the [Governance](../../protocol/governance.md) protocol page.

## See also

* [veNOTA token page](../../token/venota.md)
* [Participating in Governance guide](../../guides/participating-in-governance.md)
* [Governance protocol page](../../protocol/governance.md)
