# UManager

[Git Source](https://github.com/Ion-Protocol/nucleus-boring-vault/blob/cc0b494b83e17b9b169a73b96050d2810b690477/src/micro-managers/UManager.sol)

**Inherits:** Auth

## State Variables

### period

The period in seconds for the rate limit.

```solidity
uint16 public period;
```

### allowedCallsPerPeriod

The number of calls allowed per period.

```solidity
uint16 public allowedCallsPerPeriod;
```

### callCountPerPeriod

The number of calls made in the current period.

```solidity
mapping(uint256 => uint256) public callCountPerPeriod;
```

### manager

The ManagerWithMerkleVerification this uManager works with.

```solidity
ManagerWithMerkleVerification internal immutable manager;
```

### boringVault

The BoringVault this uManager works with.

```solidity
address internal immutable boringVault;
```

## Functions

### enforceRateLimit

```solidity
modifier enforceRateLimit();
```

### constructor

```solidity
constructor(address _owner, address _manager, address _boringVault) Auth(_owner, Authority(address(0)));
```

### setPeriod

Sets the duration of the period.

*Callable by MULTISIG\_ROLE.*

```solidity
function setPeriod(uint16 _period) external requiresAuth;
```

### setAllowedCallsPerPeriod

Sets the number of calls allowed per period.

*Callable by MULTISIG\_ROLE.*

```solidity
function setAllowedCallsPerPeriod(uint16 _allowedCallsPerPeriod) external requiresAuth;
```

### revokeTokenApproval

Allows auth to set token approvals to zero.

*Callable by STRATEGIST\_ROLE.*

```solidity
function revokeTokenApproval(
    bytes32[][] calldata manageProofs,
    address[] calldata decodersAndSanitizers,
    ERC20[] calldata tokens,
    address[] calldata spenders
)
    external
    requiresAuth;
```

## Events

### PeriodUpdated

```solidity
event PeriodUpdated(uint16 oldPeriod, uint16 newPeriod);
```

### AllowedCallsPeriodUpdated

```solidity
event AllowedCallsPeriodUpdated(uint16 oldAllowance, uint16 newAllowance);
```

## Errors

### UManager\_\_CallCountExceeded

```solidity
error UManager__CallCountExceeded();
```
