Redeemer
Permissionless contract for redeeming iBGT tokens for BERA via the Infrared protocol.
State Variables
bgt
Address of the BGT token.
address public immutable bgt;
ibgt
Address of the iBGT token.
address public immutable ibgt;
infrared
Address of the Infrared protocol contract.
InfraredV1_8 public immutable infrared;
Functions
constructor
Constructor to initialize the contract.
constructor(address _bgt, address _infrared);
Parameters
Name | Type | Description |
---|---|---|
_bgt | address | Address of the BGT token. |
_infrared | address | Address of the Infrared protocol. |
redeemIbgtForBera
Redeems iBGT for BERA.
Caller must approve this contract for iBGT. Checks unboosted BGT availability on Infrared. Burns iBGT, calls Infrared to redeem, and transfers BERA to the caller.
function redeemIbgtForBera(uint256 amount) external;
Parameters
Name | Type | Description |
---|---|---|
amount | uint256 | The amount of iBGT to redeem. |
receive
Fallback to receive BERA from Infrared.
receive() external payable;
Events
IbgtRedeemed
Event emitted when iBGT is redeemed for BERA.
event IbgtRedeemed(address indexed user, uint256 amount);
Parameters
Name | Type | Description |
---|---|---|
user | address | The user who redeemed. |
amount | uint256 | The amount of iBGT redeemed. |
Errors
InvalidAmount
Error thrown for zero amount
error InvalidAmount();
InvalidAddress
Error thrown for invalid address
error InvalidAddress();
InsufficientUnboostedBGT
Error thrown when insufficient unboosted BGT is available for redemption.
error InsufficientUnboostedBGT();