Staking Table

[Previous << Flow Fees](https://qiita.com/flowcadence/items/0f41148ca231a09d1efb)
[Next >> Epoch Contracts](https://qiita.com/flowcadence/items/f5e22a34d79769cb5c5d)

https://qiita.com/flowcadence/items/3073d69c6e9895e68b5a#flow-developers

<h1>Flow Staking Contract Reference</h1>

<h2>Contract</h2>

`FlowIDTableStaking`コントラクトは、ステーク(担保)されたノード、委任、報酬を管理する中心的なテーブルです。

Source: [FlowIDTableStaking.cdc](https://github.com/onflow/flow-core-contracts/blob/master/contracts/FlowIDTableStaking.cdc)

| Network | Contract Address |
|:-:|:-:|
| Emulator | `0xf8d6e0586b0a20c7` |
| Cadence Testing Framework | `0x0000000000000001` |
| Testnet | `0x9eca2b38b18b5dfe` |
| Mainnet | `0x8624b52f9ddcd04a` |

<h1>Transactions and Scripts</h1>

ステーキングコントラクトのトランザクションは、`flow-core-contracts`レポジトリにあります。開発者およびユーザーは、テスト用に用意されている基本トランザクションではなく、[ステーキングコレクショントランザクション(the staking collection transactions)](https://developers.flow.com/networks/staking/staking-collection)を使用してトークンをステークすることが推奨されます。

<h3>Getting Staking Info with Scripts</h3>

これらのスクリプトは読み取り専用であり、ステーキングコントラクトの現在の状態(ステート)に関する情報を取得します。

| ID | Name | Source |
|:-:|:-:|:-:|
| `SC.01` | Get Delegation Cut Percentage | [idTableStaking/get_cut_percentage.cdc](https://github.com/onflow/flow-core-contracts/blob/master/transactions/idTableStaking/scripts/get_cut_percentage.cdc) |
| `SC.02` | Get Minimum Stake Requirements | [dTableStaking/get_stake_requirements.cdc](https://github.com/onflow/flow-core-contracts/blob/master/transactions/idTableStaking/scripts/get_stake_requirements.cdc) |
| `SC.03` | Get Total Weekly Reward Payout | [idTableStaking/get_weekly_payout.cdc](https://github.com/onflow/flow-core-contracts/blob/master/transactions/idTableStaking/scripts/get_weekly_payout.cdc) |
| `SC.04` | Get Current Staked Node Table | [idTableStaking/get_current_table.cdc](https://github.com/onflow/flow-core-contracts/blob/master/transactions/idTableStaking/scripts/get_current_table.cdc) |
| `SC.05` | Get Proposed Staked Node Table | [idTableStaking/get_proposed_table.cdc](https://github.com/onflow/flow-core-contracts/blob/master/transactions/idTableStaking/scripts/get_proposed_table.cdc) |
| `SC.06` | Get Total Flow Staked | [idTableStaking/get_total_staked.cdc](https://github.com/onflow/flow-core-contracts/blob/master/transactions/idTableStaking/scripts/get_total_staked.cdc) |
| `SC.07` | Get Total Flow Staked by Node Type | [idTableStaking/get_total_staked_by_type.cdc](https://github.com/onflow/flow-core-contracts/blob/master/transactions/idTableStaking/scripts/get_total_staked_by_type.cdc) |
| `SC.08` | Get All Info about a single NodeID | [idTableStaking/get_node_info.cdc](https://github.com/onflow/flow-core-contracts/blob/master/transactions/idTableStaking/scripts/get_node_info.cdc) |
| `SC.09` | Get a node's total Commitment (delegators) | [idTableStaking/get_node_total_commitment.cdc](https://github.com/onflow/flow-core-contracts/blob/master/transactions/idTableStaking/scripts/get_node_total_commitment.cdc) |
| `SC.10` | Get All Info about a single Delegator | [idTableStaking/delegation/get_delegator_info.cdc](https://github.com/onflow/flow-core-contracts/blob/master/transactions/idTableStaking/delegation/get_delegator_info.cdc) |
| `SC.11` | Get a node's total Commitment | [idTableStaking/get_node_total_commitment_without_delegators.cdc](https://github.com/onflow/flow-core-contracts/blob/master/transactions/idTableStaking/scripts/get_node_total_commitment_without_delegators.cdc) |


<h3>Delegator Transactions</h3>

トークンによる委任に関するドキュメントは、[ステーキングコレクション](https://developers.flow.com/networks/staking/staking-collection)のステーキングに関するドキュメントに記載されています。

<h1>Events</h1>

`FlowIDTableStaking`コントラクトは、重要なアクションが発生するたびにイベントを発行します。各イベントの詳細については、[ステーキングイベントのドキュメント](https://developers.flow.com/networks/staking/staking-scripts-events)を参照してください。

```ruby
    /** Epoch */
    access(all) event NewEpoch(
        totalStaked: UFix64,
        totalRewardPayout: UFix64,
        newEpochCounter: UInt64
    )
    access(all) event EpochTotalRewardsPaid(
        total: UFix64,
        fromFees: UFix64,
        minted: UFix64,
        feesBurned: UFix64,
        epochCounterForRewards: UInt64
    )

    /** Node */
    access(all) event NewNodeCreated(nodeID: String, role: UInt8, amountCommitted: UFix64)
    access(all) event TokensCommitted(nodeID: String, amount: UFix64)
    access(all) event TokensStaked(nodeID: String, amount: UFix64)
    access(all) event NodeTokensRequestedToUnstake(nodeID: String, amount: UFix64)
    access(all) event TokensUnstaking(nodeID: String, amount: UFix64)
    access(all) event TokensUnstaked(nodeID: String, amount: UFix64)
    access(all) event NodeRemovedAndRefunded(nodeID: String, amount: UFix64)
    access(all) event RewardsPaid(nodeID: String, amount: UFix64, epochCounter:  UInt64)
    access(all) event UnstakedTokensWithdrawn(nodeID: String, amount: UFix64)
    access(all) event RewardTokensWithdrawn(nodeID: String, amount: UFix64)
    access(all) event NetworkingAddressUpdated(nodeID: String, newAddress: String)
    access(all) event NodeWeightChanged(nodeID: String, newWeight: UInt64)

    /** Delegator */
    access(all) event NewDelegatorCreated(nodeID: String, delegatorID: UInt32)
    access(all) event DelegatorTokensCommitted(nodeID: String, delegatorID: UInt32, amount: UFix64)
    access(all) event DelegatorTokensStaked(nodeID: String, delegatorID: UInt32, amount: UFix64)
    access(all) event DelegatorTokensRequestedToUnstake(nodeID: String, delegatorID: UInt32, amount: UFix64)
    access(all) event DelegatorTokensUnstaking(nodeID: String, delegatorID: UInt32, amount: UFix64)
    access(all) event DelegatorTokensUnstaked(nodeID: String, delegatorID: UInt32, amount: UFix64)
    access(all) event DelegatorRewardsPaid(nodeID: String, delegatorID: UInt32, amount: UFix64, epochCounter:  UInt64)
    access(all) event DelegatorUnstakedTokensWithdrawn(nodeID: String, delegatorID: UInt32, amount: UFix64)
    access(all) event DelegatorRewardTokensWithdrawn(nodeID: String, delegatorID: UInt32, amount: UFix64)

    /** Contract Fields */
    access(all) event NewDelegatorCutPercentage(newCutPercentage: UFix64)
    access(all) event NewWeeklyPayout(newPayout: UFix64)
    access(all) event NewStakingMinimums(newMinimums: {UInt8: UFix64})
    access(all) event NewDelegatorStakingMinimum(newMinimum: UFix64)
```

*Last updated on **Dec 17, 2024** by **j pimmel***

翻訳元

https://developers.flow.com/build/core-contracts/staking-contract-reference

***

<b>[Previous << Flow Fees](https://qiita.com/flowcadence/items/0f41148ca231a09d1efb)
</b>

[Flow blockchain / Cadence version1.0ドキュメント](https://qiita.com/flowcadence/items/3073d69c6e9895e68b5a) (Flow Fees)

<b>[Next >> Epoch Contracts](https://qiita.com/flowcadence/items/f5e22a34d79769cb5c5d)</b>