Skip to content

Commit

Permalink
refactor/cleanup Staking/StakingStore
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiaszimmermann committed Sep 10, 2024
1 parent 0ed24f1 commit c08ccbc
Show file tree
Hide file tree
Showing 9 changed files with 524 additions and 572 deletions.
5 changes: 3 additions & 2 deletions contracts/registry/RegistryAuthorization.sol
Original file line number Diff line number Diff line change
Expand Up @@ -299,10 +299,11 @@ contract RegistryAuthorization
_authorize(functions, StakingStore.increaseTotalValueLocked.selector, "increaseTotalValueLocked");
_authorize(functions, StakingStore.decreaseTotalValueLocked.selector, "decreaseTotalValueLocked");
_authorize(functions, StakingStore.createStake.selector, "createStake");
_authorize(functions, StakingStore.stake.selector, "stake");
_authorize(functions, StakingStore.unstake.selector, "unstake");
_authorize(functions, StakingStore.updateRewards.selector, "updateRewards");
_authorize(functions, StakingStore.increaseStakes.selector, "increaseStakes");
_authorize(functions, StakingStore.decreaseStakes.selector, "decreaseStakes");
_authorize(functions, StakingStore.restakeRewards.selector, "restakeRewards");
_authorize(functions, StakingStore.claimRewards.selector, "claimRewards");
}
}

3 changes: 1 addition & 2 deletions contracts/staking/IStaking.sol
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,8 @@ interface IStaking is
function stake(NftId stakeNftId, Amount dipAmount) external returns (Amount newStakeBalance);

/// @dev Pays the specified DIP amount to the holder of the stake NFT ID.
/// If dipAmount is set to Amount.max() all stakes and rewards are transferred to the stake holder.
/// permissioned: only staking service may call this function.
function unstake(NftId stakeNftId) external returns (Amount unstakedAmount, Amount rewardsClaimedAmount);
function unstake(NftId stakeNftId) external returns (Amount unstakedAmount);

/// @dev restakes the dips to a new target.
/// the sum of the staked dips and the accumulated rewards will be restaked.
Expand Down
Loading

0 comments on commit c08ccbc

Please sign in to comment.