文件 1 的 14:Context.sol
pragma solidity >=0.6.0 <0.8.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this;
return msg.data;
}
}
文件 2 的 14:EIP20NonStandardInterface.sol
pragma solidity 0.7.6;
interface EIP20NonStandardInterface {
function totalSupply() external view returns (uint256);
function balanceOf(address owner) external view returns (uint256 balance);
function transfer(address dst, uint256 amount) external;
function transferFrom(
address src,
address dst,
uint256 amount
) external;
function approve(address spender, uint256 amount)
external
returns (bool success);
function allowance(address owner, address spender)
external
view
returns (uint256 remaining);
event Transfer(address indexed from, address indexed to, uint256 amount);
event Approval(
address indexed owner,
address indexed spender,
uint256 amount
);
}
文件 3 的 14:ICollateralSplit.sol
pragma solidity 0.7.6;
interface ICollateralSplit {
function isCollateralSplit() external pure returns (bool);
function symbol() external pure returns (string memory);
function split(
address[] calldata _oracles,
address[] calldata _oracleIterators,
int256[] calldata _underlyingStarts,
uint256 _settleTime,
uint256[] calldata _underlyingEndRoundHints
) external view returns (uint256 _split, int256[] memory _underlyingEnds);
}
文件 4 的 14:IDerivativeSpecification.sol
pragma solidity 0.7.6;
interface IDerivativeSpecification {
function isDerivativeSpecification() external pure returns (bool);
function oracleSymbols() external view returns (bytes32[] memory);
function oracleIteratorSymbols() external view returns (bytes32[] memory);
function collateralTokenSymbol() external view returns (bytes32);
function collateralSplitSymbol() external view returns (bytes32);
function livePeriod() external view returns (uint256);
function primaryNominalValue() external view returns (uint256);
function complementNominalValue() external view returns (uint256);
function authorFee() external view returns (uint256);
function symbol() external view returns (string memory);
function name() external view returns (string memory);
function baseURI() external view returns (string memory);
function author() external view returns (address);
}
文件 5 的 14:IERC20.sol
pragma solidity >=0.6.0 <0.8.0;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
文件 6 的 14:IERC20MintedBurnable.sol
pragma solidity 0.7.6;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
interface IERC20MintedBurnable is IERC20 {
function mint(address to, uint256 amount) external;
function burn(uint256 amount) external;
function burnFrom(address account, uint256 amount) external;
}
文件 7 的 14:IFeeLogger.sol
pragma solidity 0.7.6;
interface IFeeLogger {
function log(
address _liquidityProvider,
address _collateral,
uint256 _protocolFee,
address _author
) external;
}
文件 8 的 14:IPausableVault.sol
pragma solidity 0.7.6;
interface IPausableVault {
function pause() external;
function unpause() external;
}
文件 9 的 14:ITokenBuilder.sol
pragma solidity 0.7.6;
import "./IERC20MintedBurnable.sol";
import "../IDerivativeSpecification.sol";
interface ITokenBuilder {
function isTokenBuilder() external pure returns (bool);
function buildTokens(
IDerivativeSpecification derivative,
uint256 settlement,
address _collateralToken
) external returns (IERC20MintedBurnable, IERC20MintedBurnable);
}
文件 10 的 14:Ownable.sol
pragma solidity >=0.6.0 <0.8.0;
import "../utils/Context.sol";
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view virtual returns (address) {
return _owner;
}
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
文件 11 的 14:Pausable.sol
pragma solidity >=0.6.0 <0.8.0;
import "./Context.sol";
abstract contract Pausable is Context {
event Paused(address account);
event Unpaused(address account);
bool private _paused;
constructor () internal {
_paused = false;
}
function paused() public view virtual returns (bool) {
return _paused;
}
modifier whenNotPaused() {
require(!paused(), "Pausable: paused");
_;
}
modifier whenPaused() {
require(paused(), "Pausable: not paused");
_;
}
function _pause() internal virtual whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
function _unpause() internal virtual whenPaused {
_paused = false;
emit Unpaused(_msgSender());
}
}
文件 12 的 14:ReentrancyGuard.sol
pragma solidity >=0.6.0 <0.8.0;
abstract contract ReentrancyGuard {
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor () internal {
_status = _NOT_ENTERED;
}
modifier nonReentrant() {
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
_status = _ENTERED;
_;
_status = _NOT_ENTERED;
}
}
文件 13 的 14:SafeMath.sol
pragma solidity >=0.6.0 <0.8.0;
library SafeMath {
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
if (b > a) return (false, 0);
return (true, a - b);
}
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
if (b == 0) return (false, 0);
return (true, a / b);
}
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
if (b == 0) return (false, 0);
return (true, a % b);
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a, "SafeMath: subtraction overflow");
return a - b;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) return 0;
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0, "SafeMath: division by zero");
return a / b;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0, "SafeMath: modulo by zero");
return a % b;
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
return a - b;
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
return a / b;
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
return a % b;
}
}
文件 14 的 14:Vault.sol
pragma solidity 0.7.6;
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Pausable.sol";
import "./tokens/EIP20NonStandardInterface.sol";
import "./IDerivativeSpecification.sol";
import "./collateralSplits/ICollateralSplit.sol";
import "./tokens/IERC20MintedBurnable.sol";
import "./tokens/ITokenBuilder.sol";
import "./IFeeLogger.sol";
import "./IPausableVault.sol";
contract Vault is Ownable, Pausable, IPausableVault, ReentrancyGuard {
using SafeMath for uint256;
using SafeMath for uint8;
uint256 public constant FRACTION_MULTIPLIER = 10**12;
enum State { Created, Live, Settled }
event StateChanged(State oldState, State newState);
event LiveStateSet(address primaryToken, address complementToken);
event SettledStateSet(
int256[] underlyingStarts,
int256[] underlyingEnds,
uint256 primaryConversion,
uint256 complementConversion
);
event Minted(address indexed recipient, uint256 minted, uint256 collateral, uint256 fee);
event Refunded(address indexed recipient, uint256 tokenAmount, uint256 collateral);
event Redeemed(
address indexed recipient,
address tokenAddress,
uint256 tokenAmount,
uint256 conversion,
uint256 collateral
);
uint256 public liveTime;
uint256 public settleTime;
uint256 public settlementDelay;
int256[] public underlyingStarts;
int256[] public underlyingEnds;
uint256 public primaryConversion;
uint256 public complementConversion;
uint256 public protocolFee;
uint256 public authorFeeLimit;
address public feeWallet;
State public state;
IDerivativeSpecification public derivativeSpecification;
IERC20 public collateralToken;
address[] public oracles;
address[] public oracleIterators;
ICollateralSplit public collateralSplit;
ITokenBuilder public tokenBuilder;
IFeeLogger public feeLogger;
IERC20MintedBurnable public primaryToken;
IERC20MintedBurnable public complementToken;
constructor(
uint256 _liveTime,
uint256 _protocolFee,
address _feeWallet,
address _derivativeSpecification,
address _collateralToken,
address[] memory _oracles,
address[] memory _oracleIterators,
address _collateralSplit,
address _tokenBuilder,
address _feeLogger,
uint256 _authorFeeLimit,
uint256 _settlementDelay
) public {
require(_liveTime > 0, "Live zero");
require(_liveTime <= block.timestamp, "Live in future");
liveTime = _liveTime;
protocolFee = _protocolFee;
require(_feeWallet != address(0), "Fee wallet");
feeWallet = _feeWallet;
require(_derivativeSpecification != address(0), "Derivative");
derivativeSpecification = IDerivativeSpecification(
_derivativeSpecification
);
require(_collateralToken != address(0), "Collateral token");
collateralToken = IERC20(_collateralToken);
require(_oracles.length > 0, "Oracles");
require(_oracles[0] != address(0), "First oracle is absent");
oracles = _oracles;
require(_oracleIterators.length > 0, "OracleIterators");
require(
_oracleIterators[0] != address(0),
"First oracle iterator is absent"
);
oracleIterators = _oracleIterators;
require(_collateralSplit != address(0), "Collateral split");
collateralSplit = ICollateralSplit(_collateralSplit);
require(_tokenBuilder != address(0), "Token builder");
tokenBuilder = ITokenBuilder(_tokenBuilder);
require(_feeLogger != address(0), "Fee logger");
feeLogger = IFeeLogger(_feeLogger);
authorFeeLimit = _authorFeeLimit;
settleTime = liveTime + derivativeSpecification.livePeriod();
require(block.timestamp < settleTime, "Settled time");
settlementDelay = _settlementDelay;
}
function pause() external override onlyOwner() {
_pause();
}
function unpause() external override onlyOwner() {
_unpause();
}
function initialize(int256[] calldata _underlyingStarts) external {
require(state == State.Created, "Incorrect state.");
underlyingStarts = _underlyingStarts;
changeState(State.Live);
(primaryToken, complementToken) = tokenBuilder.buildTokens(
derivativeSpecification,
settleTime,
address(collateralToken)
);
emit LiveStateSet(address(primaryToken), address(complementToken));
}
function changeState(State _newState) internal {
state = _newState;
emit StateChanged(state, _newState);
}
function settle(uint256[] calldata _underlyingEndRoundHints)
public
whenNotPaused()
{
require(state == State.Live, "Incorrect state");
require(
block.timestamp >= (settleTime + settlementDelay),
"Incorrect time"
);
changeState(State.Settled);
uint256 split;
(split, underlyingEnds) = collateralSplit.split(
oracles,
oracleIterators,
underlyingStarts,
settleTime,
_underlyingEndRoundHints
);
split = range(split);
uint256 collectedCollateral = collateralToken.balanceOf(address(this));
uint256 mintedPrimaryTokenAmount = primaryToken.totalSupply();
if (mintedPrimaryTokenAmount > 0) {
uint256 primaryCollateralPortion = collectedCollateral.mul(split);
primaryConversion = primaryCollateralPortion.div(
mintedPrimaryTokenAmount
);
complementConversion = collectedCollateral
.mul(FRACTION_MULTIPLIER)
.sub(primaryCollateralPortion)
.div(mintedPrimaryTokenAmount);
}
emit SettledStateSet(
underlyingStarts,
underlyingEnds,
primaryConversion,
complementConversion
);
}
function range(uint256 _split) public pure returns (uint256) {
if (_split > FRACTION_MULTIPLIER) {
return FRACTION_MULTIPLIER;
}
return _split;
}
function performMint(address _recipient, uint256 _collateralAmount)
internal
{
require(state == State.Live, "Live is over");
require(_collateralAmount > 0, "Zero amount");
_collateralAmount = doTransferIn(msg.sender, _collateralAmount);
uint256 feeAmount = withdrawFee(_collateralAmount);
uint256 netAmount = _collateralAmount.sub(feeAmount);
uint256 tokenAmount = denominate(netAmount);
primaryToken.mint(_recipient, tokenAmount);
complementToken.mint(_recipient, tokenAmount);
emit Minted(_recipient, tokenAmount, _collateralAmount, feeAmount);
}
function mintTo(address _recipient, uint256 _collateralAmount)
external
nonReentrant()
{
performMint(_recipient, _collateralAmount);
}
function mint(uint256 _collateralAmount) external nonReentrant() {
performMint(msg.sender, _collateralAmount);
}
function performRefund(address _recipient, uint256 _tokenAmount) internal {
require(_tokenAmount > 0, "Zero amount");
require(
_tokenAmount <= primaryToken.balanceOf(msg.sender),
"Insufficient primary amount"
);
require(
_tokenAmount <= complementToken.balanceOf(msg.sender),
"Insufficient complement amount"
);
primaryToken.burnFrom(msg.sender, _tokenAmount);
complementToken.burnFrom(msg.sender, _tokenAmount);
uint256 unDenominated = unDenominate(_tokenAmount);
emit Refunded(_recipient, _tokenAmount, unDenominated);
doTransferOut(_recipient, unDenominated);
}
function refund(uint256 _tokenAmount) external nonReentrant() {
performRefund(msg.sender, _tokenAmount);
}
function refundTo(address _recipient, uint256 _tokenAmount)
external
nonReentrant()
{
performRefund(_recipient, _tokenAmount);
}
function performRedeem(
address _recipient,
uint256 _primaryTokenAmount,
uint256 _complementTokenAmount,
uint256[] calldata _underlyingEndRoundHints
) internal {
require(
_primaryTokenAmount > 0 || _complementTokenAmount > 0,
"Both tokens zero amount"
);
require(
_primaryTokenAmount <= primaryToken.balanceOf(msg.sender),
"Insufficient primary amount"
);
require(
_complementTokenAmount <= complementToken.balanceOf(msg.sender),
"Insufficient complement amount"
);
if (
block.timestamp >= (settleTime + settlementDelay) &&
state == State.Live
) {
settle(_underlyingEndRoundHints);
}
if (state == State.Settled) {
uint collateral = redeemAsymmetric(
_recipient,
primaryToken,
_primaryTokenAmount,
primaryConversion
);
collateral = redeemAsymmetric(
_recipient,
complementToken,
_complementTokenAmount,
complementConversion
).add(collateral);
if (collateral > 0) {
doTransferOut(_recipient, collateral);
}
}
}
function redeemTo(
address _recipient,
uint256 _primaryTokenAmount,
uint256 _complementTokenAmount,
uint256[] calldata _underlyingEndRoundHints
) external nonReentrant() {
performRedeem(
_recipient,
_primaryTokenAmount,
_complementTokenAmount,
_underlyingEndRoundHints
);
}
function redeem(
uint256 _primaryTokenAmount,
uint256 _complementTokenAmount,
uint256[] calldata _underlyingEndRoundHints
) external nonReentrant() {
performRedeem(
msg.sender,
_primaryTokenAmount,
_complementTokenAmount,
_underlyingEndRoundHints
);
}
function redeemAsymmetric(
address _recipient,
IERC20MintedBurnable _derivativeToken,
uint256 _amount,
uint256 _conversion
) internal returns(uint256 collateral){
if (_amount == 0) {
return 0;
}
_derivativeToken.burnFrom(msg.sender, _amount);
collateral = _amount.mul(_conversion) / FRACTION_MULTIPLIER;
emit Redeemed(_recipient, address(_derivativeToken),_amount, _conversion, collateral);
}
function denominate(uint256 _collateralAmount)
internal
view
returns (uint256)
{
return
_collateralAmount.div(
derivativeSpecification.primaryNominalValue() +
derivativeSpecification.complementNominalValue()
);
}
function unDenominate(uint256 _tokenAmount)
internal
view
returns (uint256)
{
return
_tokenAmount.mul(
derivativeSpecification.primaryNominalValue() +
derivativeSpecification.complementNominalValue()
);
}
function withdrawFee(uint256 _amount) internal returns (uint256) {
uint256 protocolFeeAmount =
calcAndTransferFee(_amount, payable(feeWallet), protocolFee);
feeLogger.log(
msg.sender,
address(collateralToken),
protocolFeeAmount,
derivativeSpecification.author()
);
uint256 authorFee = derivativeSpecification.authorFee();
if (authorFee > authorFeeLimit) {
authorFee = authorFeeLimit;
}
uint256 authorFeeAmount =
calcAndTransferFee(
_amount,
payable(derivativeSpecification.author()),
authorFee
);
return protocolFeeAmount.add(authorFeeAmount);
}
function calcAndTransferFee(
uint256 _amount,
address payable _beneficiary,
uint256 _fee
) internal returns (uint256 _feeAmount) {
_feeAmount = _amount.mul(_fee).div(FRACTION_MULTIPLIER);
if (_feeAmount > 0) {
doTransferOut(_beneficiary, _feeAmount);
}
}
function doTransferIn(address from, uint256 amount)
internal
returns (uint256)
{
uint256 balanceBefore = collateralToken.balanceOf(address(this));
EIP20NonStandardInterface(address(collateralToken)).transferFrom(
from,
address(this),
amount
);
bool success;
assembly {
switch returndatasize()
case 0 {
success := not(0)
}
case 32 {
returndatacopy(0, 0, 32)
success := mload(0)
}
default {
revert(0, 0)
}
}
require(success, "TOKEN_TRANSFER_IN_FAILED");
uint256 balanceAfter = collateralToken.balanceOf(address(this));
require(balanceAfter >= balanceBefore, "TOKEN_TRANSFER_IN_OVERFLOW");
return balanceAfter - balanceBefore;
}
function doTransferOut(address to, uint256 amount) internal {
EIP20NonStandardInterface(address(collateralToken)).transfer(
to,
amount
);
bool success;
assembly {
switch returndatasize()
case 0 {
success := not(0)
}
case 32 {
returndatacopy(0, 0, 32)
success := mload(0)
}
default {
revert(0, 0)
}
}
require(success, "TOKEN_TRANSFER_OUT_FAILED");
}
}
{
"compilationTarget": {
"contracts/Vault.sol": "Vault"
},
"evmVersion": "istanbul",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": true,
"runs": 1000000
},
"remappings": []
}
[{"inputs":[{"internalType":"uint256","name":"_liveTime","type":"uint256"},{"internalType":"uint256","name":"_protocolFee","type":"uint256"},{"internalType":"address","name":"_feeWallet","type":"address"},{"internalType":"address","name":"_derivativeSpecification","type":"address"},{"internalType":"address","name":"_collateralToken","type":"address"},{"internalType":"address[]","name":"_oracles","type":"address[]"},{"internalType":"address[]","name":"_oracleIterators","type":"address[]"},{"internalType":"address","name":"_collateralSplit","type":"address"},{"internalType":"address","name":"_tokenBuilder","type":"address"},{"internalType":"address","name":"_feeLogger","type":"address"},{"internalType":"uint256","name":"_authorFeeLimit","type":"uint256"},{"internalType":"uint256","name":"_settlementDelay","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"primaryToken","type":"address"},{"indexed":false,"internalType":"address","name":"complementToken","type":"address"}],"name":"LiveStateSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"minted","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"collateral","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"fee","type":"uint256"}],"name":"Minted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"address","name":"tokenAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"conversion","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"collateral","type":"uint256"}],"name":"Redeemed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"collateral","type":"uint256"}],"name":"Refunded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"int256[]","name":"underlyingStarts","type":"int256[]"},{"indexed":false,"internalType":"int256[]","name":"underlyingEnds","type":"int256[]"},{"indexed":false,"internalType":"uint256","name":"primaryConversion","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"complementConversion","type":"uint256"}],"name":"SettledStateSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"enum Vault.State","name":"oldState","type":"uint8"},{"indexed":false,"internalType":"enum Vault.State","name":"newState","type":"uint8"}],"name":"StateChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"FRACTION_MULTIPLIER","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"authorFeeLimit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"collateralSplit","outputs":[{"internalType":"contract ICollateralSplit","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"collateralToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"complementConversion","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"complementToken","outputs":[{"internalType":"contract IERC20MintedBurnable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"derivativeSpecification","outputs":[{"internalType":"contract IDerivativeSpecification","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeLogger","outputs":[{"internalType":"contract IFeeLogger","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeWallet","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"int256[]","name":"_underlyingStarts","type":"int256[]"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"liveTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_collateralAmount","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"uint256","name":"_collateralAmount","type":"uint256"}],"name":"mintTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"oracleIterators","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"oracles","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"primaryConversion","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"primaryToken","outputs":[{"internalType":"contract IERC20MintedBurnable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"protocolFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_split","type":"uint256"}],"name":"range","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"_primaryTokenAmount","type":"uint256"},{"internalType":"uint256","name":"_complementTokenAmount","type":"uint256"},{"internalType":"uint256[]","name":"_underlyingEndRoundHints","type":"uint256[]"}],"name":"redeem","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"uint256","name":"_primaryTokenAmount","type":"uint256"},{"internalType":"uint256","name":"_complementTokenAmount","type":"uint256"},{"internalType":"uint256[]","name":"_underlyingEndRoundHints","type":"uint256[]"}],"name":"redeemTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenAmount","type":"uint256"}],"name":"refund","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"uint256","name":"_tokenAmount","type":"uint256"}],"name":"refundTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_underlyingEndRoundHints","type":"uint256[]"}],"name":"settle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"settleTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"settlementDelay","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"state","outputs":[{"internalType":"enum Vault.State","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenBuilder","outputs":[{"internalType":"contract ITokenBuilder","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"underlyingEnds","outputs":[{"internalType":"int256","name":"","type":"int256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"underlyingStarts","outputs":[{"internalType":"int256","name":"","type":"int256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"}]