Repository navigation
Delegation calls reference
Delegate an amount of FTM to a validator.
Can be used to create a new delegation or increase an existing delegation.
The delegated stake is always unlocked unless locked explicitly with lockStake.
sfcc.delegate(validatorID, {from: "0xAddress", value: web3.toWei("amount", "ftm")})- Validator must exist
- Validator is active
- Amount is greater than zero
-
Validator's stakeis less or equal to16.0*validator's self-stake
Put in a request to withdraw an amount of delegated stake.
After a number of seconds and epochs have passed since calling the function below (called withdrawal period), you will be able to call withdraw successfully.
requestID is any number which isn't occupied by an existing withdrawal request for this delegation.
sfcc.undelegate(validatorID, requestID, web3.toWei("amount", "ftm"), {from: "0xAddress"})- Amount is greater than zero
- Delegation's
unlocked stakeis greater or equal to the amount to undelegate -
requestIDisn't occupied by an existing withdrawal request for this delegation - If called for validator's self-delegation, then the following stays true after the operation: either
validator's stakeis less or equal to16.0*validator's self-stakeor theself-stakeis0
Withdrawal period in seconds and epochs can be retrieved via
sfcc.withdrawalPeriodTime()
sfcc.withdrawalPeriodEpochs()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 elapse since undelegate call (called withdrawal period).
If validator is a cheater (i.e. double-signed), then the stake may be fully or partially slashed according to validator's slashingRefundRatio.
sfcc.withdraw(validatorID, requestID, {from: "0xAddress"})- Withdrawal request with given address, validator ID and requestID exists
- At least
sfcc.withdrawalPeriodTime()seconds passed sinceundelegatecall - At least
sfcc.withdrawalPeriodEpochs()epochs passed sinceundelegatecall - Non-slashed part of stake is above zero