VestingTokenFactory

The VestingTokenFactory works as a beacon to proxy contracts that will delegate their logic to the VestingToken contract. This smart contract also acts as a manager for the fees collected by VestingToken transactions.

Implements and Inherits

  • Ownable: to allow access to write functions.

  • IBeacon: to interact with the BeaconProxy contracts.

  • IFeeManager: to store and provide information for the fee.

Functions

implementation

Necessary for the IBeacon. Has to point to the VestingTokenFactory deployed implementation.

maxFee

Unvest DAO can set the Protocol Fee to any value between 0% and 5%. This function ensures that the Protocol Fee cannot exceed 5%.

minFee

This function allows the Protocol Fee to be set to 0%.

feeData

Exposes in a single call the current feePercentage and current feeCollector.

IFeeManager(managerAddress).feeData();
// Returns:
// struct FeeData {
//     address feeCollector;
//     uint64 feePercentage;
// }

feeCollector

For accessibility, this is a shortcut for IFeeManager(managerAddress).feeData().feeCollector

feePercentage

For accessibility, this is a shortcut for IFeeManager(managerAddress).feeData().feePercentage

vestingTokens

  • underlyingToken: address of the ERC20 that is associated with a deployed VestingToken

Since mistakes can be made when deploying a new contract, a malicious individual could deploy one, or the ERC20 just needs multiple Vesting strategies, the contract stores all addresses of deployed VestingTokens and maps them to the underlyingToken's address.

setFeeCollector

  • newFeeCollector: the new address that will be collecting VestingTokens.

Only the owner of this contract can call this function.

setFeePercentage

  • newFeePercentage: the new fee percentage that will be charged on VestingTokens' transfers.

Only the feeCollector can call this function.

createVestingToken

  • name (string): name of the ERC20 that will be created.

  • symbol (string): symbol of the ERC20 that will be created.

  • underlyingTokenAddress (address) : address of the ERC20 that is being locked in the new VestingToken contract.

  • milestonesArray (Milestone[]): array of the milestones that will describe the release behaviour of the new VestingToken contract.

The contract is initialized with a name, symbol, the address of the underlying ERC20 token, and an array of milestones that describe the rules for releasing tokens.

Last updated