Skip to content

Commit

Permalink
add startCheckpoint on module manager
Browse files Browse the repository at this point in the history
  • Loading branch information
bxmmm1 committed Jul 26, 2024
1 parent 6f1f071 commit e7d9dd8
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 0 deletions.
9 changes: 9 additions & 0 deletions mainnet-contracts/src/PufferModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,15 @@ contract PufferModule is IPufferModule, Initializable, AccessManagedUpgradeable
});
}

/**
* @inheritdoc IPufferModule
* @dev Restricted to PufferModuleManager
*/
function startCheckpoint() external virtual onlyPufferModuleManager {
ModuleStorage storage $ = _getPufferModuleStorage();
$.eigenPod.startCheckpoint({ revertIfNoBalance: true });
}

/**
* @dev Restricted to PufferProtocol
*/
Expand Down
11 changes: 11 additions & 0 deletions mainnet-contracts/src/PufferModuleManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,17 @@ contract PufferModuleManager is IPufferModuleManager, AccessManagedUpgradeable,
emit CustomCallSucceeded(address(restakingOperator), target, customCalldata, response);
}

/**
* @inheritdoc IPufferModuleManager
* @dev Restricted to the DAO
*/
function callStartCheckpoint(address[] calldata moduleAddresses) external virtual restricted {
for (uint256 i = 0; i < moduleAddresses.length; i++) {
// reverts if supplied with a duplicate module address
IPufferModule(moduleAddresses[i]).startCheckpoint();
}
}

/**
* @inheritdoc IPufferModuleManager
* @dev Restricted to the DAO
Expand Down
5 changes: 5 additions & 0 deletions mainnet-contracts/src/interface/IPufferModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,11 @@ interface IPufferModule {
bool[] calldata receiveAsTokens
) external;

/**
* @notice Starts the checkpoint for the module
*/
function startCheckpoint() external;

/**
* @notice Function callable only by PufferProtocol
* @param to is the destination address
Expand Down
5 changes: 5 additions & 0 deletions mainnet-contracts/src/interface/IPufferModuleManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,11 @@ interface IPufferModuleManager {
*/
function callSetProofSubmitter(bytes32 moduleName, address proofSubmitter) external;

/**
* @notice Starts the checkpointing on puffer modules
*/
function callStartCheckpoint(address[] calldata moduleAddresses) external;

/**
* @notice Calls the modifyOperatorDetails function on the restaking operator
* @param restakingOperator is the address of the restaking operator
Expand Down

0 comments on commit e7d9dd8

Please sign in to comment.