SFC

Sonic

0xfc00face00000000000000000000000000000000

Proxy 實作合約: 0xf46ab7507088cc9d3f58bb85ae2c36c86103447d

Solidity v0.8.27+commit.40a35a09

🤖
透過你的 AI 查詢此合約
參考: 0xfc00face00000000000000000000000000000000
範例提示詞: "Tell me the current state of sonic/0xfc00face00000000000000000000000000000000"
還沒有接入 AI?→ mcp.smarts.md
Sonic 在 Smarts 上是僅文件鏈:原始碼和 ABI 已索引,但目前不提供即時鏈上資料(狀態、最新事件、管理員概覽)。AI 代理仍可透過 MCP 呼叫 get_contract_info 和 get_contract_source。

概覽

讀取函式
40
寫入函式
28
事件
16

讀取函式

UPGRADE_INTERFACE_VERSION() view

Returns the upgrade interface version string for this SFC contract.✨ AI

回傳值

名稱 類型 描述
string The semantic or numeric version identifier for the upgrade interface.✨ AI
constsAddress() view

Get consts address.

回傳值

名稱 類型 描述
address
currentEpoch() view

Get the current epoch number.

回傳值

名稱 類型 描述
uint256
currentSealedEpoch() view

Returns the current sealed epoch identifier.✨ AI

回傳值

名稱 類型 描述
uint256 The current sealed epoch as a uint256.✨ AI
epochEndTime(epoch: uint256) view

Get epoch end time.

參數

名稱 類型 描述
epoch uint256

回傳值

名稱 類型 描述
uint256
getEpochAccumulatedOriginatedTxsFee(epoch: uint256, validatorID: uint256) view

Get accumulated originated txs fee for a validator in a given epoch.

參數

名稱 類型 描述
epoch uint256
validatorID uint256

回傳值

名稱 類型 描述
uint256
getEpochAccumulatedRewardPerToken(epoch: uint256, validatorID: uint256) view

Get accumulated reward per token for a validator in a given epoch.

參數

名稱 類型 描述
epoch uint256
validatorID uint256

回傳值

名稱 類型 描述
uint256
getEpochAccumulatedUptime(epoch: uint256, validatorID: uint256) view

Get accumulated uptime for a validator in a given epoch.

參數

名稱 類型 描述
epoch uint256
validatorID uint256

回傳值

名稱 類型 描述
uint256
getEpochAverageUptime(epoch: uint256, validatorID: uint256) view

Get average uptime for a validator in a given epoch.

參數

名稱 類型 描述
epoch uint256
validatorID uint256

回傳值

名稱 類型 描述
uint64
getEpochEndBlock(epoch: uint256) view

Get end block for a given epoch.

參數

名稱 類型 描述
epoch uint256

回傳值

名稱 類型 描述
uint256
getEpochOfflineBlocks(epoch: uint256, validatorID: uint256) view

Get offline blocks for a validator in a given epoch.

參數

名稱 類型 描述
epoch uint256
validatorID uint256

回傳值

名稱 類型 描述
uint256
getEpochOfflineTime(epoch: uint256, validatorID: uint256) view

Get offline time for a validator in a given epoch.

參數

名稱 類型 描述
epoch uint256
validatorID uint256

回傳值

名稱 類型 描述
uint256
getEpochReceivedStake(epoch: uint256, validatorID: uint256) view

Get received stake for a validator in a given epoch.

參數

名稱 類型 描述
epoch uint256
validatorID uint256

回傳值

名稱 類型 描述
uint256
getEpochSnapshot(epoch: uint256) view

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
getEpochValidatorIDs(epoch: uint256) view

Get validator IDs for given epoch.

參數

名稱 類型 描述
epoch uint256

回傳值

名稱 類型 描述
uint256[]
getRedirection(delegator: address) view

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
getRedirectionRequest(delegator: address) view

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
getSelfStake(validatorID: uint256) view

Get self-stake of a validator.

參數

名稱 類型 描述
validatorID uint256

回傳值

名稱 類型 描述
uint256
getStake(delegator: address, validatorID: uint256) view

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
getValidator(validatorID: uint256) view

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
getValidatorID(auth: address) view

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
getValidatorPubkey(validatorID: uint256) view

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
getWithdrawalRequest(delegator: address, validatorID: uint256, wrID: uint256) view

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
isSlashed(validatorID: uint256) view

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
lastValidatorID() view

Return the ID of the last registered validator.✨ AI

回傳值

名稱 類型 描述
uint256 The uint256 identifier of the most recently added validator.✨ AI
owner() view

Returns the address of the contract owner.✨ AI

開發者: Returns the address of the current owner.

回傳值

