Skip to content

feat(migrations): add MigratorV6Epochs9to12Rewards with deploy script#454

Merged
zsculac merged 2 commits intomainfrom
migrator-v6-epoch-9-to-12
Feb 13, 2026
Merged

feat(migrations): add MigratorV6Epochs9to12Rewards with deploy script#454
zsculac merged 2 commits intomainfrom
migrator-v6-epoch-9-to-12

Conversation

@lupuszr
Copy link
Contributor

@lupuszr lupuszr commented Feb 11, 2026

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 MigratorV6Epochs9to12Rewards contract to migrate pre-calculated delegator and operator rewards for epochs 912, 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_testnet gasPrice in hardhat.config.ts.

Written by Cursor Bugbot for commit d274e95. This will update automatically on new commits. Configure here.

revert ProfileLib.ProfileDoesntExist(identityId);
}
}
}
Copy link

Choose a reason for hiding this comment

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

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.

Fix in Cursor Fix in Web

Comment on lines +23 to +24
uint256 public constant START_EPOCH = 9;
uint256 public constant END_EPOCH = 12;
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the purpose of these 2? I don't see them used in the contract anywhere

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

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;
Copy link

Choose a reason for hiding this comment

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

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.

Fix in Cursor Fix in Web

@zsculac zsculac merged commit 51b3493 into main Feb 13, 2026
5 checks passed
@zsculac zsculac deleted the migrator-v6-epoch-9-to-12 branch February 13, 2026 08:01
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.

2 participants