Function: createVestingAllocation(address _grantee, VestingAllocation.Allocation _allocation, VestingAllocation.Milestone[] _milestones)
This function is used to create a new VestingAllocation contract.
Inputs
_granteeControl: Arbitrary.
Constraints: None.
Impact: Address of the grantee.
_allocationControl: Arbitrary.
Constraints: None.
Impact: Struct of the allocation including
Allocationfields:tokenStreamTotal,vestingCliffCredit,unlockingCliffCredit,vestingRate,vestingStartTime,unlockRate,unlockStartTime, andtokenContract.
_milestonesControl: Arbitrary.
Constraints: None.
Impact: Array of
Milestone. Struct of the milestone includingmilestoneAward,unlockOnCompletion,complete, and an array ofconditionContractsaddresses.
Branches and code coverage
Intended branches
Calculate the total amount of tokens to be vested.
Create a new vesting allocation contract through
vestingFactory.Transfer the total amount of tokens to the vesting allocation from authority.
Update the
vestingAllocationsarray.
Negative behavior
Revert if the grantee is the zero address.
Revert if
_allocation.tokenContractis the zero address.Revert if
_allocation.vestingCliffCreditis greater than_allocation.tokenStreamTotal.Revert if
_allocation.unlockingCliffCreditis greater than_allocation.tokenStreamTotal.Revert if the length of
_milestonesis greater thanARRAY_LENGTH_LIMIT(20).Revert if the
_allocation.tokenStreamTotal+_milestoneTotalis zero.