{"id":25249543,"url":"https://github.com/provable-things/aragon-staking-manager","last_synced_at":"2025-08-22T16:12:17.319Z","repository":{"id":43926337,"uuid":"277637228","full_name":"provable-things/aragon-staking-manager","owner":"provable-things","description":"An Aragon app that allows to lock for a customizable amount of time, a quantity of ERC20 tokens in exchange for organization's tokens.","archived":false,"fork":false,"pushed_at":"2023-01-24T03:21:48.000Z","size":2789,"stargazers_count":10,"open_issues_count":10,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-08T22:21:12.345Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/provable-things.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-06T20:02:30.000Z","updated_at":"2022-11-08T05:36:41.000Z","dependencies_parsed_at":"2023-01-28T09:15:46.061Z","dependency_job_id":null,"html_url":"https://github.com/provable-things/aragon-staking-manager","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/provable-things%2Faragon-staking-manager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/provable-things%2Faragon-staking-manager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/provable-things%2Faragon-staking-manager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/provable-things%2Faragon-staking-manager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/provable-things","download_url":"https://codeload.github.com/provable-things/aragon-staking-manager/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238405182,"owners_count":19466450,"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":"2025-02-12T03:22:28.768Z","updated_at":"2025-02-12T03:22:29.266Z","avatar_url":"https://github.com/provable-things.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# :crystal_ball: staking-manager\n\nAn Aragon app that allows to lock for a customizable amount of time, a quantity of ERC20 tokens in exchange for organization's tokens.\n\n\u0026nbsp;\n\n***\n\n\u0026nbsp;\n\n## :arrow_down: How to install\n\n```\ndao install \u003cDAO address\u003e staking-manager.open.aragonpm.eth --app-init-args \u003ctoken manager\u003e \u003cvault\u003e \u003cerc20 token address\u003e \u003cmin lock time\u003e \u003cmax locks\u003e --env aragon:rinkeby\n```\n\n\u0026nbsp;\n\n***\n\n\u0026nbsp;\n\n## :clipboard: How to run locally\n\n```\nyarn install\n```\n\n```\nyarn start\n```\n\n\u0026nbsp;\n\n***\n\n\u0026nbsp;\n\n## :guardsman: Test\n\n```\nyarn test\n```\n\n### Result\n\n```\n    initialize(address _tokenManager, address _vault, address _depositToken, _uint256 _minLockTime _uint256 maxLocks) fails\n      ✓ Should revert when passed non-contract address as token manager (49ms)\n      ✓ Should revert when passed non-contract address as vault\n      ✓ Should revert when passed non-contract address as deposit token\n    initialize(address _tokenManager, address _vault, address address _depositToken, _uint256 _minLockTime, _uint256 maxLocks)\n      ✓ Should set correct variables\n      ✓ Should set able to set maxLocks and minLockTime and vault (194ms)\n      ✓ Should not be able to set maxLocks because of no permission (45ms)\n      ✓ Should not be able to set maxLocks because of of value too high (75ms)\n      ✓ Should not be able to set minLockTime because of no permission (93ms)\n      ✓ Should not be able to set a new Vault because of no permission (49ms)\n      stake(uint256 _amount, uint256 _lockTime, address _receiver)\n        ✓ Should create wrapped tokens in exchange for DepositToken (107ms)\n        ✓ Should not be able to stake without token approve (70ms)\n        ✓ Should not be able to perform more stake than allowed (maxLocks) (2367ms)\n        ✓ Should not be able to stake more than you have approved (52ms)\n        ✓ Should not be able to stake with a lock time less than the minimun one (52ms)\n        ✓ Should return a correct value when getting number of staked locks (2338ms)\n        ✓ Should return a correct value when getting number of staked locks after having staked\n        ✓ Should be able to increase a lock duration (133ms)\n        ✓ Should not be able to increase a lock duration because lock does not exists (1) (125ms)\n        ✓ Should not be able to increase a lock duration because lock does not exists (2) (122ms)\n        ✓ Should be able to increase more than 1 lock duration (1) (265ms)\n        ✓ Should be able to increase more than 1 lock duration (2) (238ms)\n        ✓ Should be able to increase a lock duration of an unlocked lock (137ms)\n      unstake(uint256 _amount)\n        ✓ Should be able to both staking and unstaking (248ms)\n        ✓ Should not be able to unstake more than you have (150ms)\n        ✓ Should not be able to unstake because it needs to wait the correct time (138ms)\n        ✓ Should be able to unstake (partial ok 1) (345ms)\n        ✓ Should not be able to unstake because it needs to wait the correct time (partial fail 1) (196ms)\n        ✓ Should be able to unstake (partial ok 2) (961ms)\n        ✓ Should not be able to unstake more than what you have wrapped (partial fail 2) (419ms)\n        ✓ Should be able to unstake with different lock times (913ms)\n        ✓ Should be able to stake for a non sender address and unstake (228ms)\n        ✓ Should not be able to stake for a non sender address and unstake to msg.sender (118ms)\n        ✓ Should be able to insert in an empty slot (2541ms)\n        ✓ Should be able to stake MAX_LOCKS times, unstake MAX_LOCKS * 2 times(unstake with amount / 2) and wrapping other MAX_LOCKS times (8980ms)\n        ✓ Should be able to stake MAX_LOCKS times and unstake in two times (2210ms)\n        ✓ Should not be able to stake zero tokens (51ms)\n        ✓ Should return a correct value when getting number of staked locks after havin staked and unstake (4390ms)\n        ✓ Should be able to unstake correctly after an increasing af a lock duration (1) (250ms)\n        ✓ Should be able to unstake correctly after an increasing af a lock duration (2) (230ms)\n        ✓ Should not be able to unstake the previous stake duration if it is changed (1) (282ms)\n        ✓ Should not be able to unstake the previous stake duration if it is changed (2) (144ms)\n        ✓ Should not be able to update the lock duration for all locks (4718ms)\n        ✓ Should be able to update the lock duration for all locks and unstake (4727ms)\n\n\n  43 passing (1m)\n```\n\n\u0026nbsp;\n\n***\n\n\u0026nbsp;\n\n## :rocket: How to publish\n\nCreate an __`.env`__ file with the following format\n\n```\nRINKEBY_PRIVATE_KEY=\nMAINNET_PRIVATE_KEY=\nINFURA_KEY=\n```\n\nRun the local IPFS node:\n\n```\naragon ipfs start\n```\n\nand then publish.\n\n```\nnpx buidler publish \"version or patch/minor/major\" --network \"rinkeby or mainnet\"\n```\n\n\u0026nbsp;\n\n***\n\n\u0026nbsp;\n\n## :white_check_mark: How to verify\n\nAdd the following field to __`.env`__ file\n\n```\nETHERSCAN_API_KEY=\n```\n\nand then verify.\n\n```\nnpx buidler verify-contract --contract-name StakingManager --address 'deployed contract address' \"constructor arguments\"\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprovable-things%2Faragon-staking-manager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprovable-things%2Faragon-staking-manager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprovable-things%2Faragon-staking-manager/lists"}