-
Notifications
You must be signed in to change notification settings - Fork 11
Validator calls reference
Create a new validator (staker)
Minimum stake is 3175000 FTM
sfcc.createStake([], {from:`address`, value: web3.toWei(`amount`, "ftm")})
- Stake amount is greater or equal to
sfcc.minStake()
- This address isn't a staker
- This address isn't a delegator
Not availible since sfc2.0.2-rc2.
- Staker must exist
- All staker rewards are claimed
- Staker isn't deactivated (i.e. didn't prepare to withdraw)
Put in a request to partially withdraw stake. After a number of seconds and epochs have passed since calling the function below, you will be able to call withdrawByRequest() successfully.
Note that it's not possible to call this function until all the rewards are claimed (rewards may be claimed even if they're locked).
Pay attention that proportional part of stashed rewards will be burned within this call.
request ID
is any number which wasn't used by validator before.
Remember this number, it'll be needed to finalize withdrawal. Use 0
if not sure.
Validator cannot leave less stake than minStake()
or less than delegations amount
* 15.0
.
This call doesn't affect already earned rewards by delegators.
The validator's stake will be decreased in next epoch by amount
.
sfcc.prepareToWithdrawStakePartial(`request ID`, web3.toWei(`amount to withdraw`, "ftm"), {from: `address`})
- Staker must exist
- All staker rewards are claimed
- Staker isn't deactivated (i.e. didn't prepare to withdraw)
- request ID isn't occupied by another request
-
amount to withdraw
>=minStakeDecrease()
-
left amount
>=minStake()
-
left amount
>=delegations amount
*15.0
After enough seconds and epochs have passed since calling PreparedToWithdrawStake(), validator can call this function successfully.
If staker is a cheater (i.e. doublesigned in DAG), then staker will be erased, but delegated stake won't be withdrawn (i.e. will be slashed).
sfcc.withdrawStake({from: `address`})
- Passed at least
sfcc.stakeLockPeriodTime()
seconds sinceprepareToWithdrawStake
was called - Passed at least
sfcc.stakeLockPeriodEpochs()
epochs sinceprepareToWithdrawStake
was called
Finalize withdrawal request. Erases request object and withdraws requested stake, transfers requested stake to account address.
Note that a number of seconds and epochs must elaspe since prepareToWithdrawStakePartial
call.
If staker is a cheater (i.e. doublesigned in DAG), then object will be erased, but stake won't be withdrawn (i.e. will be slashed).
sfcc.withdrawByRequest(`request ID`, {from: `address`})
- Passed at least
sfcc.stakeLockPeriodTime()
seconds sinceprepareToWithdrawStakePartial
- Passed at least
sfcc.stakeLockPeriodEpochs()
epochs sinceprepareToWithdrawStakePartial
Lock up stake.
Reward for a non-locked stake is 30% (base rate) of the full reward for a locked stake.
Note that it's impossible to withdraw stake until lockup period has expired.
-
lockup duration
- lockup duration in seconds. Must be >= 14 days, <= 365 days.
sfcc.lockUpStake(`lockup duration`, {from: `address`})
-
lockup duration
>= 14 days -
lockup duration
<= 365 days