名稱 類型 描述
address The current owner address that holds administrative privileges over the contract.✨ AI
pendingRewards(delegator: address, toValidatorID: uint256) view

Get the amount of rewards which can be currently claimed by the given delegator for the given validator.

參數

名稱 類型 描述
delegator address
toValidatorID uint256

回傳值

名稱 類型 描述
uint256
proxiableUUID() view

Retrieve the ERC1822 proxiable UUID that identifies the implementation storage slot.✨ AI

開發者: Implementation of the ERC-1822 {proxiableUUID} function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.

回傳值

名稱 類型 描述
bytes32 A bytes32 UUID (ERC-1822) that uniquely identifies the storage slot used for the implementation address.✨ AI
pubkeyAddressToValidatorID(pubkeyAddress: address) view

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
redirectionAuthorizer() view

Returns the address currently configured as the redirection authorizer.✨ AI

回傳值

名稱 類型 描述
address The address of the contract or account authorized to perform redirection authorization.✨ AI
rewardsStash(delegator: address, validatorID: uint256) view

Get amount of currently stashed rewards.

參數

名稱 類型 描述
delegator address
validatorID uint256

回傳值

名稱 類型 描述
uint256
slashingRefundRatio(validatorID: uint256) view

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
stakeSubscriberAddress() view

Returns the address currently set as the stake subscriber.✨ AI

回傳值

名稱 類型 描述
address The address registered as the stake subscriber.✨ AI
stashedRewardsUntilEpoch(delegator: address, validatorID: uint256) view

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
totalActiveStake() view

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
totalStake() view

Returns the total amount of stake held by the contract.✨ AI

回傳值

名稱 類型 描述
uint256 Total staked amount currently held by the contract, in wei.✨ AI
totalSupply() view

Returns the total number of tokens in existence.✨ AI

回傳值

名稱 類型 描述
uint256 Total number of tokens in existence as a uint256.✨ AI
treasuryAddress() view

Returns the address of the treasury for this contract.✨ AI

回傳值

名稱 類型 描述
address The treasury address that receives fees or holds contract funds.✨ AI
unresolvedTreasuryFees() view

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
version() pure

Returns the contract's version encoded as a 3-byte value.✨ AI

開發者: Returns the version of the SFC contract

回傳值

名稱 類型 描述
bytes3 A 3-byte value encoding the contract version (bytes3), typically major.minor.patch packed into three bytes.✨ AI

寫入函式

announceRedirection(to: address) nonpayable

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
burnNativeTokens() payable

Burn native tokens by sending them to the SFC contract.

claimRewards(toValidatorID: uint256) nonpayable

Claim rewards for stake delegated to a validator.

參數

名稱 類型 描述
toValidatorID uint256
createValidator(pubkey: bytes) payable

Create a validator with a given public key while using attached value as the validator's self-stake.

參數

名稱 類型 描述
pubkey bytes
deactivateValidator(validatorID: uint256, status: uint256) nonpayable

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(toValidatorID: uint256) payable

Delegate stake to a validator.

參數

名稱 類型 描述
toValidatorID uint256
distributeExtraReward(epoch: uint256, withBurn: bool) payable

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
initialize(sealedEpoch: uint256, _totalSupply: uint256, nodeDriver: address, _c: address, owner: address) nonpayable

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
initiateRedirection(from: address, to: address) nonpayable

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
issueTokens(amount: uint256) nonpayable

Issue tokens to the issued tokens recipient as a counterparty to the burnt FTM tokens.

參數

名稱 類型 描述
amount uint256
redirect(to: address) nonpayable

Accept redirection proposal. Redirection must by accepted by the validator key holder before it starts to be applied.

參數

名稱 類型 描述
to address
renounceOwnership() nonpayable

Renounces ownership of the contract by transferring it to the zero address.✨ AI

開發者: Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.
resolveTreasuryFees() nonpayable

Resolve failed treasury transfers and send the unresolved fees to the treasury address.

restakeRewards(toValidatorID: uint256) nonpayable

Re-stake rewards - claim rewards for staking and delegate it immediately to the same validator - add it to the current stake.

參數

名稱 類型 描述
toValidatorID uint256
sealEpoch(offlineTime: uint256[], offlineBlocks: uint256[], uptimes: uint256[], originatedTxsFee: uint256[]) nonpayable

Seal epoch. Called BEFORE epoch sealing made by the client itself.

參數

名稱 類型 描述
offlineTime uint256[]
offlineBlocks uint256[]
uptimes uint256[]
originatedTxsFee uint256[]
sealEpochValidators(nextValidatorIDs: uint256[]) nonpayable

Seal epoch. Called AFTER epoch sealing made by the client itself.

參數

名稱 類型 描述
nextValidatorIDs uint256[]
setGenesisDelegation(delegator: address, toValidatorID: uint256, stake: uint256) nonpayable

