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-envelop-token

v2.0.1

Published

[![Build Status](https://app.travis-ci.com/The-Poolz/synthetic-token.svg?branch=locked-synthetic)](https://app.travis-ci.com/The-Poolz/synthetic-token) [![codecov](https://codecov.io/gh/The-Poolz/synthetic-token/branch/locked-synthetic/graph/badge.svg?to

Downloads

38

Readme

synthetic-token

Build Status codecov CodeFactor

A synthetic token is an ERC20 smart contract that proof of ownership of the original token. The owner of synthetic tokens has the right to exchange his token for the original using the properties of the contract.

Installation

npm install

Testing

truffle run coverage

Deploy

truffle dashboard
truffle migrate --network dashboard

Functions

Contract Creation

When we create a synthetic token, we need to stick to the settings of the original token.

  • Decimal numbers must be the same as the original token
  • If the capitalization of the synthetic token is greater than the original token, we will not be able to block the original tokens
  • Synthetic token contract can't work without Locked-Deal contract
constructor(
        string memory _name, // token name
        string memory _symbol, // token symbol
        uint _cap, // set the capitalization of synthetic tokens
        uint8 _decimals, // token decimals
        address _owner, // who will take synthetic tokens
        address _lockedDealAddress, // can't be zero address
        address _whitelistAddress
    )

Testnet tx (without a whitelist): link Testnet tx (with a whitelist): link

Transfer the original tokens to the envelope token contract

Using SetLockingDetails function allows us to transfer one-time original tokens to a contract of synthetic tokens.

// Can only use the owner address or Governer contract.
SetLockingDetails(
        address _tokenAddress, // address of original token
        uint64[] calldata _unlockTimes, // times when we can unlock original tokens
        uint8[] calldata _ratios, // ratios for the time how much we take
        uint256 _finishTime // after finish time we can transfer tokens
    )

Testnet tx: link

Get information about locking

getActivationResult is view function that returns main information about locking tokens.

  • Total tokens
  • Creditable amount
  • Unlock times
  • Unlock amounts
getActivationResult(uint _amountToActivate)
public
view
returns(uint TotalTokens, uint CreditableAmount, uint64[] memory unlockTimes, uint256[] memory unlockAmounts)

Take original tokens

Each user that have synthetic tokens can “Open” the Envelope to receive the original token. User can open the Envelopes only after the expiration of the agreement by using Locked-Deal contract.

// try to take original tokens if time is up or create new locked pools
ActivateSynthetic(uint _amountToActivate)
//or
ActivateSynthetic() // _amountToActivate = balance of the tokens that the sender has

Testnet tx (without a creating new pool): link Testnet tx (with a creating new pool): link

License

The-Poolz Contracts is released under the MIT License.