Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Token vesting specs #11

Open
vanruch opened this issue Aug 21, 2023 · 1 comment
Open

Token vesting specs #11

vanruch opened this issue Aug 21, 2023 · 1 comment

Comments

@vanruch
Copy link
Contributor

vanruch commented Aug 21, 2023

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

@dzhelezov
Copy link
Contributor

We need a topUp() method to be able to add more vested tokens to the team members. The team members “earn” tokens based on their time with Subsquid, so it’s not know which sum should be allocated at TGE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants