SFC
Sonic0xfc00face00000000000000000000000000000000
Proxy 实现合约: 0xf46ab7507088cc9d3f58bb85ae2c36c86103447d
Solidity v0.8.27+commit.40a35a09
概览
读取函数
Returns the upgrade interface version string for this SFC contract.✨ AI
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | string | The semantic or numeric version identifier for the upgrade interface.✨ AI |
Get consts address.
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | address |
Get the current epoch number.
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | uint256 |
Returns the current sealed epoch identifier.✨ AI
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | uint256 | The current sealed epoch as a uint256.✨ AI |
Get epoch end time.
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| epoch | uint256 |
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | uint256 |
Get accumulated originated txs fee for a validator in a given epoch.
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| epoch | uint256 | |
| validatorID | uint256 |
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | uint256 |
Get accumulated reward per token for a validator in a given epoch.
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| epoch | uint256 | |
| validatorID | uint256 |
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | uint256 |
Get accumulated uptime for a validator in a given epoch.
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| epoch | uint256 | |
| validatorID | uint256 |
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | uint256 |
Get average uptime for a validator in a given epoch.
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| epoch | uint256 | |
| validatorID | uint256 |
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | uint64 |
Get end block for a given epoch.
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| epoch | uint256 |
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | uint256 |
Get offline blocks for a validator in a given epoch.
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| epoch | uint256 | |
| validatorID | uint256 |
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | uint256 |
Get offline time for a validator in a given epoch.
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| epoch | uint256 | |
| validatorID | uint256 |
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | uint256 |
Get received stake for a validator in a given epoch.
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| epoch | uint256 | |
| validatorID | uint256 |
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | uint256 |
Return the stored snapshot data for a specific epoch.✨ AI
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| epoch | uint256 | Epoch index to query.✨ AI |
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| endTime | uint256 | End timestamp (unix seconds) of the epoch snapshot.✨ AI |
| endBlock | uint256 | Block number at the end of the epoch.✨ AI |
| epochFee | uint256 | Total fees collected for the epoch (in contract token units).✨ AI |
| baseRewardPerSecond | uint256 | Base reward rate distributed per second during the epoch.✨ AI |
| totalStake | uint256 | Total amount staked at the epoch snapshot.✨ AI |
| totalSupply | uint256 | Total token supply recorded at the epoch snapshot.✨ AI |
Get validator IDs for given epoch.
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| epoch | uint256 |
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | uint256[] |
Return the address that receives delegated votes or rewards for a given delegator.✨ AI
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| delegator | address | Address of the delegator whose redirection target will be queried.✨ AI |
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| receiver | address | Receiver address that the delegator redirects to, or the zero address if no redirection is set.✨ AI |
Get the current redirection target for the given delegator.✨ AI
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| delegator | address | Delegator address to query the redirection for.✨ AI |
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| receiver | address | Receiver address that receives redirected rewards, or the zero address if no redirection is set.✨ AI |
Get self-stake of a validator.
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| validatorID | uint256 |
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | uint256 |
Returns the amount of stake the delegator has assigned to the given validator.✨ AI
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| delegator | address | Address of the delegator whose stake is being queried.✨ AI |
| validatorID | uint256 | Identifier of the validator for which to query the delegator's stake.✨ AI |
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| stake | uint256 | The staked token amount (in contract base units) that the delegator has for the validator.✨ AI |
Fetches and returns on-chain details for the specified validator ID.✨ AI
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| validatorID | uint256 | Identifier of the validator to query.✨ AI |
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| status | uint256 | Validator status code as stored on-chain.✨ AI |
| receivedStake | uint256 | Total stake received by the validator, denominated in wei.✨ AI |
| auth | address | Address authorized to manage the validator (operator or owner).✨ AI |
| createdEpoch | uint256 | Epoch when the validator was created.✨ AI |
| createdTime | uint256 | Creation timestamp (unix seconds) for the validator.✨ AI |
| deactivatedTime | uint256 | Deactivation timestamp (unix seconds); zero if the validator is still active.✨ AI |
| deactivatedEpoch | uint256 | Epoch when the validator was deactivated; zero if still active.✨ AI |
Return the validator identifier associated with the given address.✨ AI
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| auth | address | Address to query for its associated validator identifier.✨ AI |
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| validatorID | uint256 | The uint256 validator identifier associated with the provided address.✨ AI |
Fetches the validator's public key for the specified validator ID.✨ AI
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| validatorID | uint256 | ID of the validator whose public key to retrieve.✨ AI |
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| pubkey | bytes | pubkey: Validator public key as raw bytes in serialized form (format depends on the chain's key scheme).✨ AI |
Returns the withdrawal request details for a delegator's stake with a specific validator.✨ AI
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| delegator | address | Address of the delegator whose withdrawal request is being queried.✨ AI |
| validatorID | uint256 | Numeric identifier of the validator associated with the request.✨ AI |
| wrID | uint256 | Identifier or index of the withdrawal request for the given delegator and validator.✨ AI |
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| epoch | uint256 | Epoch when the withdrawal request was created or becomes effective.✨ AI |
| time | uint256 | Unix timestamp (seconds) associated with the withdrawal request.✨ AI |
| amount | uint256 | Amount of tokens requested for withdrawal (in the contract's token units).✨ AI |
Check whether the given validator is slashed - the stake (or its part) cannot be withdrawn because of misbehavior (double-sign) of the validator.
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| validatorID | uint256 |
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | bool |
Return the ID of the last registered validator.✨ AI
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | uint256 | The uint256 identifier of the most recently added validator.✨ AI |
Returns the address of the contract owner.✨ AI
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | address | The current owner address that holds administrative privileges over the contract.✨ AI |
Get the amount of rewards which can be currently claimed by the given delegator for the given validator.
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| delegator | address | |
| toValidatorID | uint256 |
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | uint256 |
Retrieve the ERC1822 proxiable UUID that identifies the implementation storage slot.✨ AI
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | bytes32 | A bytes32 UUID (ERC-1822) that uniquely identifies the storage slot used for the implementation address.✨ AI |
Return the validator ID associated with a given pubkey mapping address.✨ AI
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| pubkeyAddress | address | Address that represents the stored validator public-key mapping entry.✨ AI |
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| validatorID | uint256 | Numeric identifier of the validator associated with the given pubkeyAddress.✨ AI |
Returns the address currently configured as the redirection authorizer.✨ AI
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | address | The address of the contract or account authorized to perform redirection authorization.✨ AI |
Get amount of currently stashed rewards.
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| delegator | address | |
| validatorID | uint256 |
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | uint256 |
Get the slashing refund ratio for a specific validator.✨ AI
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| validatorID | uint256 | Identifier of the validator to query.✨ AI |
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| refundRatio | uint256 | refundRatio: Slashing refund ratio for the validator, expressed in the contract's internal units.✨ AI |
Returns the address currently set as the stake subscriber.✨ AI
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | address | The address registered as the stake subscriber.✨ AI |
Get the total stashed rewards for a delegator toward a validator up to a given epoch.✨ AI
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| delegator | address | Address of the delegator whose stashed rewards are queried.✨ AI |
| validatorID | uint256 | ID of the validator for which stashed rewards are queried.✨ AI |
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| epoch | uint256 | Total stashed reward amount (in the contract's smallest token unit) for the delegator to the validator up to and including the specified epoch.✨ AI |
Return the total active stake currently held by the protocol.✨ AI
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | uint256 | Total active stake across all accounts, expressed in wei as a uint256.✨ AI |
Returns the total amount of stake held by the contract.✨ AI
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | uint256 | Total staked amount currently held by the contract, in wei.✨ AI |
Returns the total number of tokens in existence.✨ AI
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | uint256 | Total number of tokens in existence as a uint256.✨ AI |
Returns the address of the treasury for this contract.✨ AI
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | address | The treasury address that receives fees or holds contract funds.✨ AI |
Returns the current amount of unresolved fees owed to the treasury.✨ AI
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | uint256 | Total unresolved fee amount owed to the treasury, expressed in the contract's base token smallest units.✨ AI |
Returns the contract's version encoded as a 3-byte value.✨ AI
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | bytes3 | A 3-byte value encoding the contract version (bytes3), typically major.minor.patch packed into three bytes.✨ AI |
写入函数
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().
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| to | address |
Burn native tokens by sending them to the SFC contract.
Claim rewards for stake delegated to a validator.
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| toValidatorID | uint256 |
Create a validator with a given public key while using attached value as the validator's self-stake.
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| pubkey | bytes |
Deactivate a validator. Called by network node when a double-sign of the given validator is registered. Is called before sealEpoch() call.
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| validatorID | uint256 | |
| status | uint256 |
Delegate stake to a validator.
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| 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.
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| 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.
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| 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.
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| from | address | |
| to | address |
Issue tokens to the issued tokens recipient as a counterparty to the burnt FTM tokens.
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| amount | uint256 |
Accept redirection proposal. Redirection must by accepted by the validator key holder before it starts to be applied.
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| to | address |
Renounces ownership of the contract by transferring it to the zero address.✨ AI
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.
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| toValidatorID | uint256 |
Seal epoch. Called BEFORE epoch sealing made by the client itself.
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| offlineTime | uint256[] | |
| offlineBlocks | uint256[] | |
| uptimes | uint256[] | |
| originatedTxsFee | uint256[] |
Seal epoch. Called AFTER epoch sealing made by the client itself.
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| nextValidatorIDs | uint256[] |
Set an initial delegation. Called only as part of network initialization/genesis file generating.
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| delegator | address | |
| toValidatorID | uint256 | |
| stake | uint256 |
Set an initial validator. Called only as part of network initialization/genesis file generating.
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| auth | address | |
| validatorID | uint256 | |
| pubkey | bytes | |
| createdTime | uint256 |
Set admin address responsible for initiating redirections.
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| v | address |
Stash rewards for a delegator.
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| delegator | address | |
| toValidatorID | uint256 |
Transfers contract ownership to the specified new owner address.✨ AI
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| newOwner | address | Address that will become the contract owner.✨ AI |
Un-delegate stake from a validator.
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| toValidatorID | uint256 | |
| wrID | uint256 | |
| amount | uint256 |
Update consts address.
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| 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.
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| validatorID | uint256 | |
| refundRatio | uint256 |
Update voteBook address.
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| v | address |
Update treasury address.
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| v | address |
Upgrade the proxy's implementation to newImplementation and execute a call with data, forwarding any attached ETH.✨ AI
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| newImplementation | address | Address of the new implementation contract to set as the proxy target.✨ AI |
| data | bytes | Encoded function call and arguments to execute on the new implementation after upgrade; can be empty.✨ AI |
Withdraw stake from a validator after its un-delegation. Un-delegated stake is locked for a certain period of time.
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| toValidatorID | uint256 | |
| wrID | uint256 |
事件
| 名称 | 类型 | 已索引 | 描述 |
|---|---|---|---|
| from | address | ✓ | |
| to | address | ✓ |
| 名称 | 类型 | 已索引 | 描述 |
|---|---|---|---|
| amount | uint256 |
| 名称 | 类型 | 已索引 | 描述 |
|---|---|---|---|
| validatorID | uint256 | ✓ | |
| status | uint256 |
| 名称 | 类型 | 已索引 | 描述 |
|---|---|---|---|
| delegator | address | ✓ | |
| toValidatorID | uint256 | ✓ | |
| rewards | uint256 |
| 名称 | 类型 | 已索引 | 描述 |
|---|---|---|---|
| validatorID | uint256 | ✓ | |
| auth | address | ✓ | |
| createdEpoch | uint256 | ||
| createdTime | uint256 |
| 名称 | 类型 | 已索引 | 描述 |
|---|---|---|---|
| validatorID | uint256 | ✓ | |
| deactivatedEpoch | uint256 | ||
| deactivatedTime | uint256 |
| 名称 | 类型 | 已索引 | 描述 |
|---|---|---|---|
| delegator | address | ✓ | |
| toValidatorID | uint256 | ✓ | |
| amount | uint256 |
| 名称 | 类型 | 已索引 | 描述 |
|---|---|---|---|
| epochID | uint256 | ✓ | |
| received | uint256 | ||
| distributed | uint256 |
| 名称 | 类型 | 已索引 | 描述 |
|---|---|---|---|
| version | uint64 |
| 名称 | 类型 | 已索引 | 描述 |
|---|---|---|---|
| previousOwner | address | ✓ | |
| newOwner | address | ✓ |
| 名称 | 类型 | 已索引 | 描述 |
|---|---|---|---|
| delegator | address | ✓ | |
| toValidatorID | uint256 | ✓ | |
| rewards | uint256 |
| 名称 | 类型 | 已索引 | 描述 |
|---|---|---|---|
| amount | uint256 |
| 名称 | 类型 | 已索引 | 描述 |
|---|---|---|---|
| delegator | address | ✓ | |
| toValidatorID | uint256 | ✓ | |
| wrID | uint256 | ✓ | |
| amount | uint256 |
| 名称 | 类型 | 已索引 | 描述 |
|---|---|---|---|
| validatorID | uint256 | ✓ | |
| refundRatio | uint256 |
| 名称 | 类型 | 已索引 | 描述 |
|---|---|---|---|
| implementation | address | ✓ |
| 名称 | 类型 | 已索引 | 描述 |
|---|---|---|---|
| delegator | address | ✓ | |
| toValidatorID | uint256 | ✓ | |
| wrID | uint256 | ✓ | |
| amount | uint256 | ||
| penalty | uint256 |