Skip to main content

ReserveStabilizer

Functions

constructor

function constructor(
address _core,
address _oracle,
address _backupOracle,
contract IERC20 _token,
uint256 _usdPerFeiBasisPoints
) public

ERC20 Reserve Stabilizer constructor

Parameters

NameTypeDescription
_coreaddressFei Core to reference
_oracleaddressthe price oracle to reference
_backupOracleaddressthe backup oracle to reference
_tokencontract IERC20the ERC20 token for this stabilizer, 0x0 if TRIBE or ETH
_usdPerFeiBasisPointsuint256the USD price per FEI to sell tokens at

exchangeFei

function exchangeFei(
uint256 feiAmount
) public returns (uint256 amountOut)

exchange FEI for tokens from the reserves

Parameters

NameTypeDescription
feiAmountuint256of FEI to sell

getAmountOut

function getAmountOut(
uint256 amountFeiIn
) public returns (uint256)

returns the amount out of tokens from the reserves for a given amount of FEI

Parameters

NameTypeDescription
amountFeiInuint256the amount of FEI in

withdraw

function withdraw(
address to,
uint256 amountOut
) external

withdraw tokens from the reserves

Parameters

NameTypeDescription
toaddressaddress to send tokens
amountOutuint256amount of tokens to send

deposit

function deposit() external

new PCV deposited to the stabilizer

no-op because the token transfer already happened

balance

function balance() public returns (uint256)

returns the amount of the held ERC-20

balanceReportedIn

function balanceReportedIn() public returns (address)

display the related token of the balance reported

setUsdPerFeiRate

function setUsdPerFeiRate(
uint256 newUsdPerFeiBasisPoints
) external

sets the USD per FEI exchange rate rate

Parameters

NameTypeDescription
newUsdPerFeiBasisPointsuint256the USD per FEI exchange rate denominated in basis points (1/10000)

_transfer

function _transfer(
address to,
uint256 amount
) internal

Parameters

NameTypeDescription
toaddress
amountuint256