-
Notifications
You must be signed in to change notification settings - Fork 478
feat(incentives): add implementation #1681
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
0xClandestine
merged 62 commits into
release-dev/incentive-council
from
feat/incentives-implementation
Jan 9, 2026
Merged
Changes from 60 commits
Commits
Show all changes
62 commits
Select commit
Hold shift + click to select a range
f12106e
wip
0xClandestine 196d782
test
0xClandestine bdb91cc
gap
0xClandestine 9eafb1b
fix epoch calc
0xClandestine 500eb8d
docs
0xClandestine f4ad933
rebase fixes
0xClandestine b80bdfd
fmt
0xClandestine 94bbff3
wip
0xClandestine 4720207
add mocks
0xClandestine 538f1c9
update constructor
0xClandestine 025a741
passing
0xClandestine 4b27fe8
passing
0xClandestine 864fe16
test
0xClandestine 70b03b6
passing
0xClandestine a366b4c
wip
0xClandestine d07b578
wip
0xClandestine 647e5da
wip
0xClandestine ebe098c
wip
0xClandestine 5ac71f5
typo
0xClandestine 78b8659
missing accounting
0xClandestine 6eb0106
test
0xClandestine a0096d2
fix deny_warnings
0xClandestine b7b9680
wip
0xClandestine cb98b00
rename
0xClandestine c7ffd46
fmt
0xClandestine 1804c3e
todo
0xClandestine fba7fd1
passing
0xClandestine 812cbef
wip
0xClandestine fa6de9d
wip
0xClandestine 9ebc04b
wip
0xClandestine cbc9bfa
docs
0xClandestine 51a6179
wip
0xClandestine fa055ce
fixes
0xClandestine e8a8701
fix
0xClandestine 8c0ae9d
fix
0xClandestine 0acec59
fixes
0xClandestine 56a5a19
docs
0xClandestine 64bf038
optimize
0xClandestine d9c9d3b
cleanup
0xClandestine 67a6482
passing
0xClandestine 28963df
review
0xClandestine 7f05baf
flakey test
0xClandestine b2c392b
review
0xClandestine 615c4cc
fix: total weight check
0xClandestine b0a9d70
gap
0xClandestine a2e1d98
add event
0xClandestine 1716838
fix
0xClandestine 2c68008
regression test
0xClandestine f5e2258
remove disableDistribution, use update instead to disable + reenable
0xClandestine de09d42
update denominator
0xClandestine 435d395
validate operator sets
0xClandestine dfe2f71
passing
0xClandestine 403dd40
passing
0xClandestine 71e5a82
prevent button press/mints before epoch 0
0xClandestine d9805dc
pending weight accounting
0xClandestine 900ca73
more coverage
0xClandestine 3ab690e
remove pending total weight in favor or restricting adds/updates unti…
0xClandestine 1a6e455
stopEpoch -> totalEpochs
0xClandestine 90fe467
prevent reverts when processing
0xClandestine 9be8bdd
unused error
0xClandestine ee43371
setup check
0xClandestine a3d26bd
use require statements
0xClandestine File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| // SPDX-License-Identifier: BUSL-1.1 | ||
| pragma solidity ^0.8.27; | ||
|
|
||
| import "../../interfaces/IEmissionsController.sol"; | ||
| import "../../interfaces/IRewardsCoordinator.sol"; | ||
|
|
||
| abstract contract EmissionsControllerStorage is IEmissionsController { | ||
| // Constants | ||
|
|
||
| /// @inheritdoc IEmissionsController | ||
| uint256 public constant MAX_TOTAL_WEIGHT = 10_000; | ||
|
|
||
| /// @dev Index for flag that pauses pressing the button when set. | ||
| uint8 internal constant PAUSED_TOKEN_FLOWS = 0; | ||
|
|
||
| // Immutables | ||
|
|
||
| /// @dev The EIGEN token that will be minted for emissions. | ||
| IEigen public immutable override EIGEN; | ||
| /// @dev The backing Eigen token that will be minted for emissions. | ||
| IBackingEigen public immutable override BACKING_EIGEN; | ||
|
0xClandestine marked this conversation as resolved.
|
||
| /// @dev The AllocationManager contract for managing operator sets. | ||
| IAllocationManager public immutable override ALLOCATION_MANAGER; | ||
| /// @dev The RewardsCoordinator contract for submitting rewards. | ||
| IRewardsCoordinator public immutable override REWARDS_COORDINATOR; | ||
|
|
||
| /// @inheritdoc IEmissionsController | ||
| uint256 public immutable EMISSIONS_INFLATION_RATE; | ||
| /// @inheritdoc IEmissionsController | ||
| uint256 public immutable EMISSIONS_START_TIME; | ||
| /// @inheritdoc IEmissionsController | ||
| uint256 public immutable EMISSIONS_EPOCH_LENGTH; | ||
|
|
||
| // Mutatables | ||
|
|
||
| // Slot 0 (Packed) | ||
|
|
||
| /// @inheritdoc IEmissionsController | ||
| address public incentiveCouncil; | ||
| /// @inheritdoc IEmissionsController | ||
| uint16 public totalWeight; | ||
|
|
||
| /// @dev Returns an append-only array of distributions. | ||
| Distribution[] internal _distributions; | ||
| /// @dev Mapping from epoch number to epoch metadata. | ||
| mapping(uint256 epoch => Epoch) internal _epochs; | ||
|
|
||
| // Construction | ||
|
|
||
| constructor( | ||
| IEigen eigen, | ||
| IBackingEigen backingEigen, | ||
| IAllocationManager allocationManager, | ||
| IRewardsCoordinator rewardsCoordinator, | ||
| uint256 inflationRate, | ||
| uint256 startTime, | ||
| uint256 epochLength | ||
| ) { | ||
| EIGEN = eigen; | ||
| BACKING_EIGEN = backingEigen; | ||
| ALLOCATION_MANAGER = allocationManager; | ||
| REWARDS_COORDINATOR = rewardsCoordinator; | ||
|
|
||
| EMISSIONS_INFLATION_RATE = inflationRate; | ||
| EMISSIONS_START_TIME = startTime; | ||
| EMISSIONS_EPOCH_LENGTH = epochLength; | ||
|
elhajin marked this conversation as resolved.
|
||
| } | ||
|
|
||
| /// @dev This empty reserved space is put in place to allow future versions to add new | ||
| /// variables without shifting down storage in the inheritance chain. | ||
| /// See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps | ||
| uint256[47] private __gap; | ||
| } | ||
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| // SPDX-License-Identifier: BUSL-1.1 | ||
| pragma solidity ^0.8.9; | ||
|
|
||
| import "forge-std/Test.sol"; | ||
| import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; | ||
|
|
||
| contract BackingEigenMock is Test, ERC20 { | ||
| constructor() ERC20("Backing EIGEN", "bEIGEN") {} | ||
|
|
||
| function mint(address to, uint amount) external { | ||
| _mint(to, amount); | ||
| } | ||
| } | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| // SPDX-License-Identifier: BUSL-1.1 | ||
| pragma solidity ^0.8.9; | ||
|
|
||
| import "forge-std/Test.sol"; | ||
| import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; | ||
| import "./BackingEigenMock.sol"; | ||
|
|
||
| contract EigenMock is Test, ERC20 { | ||
| BackingEigenMock backingEigen; | ||
|
|
||
| constructor(BackingEigenMock _backingEigen) ERC20("EIGEN", "EIGEN") { | ||
| backingEigen = _backingEigen; | ||
| } | ||
|
|
||
| function wrap(uint amount) external { | ||
| backingEigen.transferFrom(msg.sender, address(this), amount); | ||
| _mint(msg.sender, amount); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| // SPDX-License-Identifier: BUSL-1.1 | ||
| pragma solidity ^0.8.9; | ||
|
|
||
| import "forge-std/Test.sol"; | ||
| import "../../contracts/interfaces/IRewardsCoordinator.sol"; | ||
|
|
||
| contract RewardsCoordinatorMock is Test { | ||
| function createRewardsForAllEarners(IRewardsCoordinatorTypes.RewardsSubmission[] calldata) external { | ||
| // Mock implementation - does nothing for testing | ||
| } | ||
|
|
||
| function createUniqueStakeRewardsSubmission(OperatorSet calldata, IRewardsCoordinatorTypes.RewardsSubmission[] calldata) external { | ||
| // Mock implementation - does nothing for testing | ||
| } | ||
|
|
||
| function createTotalStakeRewardsSubmission(OperatorSet calldata, IRewardsCoordinatorTypes.RewardsSubmission[] calldata) external { | ||
| // Mock implementation - does nothing for testing | ||
| } | ||
| } | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.