# Vault

### Overview

**The Vault** is the primary smart-contract deployed across all networks supported by Enjoyoors. It's main function is to collect tokens allowed for deposits into the protocol from users. Users who have staked their tokens can request withdrawals at any time.

**The Withdrawal Approver** is a smart-contract responsible for managing the withdrawal logic of tokens staked in the Vault. The address of this contract is provided to the Vault and can be updated to any other implementation that adheres to the required interface. In the current implementation, the contract administrator sets the withdrawal delay period (in seconds), which defines the time required to complete a withdrawal after it has been requested.

<figure><img src="https://3616471638-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8tjfwh5kqfR9hmQCbfP7%2Fuploads%2FE4YPxsFjuBp2yjmc5lBU%2Fenj_contracts.drawio.svg?alt=media&#x26;token=51982f15-cf83-400f-a235-1fba5eef3488" alt=""><figcaption></figcaption></figure>

### Methods

1. `deposit` - this method allows stakers to stake tokens supported by the protocol. It accepts the token address and the amount as parameters.
2. `requestWithdrawal` - this method must be called to initiate the withdrawal of staked tokens. It requires the token address and the amount as parameters. In response, a `WithdrawalRequested` event containing the `requestId` will be emitted.
3. `claimWithdrawal` - after a specified period (configurable parameter) has passed since calling `requestWithdrawal`, the tokens can be claimed by providing the corresponding `requestId` as a parameter.

### Contract addresses

|                     | Vault                                      | Withdrawal Approver                        |
| ------------------- | ------------------------------------------ | ------------------------------------------ |
| **Monad (Testnet)** | 0x9FacfE94E5f0AD42672eC75a348a376B13Da86e1 | 0x96f47f31Ac297Ab6CFc2d9aC066c631efcB7c65B |
| **Еthereum**        | 0x59660cb83da31EC23F9d992C11f80Fc527046409 | 0x8A4E79D2e12D253f6cEFec473439b4b0e98B7c17 |

### ABI

{% file src="<https://3616471638-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8tjfwh5kqfR9hmQCbfP7%2Fuploads%2FNvl23imzfBlguWccjA7T%2FEnjooyoorsVault.json?alt=media&token=58ead37e-c170-4063-9728-5bd1ea86066c>" %}
Enjoyoors Vault ABI
{% endfile %}

{% file src="<https://3616471638-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8tjfwh5kqfR9hmQCbfP7%2Fuploads%2FlTOvVwbHjtgVOxwSDv3L%2FWithdrawalApprover.json?alt=media&token=946fa660-257a-497b-b5a4-9c8845f55484>" %}
Withdrawal Approver ABI
{% endfile %}

### GitHub Repository

<https://github.com/eq-lab/enjoyoors-evm-contracts>
