Last active
April 27, 2022 17:05
-
-
Save arwer13/ea82f108ff489ec4fbbbc917b7088803 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
contract WithdrawerExitBus is IBeaconChainMessageBus { | |
uint256 constant WITHDRAWER_EXIT_TYPE = 0x00; | |
struct WithdrawerExit { | |
address withdrawalAddress; // address corresponding to the 0x01 withdrawal creds | |
uint256 validatorIndex; // caller is responsible to get it from validator pubkey | |
} | |
function initiateValidatorExit(uint256 _validatorIndex) external { | |
// optionally require msg.value > some value and lock it on the contract | |
WithdrawerExit memory withdrawerExit = WithdrawerExit(msg.sender, _validatorIndex); | |
bytes memory encodedData = abi.encode(withdrawerExit); | |
emit MessageEvent(Message(WITHDRAWER_EXIT_TYPE, encodedData)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment