Function: createRestrictedTokenAward(address _grantee, uint256 _repurchasePrice, address _paymentToken, uint256 _shortStopDuration, VestingAllocation.Allocation _allocation, VestingAllocation.Milestone[] _milestones)
This function is used to create a new RestrictedTokenAllocation contract.
Inputs
_granteeControl: Arbitrary.
Constraints: None.
Impact: Address of the grantee.
_repurchasePriceControl: Arbitrary.
Constraints: None.
Impact: Value of repurchase price.
_paymentTokenControl: Arbitrary.
Constraints: None.
Impact: Address of payment token.
_shortStopDurationControl: Arbitrary.
Constraints: None.
Impact: Value of short stop duration.
_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
Validate the provided parameters.
Create a new allocation contract through the
createAndInitializeRestrictedTokenAwardfunction.Calculate the total amount of tokens to be transferred.
Transfer the total amount of tokens from the authority to the allocation.
Update the
restrictedTokenAllocationsmapping.
Negative behavior
Revert if the condition check fails.
Revert if the total amount of tokens to be transferred is zero.
Revert if one of the parameters is zero address (
_grantee,_paymentToken,_allocation.tokenContract).Revert if the
_reputationPriceis zero.Revert if
_allocation.vestingCliffCreditis greater than_allocation.tokenStreamTotal.Revert if
_allocation.unlockingCliffCreditis greater than_allocation.tokenStreamTotal.Revert if the token allowance of
authorityis less than the total amount of tokens to be transferred.Revert if the token balance of
authorityis less than the total amount of tokens to be transferred.