Skip to content

Conversation

alexkeating
Copy link
Collaborator

@alexkeating alexkeating commented Aug 11, 2025

Description

  • Move contract variables to storage
  • Read new storage struct
  • Rename contracts that have been made upgradeable
  • Update tests to use proxy
  • Add disable initializers to fake and mocks

uint256 _totalStakeCap;
}

// keccak256(abi.encode(uint256(keccak256("storage.StakerCapDeposits")) - 1)) &~bytes32(uint256(0xff))
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add vendor subdomain


/// @notice Delegable governance token which users stake to earn rewards.
IERC20 public immutable STAKE_TOKEN;
struct StakerStorage {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does cause multiple slot reads? Make sure gas estimations are still reasonable

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Targeting zksync, not a huge change so we will not optimize

// Public getter functions for storage variables

/// @notice ERC20 token in which rewards are denominated and distributed.
function REWARD_TOKEN() public view virtual returns (IERC20) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should these still be capitalized

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also are there any of these getters we should remove


/// @notice Initializes the the contract.
/// @param _initialTotalStakeCap The initial maximum total stake allowed.
function __StakerCapDepositsUpgradeable_init_unchained(uint256 _initialTotalStakeCap)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kept these to match convention, but they seem to only be used as a passthrough

@alexkeating alexkeating marked this pull request as ready for review August 14, 2025 12:55
@alexkeating alexkeating changed the title Upgradeable staker Upgradeable staker (DO NOT MERGE) Aug 14, 2025
}

/// @notice Current configuration parameters for the fee assessed on claiming.
function claimFeeParameters() public view virtual returns (ClaimFeeParameters memory) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this return a tuple to maintain compatibility with the regular Staker?

__StakerDelegateSurrogateVotesUpgradeable_init_unchained(_votingToken);
}

/// @notice Initializes the the contract.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// @notice Initializes the the contract.
/// @notice Initializes the `StakerDelegateSurrogateVotesUpgradeable` contract.

return _domainSeparatorV4();
}

/// @notice Initializes the the contract.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// @notice Initializes the the contract.
/// @notice Initializes the `StakerOnBehalfUpgradeable` contract.

@github-actions
Copy link

github-actions bot commented Sep 6, 2025

Coverage after merging upgradeable-staker into main will be

98.58%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
src
   DelegationSurrogate.sol100%100%100%100%
   DelegationSurrogateVotes.sol100%100%100%100%
   StakerUpgradeable.sol98.92%100%98.31%98.99%453–455
src/calculators
   BinaryEligibilityOracleEarningPowerCalculator.sol100%100%100%100%
   IdentityEarningPowerCalculator.sol100%100%100%100%
src/extensions
   StakerCapDepositsUpgradeable.sol100%100%100%100%
   StakerDelegateSurrogateVotesUpgradeable.sol85.71%100%83.33%85%72–74
   StakerOnBehalfUpgradeable.sol94.20%100%83.33%96.23%60, 63
   StakerPermitAndStakeUpgradeable.sol100%100%100%100%
src/notifiers
   MintRewardNotifier.sol100%100%100%100%
   RewardTokenNotifierBase.sol100%100%100%100%
   TransferFromRewardNotifier.sol100%100%100%100%
   TransferRewardNotifier.sol100%100%100%100%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant