Files
nym/contracts/vesting
Jędrzej Stuczyński 5709c45a50 Feature/circulating supply (#2814)
* Fixed typo in node_status_cache constant

* ibid

* Moved some caching stuff around so I can see what depends on what

* Finishing merge of conflicted files

* Minor smoothing

* Got cache reads working for circ supply and refactored common cache

* Refactored nyxd client usages to make things bit more clear

* Moved caching support stuff into the support folder

* Moved storage code into support module

* Removed dead code

* Tweaks

* Handling cases a little more nicely in circulating supply api

* Renamed nymd_client to nyxd_client

* Pulled CacheNotification into the caching support module

* Pulled some domain-specific helpers out of cache refresher

* Moving some more helper methods out of the cache refresher

* Deleting unused code

* Extracted a few more functions out of the cache refresher

* A few comments as breadcrumbs

* Renaming the anemic "helpers" to "node_sets"

* Renaming the validator_cache module to nym_contract_cache

* Renaming nym contract cache stuff to make things clearer

* Renamging a few things in comments

* Renaming validator_cache to nym_contract_cache

* foomp

* Started refactoring http and cli

* Extracted cli arg parsing into its own module

* Cleanup

* Extracted start methods into various modules to clean main up

* WIP commit

* Build working, swagger not

* Fixed swagger docs metadata

* Removed log statement

* Circulating supply cache now working with simple logic

* Fixed up circulating supply method names

* Starting to work in some (wrong) constants

* Documented the cache

* Renaming circulating-supply route

* nym-api compiling after the rebasing

but most likely not fully working yet

* removed unused imports

* only starting RewardedSetUpdater if the config flag is set

* nym-api compiling with coconut feature

* removed redundant process_runner

* removed generic aspect of nym-api nyxd::Client

* signle entry point for starting nym_contract_cache

* do not eagerly grab instances of managed state

* inlining openapi route spec

* CirculatingSupplyResponse type

* fixed compilation of coconut tests

* calculating circulating supply based on mixmining reserve and vesting tokens

* separated different variants of caching intervals

* allow nym-api to specify address of the vesting contract

* fixed types export

* renamed the query on the vesting contract

* reorganised startup procedure and made all start methods independent from rocket

* cleaned up startup procedure for nym-api

* startup checks for rewarding permisssions

* updated changelog

* added config flag to control whether circulating supply should be updated

Co-authored-by: Dave Hrycyszyn <futurechimp@users.noreply.github.com>
2023-01-12 10:39:21 +00:00
..
2021-12-03 10:14:47 +01:00
2023-01-12 10:39:21 +00:00
2021-12-01 15:42:34 +01:00
2022-05-23 13:25:20 +02:00

Nym vesting contract

  1. Initial vesting tokens are deposited and assigned to existing addresses via CreatePeriodicVestingAccount
  2. Admin account can then delegate vested and unvested tokens to mixnodes on behalf of vesting accounts
  3. Vesting accounts can withdraw vested and undelegated (spendable) coins to their addresses

Glossary

Term Definition
original vesting coins vesting amount specified at account creation
vested coins coins vested up to the current vesting period, current period excluded
vesting coins original vesting amount minus vested coins, claimed rewards are not part of vesting coins
delegated free coins delegated coins that have vested
delegated vesting coins total delegation amount minus delegated free coins
pledged free coins pledged coins that have vested
pledged vesting coins total pledge amount minus pledged free coins
locked coins vesting coins minus delegated vesting and pledged vesting coins
spendable coins current vesting account balance minus locked coins

Vesting coin delegation flow

vesting-coin-delegation