IInfraredBERA

Git Source

Inherits: IERC20, IAccessControl

Functions

infrared

Address of the Infrared operator contract

function infrared() external view returns (address);

depositor

Address of the depositor that interacts with chain deposit precompile

function depositor() external view returns (address);

withdrawor

Address of the withdrawor that interacts with chain withdraw precompile

function withdrawor() external view returns (address);

receivor

Address of the fee receivor contract that receives tx priority fees + MEV on EL

function receivor() external view returns (address);

deposits

Deposits of BERA backing InfraredBERA intended for use in CL by validators

function deposits() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256The amount of BERA for deposits to CL

stakes

Returns the amount of BERA staked in validator with given pubkey

function stakes(bytes calldata pubkey) external view returns (uint256);

Returns

NameTypeDescription
<none>uint256The amount of BERA staked in validator

staked

Returns whether initial deposit has been staked to validator with given pubkey

function staked(bytes calldata pubkey) external view returns (bool);

Returns

NameTypeDescription
<none>boolWhethere initial deposit has been staked to validator

hasExited

Checks if a validator has been force exited from the Consensus Layer

exited validators can no longer be deposited in.

function hasExited(bytes calldata pubkey) external view returns (bool);

Parameters

NameTypeDescription
pubkeybytesThe public key of the validator to check

Returns

NameTypeDescription
<none>boolbool True if the validator has been force exited, false otherwise

signatures

Returns the deposit signature to use for given pubkey

function signatures(bytes calldata pubkey)
    external
    view
    returns (bytes memory);

Returns

NameTypeDescription
<none>bytesThe deposit signature for pubkey

feeDivisorShareholders

Fee taken by the shareholders on yield from EL coinbase priority fees + MEV, represented as an integer denominator (1/x)%

additional fees include POL base rewards, POL comission, POL bribes

function feeDivisorShareholders() external view returns (uint16);

Returns

NameTypeDescription
<none>uint16The fee taken by shareholders as an integer denominator (1/x)%, (25% = 4), (50% = 2), (100% = 1)

pending

Pending deposits yet to be forwarded to CL

function pending() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256The amount of BERA yet to be deposited to CL

confirmed

Confirmed deposits sent to CL

function confirmed() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256The amount of BERA confirmed to be deposited to CL

keeper

Returns whether given account is an InfraredBERA keeper

function keeper(address account) external view returns (bool);

Returns

NameTypeDescription
<none>boolWhether account is a keeper

governor

Returns whether given account is an InfraredBERA governor

function governor(address account) external view returns (bool);

Returns

NameTypeDescription
<none>boolWhether account is a governor

validator

Returns whether given pubkey is in Infrared validator set

function validator(bytes calldata pubkey) external view returns (bool);

Returns

NameTypeDescription
<none>boolWhether pubkey in Infrared validator set

previewMint

Previews the amount of InfraredBERA shares that would be minted for a given BERA amount

function previewMint(uint256 beraAmount)
    external
    view
    returns (uint256 shares, uint256 fee);

Parameters

NameTypeDescription
beraAmountuint256The amount of BERA to simulate depositing

Returns

NameTypeDescription
sharesuint256The amount of InfraredBERA shares that would be minted, returns 0 if the operation would fail
feeuint256The fee that would be charged for the mint operation

previewBurn

Previews the amount of BERA that would be received for burning InfraredBERA shares

function previewBurn(uint256 shares)
    external
    view
    returns (uint256 beraAmount, uint256 fee);

Parameters

NameTypeDescription
sharesuint256The amount of InfraredBERA shares to simulate burning

Returns

NameTypeDescription
beraAmountuint256The amount of BERA that would be received, returns 0 if the operation would fail
feeuint256The fee that would be charged for the burn operation

initialize

Initializes InfraredBERA to allow for future mints and burns

Must be called before InfraredBERA can offer deposits and withdraws

function initialize(
    address _gov,
    address _keeper,
    address _infrared,
    address _depositor,
    address _withdrawor,
    address _receivor
) external payable;

compound

Compounds accumulated EL yield in fee receivor into deposits

Called internally at bof whenever InfraredBERA minted or burned

Only sweeps if amount transferred from fee receivor would exceed min deposit thresholds

function compound() external;

sweep

Sweeps received funds in msg.value as yield into deposits

Fee receivor must call this function in its sweep function for autocompounding

function sweep() external payable;

collect

Collects yield from fee receivor and mints ibera shares to Infrared

Only Infrared can call this function

function collect() external returns (uint256 sharesMinted);

Returns

NameTypeDescription
sharesMinteduint256The amount of ibera shares minted

mint

Mints ibera shares to receiver for bera paid in by sender

function mint(address receiver)
    external
    payable
    returns (uint256 nonce, uint256 shares);

Parameters

NameTypeDescription
receiveraddressAddress of the receiver of ibera

Returns

NameTypeDescription
nonceuint256The nonce issued to identify the credited bera funds for deposit
sharesuint256The amount of shares of ibera minted

burn

Burns ibera shares from sender for bera to ultimately be transferred to receiver on subsequent call to claim

Sender must pay withdraw precompile fee upfront

function burn(address receiver, uint256 shares)
    external
    payable
    returns (uint256 nonce, uint256 amount);

Parameters

NameTypeDescription
receiveraddressAddress of the receiver of future bera
sharesuint256The amount of shares of ibera burned

Returns

NameTypeDescription
nonceuint256The nonce issued to identify the owed bera funds for claim
amountuint256The amount of bera funds that will be available for claim

register

Registers update to BERA staked in validator with given pubkey at CL

Reverts if not called by depositor or withdrawor

function register(bytes calldata pubkey, int256 delta) external;

Parameters

NameTypeDescription
pubkeybytesThe pubkey of the validator to update BERA stake for at CL
deltaint256The change in the amount of BERA staked/unstaked (+/-) at CL

setFeeDivisorShareholders

Sets the fee shareholders taken on yield from EL coinbase priority fees + MEV

function setFeeDivisorShareholders(uint16 to) external;

Parameters

NameTypeDescription
touint16The new fee shareholders represented as an integer denominator (1/x)%

setDepositSignature

Sets the deposit signature to be used when depositing to pubkey

function setDepositSignature(bytes calldata pubkey, bytes calldata signature)
    external;

Parameters

NameTypeDescription
pubkeybytesThe pubkey of the validator receiving the deposit
signaturebytesThe deposit signature to use for pubkey

withdrawalsEnabled

Flag to show whether withdrawals are currently enabled

function withdrawalsEnabled() external view returns (bool);

Returns

NameTypeDescription
<none>boolTrue if withdrawals are enabled

Events

Mint

event Mint(
    address indexed receiver,
    uint256 nonce,
    uint256 amount,
    uint256 shares,
    uint256 fee
);

Burn

event Burn(
    address indexed receiver,
    uint256 nonce,
    uint256 amount,
    uint256 shares,
    uint256 fee
);

Sweep

event Sweep(uint256 amount);

Register

event Register(bytes pubkey, int256 delta, uint256 stake);

SetFeeShareholders

event SetFeeShareholders(uint16 from, uint16 to);

SetDepositSignature

event SetDepositSignature(bytes pubkey, bytes from, bytes to);

WithdrawalFlagSet

event WithdrawalFlagSet(bool flag);