Skip to content

Instantly share code, notes, and snippets.

@lightclient
Created April 1, 2024 21:49
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 lightclient/54abb2af2465d6969fa6d1920b9ad9d7 to your computer and use it in GitHub Desktop.
Save lightclient/54abb2af2465d6969fa6d1920b9ad9d7 to your computer and use it in GitHub Desktop.
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
contract DepositGen {
event DepositEvent(
bytes pubkey,
bytes withdrawal_credentials,
bytes amount,
bytes signature,
bytes index
);
uint8 curr = 0;
receive() external payable {
bytes memory pubkey = new bytes(48);
pubkey[0] = bytes1(curr);
bytes memory withdrawal_credentials = new bytes(32);
withdrawal_credentials[0] = bytes1(curr);
bytes memory amount = new bytes(8);
amount[0] = bytes1(curr);
bytes memory signature = new bytes(96);
signature[0] = bytes1(curr);
bytes memory index = new bytes(8);
index[0] = bytes1(curr);
curr++;
emit DepositEvent(pubkey, withdrawal_credentials, amount, signature, index);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment