Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

IStakedIR

Git Source

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

NameTypeDescription
amountuint256Amount of IR tokens to compound

setCompounder

Update compounder address

Only callable by Infrared protocol

function setCompounder(address _newCompounder) external;

Parameters

NameTypeDescription
_newCompounderaddressThe new compounder address

setMinLockupPeriod

Update minimum lockup period

Only callable by Infrared protocol

function setMinLockupPeriod(uint256 _newPeriod) external;

Parameters

NameTypeDescription
_newPerioduint256The new minimum lockup period in seconds

compounder

Get the current compounder address

function compounder() external view returns (address);

Returns

NameTypeDescription
<none>addressThe address authorized to compound rewards

totalCompounded

Get total rewards compounded since inception

function totalCompounded() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256Total IR tokens compounded

infrared

Get Infrared protocol address

function infrared() external view returns (address);

Returns

NameTypeDescription
<none>addressThe Infrared protocol address

minLockupPeriod

Get minimum lockup period

function minLockupPeriod() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256The minimum lockup period in seconds

depositTimestamp

Get deposit timestamp for a user

function depositTimestamp(address user) external view returns (uint256);

Parameters

NameTypeDescription
useraddressThe user address

Returns

NameTypeDescription
<none>uint256The 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

NameTypeDescription
useraddressThe user address

Returns

NameTypeDescription
<none>uint256Seconds remaining (0 if lockup has expired)

Events

Compounded

Emitted when rewards are compounded

event Compounded(
    address indexed compounder, uint256 amount, uint256 newTotalAssets
);

Parameters

NameTypeDescription
compounderaddressAddress that initiated the compound
amountuint256Amount of IR tokens compounded
newTotalAssetsuint256New total assets after compounding

CompounderUpdated

Emitted when the compounder address is updated

event CompounderUpdated(
    address indexed oldCompounder, address indexed newCompounder
);

Parameters

NameTypeDescription
oldCompounderaddressPrevious compounder address
newCompounderaddressNew compounder address

MinLockupPeriodUpdated

Emitted when minimum lockup period is updated

event MinLockupPeriodUpdated(uint256 oldPeriod, uint256 newPeriod);

Parameters

NameTypeDescription
oldPerioduint256Previous lockup period
newPerioduint256New 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();