Skip to content

Token vesting specs #11

@vanruch

Description

@vanruch

SQD Token vesting

This issue outlines the key functionality and general design of the vesting contracts.

General Design

Each vesting beneficiary will have a contract deployed. The contract will have a linear vesting function with a cliff, parametrized by vesting start time and duration, cliff, and total amount. Total amount will be linearly vested from start time for duration of vesting, but the beneficiary will only be able to withdraw SQD starting from (start time + cliff) timestamp
image

Contracts will be deployed by the factory and hidden behind a proxy contract to make deployment cheaper.

VestingFactory

  • create(beneficiary, amount, startTime, duration, cliff) onlyManager
    Creates new vesting, transfers amount SQD from sender to the vesting and makes sender the vesting owner
  • add/removeProtocol(protocol) onlyManager whitelists protocols
  • [optional] allow/disallowMethod(protocol, signature) onlyManager whitelists methods for the protocol

Vesting

  • unlocked() returns amount that can be withdrawn

  • locked() returns amount yet to be unlocked (including staked funds),
    unlocked+locked+staked = totalAmount

  • wihthdraw() onlyBeneficiary transfers all unlocked SQD to the beneficiary

  • [unnecessary?] withdraw(amount) onlyBeneficiary transfers amount SQD to the beneficiary

  • approve(protocol, amount) onlyBeneficiary approves amount tokens for the whitelisted protocol

  • call(protocol, calldata) onlyBeneficiary call allowed method on the protocol

  • cancel() onlyOwner cancel vesting (maybe we want to add time restriction??)

Also necessary:
Some tool (frontend, probably) to see unlock curve, withdraw tokens, register workers, stake

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions