Redeemer.sol

This document describes the functions, attributes and modifiers in Redeemer.sol

Redeemer

Git Source

Author: Sourabh Marathe, Julian Traversa, Rob Robbins

The Redeemer contract is used to redeem the underlying lent capital of a loan.

Users may redeem their ERC-5095 tokens for the underlying asset represented by that token after maturity.

State Variables

HOLD

minimum wait before the admin may withdraw funds or change the fee rate

uint256 public constant HOLD = 3 days;

admin

address that is allowed to set fees and contracts, etc. It is commonly used in the authorized modifier.

address public admin;

marketPlace

address of the MarketPlace contract, used to access the markets mapping

address public marketPlace;

lender

address that custodies principal tokens for all markets

address public lender;

converter

address that converts compounding tokens to their underlying

address public converter;

swivelAddr

third party contract needed to redeem Swivel PTs

address public immutable swivelAddr;

tempusAddr

third party contract needed to redeem Tempus PTs

address public immutable tempusAddr;

feenominator

this value determines the amount of fees paid on auto redemptions

uint256 public feenominator;

feeChange

represents a point in time where the feenominator may change

uint256 public feeChange;

MIN_FEENOMINATOR

represents a minimum that the feenominator must exceed

uint256 public MIN_FEENOMINATOR = 500;

holdings

mapping that indicates how much underlying has been redeemed by a market

mapping(address => mapping(uint256 => uint256)) public holdings;

paused

mapping that determines if a market's iPT can be redeemed

mapping(address => mapping(uint256 => bool)) public paused;

Functions

authorized

ensures that only a certain address can call the function

modifier authorized(address a);

Parameters

unpaused

reverts on all markets where the paused mapping returns true

modifier unpaused(address u, uint256 m);

Parameters

constructor

Initializes the Redeemer contract

constructor(address l, address s, address t);

Parameters

setAdmin

sets the admin address

function setAdmin(address a) external authorized(admin) returns (bool);

Parameters

Returns

setMarketPlace

sets the address of the marketplace contract which contains the addresses of all the fixed rate markets

function setMarketPlace(address m) external authorized(admin) returns (bool);

Parameters

Returns

setConverter

sets the converter address

function setConverter(address c, address[] memory i) external authorized(admin) returns (bool);

Parameters

Returns

setLender

sets the address of the lender contract which contains the addresses of all the fixed rate markets

function setLender(address l) external authorized(admin) returns (bool);

Parameters

Returns

setFee

sets the feenominator to the given value

function setFee(uint256 f) external authorized(admin) returns (bool);

Parameters

Returns

scheduleFeeChange

allows the admin to schedule a change to the fee denominators

function scheduleFeeChange() external authorized(admin) returns (bool);

pauseRedemptions

allows admin to stop redemptions of Illuminate PTs for a given market

function pauseRedemptions(address u, uint256 m, bool b) external authorized(admin);

Parameters

approve

approves the converter to spend the compounding asset

function approve(address i) external authorized(marketPlace);

Parameters

redeem

redeem method for Yield, Element, Pendle, APWine, Tempus and Notional protocols

function redeem(uint8 p, address u, uint256 m) external unpaused(u, m) returns (bool);

Parameters

Returns

redeem

redeem method signature for Swivel

function redeem(uint8 p, address u, uint256 m, uint8 protocol) external unpaused(u, m) returns (bool);

Parameters

Returns

redeem

redeem method signature for Sense

function redeem(uint8 p, address u, uint256 m, uint256 s, uint256 a, address periphery)
    external
    unpaused(u, m)
    returns (bool);

Parameters

Returns

redeem

burns Illuminate principal tokens and sends underlying to user

function redeem(address u, uint256 m) external unpaused(u, m);

Parameters

authRedeem

implements the redeem method for the contract to fulfill the ERC-5095 interface

function authRedeem(address u, uint256 m, address f, address t, uint256 a)
    external
    authorized(IMarketPlace(marketPlace).markets(u, m, 0))
    unpaused(u, m)
    returns (uint256);

Parameters

Returns

autoRedeem

implements a redeem method to enable third-party redemptions

expects approvals from owners to redeemer

function autoRedeem(address u, uint256 m, address[] calldata f) external unpaused(u, m) returns (uint256);

Parameters

Returns

depositHoldings

Allows for external deposit of underlying for a market

This is to be used in emergency situations where the redeem method is not functioning for a market

function depositHoldings(address u, uint256 m, uint256 a) external;

Parameters

apwineWithdraw

Execute the business logic for conducting an APWine redemption

function apwineWithdraw(address p, address u, uint256 a) internal;

Events

Redeem

emitted upon redemption of a loan

event Redeem(
    uint8 principal,
    address indexed underlying,
    uint256 indexed maturity,
    uint256 amount,
    uint256 burned,
    address sender
);

SetAdmin

emitted upon changing the admin

event SetAdmin(address indexed admin);

SetConverter

emitted upon changing the converter

event SetConverter(address indexed converter);

SetFee

emitted upon setting the fee rate

event SetFee(uint256 indexed fee);

ScheduleFeeChange

emitted upon scheduling a fee change

event ScheduleFeeChange(uint256 when);

PauseRedemptions

emitted upon pausing of Illuminate PTs

event PauseRedemptions(address indexed underlying, uint256 maturity, bool state);

Last updated