InfraredBERADepositorV2
Inherits: Upgradeable
Depositor to deposit BERA to CL for Infrared liquid staking token
State Variables
ETH1_ADDRESS_WITHDRAWAL_PREFIX
https://eth2book.info/capella/part2/deposits-withdrawals/withdrawal-processing/
uint8 public constant ETH1_ADDRESS_WITHDRAWAL_PREFIX = 0x01;
DEPOSIT_CONTRACT
The Deposit Contract Address for Berachain
address public DEPOSIT_CONTRACT;
InfraredBERA
the main InfraredBERA contract address
address public InfraredBERA;
reserves
the queued amount of BERA to be deposited
uint256 public reserves;
minActivationDeposit
Minimum deposit for a validator to become active.
uint256 public minActivationDeposit;
__gap
Reserve storage slots for future upgrades for safety
uint256[39] private __gap;
Functions
initializeV2
Initialize V2
function initializeV2() external onlyGovernor;
queue
Queues a deposit by sending BERA to this contract and storing the amount in reserves account for beacon deposits on batch
function queue() external payable;
executeInitialDeposit
Executes initial deposit for 10k bera to the specified pubkey.
Only callable by the keeper
Only callable if the deposits are enabled
Only callable for initial deposit
function executeInitialDeposit(bytes calldata pubkey) external onlyKeeper;
Parameters
Name | Type | Description |
---|---|---|
pubkey | bytes | The pubkey of the validator to deposit for |
execute
Executes a deposit to the deposit contract for the specified pubkey and amount.
Only callable by the keeper
Only callable if the deposits are enabled
Only for deposits subsequent to initialization
function execute(
BeaconRootsVerify.BeaconBlockHeader calldata header,
BeaconRootsVerify.Validator calldata validator,
bytes32[] calldata validatorMerkleWitness,
bytes32[] calldata balanceMerkleWitness,
uint256 validatorIndex,
bytes32 balanceLeaf,
uint256 amount,
uint256 nextBlockTimestamp
) external onlyKeeper;
Parameters
Name | Type | Description |
---|---|---|
header | BeaconRootsVerify.BeaconBlockHeader | The Beacon block header data |
validator | BeaconRootsVerify.Validator | The full validator struct to deposit for |
validatorMerkleWitness | bytes32[] | Merkle witness for validator |
balanceMerkleWitness | bytes32[] | Merkle witness for balance container |
validatorIndex | uint256 | index of validator |
balanceLeaf | bytes32 | 32 bytes chunk including packed balance |
amount | uint256 | The amount of BERA to deposit |
nextBlockTimestamp | uint256 | timestamp of following block to header to verify parent root in beaconroots call |
setMinActivationDeposit
function setMinActivationDeposit(uint256 _minActivationDeposit)
external
onlyGovernor;
Events
Queue
Emitted when a new deposit queued
event Queue(uint256 amount);
Parameters
Name | Type | Description |
---|---|---|
amount | uint256 | New deposit amount in BERA |
Execute
Emitted when a consensus layer deposit queued to a validator
event Execute(bytes pubkey, uint256 amount);
Parameters
Name | Type | Description |
---|---|---|
pubkey | bytes | Public key af validator to deposit to |
amount | uint256 | Validator deposit amount |
MinActivationDepositUpdated
Emitted when min activation deposit is updated by governance
event MinActivationDepositUpdated(uint256 newMinActivationDeposit);
Parameters
Name | Type | Description |
---|---|---|
newMinActivationDeposit | uint256 | New value for min activation deposit to guarentee set inclusion |