InfraredBERAWithdraworLite
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
Name | Type | Description |
---|---|---|
_gov | address | Address for admin / gov to upgrade |
_keeper | address | Address for keeper |
ibera | address | The 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
Name | Type | Description |
---|---|---|
then | uint96 | The block timestamp in past |
current | uint96 | The current block timestamp now |
Returns
Name | Type | Description |
---|---|---|
has | bool | Whether 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
Name | Type | Description |
---|---|---|
receiver | address | The address to receive withdrawn funds |
amount | uint256 | The amount of funds to withdraw |
Returns
Name | Type | Description |
---|---|---|
nonce | uint256 | The 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
Name | Type | Description |
---|---|---|
pubkey | bytes | The pubkey to withdraw validator funds from |
amount | uint256 | The 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;
}