This contract is responsible for the ecosystem behavior related to staking KSP. Voting rights (vKSP) are issued according to the staking quantity and period, and 40% of the daily KSP mining quantity is distributed to staking participants. (KSP distribution for staking participants may be changed through governance voting)
Events Read-Only Functions State-Changing Functions
Events
LockKSP
Copy event LockKSP(address user, uint lockPeriod, uint KSPAmount, uint totalLockedKSP, uint unlockTime);
Parameters
KSPAmount
: Number of KSP
totalLockedKSP
: Total number of staked KSP
unlockTime
: Available unstaking time (timestamp)
UnlockKSP
Copy event UnlockKSP(address user, uint vKSPAmount, uint KSPAmount);
Event log of KSP unstaking
Parameters
vKSPAmount
: Number of vKSP
KSPAmount
: Number of KSP
UnlockKSPUnlimited
Copy event UnlockKSPUnlimited(address user, uint vKSPBefore, uint vKSPAfter, uint KSPAmount, uint unlockTime);
Event log that occurs when unstaking vKSP x8
Parameters
vKSPBefore
: The amount of vKSP held
vKSPAfter
: Amount of vKSP held after unstaking
KSPAmount
: Amount of KSP staked
unlockTime
: Available unstaking time (timestamp)
RefixBoosting
Copy event RefixBoosting(address user, uint lockPeriod, uint boostingAmount, uint unlockTime);
Event log of staking period is changed
Parameter
boostingAmount
: Number of vKSP after period changed
unlockTime
: Available unstaking time (timestamp)
ChangeMiningRate
Copy event ChangeMiningRate(uint _mining);
Event log of daily KSP distrivution rate changed
GiveReward
Copy event GiveReward(address user, uint amount, uint lastIndex, uint rewardSum);
Event log of when mined KSP is claimed and distributed
Compound
Copy event Compound(address user, uint reward, uint compoundAmount, uint transferAmount, uint mintAmount);
Event log of when mined KSP restaking.
The compound amount can be entered in integer units
The amount minus the compund amount from the mined amount is returned to the wallet.
Read-Only Functions
balanceOf
Number of vKSP tokens held by each address
getCurrentBalance
Number of vKSP tokens held by each address recent snapshot
getUserUnlockTime
lockedKSP
Number of KSP tokens stakes
mining
It is a value between 0 and 10000, in units of 0.0001%
snapShotBalance
Number of vKSP tokens held by each address and snapshot
snapShotCount
Number of snapshot index each address
getPriorBalance
Copy function getPriorBalance(address user, uint blockNumber) public view returns (uint)
Historical user vKSP holdings per block
Parameter
blockNumber
: prior blockNumber
snapShotBalance
Copy function snapShotBalance(address user, uint index) public view returns (uint)
Historical vKSP holdings each address
State-Changing Functions
lockKSP
Copy function lockKSP(uint amount, uint lockPeriodRequested) public
The amount can be entered in integer units
unlockKSP
Copy function unlockKSP() public
Unstaking is only possible during the unstaking period.
unlockKSPUnlimited
Copy function unlockKSPUnlimited() public
Method for unstake KSP x8
Changed to x4 staking from execution
refixBoosting
Copy function refixBoosting(uint lockPeriodRequested)
Method for KSP staking period change
claimReward
Copy function claimReward() public
Method that a user calls to claim the claimable KSP
compoundReward
Copy function compoundReward() public
Method for mined KSP staking
Can be called when the reward is 1 KSP or more
It is possible to stake in integer units, and the rest is to the wallet address.