{"id":13566330,"url":"https://github.com/okp4/cosmos-tools","last_synced_at":"2025-04-04T00:30:29.967Z","repository":{"id":200476766,"uuid":"514184596","full_name":"okp4/cosmos-tools","owner":"okp4","description":"💰 Tool to generate cliff vesting configuration for cosmos chains","archived":false,"fork":false,"pushed_at":"2024-03-27T23:45:42.000Z","size":110,"stargazers_count":2,"open_issues_count":11,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-04T20:42:26.063Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/okp4.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-07-15T07:58:56.000Z","updated_at":"2023-10-16T09:23:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"f705d18a-712a-41b8-a654-328d1f3bb1c7","html_url":"https://github.com/okp4/cosmos-tools","commit_stats":null,"previous_names":["okp4/cosmos-tools"],"tags_count":0,"template":false,"template_full_name":"okp4/template-rust","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/okp4%2Fcosmos-tools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/okp4%2Fcosmos-tools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/okp4%2Fcosmos-tools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/okp4%2Fcosmos-tools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/okp4","download_url":"https://codeload.github.com/okp4/cosmos-tools/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247103305,"owners_count":20884023,"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-01T13:02:07.325Z","updated_at":"2025-04-04T00:30:29.664Z","avatar_url":"https://github.com/okp4.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# 🪐 Cosmos tools\n\n[![version](https://img.shields.io/github/v/release/okp4/cosmos-tools?style=for-the-badge)](https://github.com/okp4/cosmos-tools/releases)\n[![build](https://img.shields.io/github/actions/workflow/status/okp4/cosmos-tools/build.yml?branch=main\u0026label=build\u0026style=for-the-badge)](https://github.com/okp4/cosmos-tools/actions/workflows/build.yml)\n[![lint](https://img.shields.io/github/actions/workflow/status/okp4/cosmos-tools/lint.yml?branch=main\u0026label=lint\u0026style=for-the-badge)](https://github.com/okp4/cosmos-tools/actions/workflows/lint.yml)\n[![test](https://img.shields.io/github/actions/workflow/status/okp4/cosmos-tools/test.yml?branch=main\u0026label=test\u0026style=for-the-badge)](https://github.com/okp4/cosmos-tools/actions/workflows/test.yml)\n[![codecov](https://img.shields.io/codecov/c/github/okp4/cosmos-tools?style=for-the-badge\u0026token=K5CYM8TQQY)](https://codecov.io/gh/okp4/cosmos-tools)\n[![conventional commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg?style=for-the-badge)](https://conventionalcommits.org)\n[![License](https://img.shields.io/badge/License-BSD_3--Clause-blue.svg?style=for-the-badge)](https://opensource.org/licenses/BSD-3-Clause)\n[![contributor covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg?style=for-the-badge)](https://github.com/okp4/.github/blob/main/CODE_OF_CONDUCT.md)\n\nRust command line application with multiple tools to manage cosmos blockchain.\n\n## 💰 Vesting\n\n### Generate cliff\n\nAn utility to generate the JSON configuration genesis file of a periodic vesting including a cliff.\n\n#### ❓ Why ?\n\nOn a cosmos blockchain, it's possible to create multiple type of vesting account at the start of the chain and during chain life.\n\n- [`ContinuousVestingAccount`](https://docs.cosmos.network/master/modules/auth/05_vesting.html#continuousvestingaccount) : Continuous vesting, where coins begin to vest at a start time and vest linearly with respect to time until an end time is reached\n- [`DelayedVestingAccount`](https://docs.cosmos.network/master/modules/auth/05_vesting.html#delayedvestingaccount) : Delayed vesting, where all coins are vested once an end time is reached.\n- [`PeriodicVestingAccount`](https://docs.cosmos.network/master/modules/auth/05_vesting.html#periodicvestingaccount) : Periodic vesting, where coins begin to vest at a start time and vest periodically according to number of periods and the vesting amount per period. The number of periods, length per period, and amount per period are configurable. A periodic vesting account is distinguished from a continuous vesting account in that coins can be released in staggered tranches. For example, a periodic vesting account could be used for vesting arrangements where coins are released quarterly, yearly, or over any other function of tokens over time.\n- ...\n\nBut there is a missing vesting mode : a continuous vesting account with a cliff. This means that there should be a mode where the vesting starts in a linear way on a given date but that the funds are available only after a certain time (cliff), including an end time like ContinuousVestingAccount.\n\nA temporary solution is to create a periodic vesting account with a relatively low interval so that the funds are available in the most linear way possible. To do that we need to generate a json file that including all vesting period. A generator is necessary to calculate automatically the first vesting amount after the cliff and calculate all vesting period by given an interval.\n\n#### 📄 How to use\n\n##### Command `vesting generate-cliff`\n\n```cli\ncosmos_tool vesting generate-cliff --help\n```\n\n```cli\nGenerate a JSON file containing all vesting periods based on interval and cliff duration configured\n\nUSAGE:\n    cosmos_tools vesting generate-cliff [OPTIONS] --interval \u003cINTERVAL\u003e --duration \u003cDURATION\u003e \u003cTOTAL_AMOUNT\u003e\n\nARGS:\n    \u003cTOTAL_AMOUNT\u003e    The total amount of token to vest\n\nOPTIONS:\n    -c, --cliff \u003cCLIFF_DURATION\u003e    Cliff duration (in seconds), if not filled, vesting start\n                                    immediately [default: 0]\n    -d, --duration \u003cDURATION\u003e       The total duration of vesting (in seconds)\n        --denom \u003cDENOM\u003e             Configure the token denom used into json configuration\n    -h, --help                      Print help information\n    -i, --interval \u003cINTERVAL\u003e       The period interval (in second) which amount is split\n    -o, --output \u003cOUTPUT\u003e           The path to the output file where JSON will be write, if not\n                                    filled, json will be write on stdout\n```\n\n##### Exemple\n\nTo generate a vesting account with a 2 years vesting (63 072 000 seconds), a total amount of 40 000, a 6-month cliff (15 768 000 seconds) and a distribution with an interval of 1 day (86 400 seconds). The command will look like this :\n\n```cli\ncosmos_tools vesting generate-cliff 40000 --duration 63072000 --interval 86400 --cliff 1576800\n```\n\n```json\n[\n  {\n    \"length\": \"15811200\",\n    \"amount\": {\n      \"denom\": \"uknow\",\n      \"amount\": \"10027\"\n    }\n  },\n  {\n    \"length\": \"15897600\",\n    \"amount\": {\n      \"denom\": \"uknow\",\n      \"amount\": \"55\"\n    }\n  },\n  {\n    \"length\": \"15984000\",\n    \"amount\": {\n      \"denom\": \"uknow\",\n      \"amount\": \"54\"\n    }\n  },\n ...\n]\n```\n\nWith a linear vesting after 6 month, the first distribution is 10 027uknow. And after 6 month, a distribution is done every day (1 day interval).\n\n## ⚙️ Prerequisites\n\nBe sure you have [Rust](https://www.rust-lang.org/tools/install) properly installed with [cargo-make](https://github.com/sagiegurari/cargo-make).\n\n## Build\n\n```sh\ncargo make\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fokp4%2Fcosmos-tools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fokp4%2Fcosmos-tools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fokp4%2Fcosmos-tools/lists"}