# Treasury

## Overview

The AVS Treasury contract manages the reward funds for an AVS. It supports both ETH and ERC20-based treasuries, enforces protocol-level fees, handles secure deposits and withdrawals.&#x20;

* Depending on which chain rewards are configured, either `L1AvsTreasury` or `L2AvsTreasury` contract is deployed.

<figure><picture><source srcset="https://4144525652-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYlSi30nrcEOossIDFFua%2Fuploads%2FvARujRBN7wwWeKI07nxn%2FAVS%20Treasury%20Dark%20Mode.png?alt=media&#x26;token=7314ad18-e7d5-4818-ab04-9596d04158de" media="(prefers-color-scheme: dark)"><img src="https://4144525652-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYlSi30nrcEOossIDFFua%2Fuploads%2FsalvrduJQHpuaE276t93%2Fimage.png?alt=media&#x26;token=a97ac274-5cfc-4a0b-b272-2ea9329bbff5" alt=""></picture><figcaption></figcaption></figure>

### Write Methods

#### queueTokenReplacement

Schedules an update to the rewards token address. The actual replacement will only be allowed after the `tokenReplacementModificationDelay` period has passed.

<table><thead><tr><th width="196.07421875">Parameter</th><th width="93.7421875">Type</th><th>Description</th></tr></thead><tbody><tr><td>_newToken</td><td>address</td><td>New rewards token address</td></tr></tbody></table>

#### completeTokenReplacement

Finalizes the token replacement previously scheduled via `queueTokenReplacement`.&#x20;

#### setTokenReplacementModificationDelay

Sets the delay period (in seconds) required before a token replacement modification can be executed. This delay acts as a safeguard window between queuing a token replacement and its final application.

<table><thead><tr><th width="328.7265625">Parameter</th><th width="93.7421875">Type</th><th>Description</th></tr></thead><tbody><tr><td>_tokenReplacementModificationDelay</td><td>uint32</td><td>Delay duration in seconds</td></tr></tbody></table>

#### depositNative

Deposits Native Eth rewards into the AVS Treasury.

<table><thead><tr><th width="172.5625">Parameter</th><th width="93.7421875">Type</th><th>Description</th></tr></thead><tbody><tr><td>amount</td><td>uint256</td><td>The total ETH amount being deposited.</td></tr></tbody></table>

#### depositERC20

Deposits ERC20 rewards into the AVS Treasury.

<table><thead><tr><th width="172.5625">Parameter</th><th width="93.7421875">Type</th><th>Description</th></tr></thead><tbody><tr><td>address</td><td>address</td><td>ERC20 token address</td></tr><tr><td>amount</td><td>uint256</td><td>The total token amount being deposited.</td></tr></tbody></table>
