Search
⌃K

Legacy DEI (DEPRECATED)

Deployments

0xDE12c7959E1a72bbe8a5f7A1dc8f8EeF9Ab011B3
The contract address remains the same on all chains.
The following codes are for ETH mainnet which you can find here:

State Variables

ERC-20 (Inherited)

AccessControl (Inherited)

DEI Specific

address public oracle
Address of oracle
string public symbol
Symbol of the DEI token
string public name
Name of DEI token
uint8 public constant decimals
Decimals of DEI token
address public creator_address
Creator address of DEI token
address public deus_address
Address of DEUS contract
uint256 public constant genesis_supply
Genesis supply is 10k. This is to help with establishing pools, as they need liquidity
address public reserve_tracker_address
Address of reserve tracker contract
address[] public dei_pools_array
Array of all the DEI pools contract addresses. The addresses in this array are added by the oracle and these contracts are able to mint DEI
mapping(address => bool) public dei_pools
Essentially the same as dei_pools_array , but in mapping form. Useful for gas savings in various functions like pool_mint()
uint256 private constant PRICE_PRECISION
Same as decimals variable but for prices
uint256 public global_collateral_ratio
The current ratio of DEI to collateral, over all DEI pools
uint256 public dei_step
Amount to change the collateralization ratio by upon refreshCollateralRatio
uint256 public refresh_cooldown
Seconds to wait before being able to run refreshCollateralRatio again
bytes32 public constant COLLATERAL_RATIO_PAUSER
A constant used in the pausing of the collateral ratio
bytes32 public constant TRUSTY_ROLE
bytes32 public constant MINTER_ROLE
A constant used in minting DEI token
bool public collateral_ratio_paused
Whether or not the collateral ratio is paused
uint256 public growth_ratio
Indicates the current growth ratio
uint256 public GR_top_band
uint256 public GR_bottom_band
The lower band and upper band in which the Growth Ratio can change without changing Collateral Ratio(e.g. GR Top Band=0.2means that the Growth Ratio can increase up to 20%)
uint256 public DEI_top_band
uint256 public DEI_bottom_band
DEI Bottom Band & DEI Top Band: The lower band and upper band in which the DEI Price can change without changing Collateral Ratio
bool public use_growth_ratio
Checks whether change collateral ratio or not by considering growth ratio
bool public FIP_6
Improvement proposal

View Functions

verify_price(bytes32 sighash, bytes[] calldata sigs)
Requests from oracle to check if signatures are valid or not
dei_info(uint256[] memory collat_usd_price)
Gives information about total supply, global collateral ratio, and global collateral value
globalCollateralValue(uint256[] memory collat_usd_price) public view returns (uint256)
Iterates through all DEI pools and calculate all value of collaterals in all pools globally
getChainID() public view returns (uint256)
Gives the chain Id based on the network which deployed on

Public Function

refreshCollateralRatio(uint deus_price, uint dei_price, uint256 expire_block, bytes[] calldata sigs) external
Decreases or increases the collateral ratio considering the Deus price, DEI price, Deus reserve, DEI total supply

Restricted Functions

useGrowthRatio(bool _use_growth_ratio) external onlyByTrusty
Sets use growth ratio variable
setGrowthRatioBands(uint256 _GR_top_band, uint256 _GR_bottom_band) external onlyByTrusty
Sets top band and bottom band for growth ratio
setPriceBands(uint256 _top_band, uint256 _bottom_band) external onlyByTrusty
Sets top band and bottom band for DEI price
activateFIP6(bool _activate) external onlyByTrusty
Actives the improvement proposal if it gets enough vote
pool_burn_from(address b_address, uint256 b_amount) public onlyPools
Used by pools when user redeems
pool_mint(address m_address, uint256 m_amount) public onlyPoolsOrMinters
This function is what other DEI pools or minters (staking contracts) will call to mint new DEI
addPool(address pool_address) public onlyByTrusty
Adds pool address to dei_pool_array
removePool(address pool_address) public onlyByTrusty
Removes pool address to dei_pool_array
setOracle(address _oracle) public onlyByTrusty
Sets oracle address
setDEIStep(uint256 _new_step) public onlyByTrusty
Sets dei_step
setReserveTracker(address _reserve_tracker_address) external onlyByTrusty
Sets reserve_ tracker_address
setRefreshCooldown(uint256 _new_cooldown) public onlyByTrusty
Sets refresh_cooldown
setDEUSAddress(address _deus_address) public onlyByTrusty
Sets deus_address
toggleCollateralRatio() public onlyCollateralRatioPauser
Toggles collateral_ratio_paused

Events

DEIBurned(address indexed from, address indexed to, uint256 amount)
Emitted when DEI is burned, usually from a redemption by the pool
DEIMinted(address indexed from, address indexed to, uint256 amount)
Emitted when DEI is minted
CollateralRatioRefreshed(uint256 global_collateral_ratio)
Emitted when collateral ratio is updated
PoolAdded(address pool_address)
Emitted when a new pool is added to dei_pool_array
PoolRemoved(address pool_address)
Emitted when a pool is removed from dei_pool_array
DEIStepSet(uint256 new_step)
Emitted when dei_step is changed
RefreshCooldownSet(uint256 new_cooldown)
Emitted when refresh_cooldown is changed
DEUSAddressSet(address deus_address)
Emitted when deus_address is set
PriceBandSet(uint256 top_band, uint256 bottom_band)
Emitted when top_band or bottom_band is changed
CollateralRatioToggled(bool collateral_ratio_paused)
Emitted when collateral_ratio_paused is toggled
OracleSet(address oracle)
Emitted when oracle is changed
ReserveTrackerSet(address reserve_tracker_address)
Emitted when reserve_tracker_address is set
UseGrowthRatioSet( bool use_growth_ratio)
Emitted when use_growth_ratio is set
FIP_6Set(bool activate)
Emitted when corresponding improvement proposal is activated
GrowthRatioBandSet(uint256 GR_top_band, uint256 GR_bottom_band)
Emitted when GR_top_band or GR_bottom_band is changed

Modifiers

onlyCollateralRatioPauser()
Restricts actions to the designated collateral ratio pauser.
onlyPoolsOrMinters()
Restricts actions to pool contracts or minters e.g. minting a new DEI.
onlyPools()
Restricts actions to pool contracts, e.g. redeemin DEI.
onlyByTrusty()
Restricts actions to the trusty wallet, e.g. adding or removing new pools, setting the oracle