# MaverickV2VotingEscrowWSync

**Inherits:** [MaverickV2VotingEscrow](https://docs.mav.xyz/technical-reference/maverick-v2/v2-contracts/maverick-v2-reward-contracts/maverickv2votingescrow),[ IMaverickV2VotingEscrowWSync](https://docs.mav.xyz/technical-reference/maverick-v2/v2-contracts/maverick-v2-reward-contracts/interfaces/imaverickv2votingescrowwsync)

Inherits MaverickV2VotingEscrow and adds functionality for synchronizing veMav V1 and veMav v2 balances.

### State Variables <a href="#state-variables" id="state-variables"></a>

#### legacyVeMav <a href="#legacyvemav" id="legacyvemav"></a>

This function retrieves the address of the legacy Maverick V1 Voting Escrow (veMav) token.

```solidity
IERC20 public immutable legacyVeMav;
```

#### syncBalances <a href="#syncbalances" id="syncbalances"></a>

This function retrieves the synced balance for a specific legacy lockup index of a user.

```solidity
mapping(address staker => mapping(uint256 legacyLockupIndex => uint256 balance)) public syncBalances;
```

#### MIN\_SYNC\_DURATION <a href="#min_sync_duration" id="min_sync_duration"></a>

This function retrieves the minimum lockup duration required for a legacy lockup to be eligible for synchronization.

```solidity
uint256 public constant MIN_SYNC_DURATION = 365 days;
```

### Functions <a href="#functions" id="functions"></a>

#### constructor <a href="#constructor" id="constructor"></a>

```solidity
constructor(string memory __name, string memory __symbol) MaverickV2VotingEscrow(__name, __symbol);
```

#### sync <a href="#sync" id="sync"></a>

This function synchronizes a specific legacy lockup index for a user within the contract. If the legacy lockup.end is not at least `block.timestamp + MIN_SYNC_DURATION()`, this function will revert.

```solidity
function sync(address staker, uint256 legacyLockupIndex) public nonReentrant returns (uint256 newBalance);
```

**Parameters**

| Name                | Type      | Description                                                  |
| ------------------- | --------- | ------------------------------------------------------------ |
| `staker`            | `address` | The address of the user for whom to perform synchronization. |
| `legacyLockupIndex` | `uint256` | The index of the legacy lockup to be synchronized.           |

**Returns**

| Name         | Type      | Description                                                 |
| ------------ | --------- | ----------------------------------------------------------- |
| `newBalance` | `uint256` | The new balance resulting from the synchronization process. |

<br>
