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

# VoteModule

Staking, delegation, and permissions module for xRAM.

`VoteModule` is the contract that actually supplies governance voting power. `Voter` reads `VoteModule.balanceOf(user)`, not a wallet balance or NFT position.

## Core Functions

### deposit / depositAll

```solidity theme={null}
function deposit(uint256 amount) external
function depositAll() external
```

Moves xRAM from the caller into `VoteModule` and increases the caller's voting power.

### withdraw / withdrawAll

```solidity theme={null}
function withdraw(uint256 amount) external
function withdrawAll() external
```

Returns xRAM to the caller and reduces voting power.

### delegate

```solidity theme={null}
function delegate(address delegatee) external
```

Grants another address permission to act as a delegate for voting-related calls such as `Voter.vote()`, `Voter.reset()`, and `Voter.poke()`. Passing `address(0)` clears the delegate.

### setAdmin

```solidity theme={null}
function setAdmin(address admin) external
```

Sets an admin/operator for the caller. Admin permissions are broader than delegate permissions and are used by fee-distributor reward claims.

### isDelegateFor / isAdminFor

```solidity theme={null}
function isDelegateFor(address caller, address owner) external view returns (bool)
function isAdminFor(address caller, address owner) external view returns (bool)
```

Permission checks consumed by `Voter` and `FeeDistributor`.

### unlockTime / cooldown

```solidity theme={null}
function unlockTime() external view returns (uint256)
function cooldown() external view returns (uint256)
```

Expose the active cooldown window. Unless an address is exempt, both deposits and withdrawals require `block.timestamp >= unlockTime`.

## Key Concepts

* Voting power equals the caller's staked xRAM balance in `VoteModule`.
* `notifyRewardAmount(0)` can only be called by xRAM and is used to push `unlockTime` forward after weekly maintenance.
* Delegates are intended for voting actions; admins are used for a wider set of owner-authorized operations such as fee claims.
* `AccessHub` can change cooldown settings and add cooldown exemptions for specific addresses.
