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

Create Vesting smart-contract #1

Closed
zxcat opened this issue Aug 17, 2018 · 0 comments
Closed

Create Vesting smart-contract #1

zxcat opened this issue Aug 17, 2018 · 0 comments
Assignees
Milestone

Comments

@zxcat
Copy link
Contributor

zxcat commented Aug 17, 2018

1. Requirements

  1. Use safe arithmetics to increment/decrement assets to prevent overflow (asset operator +=, -= are safe)
  2. Token resides in system token contract, it can be issued while emission. Token transferred to polls with normal transfers.
  3. Vesting must have calculated total amount (total_vesting), valid in each action (update it on vesting amount change: conversion/withdraw/burn). Vesting is not liquid, so if implement it based on system token contract, additional restrictions must be added (preventing direct transfers).

2. Configurable properties (per Token)

  1. Vesting Withdrawal
    1. Number of intervals
    2. Seconds in interval
    3. Min amount to withdraw
    4. Min balance amount to allow withdraw
  2. Voting power (Power considered as resource)
    1. Capacity (100%)
    2. Regeneration seconds (5 days)
    3. Max value used per vote (0.5%)
  3. Delegation
    1. Min amount
    2. Min seconds
    3. Max interest (%)
    4. Seconds to return

3. Methods

  1. Current price
    • Args: (token)
    • Returns: total_vesting / total_vesting_fund_token
  2. Convert Token to Vesting
    • Args: (from, to, token_amount)
  3. Token to Vesting with delegators reward
    • Args: (from, to, token_amount)
  4. Withdraw Vesting to Token
    • Args: (from, to, vesting_amount)
  5. Burn Vesting
    • Args: (owner, amount)
  6. Delegate
    • Args: (delegator, delegatee, amount, rate)
  7. Return Delegation
    • Args: (delegator, delegatee, amount)
  8. Consume Power
    • Args: (power_amount)
    • Returns: used power in vesting
@afalaleev afalaleev added this to the prototype milestone Aug 21, 2018
@afalaleev afalaleev removed the Epic label Oct 1, 2018
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

4 participants