From 2b366c72bd9658db08c82bd1dcb14c793ddba030 Mon Sep 17 00:00:00 2001 From: omahs <73983677+omahs@users.noreply.github.com> Date: Mon, 4 Nov 2024 15:21:15 +0100 Subject: [PATCH 1/4] fix typos --- docs/spec.md | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/docs/spec.md b/docs/spec.md index 6b3ff426..97bdccd1 100644 --- a/docs/spec.md +++ b/docs/spec.md @@ -465,7 +465,7 @@ fn unstake_intent(ref self: ContractState) -> u64 ``` #### description Inform of the intent to exit the stake. -This will remove the funds from the stake, pausing rewards collection for the staker and it's pool members (if exist). +This will remove the funds from the stake, pausing rewards collection for the staker and its pool members (if exist). This will also start the exit window timeout. Return the time in which the staker will be able to unstake. #### emits @@ -493,7 +493,7 @@ fn unstake_action( ) -> u128 ``` #### description -Executes the intent to exit the stake if enough time have passed. +Executes the intent to exit the stake if enough time has passed. Transfers the funds back to the staker. Return the amount of tokens transferred back to the staker. #### emits @@ -510,8 +510,8 @@ Return the amount of tokens transferred back to the staker. 6. [FINAL\_STAKER\_INDEX\_ALREADY\_SET](#final_staker_index_already_set) #### pre-condition 1. Staking contract is unpaused. -2. Staker exist and requested to unstake. -3. Enough time have passed from the unstake intent call. +2. Staker exists and requested to unstake. +3. Enough time has passed from the unstake intent call. #### access control Any address can execute. #### logic @@ -620,7 +620,7 @@ fn remove_from_delegation_pool_action( ) ``` #### description -Execute the intent to remove funds from pool if enough time have passed. +Execute the intent to remove funds from pool if enough time has passed. Transfers the funds to the pool contract. #### emits #### errors @@ -630,7 +630,7 @@ Transfers the funds to the pool contract. #### pre-condition 1. Staking contract is unpaused. 2. Removal intent request with the given `identifier` have been sent before. -3. Enough time have passed since the intent request. +3. Enough time has passed since the intent request. #### access control Any address can execute. #### logic @@ -665,7 +665,7 @@ Execute a pool member request to move from one staker's delegation pool to anoth 1. Staking contract is unpaused. 2. `switched_amount` is not zero. 3. Enough funds is in intent for switching. -4. `to_staker` exist in the contract and is not in exit window. +4. `to_staker` exists in the contract and is not in exit window. 5. `to_pool` is the delegation pool contract for `to_staker`. #### access control Only pool contract for the given staker can execute. @@ -691,7 +691,7 @@ Change the reward address for a staker. 2. [STAKER\_NOT\_EXISTS](#staker_not_exists) #### pre-condition 1. Staking contract is unpaused. -2. Staker (caller) exist in the contract. +2. Staker (caller) exists in the contract. #### access control Only staker address. #### logic @@ -716,7 +716,7 @@ Return the pool address. 4. [STAKER\_ALREADY\_HAS\_POOL](#staker_already_has_pool) #### pre-condition 1. Staking contract is unpaused. -2. Staker (caller) exist in the contract. +2. Staker (caller) exists in the contract. 3. `commission` is in valid range. 4. Staker has no pool. #### access control @@ -746,8 +746,8 @@ Return the updated staker index. 6. [UNEXPECTED\_BALANCE](#unexpected_balance) #### pre-condition 1. Staking contract is unpaused. -2. Staker exist in the contract. -3. Delegation pool exist for the staker. +2. Staker exists in the contract. +3. Delegation pool exists for the staker. #### access control Delegation pool contract of the given staker. #### logic @@ -767,7 +767,7 @@ Return [StakerInfo](#stakerinfo) of the given staker. #### errors 3. [STAKER\_NOT\_EXISTS](#staker_not_exists) #### pre-condition -1. Staker exist in the contract. +1. Staker exists in the contract. #### access control Any address can execute. #### logic @@ -856,7 +856,7 @@ Change the operational address for a staker. 2. [STAKER\_NOT\_EXISTS](#staker_not_exists) #### pre-condition 1. Staking contract is unpaused. -2. Staker (caller) exist in the contract. +2. Staker (caller) exists in the contract. #### access control Only staker address. #### logic @@ -1050,7 +1050,7 @@ Add a new pool member to the delegation pool. Only a non-listed pool member address. #### logic 1. Transfer funds from pool member to pool contract. -2. Approve transferal from pool contract to staking contract. +2. Approve transfer from pool contract to staking contract. 3. Call staking contract's [add_stake_from_pool](#add_stake_from_pool). 4. Get current index from staking contract. 5. Create entry for pool member. @@ -1129,7 +1129,7 @@ fn exit_delegation_pool_action( ) -> u128 ``` #### description -Executes the intent to exit the stake if enough time have passed. Transfers the funds back to the pool member. +Executes the intent to exit the stake if enough time has passed. Transfers the funds back to the pool member. Return the amount of tokens transferred back to the pool member. #### emits 1. [Pool Member Reward Claimed](#pool-member-reward-claimed) @@ -1141,7 +1141,7 @@ Return the amount of tokens transferred back to the pool member. 4. [CONTRACT\_IS\_PAUSED](#contract_is_paused) #### pre-condition 1. Pool member exist and requested to unstake. -2. Enough time have passed from the delegation pool exit intent call. +2. Enough time has passed from the delegation pool exit intent call. #### access control Any address can execute. #### logic @@ -1203,7 +1203,7 @@ Return the amount left in exit window for the pool member in this pool. 1. `amount` is not zero. 2. Pool member (caller) is in exit window. 3. Pool member's amount is greater or equal to the amount requested. -4. `to_staker` exist in the staking contract and is not in an exit window. +4. `to_staker` exists in the staking contract and is not in an exit window. 5. `to_pool` is the delegation pool contract for `to_staker`. #### access control Only pool member can execute. @@ -1278,7 +1278,7 @@ Change the reward address for a pool member. #### errors 1. [POOL\_MEMBER\_DOES\_NOT\_EXIST](#pool_member_does_not_exist) #### pre-condition -1. Pool member exist in the contract. +1. Pool member exists in the contract. #### access control Only pool member can execute. #### logic @@ -1297,7 +1297,7 @@ Return [PoolMemberInfo](#poolmemberinfo) of the given pool member. #### errors 1. [POOL\_MEMBER\_DOES\_NOT\_EXIST](#pool_member_does_not_exist) #### pre-condition -1. Pool member exist in the contract. +1. Pool member exists in the contract. #### access control Any address can execute. #### logic From a70d0000a5852b02ca610fa9a93afed4a9eb3e66 Mon Sep 17 00:00:00 2001 From: omahs <73983677+omahs@users.noreply.github.com> Date: Mon, 4 Nov 2024 15:26:54 +0100 Subject: [PATCH 2/4] fix typos --- .../L1/starkware/solidity/interfaces/ProxySupport.sol | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/workspace/apps/staking/L1/starkware/solidity/interfaces/ProxySupport.sol b/workspace/apps/staking/L1/starkware/solidity/interfaces/ProxySupport.sol index 95766e11..81b03642 100644 --- a/workspace/apps/staking/L1/starkware/solidity/interfaces/ProxySupport.sol +++ b/workspace/apps/staking/L1/starkware/solidity/interfaces/ProxySupport.sol @@ -9,7 +9,7 @@ import "starkware/solidity/interfaces/ContractInitializer.sol"; /** This contract contains the code commonly needed for a contract to be deployed behind an upgradability proxy. - It perform the required semantics of the proxy pattern, + It performs the required semantics of the proxy pattern, but in a generic manner. Instantiation of the Governance and of the ContractInitializer, that are the app specific part of initialization, has to be done by the using contract. @@ -17,7 +17,7 @@ import "starkware/solidity/interfaces/ContractInitializer.sol"; abstract contract ProxySupport is MGovernance, BlockDirectCall, ContractInitializer { using Addresses for address; - // The two function below (isFrozen & initialize) needed to bind to the Proxy. + // The two functions below (isFrozen & initialize) are needed to bind to the Proxy. function isFrozen() external view virtual returns (bool) { return false; } @@ -29,7 +29,7 @@ abstract contract ProxySupport is MGovernance, BlockDirectCall, ContractInitiali 1. This function cannot be called directly on the deployed contract, but only via delegate call. 2. If an EIC is provided - init is passed onto EIC and the standard init flow is skipped. - This true for both first intialization or a later one. + This is true for both first initialization or a later one. 3. The data passed to this function is as follows: [sub_contracts addresses, eic address, initData]. From 2c013745db5cf168b83d38523fc25d71e407eb6d Mon Sep 17 00:00:00 2001 From: omahs <73983677+omahs@users.noreply.github.com> Date: Mon, 4 Nov 2024 15:28:54 +0100 Subject: [PATCH 3/4] fix typo --- .../apps/staking/L1/starkware/solidity/libraries/RolesLib.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workspace/apps/staking/L1/starkware/solidity/libraries/RolesLib.sol b/workspace/apps/staking/L1/starkware/solidity/libraries/RolesLib.sol index 9aff0c76..424c62e7 100644 --- a/workspace/apps/staking/L1/starkware/solidity/libraries/RolesLib.sol +++ b/workspace/apps/staking/L1/starkware/solidity/libraries/RolesLib.sol @@ -94,7 +94,7 @@ library RolesLib { if (securityRolesInitialized()) { // If SecurityAdmin initialized, // then provisionalSecAdmin must already be a `SecurityAdmin`. - // If it's not initilized - initialize it. + // If it's not initialized - initialize it. require( AccessControl.hasRole(SECURITY_ADMIN, provisionalSecAdmin), "SECURITY_ROLES_ALREADY_INITIALIZED" From 7c62313e5fe35818a8cf75275687986033335473 Mon Sep 17 00:00:00 2001 From: omahs <73983677+omahs@users.noreply.github.com> Date: Mon, 4 Nov 2024 15:29:43 +0100 Subject: [PATCH 4/4] fix typo --- .../apps/staking/L1/starkware/solidity/stake/MintManager.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workspace/apps/staking/L1/starkware/solidity/stake/MintManager.sol b/workspace/apps/staking/L1/starkware/solidity/stake/MintManager.sol index 7e0d5d4d..8d60451d 100644 --- a/workspace/apps/staking/L1/starkware/solidity/stake/MintManager.sol +++ b/workspace/apps/staking/L1/starkware/solidity/stake/MintManager.sol @@ -109,7 +109,7 @@ contract MintManager is IMintManager, Identity, ProxySupportImpl, PeriodMintLimi } /** - Unegister an eligible token minter. + Unregister an eligible token minter. Callable only by the app governor or a security agent/admin. */ function revokeTokenMinter(address token, address minter) external onlySecurityRole {