Multiplier Write Functions Explained

Multiplier Write Functions Explained

Unistake



ContractA – Multiplier Contract


Purpose: To hold tokens of a user which can be locked up and use by ContractB to increase the percentage of Staking Bonuses that a person gets by joining a pool in ContractB.


How To Use It


Write Functions:


approveContract

Before the Multiplier will work with the PoolStake contract the desired contract must be approved.

The user puts the contract address into the "approveContract" function, this allows the approved PoolStake contract to update the lock up period via the "UpdateLockupPeriod" function.


Each time a new contract is approved the old one is over written but if there is an active lockup period at the time of the new approval the lockup period is not changed.


If after a new contract is approved the user enters into a new PoolStake term, the "UpdateLockupPeriod" function is accessed by the PoolStake contract. If the term is longer than the current Multiplier lockup from the previously approved contract, the lockup period is updated. If however the term in the PoolStake is shorter that the current Multiplier Lockup, the Multiplier is not updated with the new term


deposit


A user deposits UNISTAKE tokens to the Multiplier contract using the "deposit" function.

Tokens are sent here at any time.

The tokens will remain unlocked until a PoolStake term is entered and updated by the approved contract.

If a user deposits tokens while in a active lockup the new tokens are also locked for the active period.


withdraw

A user calls this function to withdraw their tokens. While not locked up by an approved contract, the user can withdraw these tokens any time. Once locked they will not be able to be withdrawn until the lockup ends.


updateLockupPeriod

This function is for the approved contract to access in order to lock the tokens based on the term the user chose in the PoolStake contract. Only the approved contract can update this period and lock tokens.



Report Page