Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ artifacts
#Foundry files
out
cache
snapshots

*.DS_Store

Expand Down
3 changes: 2 additions & 1 deletion script/deploy/devnet/deploy_from_scratch.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,8 @@ contract DeployFromScratch is Script, Test {
REWARDS_COORDINATOR_INIT_PAUSED_STATUS,
REWARDS_COORDINATOR_UPDATER,
REWARDS_COORDINATOR_ACTIVATION_DELAY,
REWARDS_COORDINATOR_GLOBAL_OPERATOR_COMMISSION_BIPS
REWARDS_COORDINATOR_GLOBAL_OPERATOR_COMMISSION_BIPS,
executorMultisig // feeRecipient
)
);

Expand Down
9 changes: 5 additions & 4 deletions script/deploy/local/deploy_from_scratch.slashing.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,6 @@ contract DeployFromScratch is Script, Test {
allocationManager = AllocationManager(
address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), ""))
);
allocationManagerView = AllocationManagerView(
address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), ""))
);
permissionController = PermissionController(
address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), ""))
);
Expand All @@ -237,6 +234,9 @@ contract DeployFromScratch is Script, Test {
eigenPodBeacon = new UpgradeableBeacon(address(eigenPodImplementation));

// Second, deploy the *implementation* contracts, using the *proxy contracts* as inputs
// Deploy AllocationManagerView as a standalone implementation (not a proxy)
allocationManagerView =
new AllocationManagerView(delegation, eigenStrategy, DEALLOCATION_DELAY, ALLOCATION_CONFIGURATION_DELAY);

delegationImplementation = new DelegationManager(
strategyManager,
Expand Down Expand Up @@ -327,7 +327,8 @@ contract DeployFromScratch is Script, Test {
REWARDS_COORDINATOR_INIT_PAUSED_STATUS,
REWARDS_COORDINATOR_UPDATER,
REWARDS_COORDINATOR_ACTIVATION_DELAY,
REWARDS_COORDINATOR_DEFAULT_OPERATOR_SPLIT_BIPS
REWARDS_COORDINATOR_DEFAULT_OPERATOR_SPLIT_BIPS,
executorMultisig // feeRecipient
)
);

Expand Down
2 changes: 1 addition & 1 deletion script/releases/TestUtils.sol
Original file line number Diff line number Diff line change
Expand Up @@ -926,7 +926,7 @@ library TestUtils {
RewardsCoordinator rewardsCoordinator
) internal {
vm.expectRevert(errInit);
rewardsCoordinator.initialize(address(0), 0, address(0), 0, 0);
rewardsCoordinator.initialize(address(0), 0, address(0), 0, 0, address(0));
}

function validateStrategyManagerInitialized(
Expand Down
3 changes: 2 additions & 1 deletion script/utils/ExistingDeploymentParser.sol
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,8 @@ contract ExistingDeploymentParser is Script, Logger {
0, // initialPausedStatus
address(0), // rewardsUpdater
0, // activationDelay
0 // defaultSplitBips
0, // defaultSplitBips
address(0) // feeRecipient
Copy link
Contributor

Choose a reason for hiding this comment

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

should add the feeRecipient param to both deployment scripts as well (devnet and local) .. that's why the deployFromScratch test is failing

Copy link
Member Author

Choose a reason for hiding this comment

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

);
// DelegationManager
cheats.expectRevert(bytes("Initializable: contract is already initialized"));
Expand Down
3 changes: 0 additions & 3 deletions snapshots/Integration_ALM_Multi.json

This file was deleted.

2 changes: 0 additions & 2 deletions src/contracts/core/EmissionsController.sol
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,6 @@ contract EmissionsController is
success = _tryCallRewardsCoordinator(
abi.encodeCall(IRewardsCoordinator.createAVSRewardsSubmission, (rewardsSubmissions))
);
} else {
revert InvalidDistributionType(); // Only reachable if the distribution type is `Disabled`.
}
} else {
(success,) =
Expand Down
228 changes: 179 additions & 49 deletions src/contracts/core/RewardsCoordinator.sol

Large diffs are not rendered by default.

11 changes: 10 additions & 1 deletion src/contracts/core/storage/RewardsCoordinatorStorage.sol
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ abstract contract RewardsCoordinatorStorage is IRewardsCoordinator {
/// @notice Canonical, virtual beacon chain ETH strategy
IStrategy public constant beaconChainETHStrategy = IStrategy(0xbeaC0eeEeeeeEEeEeEEEEeeEEeEeeeEeeEEBEaC0);

/// @notice Protocol fee percentage in basis points (20%).
uint16 internal constant PROTOCOL_FEE_BIPS = 2000;

// Immutables

/// @notice The DelegationManager contract for EigenLayer
Expand Down Expand Up @@ -136,6 +139,12 @@ abstract contract RewardsCoordinatorStorage is IRewardsCoordinator {
/// @notice Returns whether a `hash` is a `valid` total stake rewards submission hash for a given `avs`.
mapping(address avs => mapping(bytes32 hash => bool valid)) public isTotalStakeRewardsSubmissionHash;

/// @notice Returns whether a `submitter` is opted in for protocol fees.
mapping(address submitter => bool isOptedIn) public isOptedInForProtocolFee;

/// @notice The address that receives optional protocol fees
address public feeRecipient;

// Construction
constructor(
IDelegationManager _delegationManager,
Expand Down Expand Up @@ -164,5 +173,5 @@ abstract contract RewardsCoordinatorStorage is IRewardsCoordinator {
/// @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[33] private __gap;
uint256[31] private __gap;
}
30 changes: 29 additions & 1 deletion src/contracts/interfaces/IRewardsCoordinator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,17 @@ interface IRewardsCoordinatorEvents is IRewardsCoordinatorTypes {
IERC20 token,
uint256 claimedAmount
);

/// @notice Emitted when the fee recipient is set.
/// @param oldFeeRecipient The old fee recipient
/// @param newFeeRecipient The new fee recipient
event FeeRecipientSet(address indexed oldFeeRecipient, address indexed newFeeRecipient);

/// @notice Emitted when the opt in for protocol fee is set.
/// @param submitter The address of the submitter
/// @param oldValue The old value of the opt in for protocol fee
/// @param newValue The new value of the opt in for protocol fee
event OptInForProtocolFeeSet(address indexed submitter, bool indexed oldValue, bool indexed newValue);
}

/// @title Interface for the `IRewardsCoordinator` contract.
Expand All @@ -431,7 +442,8 @@ interface IRewardsCoordinator is IRewardsCoordinatorErrors, IRewardsCoordinatorE
uint256 initialPausedStatus,
address _rewardsUpdater,
uint32 _activationDelay,
uint16 _defaultSplitBips
uint16 _defaultSplitBips,
address _feeRecipient
) external;

/// @notice Creates a new rewards submission on behalf of an AVS, to be split amongst the
Expand Down Expand Up @@ -606,6 +618,13 @@ interface IRewardsCoordinator is IRewardsCoordinatorErrors, IRewardsCoordinatorE
uint16 split
) external;

/// @notice Sets the fee recipient address which receives optional protocol fees
/// @dev Only callable by the contract owner
/// @param _feeRecipient The address of the new fee recipient
function setFeeRecipient(
address _feeRecipient
) external;

/// @notice Sets the split for a specific operator for a specific avs
/// @param operator The operator who is setting the split
/// @param avs The avs for which the split is being set by the operator
Expand Down Expand Up @@ -643,6 +662,15 @@ interface IRewardsCoordinator is IRewardsCoordinatorErrors, IRewardsCoordinatorE
uint16 split
) external;

/// @notice Sets whether the submitter wants to pay the protocol fee on their rewards submissions.
/// @dev Submitters must opt-in to pay the protocol fee to be eligible for rewards.
/// @param submitter The address of the submitter that wants to opt-in or out of the protocol fee.
/// @param optInForProtocolFee Whether the submitter wants to pay the protocol fee.
function setOptInForProtocolFee(
address submitter,
bool optInForProtocolFee
) external;

/// @notice Sets the permissioned `rewardsUpdater` address which can post new roots
/// @dev Only callable by the contract owner
/// @param _rewardsUpdater The address of the new rewardsUpdater
Expand Down
2 changes: 1 addition & 1 deletion src/test/unit/ECDSACertificateVerifierUnit.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ contract ECDSACertificateVerifierUnitTests_verifyCertificate is ECDSACertificate

// Verification should fail - expect SignersNotOrdered because signature recovery
// with wrong message hash produces different addresses that break ordering
vm.expectRevert(); // SignersNotOrdered or VerificationFailed
cheats.expectRevert(); // SignersNotOrdered or VerificationFailed
verifier.verifyCertificate(defaultOperatorSet, cert);
}

Expand Down
Loading
Loading