Skip to content
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

feat: ObolValidatorManager #154

Merged
merged 6 commits into from
Feb 6, 2025
Merged
Show file tree
Hide file tree
Changes from 3 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
2 changes: 1 addition & 1 deletion script/DistributeFunds.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ contract DistributeFunds is Script {

vm.startBroadcast(privKey);

OptimisticWithdrawalRecipientV2 owr = OptimisticWithdrawalRecipientV2(deployedOWRV2);
OptimisticWithdrawalRecipientV2 owr = OptimisticWithdrawalRecipientV2(payable(deployedOWRV2));
owr.distributeFunds();

vm.stopBroadcast();
Expand Down
10 changes: 8 additions & 2 deletions script/OWRV2FactoryScript.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ contract OWRV2FactoryScript is Script {
address constant consolidationSysContract = 0x00431F263cE400f4455c2dCf564e53007Ca4bbBb;
// From https://github.com/ethereum/EIPs/blob/d96625a4dcbbe2572fa006f062bd02b4582eefd5/EIPS/eip-7002.md#configuration
address constant withdrawalSysContract = 0x0c15F14308530b7CDB8460094BbB9cC28b9AaaAA;

// By default the script is aiming devnet-5 (7088110746)
address constant depositSysContract = 0x4242424242424242424242424242424242424242;
// TBD
address ensReverseRegistrar = address(0x0);

Expand All @@ -28,6 +29,10 @@ contract OWRV2FactoryScript is Script {
if (ensReverseRegistrar == address(0x0)) {
revert("ensReverseRegistrar not set");
}

if (block.chainid != 7088110746) { // devnet-5
revert("update deposit contract address and chain id");
}

vm.startBroadcast(privKey);

Expand All @@ -36,7 +41,8 @@ contract OWRV2FactoryScript is Script {
ensReverseRegistrar,
msg.sender,
consolidationSysContract,
withdrawalSysContract
withdrawalSysContract,
depositSysContract
);

vm.stopBroadcast();
Expand Down
2 changes: 1 addition & 1 deletion script/RequestConsolidation.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ contract RequestConsolidation is Script {

vm.startBroadcast(privKey);

OptimisticWithdrawalRecipientV2 owr = OptimisticWithdrawalRecipientV2(owrv2);
OptimisticWithdrawalRecipientV2 owr = OptimisticWithdrawalRecipientV2(payable(owrv2));

// Call the function on the deployed contract
bytes[] memory sourcePubKeys = new bytes[](1);
Expand Down
2 changes: 1 addition & 1 deletion script/RequestWithdrawal.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ contract RequestWithdrawal is Script {

vm.startBroadcast(privKey);

OptimisticWithdrawalRecipientV2 owr = OptimisticWithdrawalRecipientV2(owrv2);
OptimisticWithdrawalRecipientV2 owr = OptimisticWithdrawalRecipientV2(payable(owrv2));

bytes[] memory pubKeys = new bytes[](1);
pubKeys[0] = pubkey;
Expand Down
48 changes: 48 additions & 0 deletions src/interfaces/IDepositContract.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// ┏━━━┓━┏┓━┏┓━━┏━━━┓━━┏━━━┓━━━━┏━━━┓━━━━━━━━━━━━━━━━━━━┏┓━━━━━┏━━━┓━━━━━━━━━┏┓━━━━━━━━━━━━━━┏┓━
// ┃┏━━┛┏┛┗┓┃┃━━┃┏━┓┃━━┃┏━┓┃━━━━┗┓┏┓┃━━━━━━━━━━━━━━━━━━┏┛┗┓━━━━┃┏━┓┃━━━━━━━━┏┛┗┓━━━━━━━━━━━━┏┛┗┓
// ┃┗━━┓┗┓┏┛┃┗━┓┗┛┏┛┃━━┃┃━┃┃━━━━━┃┃┃┃┏━━┓┏━━┓┏━━┓┏━━┓┏┓┗┓┏┛━━━━┃┃━┗┛┏━━┓┏━┓━┗┓┏┛┏━┓┏━━┓━┏━━┓┗┓┏┛
// ┃┏━━┛━┃┃━┃┏┓┃┏━┛┏┛━━┃┃━┃┃━━━━━┃┃┃┃┃┏┓┃┃┏┓┃┃┏┓┃┃━━┫┣┫━┃┃━━━━━┃┃━┏┓┃┏┓┃┃┏┓┓━┃┃━┃┏┛┗━┓┃━┃┏━┛━┃┃━
// ┃┗━━┓━┃┗┓┃┃┃┃┃┃┗━┓┏┓┃┗━┛┃━━━━┏┛┗┛┃┃┃━┫┃┗┛┃┃┗┛┃┣━━┃┃┃━┃┗┓━━━━┃┗━┛┃┃┗┛┃┃┃┃┃━┃┗┓┃┃━┃┗┛┗┓┃┗━┓━┃┗┓
// ┗━━━┛━┗━┛┗┛┗┛┗━━━┛┗┛┗━━━┛━━━━┗━━━┛┗━━┛┃┏━┛┗━━┛┗━━┛┗┛━┗━┛━━━━┗━━━┛┗━━┛┗┛┗┛━┗━┛┗┛━┗━━━┛┗━━┛━┗━┛
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┃┃━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┗┛━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

// SPDX-License-Identifier: CC0-1.0

// pragma solidity 0.6.11 was the original version
pragma solidity 0.8.19;

// This interface is designed to be compatible with the Vyper version.
/// @notice This is the Ethereum 2.0 deposit contract interface.
/// For more information see the Phase 0 specification under https://github.com/ethereum/eth2.0-specs
interface IDepositContract {
/// @notice A processed deposit event.
event DepositEvent(
bytes pubkey,
bytes withdrawal_credentials,
bytes amount,
bytes signature,
bytes index
);

/// @notice Submit a Phase 0 DepositData object.
/// @param pubkey A BLS12-381 public key.
/// @param withdrawal_credentials Commitment to a public key for withdrawals.
/// @param signature A BLS12-381 signature.
/// @param deposit_data_root The SHA-256 hash of the SSZ-encoded DepositData object.
/// Used as a protection against malformed input.
function deposit(
bytes calldata pubkey,
bytes calldata withdrawal_credentials,
bytes calldata signature,
bytes32 deposit_data_root
) external payable;

/// @notice Query the current deposit root hash.
/// @return The deposit root hash.
function get_deposit_root() external view returns (bytes32);

/// @notice Query the current deposit count.
/// @return The deposit count encoded as a little endian 64-bit number.
function get_deposit_count() external view returns (bytes memory);
}
Loading