RewardModule
Inherits: ContextUpgradeable, AccessControlDefaultAdminRulesUpgradeable
The supply-side reward accounting portion of the protocol. A lender's balance is measured in two parts: a static balance and a dynamic "supply factor". Their true balance is the product of the two values. The dynamic portion is then able to be used to distribute interest accrued to the lender.
State Variables
ION
RewardModuleStorageLocation
Functions
_getRewardModuleStorage
_initialize
_burn
Parameters
Name | Type | Description |
---|---|---|
|
| to burn tokens from |
|
| to send underlying tokens to |
|
| to burn |
_burnNormalized
Parameters
Name | Type | Description |
---|---|---|
|
| to decrease balance of |
|
| of normalized tokens to burn |
_mint
Parameters
Name | Type | Description |
---|---|---|
|
| to mint tokens to |
|
| address to transfer underlying tokens from |
|
| of reward tokens to mint |
_mintNormalized
Parameters
Name | Type | Description |
---|---|---|
|
| to increase balance of |
|
| of normalized tokens to mint |
_mintToTreasury
This function does not perform any rounding checks.
Parameters
Name | Type | Description |
---|---|---|
|
| of tokens to mint to treasury |
_setSupplyFactor
updateTreasury
Updates the treasury address
Parameters
Name | Type | Description |
---|---|---|
|
| address of new treasury |
underlying
Address of underlying asset
decimals
Decimals of the position asset
balanceOf
Current token balance
Parameters
Name | Type | Description |
---|---|---|
|
| to get balance of |
normalizedBalanceOf
Accounting is done in normalized balances
Parameters
Name | Type | Description |
---|---|---|
|
| to get normalized balance of |
name
Name of the position asset
symbol
Symbol of the position asset
treasury
Current treasury address
totalSupplyUnaccrued
totalSupply
Current total supply
normalizedTotalSupplyUnaccrued
normalizedTotalSupply
Current normalized total supply
supplyFactorUnaccrued
supplyFactor
Current supply factor
calculateRewardAndDebtDistribution
Events
Transfer
Emitted when value
tokens are moved from one account (from
) to another (to
). Note that value
may be zero.
MintToTreasury
TreasuryUpdate
Errors
InvalidBurnAmount
Cannot burn amount whose normalized value is less than zero.
InvalidMintAmount
Cannot mint amount whose normalized value is less than zero.
InvalidUnderlyingAddress
InvalidTreasuryAddress
InvalidSender
Indicates a failure with the token sender
. Used in transfers.
Parameters
Name | Type | Description |
---|---|---|
|
| Address whose tokens are being transferred. |
InvalidReceiver
Indicates a failure with the token receiver
. Used in transfers.
Parameters
Name | Type | Description |
---|---|---|
|
| Address to which tokens are being transferred. |
InsufficientBalance
Indicates an error related to the current balance
of a sender
. Used in transfers.
Parameters
Name | Type | Description |
---|---|---|
|
| Address whose token balance is insufficient. |
|
| Current balance for the interacting account. |
|
| Minimum amount required to perform a transfer. |