InfraredBERADepositor

Git Source

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;

__gap

Reserve storage slots for future upgrades for safety

uint256[40] private __gap;

Functions

initialize

Initialize the contract (replaces the constructor)

function initialize(
    address _gov,
    address _keeper,
    address ibera,
    address _depositContract
) public initializer;

Parameters

NameTypeDescription
_govaddressAddress for admin / gov to upgrade
_keeperaddressAddress for keeper
iberaaddressThe initial IBERA address
_depositContractaddressThe ETH2 (Berachain) Deposit Contract Address

queue

Queues a deposit by sending BERA to this contract and storing the amount in the pending deposits acculimator

function queue() external payable;

execute

Executes a deposit to the deposit contract for the specified pubkey and amount.

can only be called by InfraredBERA for adding to the reserves and by withdrawor for rebalancing when validators get kicked out of the set, TODO: link the set kickout code.

Only callable by the keeper

Only callable if the deposits are enabled

function execute(bytes calldata pubkey, uint256 amount) external onlyKeeper;

Parameters

NameTypeDescription
pubkeybytesThe pubkey of the validator to deposit for
amountuint256The amount of BERA to deposit

Events

Queue

event Queue(uint256 amount);

Execute

event Execute(bytes pubkey, uint256 amount);