1.3.2 • Published 2 years ago

artkdev-staking v1.3.2

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

Staking

Build Status codecov CodeFactor

Mainnet contract: link Testnet contract: link

The main idea of the ArtKDev-Staking contract is to stake ERC-20 tokens.

Navigation

Installation

npm install

Testing

truffle run coverage

Deploy

truffle dashboard
truffle migrate --network dashboard

Admin privileges

Setting a locking address

If you want to set a new locking contract's address, you should use a SetLockingAddress() function.

  function SetLockingAddress(address _newAddress) external;

Testnet tx: link

Pausing the staking

If you want to pause the staking, you should use a Pause() function.

  function Pause() external;

Testnet tx: link

Unpausing the staking

If you want to unpause the staking, you should use a Unpause() function.

  function Unpause() external;

Testnet tx: link

Owner of a staking pool

Creating a new staking pool

If you want to create a new staking pool, you should use a CreateNewStakingPool() function.

  function CreateNewStakingPool(
        address _lockingToken,     // address of a locking token
        address _rewardToken,      // address of a reward token
        uint256 _tokensAmount,     // reward tokens amount
        uint256 _startTime,        // time when pool will be started to stake
        uint256 _finishTime,       // time when pool will be finished of staking
        uint256 _profit,           // annual percentage of reward
        uint256 _minDuration,      // min duration of staking
        uint256 _maxDuration,      // max duration of staking
        uint256 _minAmount,        // min amount of tokens to stake
        uint256 _maxAmount,        // max amount of tokens to stake
        uint256 _earlierWithdraw   // amount of tokens to withdraw earlier than ordinary
    )
     external;

Testnet tx: link

Withdrawing a balance

If you want to withdraw a balance, you should use a WithdrawBalance() function.

  function WithdrawBalance(uint256 _id) external;

User privileges

Staking

If you want to stake some tokens, you should use a Stake() function.

  function Stake(
        uint256 _id,
        uint256 _amount,
        uint256 _duration  // in seconds
    ) external;

Testnet tx: link

License

ArtKDev's contracts is released under the MIT License.