Frax (FRAX)
Modified ERC-20 Contract representing the FRAX stablecoin.
Deployments
Chain | Address |
---|---|
Arbitrum | 0x17FC002b466eEc40DaE837Fc4bE5c67993ddBd6F |
Aurora | 0xE4B9e004389d91e4134a28F19BD833cBA1d994B6 |
Avalanche | 0xD24C2Ad096400B6FBcd2ad8B24E7acBc21A1da64 |
Base (LayerZero) | 0x909DBdE1eBE906Af95660033e478D59EFe831fED |
Blast (LayerZero) | 0x909DBdE1eBE906Af95660033e478D59EFe831fED |
Boba | 0x7562F525106F5d54E891e005867Bf489B5988CD9 |
BSC | 0x90C97F71E18723b0Cf0dfa30ee176Ab653E89F40 |
Ethereum (native) | 0x853d955aCEf822Db058eb8505911ED77F175b99e |
Ethereum (LayerZero) | 0x909DBdE1eBE906Af95660033e478D59EFe831fED |
Evmos | 0xE03494D0033687543a80c9B1ca7D6237F2EA8BD8 |
Fantom | 0xdc301622e621166BD8E82f2cA0A26c13Ad0BE355 |
Fraxtal (Native) | 0xFc00000000000000000000000000000000000001 |
Fraxtal (LayerZero) | 0x80eede496655fb9047dd39d9f418d5483ed600df |
Harmony | 0xFa7191D292d5633f702B0bd7E3E3BcCC0e633200 |
Metis (LayerZero) | 0x909DBdE1eBE906Af95660033e478D59EFe831fED |
Mode (LayerZero) | 0x80eede496655fb9047dd39d9f418d5483ed600df |
Moonbeam | 0x322E86852e492a7Ee17f28a78c663da38FB33bfb |
Moonriver | 0x1A93B23281CC1CDE4C4741353F3064709A16197d |
Optimism | 0x2E3D870790dC77A83DD1d18184Acc7439A53f475 |
Polygon | 0x45c32fA6DF82ead1e2EF74d17b76547EDdFaFF89 |
Sei (LayerZero) | 0x80eede496655fb9047dd39d9f418d5483ed600df |
Solana | FR87nWEUxVgerFGhZM8Y4AggKGLnaXswr1Pd8wZ4kZcp |
X-Layer (LayerZero) | 0x80eede496655fb9047dd39d9f418d5483ed600df |
State Variables
ERC-20 (Inherited)
https://docs.openzeppelin.com/contracts/2.x/api/token/erc20#ERC20
AccessControl (Inherited)
https://docs.openzeppelin.com/contracts/3.x/api/access#AccessControl NOTE: FRAX & FXS contracts have no pause or blacklist controls in any way (including system contracts).
FRAX-Specific
An enum declaring FRAX and FXS. Used with oracles.
Instance for the Chainlink ETH / USD trading. Combined with FRAX / WETH, FXS / WETH, collateral / FRAX, and collateral / FXS trading pairs, can be used to calculate FRAX/FXS/Collateral prices in USD.
Decimals for the Chainlink ETH / USD trading pair price.
Instance for the FRAX / WETH Uniswap pair price oracle.
Instance for the FXS / WETH Uniswap pair price oracle.
Array of owner address, who have privileged actions.
Address of the governance contract.
Address of the contract creator.
Address of the timelock contract.
Address of the FXS contract
Address for the fraxEthOracle
.
Address for the fxsEthOracle
.
Address for the canonical wrapped-Ethereum (WETH) contract. Should be 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
for the mainnet.
Address for the ChainlinkETHUSDPriceConsumer
.
Genesis supply of FRAX. Should be a small nonzero amount. Most of the FRAX supply will come from minting, but a small amount is needed initially to prevent divide-by-zero errors in various functions.
Array of all the FraxPool
contract addresses.
Essentially the same as frax_pools_array
, but in mapping form. Useful for gas savings in various functions like globalCollateralValue()
.
The current ratio of FRAX to collateral, over all FraxPool
s.
The fee for redeeming FRAX for FXS and/or collateral. Also the fee for buying back excess collateral with FXS. See the FraxPool
contract for usage.
The fee for minting FRAX from FXS and/or collateral. See the FraxPool
contract for usage.
Set in the constructor. Used in AccessControl
.
A constant used in the pausing of the collateral ratio.
Whether or not the collateral ratio is paused.
View Functions
oracle_price
Get the FRAX or FXS price, in USD.
frax_price
Returns the price for FRAX from the FRAX-ETH Chainlink price oracle.
fxs_price
Returns the price for FXS from the FXS-ETH Chainlink price oracle.
frax_info
Returns some commonly-used state variables and computed values. This is needed to avoid costly repeat calls to different getter functions. It is cheaper gas-wise to just dump everything and only use some of the info.
globalCollateralValue
Iterate through all FRAX pools and calculate all value of collateral in all pools globally. This uses the oracle price of each collateral.
Public Functions
refreshCollateralRatio
This function checks the price of FRAX and refreshes the collateral ratio if the price is not $1. If the price is above $1, then the ratio is lowered by .5%. If the price is below $1, then the ratio is increased by .5%. Anyone can poke this function to change the ratio. This function can only be called once every hour.
Restricted Functions
mint
Public implementation of internal _mint().
pool_burn_from
Used by pools when user redeems.
pool_mint
This function is what other frax pools will call to mint new FRAX.
addPool
Adds collateral addresses supported, such as tether and busd, must be ERC20.
removePool
Remove a pool.
setOwner
Sets the admin of the contract
setFraxStep
Sets the amount that the collateral ratio will change by upon an execution of refreshCollateralRatio(),
setPriceTarget
Set the price target to be used for refreshCollateralRatio() (does not affect minting/redeeming).
setRefreshCooldown
Set refresh cooldown for refreshCollateralRatio().
setRedemptionFee
Set the redemption fee.
setMintingFee
Set the minting fee.
setFXSAddress
Set the FXS address.
setETHUSDOracle
Set the ETH / USD oracle address.
setFRAXEthOracle
Sets the FRAX / ETH Uniswap oracle address
setFXSEthOracle
Sets the FXS / ETH Uniswap oracle address
toggleCollateralRatio
Toggle pausing / unpausing the collateral ratio.
Events
FRAXBurned
Emitted when FRAX is burned, usually from a redemption by the pool.
Modifiers
onlyCollateralRatioPauser
Restrict actions to the designated collateral ratio pauser.
onlyPools
Restrict actions to pool contracts, e.g. minting new FRAX.
onlyByGovernance
Restrict actions to the governance contract, e.g. setting the minting and redemption fees, as well as the oracle and pool addresses.
onlyByOwnerOrGovernance
Restrict actions to the governance contract or owner account(s), e.g. setting the minting and redemption fees, as well as the oracle and pool addresses.
Last updated