_minOutputQuantity
is used to limit slippage when swapping, minting or redeeming. Useful for preventing Sandwich and Frontrunning attacks.decreaseAllowance
and increaseAllowance
functions have been added to mitigate the well-known issues around setting allowances. These are based on the OpenZeppelin ERC20 implementation.function totalSupply () external returns (uint256)
function balanceOf () external returns (uint256)
account
.function transfer () external returns (bool)
amount
tokens from the caller's account to recipient
.function allowance () external returns (uint256)
spender
will be allowed to spend on behalf ofowner
through {transferFrom}. This is zero by default.function approve () external returns (bool)
amount
as the allowance of spender
over the caller's tokens.function transferFrom () external returns (bool)
amount
tokens from sender
to recipient
using the allowance mechanism. amount
is then deducted from the caller's allowance.function increaseAllowance () public returns (bool)
spender
by the caller.spender
cannot be the zero address.function decreaseAllowance () public returns (bool)
spender
by the caller.spender
cannot be the zero address.spender
must have allowance for the caller of at leastsubtractedValue
.function mint (address _input, uint256 _inputQuantity, uint256 _minOutputQuantity, address _recipient) external returns (uint256 mintOutput)
_input
_inputQuantity
_minOutputQuantity
_recipient
function mintMulti (address[] _inputs, uint256[] _inputQuantities, uint256 _minOutputQuantity, address _recipient) external returns (uint256 mintOutput)
_inputs
_inputQuantities
_minOutputQuantity
_recipient
function getMintOutput (address _input, uint256 _inputQuantity) external returns (uint256 mintOutput)
_input
_inputQuantity
function getMintMultiOutput (address[] _inputs, uint256[] _inputQuantities) external returns (uint256 mintOutput)
_inputs
_inputQuantities
function swap (address _input, address _output, uint256 _inputQuantity, uint256 _minOutputQuantity, address _recipient) external returns (uint256 swapOutput)
_input
_output
_inputQuantity
_minOutputQuantity
_recipient
function getSwapOutput (address _input, address _output, uint256 _inputQuantity) external returns (uint256 swapOutput)
_input
_output
_inputQuantity
function redeem (address _output, uint256 _mAssetQuantity, uint256 _minOutputQuantity, address _recipient) external returns (uint256 outputQuantity)
_output
_mAssetQuantity
_minOutputQuantity
_recipient
function redeemMasset (uint256 _mAssetQuantity, uint256[] _minOutputQuantities, address _recipient) external returns (uint256[] outputQuantities)
_mAssetQuantity
_minOutputQuantities
_recipient
function redeemExactBassets (address[] _outputs, uint256[] _outputQuantities, uint256 _maxMassetQuantity, address _recipient) external returns (uint256 mAssetQuantity)
_outputs
_outputQuantities
_maxMassetQuantity
_recipient
function getRedeemOutput (address _output, uint256 _mAssetQuantity) external returns (uint256 bAssetOutput)
_output
_mAssetQuantity
function getRedeemExactBassetsOutput (address[] _outputs, uint256[] _outputQuantities) external returns (uint256 mAssetQuantity)
_outputs
_outputQuantities
function getBasket () external returns (bool, bool)
Masset_MassetStructs.Basket
function getBassets () external returns (struct BassetPersonal[] personal, struct BassetData[] bData)
function getBasset (address _bAsset) external returns (struct BassetPersonal personal, struct BassetData bData)
_bAsset
function getConfig () external returns (struct InvariantConfig config)
function getPrice () external returns (uint256 price, uint256 k)