Redeemer.sol
This document describes the functions, attributes and modifiers in Redeemer.sol
Redeemer
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
admin
address that is allowed to set fees and contracts, etc. It is commonly used in the authorized modifier.
marketPlace
address of the MarketPlace contract, used to access the markets mapping
lender
address that custodies principal tokens for all markets
converter
address that converts compounding tokens to their underlying
swivelAddr
third party contract needed to redeem Swivel PTs
tempusAddr
third party contract needed to redeem Tempus PTs
feenominator
this value determines the amount of fees paid on auto redemptions
feeChange
represents a point in time where the feenominator may change
MIN_FEENOMINATOR
represents a minimum that the feenominator must exceed
holdings
mapping that indicates how much underlying has been redeemed by a market
paused
mapping that determines if a market's iPT can be redeemed
Functions
authorized
ensures that only a certain address can call the function
Parameters
Name | Type | Description |
---|---|---|
|
| address that msg.sender must be to be authorized |
unpaused
reverts on all markets where the paused mapping returns true
Parameters
Name | Type | Description |
---|---|---|
|
| address of an underlying asset |
|
| maturity (timestamp) of the market |
constructor
Initializes the Redeemer contract
Parameters
Name | Type | Description |
---|---|---|
|
| the lender contract |
|
| the Swivel contract |
|
| the Tempus contract |
setAdmin
sets the admin address
Parameters
Name | Type | Description |
---|---|---|
|
| Address of a new admin |
Returns
Name | Type | Description |
---|---|---|
|
| bool true if successful |
setMarketPlace
sets the address of the marketplace contract which contains the addresses of all the fixed rate markets
Parameters
Name | Type | Description |
---|---|---|
|
| the address of the marketplace contract |
Returns
Name | Type | Description |
---|---|---|
|
| bool true if the address was set |
setConverter
sets the converter address
Parameters
Name | Type | Description |
---|---|---|
|
| address of the new converter |
|
| a list of interest bearing tokens the redeemer will approve |
Returns
Name | Type | Description |
---|---|---|
|
| bool true if successful |
setLender
sets the address of the lender contract which contains the addresses of all the fixed rate markets
Parameters
Name | Type | Description |
---|---|---|
|
| the address of the lender contract |
Returns
Name | Type | Description |
---|---|---|
|
| bool true if the address was set |
setFee
sets the feenominator to the given value
Parameters
Name | Type | Description |
---|---|---|
|
| the new value of the feenominator, fees are not collected when the feenominator is 0 |
Returns
Name | Type | Description |
---|---|---|
|
| bool true if successful |
scheduleFeeChange
allows the admin to schedule a change to the fee denominators
pauseRedemptions
allows admin to stop redemptions of Illuminate PTs for a given market
Parameters
Name | Type | Description |
---|---|---|
|
| address of an underlying asset |
|
| maturity (timestamp) of the market |
|
| true to pause, false to unpause |
approve
approves the converter to spend the compounding asset
Parameters
Name | Type | Description |
---|---|---|
|
| an interest bearing token that must be approved for conversion |
redeem
redeem method for Yield, Element, Pendle, APWine, Tempus and Notional protocols
Parameters
Name | Type | Description |
---|---|---|
|
| principal value according to the MarketPlace's Principals Enum |
|
| address of an underlying asset |
|
| maturity (timestamp) of the market |
Returns
Name | Type | Description |
---|---|---|
|
| bool true if the redemption was successful |
redeem
redeem method signature for Swivel
Parameters
Name | Type | Description |
---|---|---|
|
| principal value according to the MarketPlace's Principals Enum |
|
| address of an underlying asset |
|
| maturity (timestamp) of the market |
|
|
Returns
Name | Type | Description |
---|---|---|
|
| bool true if the redemption was successful |
redeem
redeem method signature for Sense
Parameters
Name | Type | Description |
---|---|---|
|
| principal value according to the MarketPlace's Principals Enum |
|
| address of an underlying asset |
|
| maturity (timestamp) of the market |
|
| Sense's maturity is needed to extract the pt address |
|
| Sense's adapter index |
|
| Sense's periphery contract, used to get the verified adapter |
Returns
Name | Type | Description |
---|---|---|
|
| bool true if the redemption was successful |
redeem
burns Illuminate principal tokens and sends underlying to user
Parameters
Name | Type | Description |
---|---|---|
|
| address of an underlying asset |
|
| maturity (timestamp) of the market |
authRedeem
implements the redeem method for the contract to fulfill the ERC-5095 interface
Parameters
Name | Type | Description |
---|---|---|
|
| address of an underlying asset |
|
| maturity (timestamp) of the market |
|
| address from where the underlying asset will be burned |
|
| address to where the underlying asset will be transferred |
|
| amount of the Illuminate PT to be burned and redeemed |
Returns
Name | Type | Description |
---|---|---|
|
| uint256 amount of the underlying asset that was burned |
autoRedeem
implements a redeem method to enable third-party redemptions
expects approvals from owners to redeemer
Parameters
Name | Type | Description |
---|---|---|
|
| address of the underlying asset |
|
| maturity of the market |
|
| address from where the principal token will be burned |
Returns
Name | Type | Description |
---|---|---|
|
| uint256 amount of underlying yielded as a fee |
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
Parameters
Name | Type | Description |
---|---|---|
|
| address of the underlying asset |
|
| maturity of the market |
|
| amount of underlying to be deposited |
apwineWithdraw
Execute the business logic for conducting an APWine redemption
Events
Redeem
emitted upon redemption of a loan
SetAdmin
emitted upon changing the admin
SetConverter
emitted upon changing the converter
SetFee
emitted upon setting the fee rate
ScheduleFeeChange
emitted upon scheduling a fee change
PauseRedemptions
emitted upon pausing of Illuminate PTs
Last updated