Fixed Inflation Manager
FixedInflationManager
Coming soon
Coming soon
IFixedInflationManager
, LazyInitCapableElement
The Fixed Inflation Manager is a component that allows an organization (of the root or governance layer) to interact with a Covenants Routine contract.
Linked to an organization, it replaces the organization's standard Fixed Inflation Extension.
It allows the organization to:
Send tokens from the organization's Treasury Manager to Routine contracts, in order to execute preset operations.
Add / modify Fixed Inflation operations in a Routine contract, by calling the
setEntry
function.Perform management operations on Routine contracts, such as their activation and deactivation.
This Fixed Inflation Manager supports ERC20s and Items (using the Item Interoperable Interface).
A note about this component
This Component allows you to perform standard and straightforward interactions with Routines contracts.
For example, it does not allow to mint the Organization's Item governance token. Consequently, it is necessary to develop one's own Inflation Manager Component to execute custom and more complex logic.
Here you can see the Inflation Manager used by EthereansOs Organization, which has the rights to mint $OS via the token minter and allows the daily minting of $OS used according to the tokenomics defined here.
Fixed Inflation Manager Initialization
The Fixed Inflation Manager must be initialized by a Routines contract; specifically, in the Routines contract's init
function:
The address of the Fixed Inflation Manager contract must be passed as
address_extension
The initialization data must be passed as
bytes extensionPayload
The other initialization data of the Routines contract--such as the Entry and any operations to created directly at initialization-- are explained here.
As a LazyInitCapableElement
, the Fixed Inflation Manager's initialization data must follow this pattern. In particular, the host must be the address of the Organization to which the Manager will be linked as an active component.
Following the creation of the Routines contract, and the initialization of the Manager, the organization must, through a proposal, link the Manager to itself as an active component.
Routines Contract Interaction
The Fixed Inflation Manager provides the following functions with the Routines contract.
receiveTokens
This function, which can be called only by the Routines contract itself, is used to send token(s) amount(s) from the organization's Treasury to the Routines contract when an attempt is made to execute a Routines operation (to learn more, see here).
In the scenario where the amountsToMint
parameter is passed, the function will attempt to mint the token(s) (tokenAddresses
) amount(s) (transferAmounts
) and transfer them to the Routines contract using the _mintAndTransferFunction
(see below).
burnToken
This function, which can be called only by the Routines contract itself, is used to perform a burn operation on an ERC20 token, by using the _burn
function (see below).
setEntry
This function, which can be called by all authorized components linked to the organization, is used to add new routine operations, as well as modify existing ones. More info about this can be found here.
flushBack
This function, which can be called by all authorized components linked to the organization, is used to send back token(s) amount(s) from the Routine contract to the Organization's Treasury Manager. This allows the Organization to take over the liquidity in the contract.
setActive
This function, which can be called by all authorized components linked to the organization, is used to activate the Fixed Inflation Manager. A routine contract can only work if its extension (in this case is the Fixed Inflation Manager) is active.
deactivationByFailure
This function, which can be called only by the Routines contract itself, is used to deactivate the Fixed Inflation Manager. The extension (which in this case is the Fixed Inflation Manager, it having replaced the default Fixed Inflation Extension), is deactivated when an operation fails as a result of not having enough tokens to be carried out. Once deactivated, it must be manually activated using the setActive
function.
_mintAndTransferFunction
This function is used to mint the amount required by the receiveTokens
function.
Of course, to be able to mint the tokens the organization must have the right to do so.
The function uses the standard ERC20 mint function, so you can't mint an Item.
However, this _mintAndTransfer
function is virtual; a custom Fixed Inflation Manager can override it when implementing the contract in order to mint the token using a different function.
For example, it can be customized so that you can directly mint your Item governance token.
_burn
This function is used to burn the amount required by the burnToken
function.
It uses the standard ERC20 burn
function.
However, this _burn
is virtual; a custom Fixed Inflation Manager can override it when implementing the contract in order to burn the token using a different function.
For example, it can be customized so that you can directly burn your Item governance token.
Last updated