You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: components/Starknet/modules/staking/pages/architecture.adoc
+10-24Lines changed: 10 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,11 +13,8 @@ Staking is divided into several key components, each responsible for different a
13
13
| Contract
14
14
| Description
15
15
16
-
| Operator Contract
17
-
| Acts as the access point for all interactions with the staking system, wrapping around the staking contract. It enforces access control and whitelisting, ensuring that only authorized users can perform staking operations.
18
-
19
16
| Staking Contract
20
-
| The central contract that manages the staking process. It handles direct staking, rewards distribution, and interactions with delegation pools. Validators interact with this contract through the Operator contract to stake their tokens, claim rewards, and initiate unstaking.
17
+
| The central contract that manages the staking process, which handles direct staking, rewards distribution, and interactions with delegation pools. Validators interact with this contract to stake their tokens, claim rewards, and initiate unstaking.
21
18
22
19
| Delegation Pooling Contract
23
20
| This contract manages the delegation process, allowing delegators to assign their tokens to a validator for staking. The contract is responsible for tracking each delegator's share, calculating their rewards, and managing the delegation and unstaking processes.
@@ -46,31 +43,20 @@ The following data structures are stored within the contracts and play a crucial
46
43
47
44
For more technical details, you can refer to the full staking specification document available in: https://github.com/starkware-libs/starknet-staking/blob/main/docs/spec.md[Staking Repository Spec].
48
45
49
-
== Operator Contract
50
-
51
-
The operator contract serves as the first point of interaction for all users. It manages access control, ensuring that only authorized users can stake, claim rewards, and interact with the staking system. The operator contract forwards user requests to the relevant contracts (e.g., staking contract) and includes features such as whitelisting, which restricts access to specific users if activated.
52
-
53
-
*Key Functions and Responsibilities*: +
54
-
`stake`: Allows users to stake their STRK tokens, forwarding the request to the staking contract. +
55
-
`increase_stake`: Lets existing stakers add more tokens to their stake. +
56
-
`claim_rewards`: Facilitates the claiming of rewards for stakers and delegators. +
57
-
`unstake_intent`: Initiates the unstaking process by signaling intent, which the staking contract processes. +
58
-
`unstake_action`: Finalizes the unstaking process after the waiting period.
59
-
60
46
== Staking Contract
61
47
62
-
The staking contract is the core of the staking system. It manages the entire lifecycle of staking, from initial staking to claiming rewards and unstaking. The operator contract interacts with the staking contract to execute these functions.
48
+
The staking contract is the core of the staking system. It manages the entire lifecycle of staking, from initial staking to claiming rewards and unstaking.
63
49
64
-
*Key Functions and Responsibilities (accessed via the Operator contract)*: +
65
-
`stake`: Allows users to stake their STRK tokens. This is facilitated by the Operator contract and forwarded to the Staking contract. +
66
-
`increase_stake`: Lets existing validators increase their stake, accessed through the Operator. +
67
-
`unstake_intent`: Initiates the unstaking process, managed by the Operator contract, which interacts with the Staking contract to initiate and finalize the unstaking process. +
68
-
`unstake_action`: Finalizes the unstaking process after the waiting period, returning tokens to the user through the Operator. +
69
-
`claim_rewards`: Allows users to claim rewards, facilitated through the Operator contract.
50
+
*Key Functions and Responsibilities *: +
51
+
`stake`: Allows users to stake their STRK tokens. +
52
+
`increase_stake`: Lets existing validators increase their stake. +
53
+
`unstake_intent`: Initiates the unstaking process, which can be finalized using `unstake_action` if sufficient time has passed. +
54
+
`unstake_action`: Finalizes the unstaking process after the waiting period, returning tokens to the validator address. +
55
+
`claim_rewards`: Allows users to claim rewards.
70
56
71
57
== Delegation Pooling Contract
72
58
73
-
The delegation pooling contract enables users to delegate their tokens through the Operator contract. All interactions, such as entering or exiting the pool, are forwarded to the appropriate contracts via the Operator. This contract tracks each delegator's contribution, calculates their rewards, and manages the delegation lifecycle.
59
+
The delegation pooling contract enables users to delegate their tokens. All interactions, such as entering or exiting the pool, are enabled through this contracts, which tracks each delegator's contribution, calculates their rewards, and manages the delegation lifecycle.
74
60
75
61
*Key Functions and Responsibilities*: +
76
62
`enter_delegation_pool`: Allows users to delegate their tokens to the pool associated with a validator. This function transfers the tokens, updates the delegator's record, and integrates them into the validator's pool. +
@@ -98,4 +84,4 @@ The minting curve contract defines the economic model that governs reward distri
98
84
99
85
== Security and Upgradability
100
86
101
-
The staking architecture on Starknet is designed with security and upgradability in mind. Each contract is modular, allowing for targeted upgrades and improvements without affecting the entire system. The introduction of the Operator contract adds an extra layer of access control, ensuring only authorized users can interact with the staking system. Access control mechanisms are in place to ensure that only authorized parties can make critical changes, further enhancing the security of the staking process.
87
+
The staking architecture on Starknet is designed with security and upgradability in mind. Each contract is modular, allowing for targeted upgrades and improvements without affecting the entire system. Access control mechanisms are in place to ensure that only authorized parties can make critical changes, further enhancing the security of the staking process.
0 commit comments