Conversation
cd9b08e to
58f4c12
Compare
58f4c12 to
e96ff5a
Compare
49a8005 to
21b638b
Compare
99df000 to
301a35f
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds "stake on behalf" functionality to the StakingRewards contract, replacing the single rewardsDistribution address with OpenZeppelin's AccessControlUpgradeable for role-based access, and introduces an initial lock period that restricts withdrawals and reward claims.
Changes:
- Added
stakeOnBehalfandstakeAndLockOnBehalffunctions gated bySTAKER_ON_BEHALF_ROLE, refactoringstakeandlockStakeinto internal_stakeand_lockStakehelpers - Replaced
rewardsDistributionaddress withAccessControlUpgradeableroles (REWARDS_DISTRIBUTOR_ROLE,STAKER_ON_BEHALF_ROLE) - Added
setInitialLockPeriodowner function to block withdrawals and reward claims during a configurable initial lock period
Reviewed changes
Copilot reviewed 3 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| contracts/staking/StakingRewards.sol | Core changes: AccessControl integration, stake-on-behalf functions, initial lock period |
| contracts/staking/interfaces/IStakingRewards.sol | Interface updated to reflect new functions and removed rewardsDistribution/setRewardsDistribution |
| test/StakingRewards.test.ts | Tests updated for role-based access and new functionality |
| package-lock.json | Dependency peer/direct flag changes |
| README.md | Minor trailing whitespace change |
| .gitignore | Added testnet deploy script JSON exclusion |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
This PR adds "stake on behalf" functionality and role-based access control to the StakingRewards upgradeable contract, replacing the single rewardsDistribution address with OpenZeppelin's AccessControlUpgradeable roles, and introducing an initial lock period feature.
Changes:
- Replaced
rewardsDistributionaddress andonlyRewardsDistributionmodifier withAccessControlUpgradeableroles (REWARDS_DISTRIBUTOR_ROLE,STAKER_ON_BEHALF_ROLE) - Added
stakeOnBehalf,stakeAndLockOnBehalffunctions and refactoredstake/lockStakeinto internal_stake/_lockStakehelpers - Added
setInitialLockPeriodto block withdrawals and reward claims during a configurable initial lock period
Reviewed changes
Copilot reviewed 3 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| contracts/staking/StakingRewards.sol | Core changes: ACL roles, stake-on-behalf functions, initial lock period, internal refactors |
| contracts/staking/interfaces/IStakingRewards.sol | Interface updated to reflect new functions and removed rewardsDistribution/setRewardsDistribution |
| test/StakingRewards.test.ts | Tests updated for role-based access, new stakeOnBehalf/stakeAndLockOnBehalf, and initial lock period |
| package-lock.json | Dependency peer/direct classification changes |
| README.md | Whitespace-only change |
| .gitignore | Added testnet deployment JSON exclusion |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
stakeAndLockOnBehalfsetStakerOnBehalffunction to only allowstakerOnBehalfaddress to execute the previous function.stakeOnBehalfto only stake on behalf without lock period.