Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
Sidu28 committed Nov 19, 2023
1 parent f3ca8c2 commit 049b38f
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 15 deletions.
9 changes: 9 additions & 0 deletions src/contracts/interfaces/IEigenPodManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,15 @@ interface IEigenPodManager is IPausable {

/// @notice Emitted when succinct gateway contract is updated
event SuccinctGatewayUpdated(address indexed newSuccinctGateway);

event ProofRequested(address indexed podOwner, uint8 indexed proverID, bool success);


struct ProofServiceDetails{
address proverAddress;
bytes4 requestSelector;
uint256 fee;
}

/**
* @notice Creates an EigenPod for the sender.
Expand Down
31 changes: 16 additions & 15 deletions src/contracts/pods/EigenPodManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -234,15 +234,6 @@ contract EigenPodManager is
_updateBeaconChainOracle(newBeaconChainOracle);
}


/**
* @notice Updates the succinct gateway contract that is used to request partial withdrawal proofs
* @param newSuccinctGateway is the new gateway contract being pointed to
*/
function updateSuccinctGateway(ISuccinctGateway newSuccinctGateway) external onlyOwner {
_setSuccinctGateway(newSuccinctGateway);
}

// INTERNAL FUNCTIONS

function _deployPod() internal onlyWhenNotPaused(PAUSED_NEW_EIGENPODS) returns (IEigenPod) {
Expand Down Expand Up @@ -277,12 +268,6 @@ contract EigenPodManager is
maxPods = _maxPods;
}

/// @notice Internal setter for `functionGateway` that also emits an event
function _setSuccinctGateway(ISuccinctGateway newSuccinctGateway) internal {
succinctGateway = newSuccinctGateway;
emit SuccinctGatewayUpdated(address(newSuccinctGateway));
}

/**
* @notice Calculates the change in a pod owner's delegateable shares as a result of their beacon chain ETH shares changing
* from `sharesBefore` to `sharesAfter`. The key concept here is that negative/"deficit" shares are not delegateable.
Expand Down Expand Up @@ -357,6 +342,22 @@ contract EigenPodManager is
callbackGasLimit
);
}

function requestPartialWithdrawalProof(
address podOwner,
uint8 proverID,
bytes calldata input
) external payable onlyEigenPod(podOwner){
ProofServiceDetails memory proverDetails = proofServiceDirectory[proverID];
require(msg.value >= proverDetails.fee, "EigenPodManager.requestPartialWithdrawalProof: incorrect fee amount");
bytes memory payload = abi.encodeWithSelector(proverDetails.requestSelector, input);

(bool success, bytes memory returnData) = address(proverDetails.proverAddress).call{value: msg.value}(payload);
require(success, "EigenPodManager.requestPartialWithdrawalProof: call to selected prover failed");

emit ProofRequested(podOwner, proverID, success);
}

// confirms that a proof is verified via the succinct gateway
function confirmProofVerification(
bytes32 FUNCTION_ID,
Expand Down
2 changes: 2 additions & 0 deletions src/contracts/pods/EigenPodManagerStorage.sol
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ abstract contract EigenPodManagerStorage is IEigenPodManager {
mapping(address => int256) public podOwnerShares;


mapping(uint8 => ProofServiceDetails) public proofServiceDirectory;

/// @notice succinct's function gateway contract
ISuccinctGateway public succinctGateway;

Expand Down

0 comments on commit 049b38f

Please sign in to comment.