Skip to content

Commit

Permalink
added natspec
Browse files Browse the repository at this point in the history
  • Loading branch information
Sidu28 committed Dec 5, 2023
1 parent a907f7e commit 7f45cac
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
5 changes: 4 additions & 1 deletion src/contracts/interfaces/IEigenPodManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ interface IEigenPodManager is IPausable {
event MaxPodsUpdated(uint256 previousValue, uint256 newValue);

/// @notice Emitted when a new proof fulfiller is added
event ProofServiceUpdated(address indexed proofService);
event ProofServiceUpdated(ProofService proofService);

/// @notice emitted when the partial withdrawal proof switch is turned on
event PartialWithdrawalProofSwitchOn();

/// @notice Emitted when a withdrawal of beacon chain ETH is completed
event BeaconChainETHWithdrawalCompleted(
Expand Down
16 changes: 8 additions & 8 deletions src/contracts/pods/EigenPodManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ contract EigenPodManager is
ownerToPod[podOwner].withdrawRestakedBeaconChainETH(destination, shares);
}

/// @notice Called by proving service to fulfill a partial withdrawal proof request
function proofServiceCallback(
bytes32 blockRoot,
uint64 oracleTimestamp,
Expand All @@ -233,27 +234,26 @@ contract EigenPodManager is
) external onlyProofService partialWithdrawalProofSwitchOn {
require(blockRoot == getBlockRootAtTimestamp(oracleTimestamp), "EigenPodManager.proofServiceCallback: block root does not match oracleRoot for that timestamp");
for(uint256 i = 0; i < callbackInfo.length; i++) {
//these checks are verified in the snark, we add them here again as a sanity check
require(oracleTimestamp >= callbackInfo[i].endTimestamp, "EigenPodManager.proofServiceCallback: oracle timestamp must be greater than or equal to callback timestamp");
require(callbackInfo[i].fee <= maxFee, "EigenPod.fulfillPartialWithdrawalProofRequest: fee must be less than or equal to maxFee");
IEigenPod pod = ownerToPod[callbackInfo[i].podOwner];
pod.fulfillPartialWithdrawalProofRequest(callbackInfo[i], proofService.feeRecipient);
}
}

function flipPartialWithdrawalProofSwitch() external onlyOwner {
if(partialWithdrawalProofSwitch) {
partialWithdrawalProofSwitch = false;
} else {
partialWithdrawalProofSwitch = true;
}
/// @notice enables partial withdrawal proving via offchain proofs
function turnOnPartialWithdrawalProofSwitch() external onlyOwner {
require(!partialWithdrawalProofSwitch)
partialWithdrawalProofSwitch = true;
emit PartialWithdrawalProofSwitchOn();
}

function updateProofService(address caller, address feeRecipient) external onlyOwner {
proofService = ProofService({
caller: caller,
feeRecipient: feeRecipient
});
emit ProofServiceUpdated(proofService.caller);
emit ProofServiceUpdated(proofService);
}

/**
Expand Down

0 comments on commit 7f45cac

Please sign in to comment.