# VVestingWallet

vVestingWallet is based on OpenZeppelin's [VestingWallet](https://docs.openzeppelin.com/contracts/4.x/api/finance#VestingWallet) contract with minor adjustments

vVestingWallet receives an amount of ERC20 tokens. The tokens are linearly released to the beneficiary over a specified period of time.

### Events

#### event ERC20Released

```solidity
event ERC20Released(
        address indexed token, 
        uint256 amount)
```

Emitted when an amount of  tokens is released&#x20;

### State-changing Functions

#### constructor

```solidity
constructor(
  address beneficiaryAddress,
  address erc20Token,
  uint64 startTimestamp,
  uint64 durationSeconds
)  
```

Creates a new Vesting Wallet for a beneficiary.

Parameters:

<table><thead><tr><th width="194">Name</th><th width="115">Type</th><th>Description</th></tr></thead><tbody><tr><td>beneficiaryAddress</td><td><code>uint256</code></td><td>Amount to stake</td></tr><tr><td>erc20Token</td><td><code>address</code></td><td>Address of the vested token</td></tr><tr><td>startTimestamp</td><td><code>uint64</code></td><td>Timestamp when the vesting starts</td></tr><tr><td>durationSeconds</td><td><code>uint64</code></td><td>duration of vesting</td></tr></tbody></table>

#### release

```solidity
function release() external
```

Releases all the available vested token to the beneficiary

Emits the [ERC20Released](#event-erc20released) event

<table><thead><tr><th width="244">Name</th><th width="115">Type</th><th>Description</th></tr></thead><tbody><tr><td>beneficiaryAddress</td><td><code>uint256</code></td><td>Amount to stake</td></tr><tr><td>erc20Token</td><td><code>address</code></td><td>Address of the vested token</td></tr><tr><td>startTimestamp</td><td><code>uint64</code></td><td>Timestamp when the vesting starts</td></tr><tr><td>durationSeconds</td><td><code>uint64</code></td><td>duration of vesting</td></tr></tbody></table>

#### function lockVrsw

### Read-only Functions

#### beneficiary

```solidity
 function beneficiary() public view returns (address)
```

Returns the beneficiary address

#### start

```solidity
 function start() public view returns (uint256)
```

Returns the timestamp when the vesting starts

#### duration

```solidity
 function duration() public view returns (uint256)
```

Returns the duration of the vesting period

#### released

```solidity
 function released() public view returns (uint256)
```

Returns the amount of tokens that have been transferred to the Beneficiary

#### releasable

```solidity
 function releasable() public view returns (uint256)
```

Returns the amount of tokens that are available to be claimed by the Beneficiary. The amount is the total number of vested tokens minus the number of tokens that have already been released.

#### vestedAmount

```solidity
 function vestedAmount() public view returns (uint256)
```

Returns total amount of tokens that are already vested.
