> For the complete documentation index, see [llms.txt](https://docs.vetro.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.vetro.org/developers/smart-contracts.md).

# Smart Contracts

The core Ethereum contracts are implemented in **Solidity 0.8.30**.

## Core Contracts

### PeggedToken

ERC-20 with ERC-20Permit (gasless approvals), ERC-20Burnable, Ownable2Step ownership, address blacklisting, and designated Gateway/Treasury integration points. This contract serves as the template for VUSD, vetBTC, and vetETH.

### Gateway

Handles swap-ins, minting, redemption, and swap-outs with:

* Configurable fees and mint limits
* Slippage protection
* Multi-step redemption process with a governance-configurable security delay for standard users
* Instant redemption for whitelisted market makers against the Treasury buffer
* AMO mint limit enforcement

### Treasury

Manages collateral custody with:

* Per-token configuration (vault, oracle, staleness period, swap-in/swap-out toggles)
* Decentralized price feed integration with configurable tolerance bounds
* Keeper and UMM (Universal Mint Module) role separation
* Swapper integration for internal rebalancing
* OpenZeppelin AccessControlDefaultAdminRules for role-based permissioning

### StakingVault

ERC-4626 compliant vault implementing the sVUSD variable yield product. Features:

* Governance-configurable cooldown period for withdrawals (7 days → 1 day)
* Instant withdrawal whitelist for approved addresses
* Integration with the YieldDistributor for drip-based reward delivery

### YieldDistributor

Linearly drips yield to the StakingVault over a configurable duration to prevent yield sniping. When new yield is added, remaining undistributed yield is combined with the new amount and redistributed linearly — ensuring smooth price-per-share appreciation.

## Source Code

| Resource                             | Link                                                                                                                                            |
| ------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| GitHub Repository                    | [vetro-protocol/vetro-contracts](https://github.com/vetro-protocol/vetro-contracts)                                                             |
| Contract Source                      | [/src](https://github.com/vetro-protocol/vetro-contracts/tree/main/src)                                                                         |
| Documentation                        | [/docs](https://github.com/vetro-protocol/vetro-contracts/tree/main/docs)                                                                       |
| Operations Runbook                   | [OPERATIONS.md](https://github.com/vetro-protocol/vetro-contracts/blob/main/docs/OPERATIONS.md)                                                 |
| StakingVault & YieldDistributor Spec | [StakingVault-YieldDistributor-Spec.md](https://github.com/vetro-protocol/vetro-contracts/blob/main/docs/StakingVault-YieldDistributor-Spec.md) |


---

# 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.vetro.org/developers/smart-contracts.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.
