InfraredBERADepositor

Git Source

Inherits: Upgradeable, IInfraredBERADepositor

Depositor to deposit BERA to CL for Infrared liquid staking token

State Variables

ETH1_ADDRESS_WITHDRAWAL_PREFIX

uint8 public constant ETH1_ADDRESS_WITHDRAWAL_PREFIX = 0x01;

DEPOSIT_CONTRACT

address public DEPOSIT_CONTRACT;

InfraredBERA

The address of InfraredBERA

address public InfraredBERA;

slips

Outstanding slips for deposits on previously minted ibera

mapping(uint256 => Slip) public slips;

fees

Amount of BERA internally set aside for deposit contract request fees

uint256 public fees;

nonceSlip

The next nonce to issue deposit slip for

uint256 public nonceSlip;

nonceSubmit

The next nonce to submit deposit slip for

uint256 public nonceSubmit;

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

_enoughtime

Checks whether enough time has passed beyond min delay

function _enoughtime(uint96 then, uint96 current)
    private
    pure
    returns (bool has);

Parameters

NameTypeDescription
thenuint96The block timestamp in past
currentuint96The current block timestamp now

Returns

NameTypeDescription
hasboolWhether time between then and now exceeds forced min delay

reserves

Amount of BERA internally set aside to execute deposit contract requests

function reserves() public view returns (uint256);

queue

Queues a deposit from InfraredBERA for chain deposit precompile escrowing msg.value in contract

function queue(uint256 amount) external payable returns (uint256 nonce);

Parameters

NameTypeDescription
amountuint256The amount of funds to deposit

Returns

NameTypeDescription
nonceuint256The nonce created when queueing the deposit

execute

Executes a deposit to deposit precompile using escrowed funds

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

Parameters

NameTypeDescription
pubkeybytesThe pubkey to deposit validator funds to
amountuint256The amount of funds to use from escrow to deposit to validator

Structs

Slip

struct Slip {
    uint96 timestamp;
    uint256 fee;
    uint256 amount;
}