Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(staking): fix typos #12

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 19 additions & 19 deletions docs/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ fn unstake_intent(ref self: ContractState) -> u64
```
#### description <!-- omit from toc -->
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 <!-- omit from toc -->
Expand Down Expand Up @@ -493,7 +493,7 @@ fn unstake_action(
) -> u128
```
#### description <!-- omit from toc -->
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 <!-- omit from toc -->
Expand All @@ -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 <!-- omit from toc -->
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 <!-- omit from toc -->
Any address can execute.
#### logic <!-- omit from toc -->
Expand Down Expand Up @@ -620,7 +620,7 @@ fn remove_from_delegation_pool_action(
)
```
#### description <!-- omit from toc -->
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 <!-- omit from toc -->
#### errors <!-- omit from toc -->
Expand All @@ -630,7 +630,7 @@ Transfers the funds to the pool contract.
#### pre-condition <!-- omit from toc -->
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 <!-- omit from toc -->
Any address can execute.
#### logic <!-- omit from toc -->
Expand Down Expand Up @@ -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 <!-- omit from toc -->
Only pool contract for the given staker can execute.
Expand All @@ -691,7 +691,7 @@ Change the reward address for a staker.
2. [STAKER\_NOT\_EXISTS](#staker_not_exists)
#### pre-condition <!-- omit from toc -->
1. Staking contract is unpaused.
2. Staker (caller) exist in the contract.
2. Staker (caller) exists in the contract.
#### access control <!-- omit from toc -->
Only staker address.
#### logic <!-- omit from toc -->
Expand All @@ -716,7 +716,7 @@ Return the pool address.
4. [STAKER\_ALREADY\_HAS\_POOL](#staker_already_has_pool)
#### pre-condition <!-- omit from toc -->
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 <!-- omit from toc -->
Expand Down Expand Up @@ -746,8 +746,8 @@ Return the updated staker index.
6. [UNEXPECTED\_BALANCE](#unexpected_balance)
#### pre-condition <!-- omit from toc -->
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 <!-- omit from toc -->
Delegation pool contract of the given staker.
#### logic <!-- omit from toc -->
Expand All @@ -767,7 +767,7 @@ Return [StakerInfo](#stakerinfo) of the given staker.
#### errors <!-- omit from toc -->
3. [STAKER\_NOT\_EXISTS](#staker_not_exists)
#### pre-condition <!-- omit from toc -->
1. Staker exist in the contract.
1. Staker exists in the contract.
#### access control <!-- omit from toc -->
Any address can execute.
#### logic <!-- omit from toc -->
Expand Down Expand Up @@ -856,7 +856,7 @@ Change the operational address for a staker.
2. [STAKER\_NOT\_EXISTS](#staker_not_exists)
#### pre-condition <!-- omit from toc -->
1. Staking contract is unpaused.
2. Staker (caller) exist in the contract.
2. Staker (caller) exists in the contract.
#### access control <!-- omit from toc -->
Only staker address.
#### logic <!-- omit from toc -->
Expand Down Expand Up @@ -1050,7 +1050,7 @@ Add a new pool member to the delegation pool.
Only a non-listed pool member address.
#### logic <!-- omit from toc -->
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.
Expand Down Expand Up @@ -1129,7 +1129,7 @@ fn exit_delegation_pool_action(
) -> u128
```
#### description <!-- omit from toc -->
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 <!-- omit from toc -->
1. [Pool Member Reward Claimed](#pool-member-reward-claimed)
Expand All @@ -1141,7 +1141,7 @@ Return the amount of tokens transferred back to the pool member.
4. [CONTRACT\_IS\_PAUSED](#contract_is_paused)
#### pre-condition <!-- omit from toc -->
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 <!-- omit from toc -->
Any address can execute.
#### logic <!-- omit from toc -->
Expand Down Expand Up @@ -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 <!-- omit from toc -->
Only pool member can execute.
Expand Down Expand Up @@ -1278,7 +1278,7 @@ Change the reward address for a pool member.
#### errors <!-- omit from toc -->
1. [POOL\_MEMBER\_DOES\_NOT\_EXIST](#pool_member_does_not_exist)
#### pre-condition <!-- omit from toc -->
1. Pool member exist in the contract.
1. Pool member exists in the contract.
#### access control <!-- omit from toc -->
Only pool member can execute.
#### logic <!-- omit from toc -->
Expand All @@ -1297,7 +1297,7 @@ Return [PoolMemberInfo](#poolmemberinfo) of the given pool member.
#### errors <!-- omit from toc -->
1. [POOL\_MEMBER\_DOES\_NOT\_EXIST](#pool_member_does_not_exist)
#### pre-condition <!-- omit from toc -->
1. Pool member exist in the contract.
1. Pool member exists in the contract.
#### access control <!-- omit from toc -->
Any address can execute.
#### logic <!-- omit from toc -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ 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.
*/
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;
}
Expand All @@ -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].

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down