{"id":13795266,"url":"https://github.com/makerdao/dss-vest","last_synced_at":"2025-04-09T09:11:28.960Z","repository":{"id":39535353,"uuid":"333233846","full_name":"makerdao/dss-vest","owner":"makerdao","description":null,"archived":false,"fork":false,"pushed_at":"2024-12-13T16:14:25.000Z","size":1693,"stargazers_count":37,"open_issues_count":3,"forks_count":37,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-04-02T08:08:38.984Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Solidity","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/makerdao.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":"audits/ABDK_DSSVest_Audit5a.pdf","citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-26T22:25:33.000Z","updated_at":"2024-12-13T16:14:13.000Z","dependencies_parsed_at":"2024-01-07T06:23:18.769Z","dependency_job_id":"f15e5d13-6461-438a-a307-d284ff379064","html_url":"https://github.com/makerdao/dss-vest","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makerdao%2Fdss-vest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makerdao%2Fdss-vest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makerdao%2Fdss-vest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makerdao%2Fdss-vest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/makerdao","download_url":"https://codeload.github.com/makerdao/dss-vest/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248008630,"owners_count":21032556,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T23:00:54.031Z","updated_at":"2025-04-09T09:11:28.942Z","avatar_url":"https://github.com/makerdao.png","language":"Solidity","funding_links":[],"categories":["Projects","Projects Using Dapp"],"sub_categories":["DappTools"],"readme":"[![Tests](https://github.com/makerdao/dss-vest/actions/workflows/tests.yml/badge.svg)](https://github.com/makerdao/dss-vest/actions/workflows/tests.yml)\n[![Echidna](https://github.com/makerdao/dss-vest/actions/workflows/echidna.yml/badge.svg)](https://github.com/makerdao/dss-vest/actions/workflows/echidna.yml)\n[![Certora](https://github.com/makerdao/dss-vest/actions/workflows/certora.yml/badge.svg)](https://github.com/makerdao/dss-vest/actions/workflows/certora.yml)\n\n# dss-vest\n\nA token vesting plan for contributors. Includes scheduling, cliff vesting, and third-party revocation.\n\n### Requirements\n\n- [Dapptools](https://github.com/dapphub/dapptools)\n\n### Deployment\n\n`dss-vest` allows DAOs to create a participant vesting plan via token mints or surplus withdrawals.\n\n```\n$ dapp update\n\n$ make deploy-suckable\nor\n$ make deploy-mintable gem=0xbeef...\nor\n$ make deploy-transferrable owner=0xdead... gem=0xbeef...\n```\n\n#### DssVestMintable\n\nPass the address of the vesting token to the constructor on deploy. This contract must be given authority to `mint()` tokens in the vesting contract.\n\nAfter deployment, governance must set the `cap` value using the `file` function.\n\n#### DssVestSuckable\n\nPass the MCD [chainlog](https://github.com/makerdao/dss-chain-log) address to the constructor to set up the contract for scheduled Dai or USDS `suck`s. Note: this contract must be given authority to `suck()` Dai from the `vat`'s surplus buffer.\n\nTo choose between Dai and USDS, supply the relevant join (`MCD_JOIN_DAI` or `USDS_JOIN`) as the `address _join` constructor parameter.\n\nA `vat.live` check is introduced to disable `vest()` in the event of Emergency Shutdown (aka Global Settlement).\n\nAfter deployment, governance must set the `cap` value using the `file` function.\n\n#### DssVestTransferrable\n\nPass the authorized sender address and the address of the token contract to the constructor to set up the contract for streaming arbitrary ERC20 tokens. Note: this contract must be given ERC `approve()` authority to withdraw tokens from this contract.\n\nAfter deployment, the owner must also set the `cap` value using the `file` function.\n\n### Creating a vest\n\n#### `create(_usr, _tot, _bgn, _tau, _eta, _mgr) returns (id)`\n\nCreate a new vesting plan.\n\n- `_usr`: The plan beneficiary\n- `_tot`: The total amount of the vesting plan, in token units\n  - ex. 100 MKR = `100 * 10**18`\n- `_bgn`: A unix-timestamp of the plan start date\n- `_tau`: The duration of the vesting plan (in seconds)\n- `_eta`: The cliff period, a duration in seconds from the `_bgn` time, in which tokens are accrued but not payable. (in seconds)\n- `_mgr`: (Optional) The address of an authorized manager. This address has permission to remove the vesting plan when the contributor leaves the project.\n  - Note: `auth` users on this contract _always_ have the ability to `yank` a vesting contract.\n\n### Interacting with a vest\n\n#### `vest(_id)`\n\nThe vesting plan participant calls `vest(id)` after the cliff period to pay out all accrued and unpaid tokens.\n\n#### `vest(_id, _maxAmt)`\n\nThe vesting plan participant calls `vest(id, maxAmt)` after the cliff period to pay out accrued and unpaid tokens, up to maxAmt.\n\n#### `move(_id, _dst)`\n\nThe vesting plan participant can transfer their contract `_id` control and ownership to another address `_dst`.\n\n#### `unpaid(_id) returns (amt)`\n\nReturns the amount of accrued, vested, unpaid tokens.\n\n#### `accrued(_id) returns (amt)`\n\nReturns the amount of tokens that have accrued from the beginning of the plan to the current block.\n\n#### `valid(_id) returns (bool)`\n\nReturns true if the plan id is valid and has not been claimed or yanked before the cliff.\n\n#### `restrict(uint256)`\n\nAllows governance or the owner to restrict vesting to the owner only.\n\n#### `unrestrict(uint256)`\n\nAllows governance or the owner to enable permissionless vesting.\n\n### Revoking a vest\n\n#### `yank(_id)`\n\nAn 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 `yank`ed 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.\n\n#### `yank(_id, _end)`\n\nAllows governance to schedule a point in the future to end the vest. Used for planned offboarding of contributors.\n\n## Echidna\n\n### Install Echidna\n\n- Install Echidna v2.0.0\n  ```\n  $ nix-env -i -f https://github.com/crytic/echidna/archive/v2.0.0.tar.gz\n  ```\n- Install Echidna v2.0.0 via [echidnup](https://github.com/naszam/echidnup#installing)\n  ```\n  $ echidnup v2.0.0\n  ```\n\n### Local Dependencies\n\n- Install solc 0.6.12\n  ```\n  $ nix-env -f https://github.com/dapphub/dapptools/archive/master.tar.gz -iA solc-static-versions.solc_0_6_12\n  ```\n- Install solc 0.6.12 via [duppsolc](https://github.com/naszam/duppsolc#installing)\n  ```\n  $ duppsolc 0.6.12\n  ```\n\n### Run Echidna Tests\n\n- DssVestMintableEchidnaTest:\n  ```\n  $ make echidna-mintable\n  ```\n- DssVestSuckableEchidnaTest:\n  ```\n  $ make echidna-suckable\n  ```\n- DssVestTransferrableEchidnaTest:\n  ```\n  $ make echidna-transferrable\n  ```\n\n## Certora\n\n### Install Certora\n\n- Install Java\n  ```\n  sudo apt install openjdk-14-jdk\n  ```\n- Install Certora Prover\n  ```\n  pip3 install certora-cli\n  ```\n- Set Certora Key\n  ```\n  export CERTORAKEY=\u003ckey\u003e\n  ```\n\n### Local Dependencies\n\n- Install solc-select and install solc 0.6.12 artifacts:\n  ```\n  make solc-select\n  ```\n\n### Run Certora Specs\n\n- Run DssVestMintable Specs:\n  ```\n  make certora-mintable\n  ```\n- Run DssVestSuckable Specs:\n  ```\n  make certora-suckable\n  ```\n- Run DssVestTransferrable Specs:\n  ```\n  make certora-transferrable\n  ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmakerdao%2Fdss-vest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmakerdao%2Fdss-vest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmakerdao%2Fdss-vest/lists"}