npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

poolz-delay-vault

v1.0.6

Published

[![Build Status](https://api.travis-ci.com/The-Poolz/DelayVault.svg?token=qArPwDxVjiye5pPqiscU&branch=master)](https://app.travis-ci.com/github/The-Poolz/DelayVault) [![codecov](https://codecov.io/gh/The-Poolz/DelayVault/branch/master/graph/badge.svg)](h

Downloads

4

Readme

DelayVault

Build Status codecov CodeFactor

Smart contract that pre-locks tokens indefinitely by creating Vault. When the Vault is closed by withdrawing tokens, a Pool is created for the specified period using a Locked-Deal contract.

Navigation

Installation

npm install

Testing

truffle run coverage

Deployment

truffle dashboard
truffle migrate --network dashboard

UML

classDiagram

Create new Vault

Problem:

To participate in IDO, need to lock tokens. There are usually pre-agreed conditions for participation, such as a minimum number of tokens and a locking time. After the lock time expires, the user may forget or physically be unable to re-lock the tokens for a longer period of time due to the restrictions of the Locked-Pools contract.

Solution:

Create a Vault that doesn't start the lock time before the start of the withdrawal.

https://github.com/The-Poolz/DelayVault/blob/a76a1825297a9126120ba47a83305f0a1287a9c9/contracts/DelayVault.sol#L12-L18

  • _token - the address of the token that will be locked in vault.
  • _amount - the number of tokens that will be in the vault, if there are already tokens in the vault, they will be summed up.
  • _startDelay - the period of time after which the pool will start when withdraw the tokens from the vault.
  • _cliffDelay - time parameter that sets cliff for creating the pool.
  • _finishDelay - the time for which the tokens will be locked in the pool.

Start Lock Period

Creates a new pool of tokens for a specified period or, if there is no Locked Deal address, sends tokens to the owner. https://github.com/The-Poolz/DelayVault/blob/a76a1825297a9126120ba47a83305f0a1287a9c9/contracts/DelayVault.sol#L61

  • _token - which token do you want to withdraw.

Admin settings

Set Locked Deal address

setLockedDealAddress allows the admin to set the address of the LockedDealV2 contract. Without a Locked-Deal address, the user will immediately receive their tokens upon withdrawal! https://github.com/The-Poolz/DelayVault/blob/35eba8d1dc7ba9db7edbf39ad73441e05c58e78d/contracts/DelayManageable.sol#L12

  • _lockedDealAddress - the new address of the Locked-Pools. Its default address is zero.

Setting Minimum Delays

The administrator can set the minimum delay time and the minimum number of blocked tokens. Each token limit can have its own minimum block time. When setting amounts, they should be sorted from smallest to largest. https://github.com/The-Poolz/DelayVault/blob/35eba8d1dc7ba9db7edbf39ad73441e05c58e78d/contracts/DelayManageable.sol#L20-L26 If restrictions are set, the user will not be able to specify a lower value. The admin can specify his own minimum block time for a certain number of tokens.

  • _token - the address of the token to which the blocking rules will apply.
  • _amounts - array of quantitative limits of tokens.
  • _startDelays - array of delay start limits.
  • _cliffDelays - array of output time limits in the pool.
  • _finishDelays - array of pool end limits.

License

The-Poolz Contracts is released under the MIT License.