IInfraredBERA
Inherits: IERC20, IAccessControl
Functions
infrared
The Infrared.sol
smart contract
function infrared() external view returns (address);
depositor
The InfraredBERADepositor.sol
smart contract
function depositor() external view returns (address);
withdrawor
The InfraredBERAWithdrawor.sol
smart contract
function withdrawor() external view returns (address);
receivor
The InfraredBERAFeeReceivor.sol
smart contract
function receivor() external view returns (address);
deposits
The total amount of BERA
deposited by the system
function deposits() external view returns (uint256);
stakes
Returns the amount of BERA
staked in validator with given pubkey
function stakes(bytes calldata pubkey) external view returns (uint256);
staked
Returns whether initial deposit has been staked to validator with given pubkey
function staked(bytes calldata pubkey) external view returns (bool);
hasExited
Returns whether a validator pubkey has exited
function hasExited(bytes calldata pubkey) external view returns (bool);
signatures
Returns the deposit signature to use for given pubkey
function signatures(bytes calldata pubkey)
external
view
returns (bytes memory);
feeDivisorShareholders
The fee divisor for protocol + operator + voter fees. 1/N, where N is the divisor. example 100 = 1/100 = 1%
function feeDivisorShareholders() external view returns (uint16);
pending
Pending deposits yet to be forwarded to CL
function pending() external view returns (uint256);
confirmed
Confirmed deposits sent to CL, total - future deposits
function confirmed() external view returns (uint256);
keeper
Checks if account has the keeper role
function keeper(address account) external view returns (bool);
Parameters
Name | Type | Description |
---|---|---|
account | address | The address to check |
Returns
Name | Type | Description |
---|---|---|
<none> | bool | True if the account has the keeper role |
governor
Checks if account has the governance role
function governor(address account) external view returns (bool);
Parameters
Name | Type | Description |
---|---|---|
account | address | The address to check |
Returns
Name | Type | Description |
---|---|---|
<none> | bool | True if the account has the governance role |
validator
Checks if a given pubkey is a validator in the Infrared
contract
function validator(bytes calldata pubkey) external view returns (bool);
Parameters
Name | Type | Description |
---|---|---|
pubkey | bytes | The pubkey to check |
Returns
Name | Type | Description |
---|---|---|
<none> | bool | True if the pubkey is a validator |
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);
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 |
previewBurn
Previews the amount of BERA that would be received for burning InfraredBERA shares
function previewBurn(uint256 shareAmount)
external
view
returns (uint256 beraAmount, uint256 fee);
Parameters
Name | Type | Description |
---|---|---|
shareAmount | 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
Initiializer for InfraredBERA
function initialize(
address _gov,
address _keeper,
address _infrared,
address _depositor,
address _withdrawor,
address _receivor
) external payable;
Parameters
Name | Type | Description |
---|---|---|
_gov | address | The address of the governance contract |
_keeper | address | The address of the keeper contract |
_infrared | address | The address of the Infrared.sol contract |
_depositor | address | The address of the InfraredBERADepositor.sol contract |
_withdrawor | address | The address of the InfraredBERAWithdrawor.sol contract |
_receivor | address | The address of the InfraredBERAFeeReceivor.sol contract |
compound
Internal function to update top level accounting and compound rewards
function compound() external;
sweep
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 sweep() external payable;
collect
Collects yield from fee receivor and mints ibera shares to Infrared
Called in RewardsLib::harvestOperatorRewards()
in Infrared.sol
Only Infrared can call this function
function collect() external returns (uint256 sharesMinted);
Returns
Name | Type | Description |
---|---|---|
sharesMinted | uint256 | The amount of ibera shares |
mint
Mints ibera
to the receiver
in exchange for bera
takes in msg.value as amount to mint ibera
with
function mint(address receiver) external payable returns (uint256 shares);
Parameters
Name | Type | Description |
---|---|---|
receiver | address | The address to mint ibera to |
Returns
Name | Type | Description |
---|---|---|
shares | uint256 | The amount of ibera minted |
burn
Burns ibera
from the msg.sender
and sets a receiver to get the BERA
in exchange for iBERA
function burn(address receiver, uint256 shares)
external
payable
returns (uint256 nonce, uint256 amount);
Parameters
Name | Type | Description |
---|---|---|
receiver | address | The address to send the BERA to |
shares | uint256 | The amount of ibera to burn |
Returns
Name | Type | Description |
---|---|---|
nonce | uint256 | The nonce of the withdrawal. Queue based system for withdrawals |
amount | uint256 | The amount of BERA withdrawn for the exchange of iBERA |
register
Updates the accounted for stake of a validator pubkey
function register(bytes calldata pubkey, int256 delta) external;
Parameters
Name | Type | Description |
---|---|---|
pubkey | bytes | The pubkey of the validator |
delta | int256 | The change in stake |
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 for a given pubkey. Ensure that the pubkey has signed the correct deposit amount of INITIAL_DEPOSIT
function setDepositSignature(bytes calldata pubkey, bytes calldata signature)
external;
Parameters
Name | Type | Description |
---|---|---|
pubkey | bytes | The pubkey to set the deposit signature for |
signature | bytes | The signature to set for the pubkey |
withdrawalsEnabled
Whether withdrawals are currently enabled
function withdrawalsEnabled() external view returns (bool);
Events
Mint
Emitted when InfraredBERA is minted
event Mint(address indexed receiver, uint256 amount, uint256 shares);
Parameters
Name | Type | Description |
---|---|---|
receiver | address | The address receiving the minted shares |
amount | uint256 | The amount of BERA deposited |
shares | uint256 | The amount of shares minted |
Burn
Emitted when InfraredBERA is burned
event Burn(
address indexed receiver,
uint256 nonce,
uint256 amount,
uint256 shares,
uint256 fee
);
Parameters
Name | Type | Description |
---|---|---|
receiver | address | The address receiving the withdrawn BERA |
nonce | uint256 | The withdrawal nonce |
amount | uint256 | The amount of BERA to withdraw |
shares | uint256 | The amount of shares burned |
fee | uint256 | The fee paid for withdrawal |
Sweep
Emitted when accumulated rewards are swept
event Sweep(uint256 amount);
Parameters
Name | Type | Description |
---|---|---|
amount | uint256 | The amount of BERA swept |
Register
Emitted when validator stake is registered
event Register(bytes pubkey, int256 delta, uint256 stake);
Parameters
Name | Type | Description |
---|---|---|
pubkey | bytes | The validator's public key |
delta | int256 | The change in stake amount |
stake | uint256 | The new total stake amount |
SetFeeShareholders
Emitted when fee shareholders rate is updated
event SetFeeShareholders(uint16 from, uint16 to);
Parameters
Name | Type | Description |
---|---|---|
from | uint16 | Previous fee rate |
to | uint16 | New fee rate |
SetDepositSignature
Emitted when deposit signature is updated
event SetDepositSignature(bytes pubkey, bytes from, bytes to);
Parameters
Name | Type | Description |
---|---|---|
pubkey | bytes | The validator's public key |
from | bytes | Previous signature |
to | bytes | New signature |
WithdrawalFlagSet
Emitted when withdrawal flag is updated
event WithdrawalFlagSet(bool flag);
Parameters
Name | Type | Description |
---|---|---|
flag | bool | New withdrawal flag value |