InfraredBERAWithdraworLite

Git Source

Inherits: Upgradeable, IInfraredBERAWithdrawor

Withdrawor Lite to be upgraded when voluntary exits are enabled

State Variables

WITHDRAW_REQUEST_TYPE

uint8 public constant WITHDRAW_REQUEST_TYPE = 0x01;

WITHDRAW_PRECOMPILE

address public WITHDRAW_PRECOMPILE;

InfraredBERA

The address of InfraredBERA

address public InfraredBERA;

claimor

address public claimor;

requests

Outstanding requests for claims on previously burnt ibera

mapping(uint256 => Request) public requests;

fees

Amount of BERA internally set aside for withdraw precompile request fees

uint256 public fees;

rebalancing

Amount of BERA internally rebalancing amongst Infrared validators

uint256 public rebalancing;

nonceRequest

The next nonce to issue withdraw request for

uint256 public nonceRequest;

nonceSubmit

The next nonce to submit withdraw request for

uint256 public nonceSubmit;

nonceProcess

The next nonce in queue to process claims for

uint256 public nonceProcess;

Functions

initialize

Initialize the contract (replaces the constructor)

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

Parameters

NameTypeDescription
_govaddressAddress for admin / gov to upgrade
_keeperaddressAddress for keeper
iberaaddressThe initial InfraredBERA 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 process withdraw compile requests from funds received on successful requests

function reserves() public view returns (uint256);

queue

Queues a withdraw from InfraredBERA for chain withdraw precompile escrowing minimum fees for request to withdraw precompile

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

Parameters

NameTypeDescription
receiveraddressThe address to receive withdrawn funds
amountuint256The amount of funds to withdraw

Returns

NameTypeDescription
nonceuint256The nonce created when queueing the withdraw

execute

Executes a withdraw request to withdraw precompile

Payable in case excess bera required to satisfy withdraw precompile fee

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

Parameters

NameTypeDescription
pubkeybytesThe pubkey to withdraw validator funds from
amountuint256The amount of funds to withdraw from validator

process

Processes the funds received from withdraw precompile to next-to-process request receiver

Reverts if balance has not increased by full amount of request for next-to-process request nonce

function process() external;

sweep

Sweeps forced withdrawals to InfraredBERA to re-stake principal

function sweep(bytes calldata pubkey) external;

receive

receive() external payable;

Structs

Request

struct Request {
    address receiver;
    uint96 timestamp;
    uint256 fee;
    uint256 amountSubmit;
    uint256 amountProcess;
}