feat(migrations): add MigratorV6Epochs9to12Rewards with deploy script#454
feat(migrations): add MigratorV6Epochs9to12Rewards with deploy script#454
Conversation
… and integration tests
| revert ProfileLib.ProfileDoesntExist(identityId); | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
Entire contract duplicates existing migrator logic
Low Severity
MigratorV6Epochs9to12Rewards is a near-complete copy of MigratorV6TuningPeriodRewards (and MigratorV8TuningPeriodRewards), with the only addition being START_EPOCH and END_EPOCH constants. All internal helper functions (_manageDelegatorStatus, _addNodeToShardingTable, _isMultiSigOwner, _checkOwnerOrMultiSigOwner, _checkProfileExists) and the complete migrateDelegatorReward/migrateOperatorReward flows are duplicated. Extracting the shared logic into a base contract would reduce maintenance burden and the risk of inconsistent bug fixes across three+ copies.
| uint256 public constant START_EPOCH = 9; | ||
| uint256 public constant END_EPOCH = 12; |
There was a problem hiding this comment.
What is the purpose of these 2? I don't see them used in the contract anywhere
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| string private constant _NAME = "MigratorV6Epochs9to12Rewards"; | ||
| string private constant _VERSION = "1.0.0"; | ||
| uint256 public constant START_EPOCH = 9; | ||
| uint256 public constant END_EPOCH = 12; |
There was a problem hiding this comment.
Unused START_EPOCH and END_EPOCH constants in contract
Low Severity
START_EPOCH and END_EPOCH are declared as public constants but never referenced in any contract logic. No function uses them to gate or validate behavior, so there is no on-chain enforcement that this migrator is restricted to epochs 9–12. This aligns with the reviewer's question ("What is the purpose of these 2?"). If the constants are purely informational metadata, they add dead code; if they were intended to enforce epoch boundaries, the enforcement logic is missing.


Note
Medium Risk
Deploys a new on-chain migrator that mutates staking and operator fee balances, so incorrect inputs or edge cases could affect reward accounting despite claim guards and access controls.
Overview
Introduces a new
MigratorV6Epochs9to12Rewardscontract to migrate pre-calculated delegator and operator rewards for epochs9–12, with owner/multisig-gated setters and one-time claim tracking, and migrates delegator rewards by directly increasing staking balances (plus sharding-table/active-set updates).Adds the Hardhat deploy script, exported ABI, and integration tests covering metadata, stake/operator balance updates, and access control. Updates testnet deployment registry JSONs to include the newly deployed contract and tweaks
neuroweb_testnetgasPriceinhardhat.config.ts.Written by Cursor Bugbot for commit d274e95. This will update automatically on new commits. Configure here.