Coder Social home page Coder Social logo

dss-vest's Introduction

Fuzz

dss-vest

A token vesting plan for contributors. Includes scheduling, cliff vesting, and third-party revocation.

Requirements

Deployment

dss-vest allows DAOs to create a participant vesting plan via token mints or surplus withdrawals.

$ dapp update

$ dapp deploy-mainnet-mintable
or
$ dapp deploy-mainnet-suckable

DssVestMintable

Pass the address of the vesting token to the constructor on deploy. This contract must be given authority to mint() tokens in the vesting contract.

After deployment, governance must set the cap value using the file function.

DssVestSuckable

Pass the MCD chainlog address to the constructor to set up the contract for scheduled Dai sucks. Note: this contract must be given authority to suck() Dai from the vat's surplus buffer.

After deployment, governance must set the cap value using the file function.

Creating a vest

init(_usr, _tot, _bgn, _tau, _clf, _mgr) returns (id)

Init a new vest to create a vesting plan.

  • _usr: The plan beneficiary
  • _tot: The total amount of the vesting plan, in token units
    • ex. 100 MKR = 100 * 10**18
  • _bgn: A unix-timestamp of the plan start date
  • _tau: The duration of the vesting plan (in seconds)
  • _clf: The cliff period, in which tokens are accrued but not payable. (in seconds)
  • _mgr: (Optional) The address of an authorized manager. This address has permission to remove the vesting plan when the contributor leaves the project.
    • Note: auth users on this contract always have the ability to yank a vesting contract.

Interacting with a vest

vest(_id)

The vesting plan participant calls vest(id) after the cliff period to pay out accrued and unpaid tokens.

move(_id, _dst)

The vesting plan participant can transfer their contract _id control and ownership to another address _dst.

unpaid(_id) returns (amt)

Returns the amount of accrued, vested, unpaid tokens.

accrued(_id) returns (amt)

Returns the amount of tokens that have accrued from the beginning of the plan to the current block.

valid(_id) returns (bool)

Returns true if the plan id is valid and has not been claimed or yanked before the cliff.

Revoking a vest

yank(_id)

An authorized user (ex. governance) of the vesting contract, or an optional plan manager, can yank a vesting contract. If the contract is yanked prior to the plan cliff, no funds will be paid out. If a plan is yanked after the contract cliff period has ended, new accruals will cease and the participant will be able to call vest to claim any vested funds.

yank(_id, _end)

Allows governance to schedule a point in the future to end the vest. Used for planned offboarding of contributors.

Fuzz

Install Echidna

  • Building using Nix $ nix-env -i -f https://github.com/crytic/echidna/tarball/master

Run Echidna Tests

  • Install solc 0.6.12: $ nix-env -f https://github.com/dapphub/dapptools/archive/master.tar.gz -iA solc-versions.solc_0_6_12

  • Run Echidna Tests: $ echidna-test src/fuzz/DssVestEchidnaTest.sol --contract DssVestEchidnaTest --config echidna.config.yml

dss-vest's People

Contributors

brianmcmichael avatar hexonaut avatar naszam avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.