SFC
Sonic0xfc00face00000000000000000000000000000000
Proxy implementation: 0xf46ab7507088cc9d3f58bb85ae2c36c86103447d
Solidity v0.8.27+commit.40a35a09
Overview
Read Functions
Returns
| Name | Type | Description |
|---|---|---|
| — | string |
Get consts address.
Returns
| Name | Type | Description |
|---|---|---|
| — | address |
Get the current epoch number.
Returns
| Name | Type | Description |
|---|---|---|
| — | uint256 |
Returns
| Name | Type | Description |
|---|---|---|
| — | uint256 |
Get epoch end time.
Parameters
| Name | Type | Description |
|---|---|---|
| epoch | uint256 |
Returns
| Name | Type | Description |
|---|---|---|
| — | uint256 |
Get accumulated originated txs fee for a validator in a given epoch.
Parameters
| Name | Type | Description |
|---|---|---|
| epoch | uint256 | |
| validatorID | uint256 |
Returns
| Name | Type | Description |
|---|---|---|
| — | uint256 |
Get accumulated reward per token for a validator in a given epoch.
Parameters
| Name | Type | Description |
|---|---|---|
| epoch | uint256 | |
| validatorID | uint256 |
Returns
| Name | Type | Description |
|---|---|---|
| — | uint256 |
Get accumulated uptime for a validator in a given epoch.
Parameters
| Name | Type | Description |
|---|---|---|
| epoch | uint256 | |
| validatorID | uint256 |
Returns
| Name | Type | Description |
|---|---|---|
| — | uint256 |
Get average uptime for a validator in a given epoch.
Parameters
| Name | Type | Description |
|---|---|---|
| epoch | uint256 | |
| validatorID | uint256 |
Returns
| Name | Type | Description |
|---|---|---|
| — | uint64 |
Get end block for a given epoch.
Parameters
| Name | Type | Description |
|---|---|---|
| epoch | uint256 |
Returns
| Name | Type | Description |
|---|---|---|
| — | uint256 |
Get offline blocks for a validator in a given epoch.
Parameters
| Name | Type | Description |
|---|---|---|
| epoch | uint256 | |
| validatorID | uint256 |
Returns
| Name | Type | Description |
|---|---|---|
| — | uint256 |
Get offline time for a validator in a given epoch.
Parameters
| Name | Type | Description |
|---|---|---|
| epoch | uint256 | |
| validatorID | uint256 |
Returns
| Name | Type | Description |
|---|---|---|
| — | uint256 |
Get received stake for a validator in a given epoch.
Parameters
| Name | Type | Description |
|---|---|---|
| epoch | uint256 | |
| validatorID | uint256 |
Returns
| Name | Type | Description |
|---|---|---|
| — | uint256 |
Parameters
| Name | Type | Description |
|---|---|---|
| epoch | uint256 |
Returns
| Name | Type | Description |
|---|---|---|
| endTime | uint256 | |
| endBlock | uint256 | |
| epochFee | uint256 | |
| baseRewardPerSecond | uint256 | |
| totalStake | uint256 | |
| totalSupply | uint256 |
Get validator IDs for given epoch.
Parameters
| Name | Type | Description |
|---|---|---|
| epoch | uint256 |
Returns
| Name | Type | Description |
|---|---|---|
| — | uint256[] |
Parameters
| Name | Type | Description |
|---|---|---|
| delegator | address |
Returns
| Name | Type | Description |
|---|---|---|
| receiver | address |
Parameters
| Name | Type | Description |
|---|---|---|
| delegator | address |
Returns
| Name | Type | Description |
|---|---|---|
| receiver | address |
Get self-stake of a validator.
Parameters
| Name | Type | Description |
|---|---|---|
| validatorID | uint256 |
Returns
| Name | Type | Description |
|---|---|---|
| — | uint256 |
Parameters
| Name | Type | Description |
|---|---|---|
| delegator | address | |
| validatorID | uint256 |
Returns
| Name | Type | Description |
|---|---|---|
| stake | uint256 |
Parameters
| Name | Type | Description |
|---|---|---|
| validatorID | uint256 |
Returns
| Name | Type | Description |
|---|---|---|
| status | uint256 | |
| receivedStake | uint256 | |
| auth | address | |
| createdEpoch | uint256 | |
| createdTime | uint256 | |
| deactivatedTime | uint256 | |
| deactivatedEpoch | uint256 |
Parameters
| Name | Type | Description |
|---|---|---|
| auth | address |
Returns
| Name | Type | Description |
|---|---|---|
| validatorID | uint256 |
Parameters
| Name | Type | Description |
|---|---|---|
| validatorID | uint256 |
Returns
| Name | Type | Description |
|---|---|---|
| pubkey | bytes |
Parameters
| Name | Type | Description |
|---|---|---|
| delegator | address | |
| validatorID | uint256 | |
| wrID | uint256 |
Returns
| Name | Type | Description |
|---|---|---|
| epoch | uint256 | |
| time | uint256 | |
| amount | uint256 |
Check whether the given validator is slashed - the stake (or its part) cannot be withdrawn because of misbehavior (double-sign) of the validator.
Parameters
| Name | Type | Description |
|---|---|---|
| validatorID | uint256 |
Returns
| Name | Type | Description |
|---|---|---|
| — | bool |
Returns
| Name | Type | Description |
|---|---|---|
| — | uint256 |
Returns
| Name | Type | Description |
|---|---|---|
| — | address |
Get the amount of rewards which can be currently claimed by the given delegator for the given validator.
Parameters
| Name | Type | Description |
|---|---|---|
| delegator | address | |
| toValidatorID | uint256 |
Returns
| Name | Type | Description |
|---|---|---|
| — | uint256 |
Returns
| Name | Type | Description |
|---|---|---|
| — | bytes32 |
Parameters
| Name | Type | Description |
|---|---|---|
| pubkeyAddress | address |
Returns
| Name | Type | Description |
|---|---|---|
| validatorID | uint256 |
Returns
| Name | Type | Description |
|---|---|---|
| — | address |
Get amount of currently stashed rewards.
Parameters
| Name | Type | Description |
|---|---|---|
| delegator | address | |
| validatorID | uint256 |
Returns
| Name | Type | Description |
|---|---|---|
| — | uint256 |
Parameters
| Name | Type | Description |
|---|---|---|
| validatorID | uint256 |
Returns
| Name | Type | Description |
|---|---|---|
| refundRatio | uint256 |
Returns
| Name | Type | Description |
|---|---|---|
| — | address |
Parameters
| Name | Type | Description |
|---|---|---|
| delegator | address | |
| validatorID | uint256 |
Returns
| Name | Type | Description |
|---|---|---|
| epoch | uint256 |
Returns
| Name | Type | Description |
|---|---|---|
| — | uint256 |
Returns
| Name | Type | Description |
|---|---|---|
| — | uint256 |
Returns
| Name | Type | Description |
|---|---|---|
| — | uint256 |
Returns
| Name | Type | Description |
|---|---|---|
| — | address |
Returns
| Name | Type | Description |
|---|---|---|
| — | uint256 |
Returns
| Name | Type | Description |
|---|---|---|
| — | bytes3 |
Write Functions
Announce redirection of address to be called by validator whose auth key was compromised. Produced events are used to notify redirect authorizer about redirection request. Redirect authorizer then initiates creating of appropriate redirect by calling initiateRedirection().
Parameters
| Name | Type | Description |
|---|---|---|
| to | address |
Burn native tokens by sending them to the SFC contract.
Claim rewards for stake delegated to a validator.
Parameters
| Name | Type | Description |
|---|---|---|
| toValidatorID | uint256 |
Create a validator with a given public key while using attached value as the validator's self-stake.
Parameters
| Name | Type | Description |
|---|---|---|
| pubkey | bytes |
Deactivate a validator. Called by network node when a double-sign of the given validator is registered. Is called before sealEpoch() call.
Parameters
| Name | Type | Description |
|---|---|---|
| validatorID | uint256 | |
| status | uint256 |
Delegate stake to a validator.
Parameters
| Name | Type | Description |
|---|---|---|
| toValidatorID | uint256 |
Distribute extra rewards for validators at given epoch coming from an external source. The tokens received are burned and the reward share is added to the stash of each validator eligible for the reward in the given epoch. An optional `withBurn` flag allows the sender to signal that preconfigured percentage of the rewards should be burned.
Parameters
| Name | Type | Description |
|---|---|---|
| epoch | uint256 | |
| withBurn | bool |
Initialization is called only once, after the contract deployment. Because the contract code is written directly into genesis, constructor cannot be used.
Parameters
| Name | Type | Description |
|---|---|---|
| sealedEpoch | uint256 | |
| _totalSupply | uint256 | |
| nodeDriver | address | |
| _c | address | |
| owner | address |
Initiate redirection of withdrawals/claims for a compromised validator account. Needs to be accepted by validator key holder before the redirect is active.
Parameters
| Name | Type | Description |
|---|---|---|
| from | address | |
| to | address |
Issue tokens to the issued tokens recipient as a counterparty to the burnt FTM tokens.
Parameters
| Name | Type | Description |
|---|---|---|
| amount | uint256 |
Accept redirection proposal. Redirection must by accepted by the validator key holder before it starts to be applied.
Parameters
| Name | Type | Description |
|---|---|---|
| to | address |
Resolve failed treasury transfers and send the unresolved fees to the treasury address.
Re-stake rewards - claim rewards for staking and delegate it immediately to the same validator - add it to the current stake.
Parameters
| Name | Type | Description |
|---|---|---|
| toValidatorID | uint256 |
Seal epoch. Called BEFORE epoch sealing made by the client itself.
Parameters
| Name | Type | Description |
|---|---|---|
| offlineTime | uint256[] | |
| offlineBlocks | uint256[] | |
| uptimes | uint256[] | |
| originatedTxsFee | uint256[] |
Seal epoch. Called AFTER epoch sealing made by the client itself.
Parameters
| Name | Type | Description |
|---|---|---|
| nextValidatorIDs | uint256[] |
Set an initial delegation. Called only as part of network initialization/genesis file generating.
Parameters
| Name | Type | Description |
|---|---|---|
| delegator | address | |
| toValidatorID | uint256 | |
| stake | uint256 |
Set an initial validator. Called only as part of network initialization/genesis file generating.
Parameters
| Name | Type | Description |
|---|---|---|
| auth | address | |
| validatorID | uint256 | |
| pubkey | bytes | |
| createdTime | uint256 |
Set admin address responsible for initiating redirections.
Parameters
| Name | Type | Description |
|---|---|---|
| v | address |
Stash rewards for a delegator.
Parameters
| Name | Type | Description |
|---|---|---|
| delegator | address | |
| toValidatorID | uint256 |
Parameters
| Name | Type | Description |
|---|---|---|
| newOwner | address |
Un-delegate stake from a validator.
Parameters
| Name | Type | Description |
|---|---|---|
| toValidatorID | uint256 | |
| wrID | uint256 | |
| amount | uint256 |
Update consts address.
Parameters
| Name | Type | Description |
|---|---|---|
| v | address |
Update slashing refund ratio for a validator. The refund ratio is used to calculate the amount of stake that can be withdrawn after slashing.
Parameters
| Name | Type | Description |
|---|---|---|
| validatorID | uint256 | |
| refundRatio | uint256 |
Update voteBook address.
Parameters
| Name | Type | Description |
|---|---|---|
| v | address |
Update treasury address.
Parameters
| Name | Type | Description |
|---|---|---|
| v | address |
Parameters
| Name | Type | Description |
|---|---|---|
| newImplementation | address | |
| data | bytes |
Withdraw stake from a validator after its un-delegation. Un-delegated stake is locked for a certain period of time.
Parameters
| Name | Type | Description |
|---|---|---|
| toValidatorID | uint256 | |
| wrID | uint256 |
Events
| Name | Type | Indexed | Description |
|---|---|---|---|
| from | address | ✓ | |
| to | address | ✓ |
| Name | Type | Indexed | Description |
|---|---|---|---|
| amount | uint256 |
| Name | Type | Indexed | Description |
|---|---|---|---|
| validatorID | uint256 | ✓ | |
| status | uint256 |
| Name | Type | Indexed | Description |
|---|---|---|---|
| delegator | address | ✓ | |
| toValidatorID | uint256 | ✓ | |
| rewards | uint256 |
| Name | Type | Indexed | Description |
|---|---|---|---|
| validatorID | uint256 | ✓ | |
| auth | address | ✓ | |
| createdEpoch | uint256 | ||
| createdTime | uint256 |
| Name | Type | Indexed | Description |
|---|---|---|---|
| validatorID | uint256 | ✓ | |
| deactivatedEpoch | uint256 | ||
| deactivatedTime | uint256 |
| Name | Type | Indexed | Description |
|---|---|---|---|
| delegator | address | ✓ | |
| toValidatorID | uint256 | ✓ | |
| amount | uint256 |
| Name | Type | Indexed | Description |
|---|---|---|---|
| epochID | uint256 | ✓ | |
| received | uint256 | ||
| distributed | uint256 |
| Name | Type | Indexed | Description |
|---|---|---|---|
| version | uint64 |
| Name | Type | Indexed | Description |
|---|---|---|---|
| previousOwner | address | ✓ | |
| newOwner | address | ✓ |
| Name | Type | Indexed | Description |
|---|---|---|---|
| delegator | address | ✓ | |
| toValidatorID | uint256 | ✓ | |
| rewards | uint256 |
| Name | Type | Indexed | Description |
|---|---|---|---|
| amount | uint256 |
| Name | Type | Indexed | Description |
|---|---|---|---|
| delegator | address | ✓ | |
| toValidatorID | uint256 | ✓ | |
| wrID | uint256 | ✓ | |
| amount | uint256 |
| Name | Type | Indexed | Description |
|---|---|---|---|
| validatorID | uint256 | ✓ | |
| refundRatio | uint256 |
| Name | Type | Indexed | Description |
|---|---|---|---|
| implementation | address | ✓ |
| Name | Type | Indexed | Description |
|---|---|---|---|
| delegator | address | ✓ | |
| toValidatorID | uint256 | ✓ | |
| wrID | uint256 | ✓ | |
| amount | uint256 | ||
| penalty | uint256 |