> For the complete documentation index, see [llms.txt](https://autopilot-5.gitbook.io/autopilot/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://autopilot-5.gitbook.io/autopilot/protocol/markdown/secure-storage-and-reward-distribution-architecture.md).

# Secure Storage & Reward Distribution Architecture

Autopilot uses a dedicated contract the `RewardsVault`  to manage reward storage and distribution. All rewards, once converted to USDC, are held in this contract until claimed by users. The vault operates independently from voting logic and follows a strict on-chain accounting model.

***

#### Key Properties

**Isolated Reward Storage**\
The `RewardsVault` is separate from the contracts responsible for voting, claiming, and swapping.\
No external party — including the protocol team — has access to the funds.

**Tracked Balances**\
All USDC balances are recorded under:

```solidity
solidityCopyEdittotal_tokens_stored
```

This allows the protocol to maintain accurate reward accounting across epochs.

**Built-in Validation**\
The contract includes a `withdrawNonAccounted()` function to resolve rare inconsistencies (e.g., incomplete swaps or edge-case rounding errors).\
This ensures the stored reward pool matches expected balances.

**Proportional Limits**\
User withdrawals are capped based on their voting share from the previous epoch.\
Claims are enforced using fixed formulas tied to veAERO vote weight, preventing overclaiming or manipulation.

***

> The `RewardsVault` is a non-custodial rewards contract.\
> Funds are allocated transparently, based on voting power, and can only be withdrawn by the rightful wallet.
