2022-03-22 16:17:41 +00:00
|
|
|
//SPDX-License-Identifier: MIT
|
2021-12-29 10:37:38 +00:00
|
|
|
pragma solidity ^0.7.6;
|
|
|
|
|
|
|
|
interface IMasset {
|
|
|
|
// Mint
|
|
|
|
function mint(
|
|
|
|
address _input,
|
|
|
|
uint256 _inputQuantity,
|
|
|
|
uint256 _minOutputQuantity,
|
|
|
|
address _recipient
|
|
|
|
) external returns (uint256 mintOutput);
|
|
|
|
|
|
|
|
function mintMulti(
|
|
|
|
address[] calldata _inputs,
|
|
|
|
uint256[] calldata _inputQuantities,
|
|
|
|
uint256 _minOutputQuantity,
|
|
|
|
address _recipient
|
|
|
|
) external returns (uint256 mintOutput);
|
|
|
|
|
|
|
|
function getMintOutput(address _input, uint256 _inputQuantity)
|
|
|
|
external
|
|
|
|
view
|
|
|
|
returns (uint256 mintOutput);
|
|
|
|
|
|
|
|
function getMintMultiOutput(
|
|
|
|
address[] calldata _inputs,
|
|
|
|
uint256[] calldata _inputQuantities
|
|
|
|
) external view returns (uint256 mintOutput);
|
|
|
|
|
|
|
|
// Swaps
|
|
|
|
function swap(
|
|
|
|
address _input,
|
|
|
|
address _output,
|
|
|
|
uint256 _inputQuantity,
|
|
|
|
uint256 _minOutputQuantity,
|
|
|
|
address _recipient
|
|
|
|
) external returns (uint256 swapOutput);
|
|
|
|
|
|
|
|
function getSwapOutput(
|
|
|
|
address _input,
|
|
|
|
address _output,
|
|
|
|
uint256 _inputQuantity
|
|
|
|
) external view returns (uint256 swapOutput);
|
|
|
|
|
|
|
|
// Redemption
|
|
|
|
function redeem(
|
|
|
|
address _output,
|
|
|
|
uint256 _mAssetQuantity,
|
|
|
|
uint256 _minOutputQuantity,
|
|
|
|
address _recipient
|
|
|
|
) external returns (uint256 outputQuantity);
|
|
|
|
|
|
|
|
function redeemMasset(
|
|
|
|
uint256 _mAssetQuantity,
|
|
|
|
uint256[] calldata _minOutputQuantities,
|
|
|
|
address _recipient
|
|
|
|
) external returns (uint256[] memory outputQuantities);
|
|
|
|
|
|
|
|
function redeemExactBassets(
|
|
|
|
address[] calldata _outputs,
|
|
|
|
uint256[] calldata _outputQuantities,
|
|
|
|
uint256 _maxMassetQuantity,
|
|
|
|
address _recipient
|
|
|
|
) external returns (uint256 mAssetRedeemed);
|
|
|
|
|
|
|
|
function getRedeemOutput(address _output, uint256 _mAssetQuantity)
|
|
|
|
external
|
|
|
|
view
|
|
|
|
returns (uint256 bAssetOutput);
|
|
|
|
|
|
|
|
function getRedeemExactBassetsOutput(
|
|
|
|
address[] calldata _outputs,
|
|
|
|
uint256[] calldata _outputQuantities
|
|
|
|
) external view returns (uint256 mAssetAmount);
|
|
|
|
|
|
|
|
// Views
|
|
|
|
// This return an index, could be used to check if it's part of the basket
|
|
|
|
function bAssetIndexes(address) external view returns (uint8);
|
|
|
|
|
|
|
|
function getPrice() external view returns (uint256 price, uint256 k);
|
|
|
|
}
|
|
|
|
|
|
|
|
interface ISavingsContractV2 {
|
|
|
|
function depositInterest(uint256 _amount) external; // V1 & V2
|
|
|
|
|
|
|
|
function depositSavings(uint256 _amount)
|
|
|
|
external
|
|
|
|
returns (uint256 creditsIssued); // V1 & V2
|
|
|
|
|
|
|
|
function depositSavings(uint256 _amount, address _beneficiary)
|
|
|
|
external
|
|
|
|
returns (uint256 creditsIssued); // V2
|
|
|
|
|
|
|
|
function redeemCredits(uint256 _amount)
|
|
|
|
external
|
|
|
|
returns (uint256 underlyingReturned); // V2
|
|
|
|
|
|
|
|
function redeemUnderlying(uint256 _amount)
|
|
|
|
external
|
|
|
|
returns (uint256 creditsBurned); // V2
|
|
|
|
|
|
|
|
function exchangeRate() external view returns (uint256); // V1 & V2
|
|
|
|
|
|
|
|
function balanceOfUnderlying(address _user)
|
|
|
|
external
|
|
|
|
view
|
|
|
|
returns (uint256 balance); // V2
|
|
|
|
|
|
|
|
function underlyingToCredits(uint256 _credits)
|
|
|
|
external
|
|
|
|
view
|
|
|
|
returns (uint256 underlying); // V2
|
|
|
|
|
|
|
|
function creditsToUnderlying(uint256 _underlying)
|
|
|
|
external
|
|
|
|
view
|
|
|
|
returns (uint256 credits); // V2
|
|
|
|
}
|
|
|
|
|
|
|
|
interface IStakingRewardsWithPlatformToken {
|
|
|
|
/**
|
|
|
|
* @dev Stakes a given amount of the StakingToken for the sender
|
|
|
|
* @param _amount Units of StakingToken
|
|
|
|
*/
|
|
|
|
function stake(uint256 _amount) external;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @dev Stakes a given amount of the StakingToken for a given beneficiary
|
|
|
|
* @param _beneficiary Staked tokens are credited to this address
|
|
|
|
* @param _amount Units of StakingToken
|
|
|
|
*/
|
|
|
|
function stake(address _beneficiary, uint256 _amount) external;
|
|
|
|
|
|
|
|
function exit() external;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @dev Withdraws given stake amount from the pool
|
|
|
|
* @param _amount Units of the staked token to withdraw
|
|
|
|
*/
|
|
|
|
function withdraw(uint256 _amount) external;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @dev Claims outstanding rewards (both platform and native) for the sender.
|
|
|
|
* First updates outstanding reward allocation and then transfers.
|
|
|
|
*/
|
|
|
|
function claimReward() external;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @dev Claims outstanding rewards for the sender. Only the native
|
|
|
|
* rewards token, and not the platform rewards
|
|
|
|
*/
|
|
|
|
function claimRewardOnly() external;
|
2021-12-30 05:05:31 +00:00
|
|
|
|
|
|
|
function getRewardToken() external returns (address token);
|
|
|
|
|
|
|
|
function getPlatformToken() external returns (address token);
|
2021-12-29 10:37:38 +00:00
|
|
|
}
|
|
|
|
|
2022-01-02 08:44:36 +00:00
|
|
|
interface IFeederPool {
|
2021-12-29 10:37:38 +00:00
|
|
|
// Mint
|
|
|
|
function mint(
|
|
|
|
address _input,
|
|
|
|
uint256 _inputQuantity,
|
|
|
|
uint256 _minOutputQuantity,
|
|
|
|
address _recipient
|
2022-01-02 08:44:36 +00:00
|
|
|
) external returns (uint256 mintOutput);
|
2021-12-29 10:37:38 +00:00
|
|
|
|
|
|
|
function mintMulti(
|
|
|
|
address[] calldata _inputs,
|
|
|
|
uint256[] calldata _inputQuantities,
|
|
|
|
uint256 _minOutputQuantity,
|
|
|
|
address _recipient
|
2022-01-02 08:44:36 +00:00
|
|
|
) external returns (uint256 mintOutput);
|
2021-12-29 10:37:38 +00:00
|
|
|
|
|
|
|
function getMintOutput(address _input, uint256 _inputQuantity)
|
|
|
|
external
|
|
|
|
view
|
|
|
|
returns (uint256 mintOutput);
|
|
|
|
|
|
|
|
function getMintMultiOutput(
|
|
|
|
address[] calldata _inputs,
|
|
|
|
uint256[] calldata _inputQuantities
|
2022-01-02 08:44:36 +00:00
|
|
|
) external view returns (uint256 mintOutput);
|
2021-12-29 10:37:38 +00:00
|
|
|
|
|
|
|
// Swaps
|
|
|
|
function swap(
|
|
|
|
address _input,
|
|
|
|
address _output,
|
|
|
|
uint256 _inputQuantity,
|
|
|
|
uint256 _minOutputQuantity,
|
|
|
|
address _recipient
|
2022-01-02 08:44:36 +00:00
|
|
|
) external returns (uint256 swapOutput);
|
2021-12-29 10:37:38 +00:00
|
|
|
|
|
|
|
function getSwapOutput(
|
|
|
|
address _input,
|
|
|
|
address _output,
|
|
|
|
uint256 _inputQuantity
|
2022-01-02 08:44:36 +00:00
|
|
|
) external view returns (uint256 swapOutput);
|
2021-12-29 10:37:38 +00:00
|
|
|
|
|
|
|
// Redemption
|
|
|
|
function redeem(
|
|
|
|
address _output,
|
|
|
|
uint256 _fpTokenQuantity,
|
|
|
|
uint256 _minOutputQuantity,
|
|
|
|
address _recipient
|
2022-01-02 08:44:36 +00:00
|
|
|
) external returns (uint256 outputQuantity);
|
2021-12-29 10:37:38 +00:00
|
|
|
|
|
|
|
function redeemProportionately(
|
|
|
|
uint256 _fpTokenQuantity,
|
|
|
|
uint256[] calldata _minOutputQuantities,
|
|
|
|
address _recipient
|
2022-01-02 08:44:36 +00:00
|
|
|
) external returns (uint256[] memory outputQuantities);
|
2021-12-29 10:37:38 +00:00
|
|
|
|
|
|
|
function redeemExactBassets(
|
|
|
|
address[] calldata _outputs,
|
|
|
|
uint256[] calldata _outputQuantities,
|
|
|
|
uint256 _maxMassetQuantity,
|
|
|
|
address _recipient
|
2022-01-02 08:44:36 +00:00
|
|
|
) external returns (uint256 mAssetRedeemed);
|
2021-12-29 10:37:38 +00:00
|
|
|
|
|
|
|
function getRedeemOutput(address _output, uint256 _fpTokenQuantity)
|
|
|
|
external
|
|
|
|
view
|
|
|
|
returns (uint256 bAssetOutput);
|
|
|
|
|
|
|
|
function getRedeemExactBassetsOutput(
|
|
|
|
address[] calldata _outputs,
|
|
|
|
uint256[] calldata _outputQuantities
|
2022-01-02 08:44:36 +00:00
|
|
|
) external view returns (uint256 mAssetAmount);
|
2021-12-29 10:37:38 +00:00
|
|
|
|
|
|
|
// Views
|
2022-01-02 08:44:36 +00:00
|
|
|
function mAsset() external view returns (address);
|
2021-12-29 10:37:38 +00:00
|
|
|
|
2022-01-02 08:44:36 +00:00
|
|
|
function getPrice() external view returns (uint256 price, uint256 k);
|
2021-12-29 10:37:38 +00:00
|
|
|
}
|