Set an initial delegation. Called only as part of network initialization/genesis file generating.

參數

名稱 類型 描述
delegator address
toValidatorID uint256
stake uint256
setGenesisValidator(auth: address, validatorID: uint256, pubkey: bytes, createdTime: uint256) nonpayable

Set an initial validator. Called only as part of network initialization/genesis file generating.

參數

名稱 類型 描述
auth address
validatorID uint256
pubkey bytes
createdTime uint256
setRedirectionAuthorizer(v: address) nonpayable

Set admin address responsible for initiating redirections.

參數

名稱 類型 描述
v address
stashRewards(delegator: address, toValidatorID: uint256) nonpayable

Stash rewards for a delegator.

參數

名稱 類型 描述
delegator address
toValidatorID uint256
transferOwnership(newOwner: address) nonpayable

Transfers contract ownership to the specified new owner address.✨ AI

開發者: Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.

參數

名稱 類型 描述
newOwner address Address that will become the contract owner.✨ AI
undelegate(toValidatorID: uint256, wrID: uint256, amount: uint256) nonpayable

Un-delegate stake from a validator.

參數

名稱 類型 描述
toValidatorID uint256
wrID uint256
amount uint256
updateConstsAddress(v: address) nonpayable

Update consts address.

參數

名稱 類型 描述
v address
updateSlashingRefundRatio(validatorID: uint256, refundRatio: uint256) nonpayable

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
updateStakeSubscriberAddress(v: address) nonpayable

Update voteBook address.

參數

名稱 類型 描述
v address
updateTreasuryAddress(v: address) nonpayable

Update treasury address.

參數

名稱 類型 描述
v address
upgradeToAndCall(newImplementation: address, data: bytes) payable

Upgrade the proxy's implementation to newImplementation and execute a call with data, forwarding any attached ETH.✨ AI

開發者: Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call encoded in `data`. Calls {_authorizeUpgrade}. Emits an {Upgraded} event.

參數

名稱 類型 描述
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(toValidatorID: uint256, wrID: uint256) nonpayable

Withdraw stake from a validator after its un-delegation. Un-delegated stake is locked for a certain period of time.

參數

名稱 類型 描述
toValidatorID uint256
wrID uint256

事件

AnnouncedRedirection(from: address, to: address)
名稱 類型 已索引 描述
from address
to address
BurntNativeTokens(amount: uint256)
名稱 類型 已索引 描述
amount uint256
ChangedValidatorStatus(validatorID: uint256, status: uint256)
名稱 類型 已索引 描述
validatorID uint256
status uint256
ClaimedRewards(delegator: address, toValidatorID: uint256, rewards: uint256)
名稱 類型 已索引 描述
delegator address
toValidatorID uint256
rewards uint256
CreatedValidator(validatorID: uint256, auth: address, createdEpoch: uint256, createdTime: uint256)
名稱 類型 已索引 描述
validatorID uint256
auth address
createdEpoch uint256
createdTime uint256
DeactivatedValidator(validatorID: uint256, deactivatedEpoch: uint256, deactivatedTime: uint256)
名稱 類型 已索引 描述
validatorID uint256
deactivatedEpoch uint256
deactivatedTime uint256
Delegated(delegator: address, toValidatorID: uint256, amount: uint256)
名稱 類型 已索引 描述
delegator address
toValidatorID uint256
amount uint256
DistributedExtraRewards(epochID: uint256, received: uint256, distributed: uint256)
名稱 類型 已索引 描述
epochID uint256
received uint256
distributed uint256
Initialized(version: uint64)
名稱 類型 已索引 描述
version uint64
OwnershipTransferred(previousOwner: address, newOwner: address)
名稱 類型 已索引 描述
previousOwner address
newOwner address
RestakedRewards(delegator: address, toValidatorID: uint256, rewards: uint256)
名稱 類型 已索引 描述
delegator address
toValidatorID uint256
rewards uint256
TreasuryFeesResolved(amount: uint256)
名稱 類型 已索引 描述
amount uint256
Undelegated(delegator: address, toValidatorID: uint256, wrID: uint256, amount: uint256)
名稱 類型 已索引 描述
delegator address
toValidatorID uint256
wrID uint256
amount uint256
UpdatedSlashingRefundRatio(validatorID: uint256, refundRatio: uint256)
名稱 類型 已索引 描述
validatorID uint256
refundRatio uint256
Upgraded(implementation: address)
名稱 類型 已索引 描述
implementation address
Withdrawn(delegator: address, toValidatorID: uint256, wrID: uint256, amount: uint256, penalty: uint256)
名稱 類型 已索引 描述
delegator address
toValidatorID uint256
wrID uint256
amount uint256
penalty uint256