IInfraredBERA
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
Name | Type | Description |
---|---|---|
<none> | uint256 | The 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
Name | Type | Description |
---|---|---|
<none> | uint256 | The 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
Name | Type | Description |
---|---|---|
<none> | bool | Whethere 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
Name | Type | Description |
---|---|---|
pubkey | bytes | The public key of the validator to check |
Returns
Name | Type | Description |
---|---|---|
<none> | bool | bool 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
Name | Type | Description |
---|---|---|
<none> | bytes | The 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
Name | Type | Description |
---|---|---|
<none> | uint16 | The 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
Name | Type | Description |
---|---|---|
<none> | uint256 | The amount of BERA yet to be deposited to CL |
confirmed
Confirmed deposits sent to CL
function confirmed() external view returns (uint256);
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | The 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
Name | Type | Description |
---|---|---|
<none> | bool | Whether account is a keeper |
governor
Returns whether given account is an InfraredBERA governor
function governor(address account) external view returns (bool);
Returns
Name | Type | Description |
---|---|---|
<none> | bool | Whether account is a governor |
validator
Returns whether given pubkey is in Infrared validator set
function validator(bytes calldata pubkey) external view returns (bool);
Returns
Name | Type | Description |
---|---|---|
<none> | bool | Whether 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
Name | Type | Description |
---|---|---|
beraAmount | uint256 | The amount of BERA to simulate depositing |
Returns
Name | Type | Description |
---|---|---|
shares | uint256 | The amount of InfraredBERA shares that would be minted, returns 0 if the operation would fail |
fee | uint256 | The 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
Name | Type | Description |
---|---|---|
shares | uint256 | The amount of InfraredBERA shares to simulate burning |
Returns
Name | Type | Description |
---|---|---|
beraAmount | uint256 | The amount of BERA that would be received, returns 0 if the operation would fail |
fee | uint256 | The 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
Name | Type | Description |
---|---|---|
sharesMinted | uint256 | The 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
Name | Type | Description |
---|---|---|
receiver | address | Address of the receiver of ibera |
Returns
Name | Type | Description |
---|---|---|
nonce | uint256 | The nonce issued to identify the credited bera funds for deposit |
shares | uint256 | The 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
Name | Type | Description |
---|---|---|
receiver | address | Address of the receiver of future bera |
shares | uint256 | The amount of shares of ibera burned |
Returns
Name | Type | Description |
---|---|---|
nonce | uint256 | The nonce issued to identify the owed bera funds for claim |
amount | uint256 | The 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
Name | Type | Description |
---|---|---|
pubkey | bytes | The pubkey of the validator to update BERA stake for at CL |
delta | int256 | The 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
Name | Type | Description |
---|---|---|
to | uint16 | The 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
Name | Type | Description |
---|---|---|
pubkey | bytes | The pubkey of the validator receiving the deposit |
signature | bytes | The deposit signature to use for pubkey |
withdrawalsEnabled
Flag to show whether withdrawals are currently enabled
function withdrawalsEnabled() external view returns (bool);
Returns
Name | Type | Description |
---|---|---|
<none> | bool | True 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);