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

artkdev-locking

v3.0.3

Published

[![Build Status](https://app.travis-ci.com/artkdev2020/ArtKDev-Locking.svg?branch=main)](https://app.travis-ci.com/artkdev2020/ArtKDev-Locking) [![codecov](https://codecov.io/gh/artkdev2020/ArtKDev-Locking/branch/main/graph/badge.svg?token=XFXXHIYRJN)](h

Downloads

23

Readme

ArtKDev-Locking

Build Status codecov CodeFactor

Mainnet contract: link Testnet contract: link

The main idea of the ArtKDev-Locking contract is to keep ERC-20 tokens foolproofly.

Navigation

Installation

npm install

Testing

truffle run coverage

Deploy

truffle dashboard
truffle migrate --network dashboard

Admin privileges

Setting a whitelist address

If you want to set a new whitelist address, you should use a SetWhiteListAddress() function.

  function SetWhiteListAddress(address _newAddress) external;

Testnet tx: link

Setting a token fee whitelist id

If you want to set a new token fee whitelist id, you should use a SetTokenFeeWhiteListId() function.

    function SetTokenFeeWhiteListId(uint256 _newId) external;

Testnet tx: link

Setting a token filter whitelist id

If you want to set a new token filter whitelist id, you should use a SetTokenFilterWhiteListId() function.

  function SetTokenFilterWhiteListId(uint256 _newId) external

Testnet tx: link

Setting a user whitelist id

If you want to set a new user whitelist id, you should use a SetUserWhiteListId() function.

    function SetUserWhiteListId(uint256 _newId) external;

Testnet tx: link

Setting a max transaction pools' limit

If you want to set a new max transation pools' limit, you should use a SetMaxTransactionPoolsLimit() function.

    function SetMaxTransactionPoolsLimit(uint256 _newLimit) external;

Testnet tx: link

Swapping a token filter

If you want to swap a token filter condition, you should use a SwapTokenFilter() function.

    function SwapTokenFilter() external

Testnet tx: link

Owner of the tokens

Transferring pool ownership

If you want to transfer a pool ownership, you should use a TransferPool() function.

  function TransferPool(address _newOwner, uint256 _poolId) external;

Testnet tx: link

Splitting a pool amount

If you want to split a pool, you should use a SplitPoolAmount() function.

  function SplitPoolAmount(
        address _newOwner,
        uint256 _poolId,
        uint256 _newAmount
    ) external returns(uint256);

Testnet tx: link

Approving an allowance

If you want to approve an allowance, you should use a ApproveAllowance() function.

  function ApproveAllowance(
        address _user,
        uint256 _poolId,
        uint256 _amount
    ) external;

Testnet tx: link

User privileges

Creating a new pool

CreateNewPool() function allows us to create a new pool for locking tokens. If it is needed you have to pay some fee for creation.

  function CreateNewPool(
        address _owner,  // owner of tokens
        address _token,  // locking token address
        uint256 _startTime,  // time when pool will be started
        uint256 _finishTime,  // time until pool will have been worked
        uint256 _amount  // amount of tokens to sell in the pool
    ) external payable returns(uint256);

Testnet tx: link

Creating an array of pools

CreatePoolsAmount() function allows us to create an array of the pools for locking tokens.

  function CreatePoolsAmount(
        address _token,
        address[] calldata _owner,
        uint256[] calldata _startTime,
        uint256[] calldata _finishTime,
        uint256[] calldata _amount
    )   external payable;

Testnet tx: link

Creating an array of pools with respect to finish time

CreatePoolsAmountTimes() function allows us to create an array of the pools for locking tokens.

function CreatePoolsAmountTimes(
        address _token,
        address[] calldata _owner,
        uint256[] calldata _startTime,
        uint256[] calldata _finishTime,
        uint256[] calldata _amount
    )   external payable;

Testnet tx: link

Getting my pools' ids by a token

    function GetMyPoolsIdsByToken(address _owner, address[] memory _tokens)
        external
        view
        returns (uint256[] memory);

Getting a pools' data

If you want to get a pool data, you should you a GetPoolsData() function.

    function GetPoolsData(uint256[] memory _ids)
        external
        view
        returns (Pool[] memory)

Check whether is token without fee?

If you want to check whether is a token without a fee, you should you a isTokenWithoutFee() function.

    function isTokenWithoutFee(address _token) public view returns(bool);

Check whether is token in a whitelist?

If you want to check whether is a token in a whitelist, you should you a IsTokenWhiteListed() function.

   function IsTokenWhiteListed(address _token) public view returns(bool);

Check does whether a user have to pay a commission?

If you want to check does whether a user have to pay a commission, you should you a IsUserWithoutFee() function.

   function IsUserWithoutFee(address _user) public view returns(bool);

Gettting a pool data

  function PoolsMap(uint256 _id)
        public
        view
        returns (
            address, // owner
            address  // token
            uint256, // startTime
            uint256, // finishTime
            uint256, // amount
            uint256  // debitedAmount
        );

Getting all my pools' ids

   function GetAllMyPoolsIds(address _owner) external view returns (uint256[] memory);

Getting my pools' ids

  function GetMyPoolsIds(address _owner) external view returns (uint256[] memory);

Withdrawing a tokens

  function WithdrawTokens(uint256 _poolId) external returns (bool);

Testnet tx: link

Getting a withdrawable amount

Using this function you can check how many tokens can be unlocked in a pool.

  function GetWithdrawableAmount(uint256 _poolId) public view returns(uint256);

Splitting a pool amount from already an existing pool's allowance for a user.

  function SplitPoolAmountFrom(
        address _address,
        uint256 _poolId,
        uint256 _amount
    ) external returns(uint256);

Testnet tx: link

Getting an allowance

There is a way how to get a pool allowance.

  function Allowance(uint256 _poolId, address _address) public view returns(uint256);

License

ArtKDev's contracts is released under the MIT License.