IStakedIR
Inherits: IERC4626
Title: IStakedIR
Interface for the StakedIR ERC4626 vault
Extends ERC4626 with compounding functionality
Functions
compound
Compound rewards (convert non-IR rewards via auction, then deposit)
Only callable by authorized compounder
Increases share value for all sIR holders
function compound(uint256 amount) external;
Parameters
| Name | Type | Description |
|---|---|---|
amount | uint256 | Amount of IR tokens to compound |
setCompounder
Update compounder address
Only callable by Infrared protocol
function setCompounder(address _newCompounder) external;
Parameters
| Name | Type | Description |
|---|---|---|
_newCompounder | address | The new compounder address |
setMinLockupPeriod
Update minimum lockup period
Only callable by Infrared protocol
function setMinLockupPeriod(uint256 _newPeriod) external;
Parameters
| Name | Type | Description |
|---|---|---|
_newPeriod | uint256 | The new minimum lockup period in seconds |
compounder
Get the current compounder address
function compounder() external view returns (address);
Returns
| Name | Type | Description |
|---|---|---|
<none> | address | The address authorized to compound rewards |
totalCompounded
Get total rewards compounded since inception
function totalCompounded() external view returns (uint256);
Returns
| Name | Type | Description |
|---|---|---|
<none> | uint256 | Total IR tokens compounded |
infrared
Get Infrared protocol address
function infrared() external view returns (address);
Returns
| Name | Type | Description |
|---|---|---|
<none> | address | The Infrared protocol address |
minLockupPeriod
Get minimum lockup period
function minLockupPeriod() external view returns (uint256);
Returns
| Name | Type | Description |
|---|---|---|
<none> | uint256 | The minimum lockup period in seconds |
depositTimestamp
Get deposit timestamp for a user
function depositTimestamp(address user) external view returns (uint256);
Parameters
| Name | Type | Description |
|---|---|---|
user | address | The user address |
Returns
| Name | Type | Description |
|---|---|---|
<none> | uint256 | The timestamp when the user last deposited |
lockupRemaining
Get time remaining in lockup period for a user
function lockupRemaining(address user) external view returns (uint256);
Parameters
| Name | Type | Description |
|---|---|---|
user | address | The user address |
Returns
| Name | Type | Description |
|---|---|---|
<none> | uint256 | Seconds remaining (0 if lockup has expired) |
Events
Compounded
Emitted when rewards are compounded
event Compounded(
address indexed compounder, uint256 amount, uint256 newTotalAssets
);
Parameters
| Name | Type | Description |
|---|---|---|
compounder | address | Address that initiated the compound |
amount | uint256 | Amount of IR tokens compounded |
newTotalAssets | uint256 | New total assets after compounding |
CompounderUpdated
Emitted when the compounder address is updated
event CompounderUpdated(
address indexed oldCompounder, address indexed newCompounder
);
Parameters
| Name | Type | Description |
|---|---|---|
oldCompounder | address | Previous compounder address |
newCompounder | address | New compounder address |
MinLockupPeriodUpdated
Emitted when minimum lockup period is updated
event MinLockupPeriodUpdated(uint256 oldPeriod, uint256 newPeriod);
Parameters
| Name | Type | Description |
|---|---|---|
oldPeriod | uint256 | Previous lockup period |
newPeriod | uint256 | New lockup period |
Errors
Unauthorized
Thrown when caller is not authorized
error Unauthorized();
ZeroAddress
Thrown when zero address is provided
error ZeroAddress();
ZeroAmount
Thrown when zero amount is provided
error ZeroAmount();
LockupPeriodActive
Thrown when attempting to withdraw during lockup period
error LockupPeriodActive();