Skip to content

Instantly share code, notes, and snippets.

@arwer13
Last active April 27, 2022 17:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arwer13/ea82f108ff489ec4fbbbc917b7088803 to your computer and use it in GitHub Desktop.
Save arwer13/ea82f108ff489ec4fbbbc917b7088803 to your computer and use it in GitHub Desktop.
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