ETH Price: $3,274.28 (+0.88%)
Gas: 1 Gwei

Contract

0xea5b9650f6c47D112Bb008132a86388B594Eb849
 
Transaction Hash
Method
Block
From
To
Redeem167681492023-03-06 8:32:35509 days ago1678091555IN
0xea5b9650...B594Eb849
0 ETH0.0021240321.44194508
Redeem166261692023-02-14 9:43:23529 days ago1676367803IN
0xea5b9650...B594Eb849
0 ETH0.0013670914.50334266
Redeem166261562023-02-14 9:40:47529 days ago1676367647IN
0xea5b9650...B594Eb849
0 ETH0.0018769317.00125448
Refund125444532021-05-31 21:09:171152 days ago1622495357IN
0xea5b9650...B594Eb849
0 ETH0.0022541225
Refund124288232021-05-13 22:32:521170 days ago1620945172IN
0xea5b9650...B594Eb849
0 ETH0.01126408105
Refund124245702021-05-13 6:53:351171 days ago1620888815IN
0xea5b9650...B594Eb849
0 ETH0.0095968104
Mint124038422021-05-10 2:13:401174 days ago1620612820IN
0xea5b9650...B594Eb849
0 ETH0.01967977110
Mint123865282021-05-07 10:03:181177 days ago1620381798IN
0xea5b9650...B594Eb849
0 ETH0.008112849.5
Mint123864452021-05-07 9:48:251177 days ago1620380905IN
0xea5b9650...B594Eb849
0 ETH0.0072813145
0x00000000123864282021-05-07 9:43:541177 days ago1620380634IN
0xea5b9650...B594Eb849
0 ETH0.0010713550
Mint123757002021-05-05 17:54:471178 days ago1620237287IN
0xea5b9650...B594Eb849
0 ETH0.003810170
Mint123756352021-05-05 17:42:121178 days ago1620236532IN
0xea5b9650...B594Eb849
0 ETH0.0047898488
Mint123722932021-05-05 5:14:011179 days ago1620191641IN
0xea5b9650...B594Eb849
0 ETH0.0053664930
Mint123403562021-04-30 6:53:461184 days ago1619765626IN
0xea5b9650...B594Eb849
0 ETH0.0115091550
Initialize123400882021-04-30 5:56:181184 days ago1619762178IN
0xea5b9650...B594Eb849
0 ETH0.187601450

Latest 1 internal transaction

Advanced mode:
Parent Transaction Hash Block From To
123400862021-04-30 5:55:311184 days ago1619762131  Contract Creation0 ETH
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Vault

Compiler Version
v0.7.6+commit.7338295f

Optimization Enabled:
Yes with 1000000 runs

Other Settings:
default evmVersion
File 1 of 14 : Vault.sol
// "SPDX-License-Identifier: GPL-3.0-or-later"

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";

/// @title Derivative implementation Vault
/// @notice A smart contract that references derivative specification and enables users to mint and redeem the derivative
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
    );

    /// @notice start of live period
    uint256 public liveTime;
    /// @notice end of live period
    uint256 public settleTime;

    /// @notice redeem function can only be called after the end of the Live period + delay
    uint256 public settlementDelay;

    /// @notice underlying value at the start of live period
    int256[] public underlyingStarts;
    /// @notice underlying value at the end of live period
    int256[] public underlyingEnds;

    /// @notice primary token conversion rate multiplied by 10 ^ 12
    uint256 public primaryConversion;
    /// @notice complement token conversion rate multiplied by 10 ^ 12
    uint256 public complementConversion;

    /// @notice protocol fee multiplied by 10 ^ 12
    uint256 public protocolFee;
    /// @notice limit on author fee multiplied by 10 ^ 12
    uint256 public authorFeeLimit;

    // @notice protocol's fee receiving wallet
    address public feeWallet;

    // @notice current state of the vault
    State public state;

    // @notice derivative specification address
    IDerivativeSpecification public derivativeSpecification;
    // @notice collateral token address
    IERC20 public collateralToken;
    // @notice oracle address
    address[] public oracles;
    address[] public oracleIterators;
    // @notice collateral split address
    ICollateralSplit public collateralSplit;
    // @notice derivative's token builder strategy address
    ITokenBuilder public tokenBuilder;
    IFeeLogger public feeLogger;

    // @notice primary token address
    IERC20MintedBurnable public primaryToken;
    // @notice complement token address
    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();
    }

    /// @notice Initialize vault by creating derivative token and switching to Live state
    /// @dev Extracted from constructor to reduce contract gas creation amount
    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);
    }

    /// @notice Switch to Settled state if appropriate time threshold is passed and
    /// set underlyingStarts value and set underlyingEnds value,
    /// calculate primaryConversion and complementConversion params
    /// @dev Reverts if underlyingEnds are not available
    /// Vault cannot settle when it paused
    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);
    }

    /// @notice Mints primary and complement derivative tokens
    /// @dev Checks and switches to the right state and does nothing if vault is not in Live state
    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);
    }

    /// @notice Refund equal amounts of derivative tokens for collateral at any time
    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
        );
    }

    /// @notice Redeems unequal amounts previously calculated conversions if the vault is in Settled state
    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);
        }
    }

    /// @dev Similar to EIP20 transfer, except it handles a False result from `transferFrom` and reverts in that case.
    /// This will revert due to insufficient balance or insufficient allowance.
    /// This function returns the actual amount received,
    /// which may be less than `amount` if there is a fee attached to the transfer.
    /// @notice This wrapper safely handles non-standard ERC-20 tokens that do not return a value.
    /// See here: https://medium.com/coinmonks/missing-return-value-bug-at-least-130-tokens-affected-d67bf08521ca
    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 {
                    // This is a non-standard ERC-20
                    success := not(0) // set success to true
                }
                case 32 {
                    // This is a compliant ERC-20
                    returndatacopy(0, 0, 32)
                    success := mload(0) // Set `success = returndata` of external call
                }
                default {
                    // This is an excessively non-compliant ERC-20, revert.
                    revert(0, 0)
                }
        }
        require(success, "TOKEN_TRANSFER_IN_FAILED");

        // Calculate the amount that was *actually* transferred
        uint256 balanceAfter = collateralToken.balanceOf(address(this));
        require(balanceAfter >= balanceBefore, "TOKEN_TRANSFER_IN_OVERFLOW");
        return balanceAfter - balanceBefore; // underflow already checked above, just subtract
    }

    /// @dev Similar to EIP20 transfer, except it handles a False success from `transfer` and returns an explanatory
    /// error code rather than reverting. If caller has not called checked protocol's balance, this may revert due to
    /// insufficient cash held in this contract. If caller has checked protocol's balance prior to this call, and verified
    /// it is >= amount, this should not revert in normal conditions.
    /// @notice This wrapper safely handles non-standard ERC-20 tokens that do not return a value.
    /// See here: https://medium.com/coinmonks/missing-return-value-bug-at-least-130-tokens-affected-d67bf08521ca
    function doTransferOut(address to, uint256 amount) internal {
        EIP20NonStandardInterface(address(collateralToken)).transfer(
            to,
            amount
        );

        bool success;
        assembly {
            switch returndatasize()
                case 0 {
                    // This is a non-standard ERC-20
                    success := not(0) // set success to true
                }
                case 32 {
                    // This is a complaint ERC-20
                    returndatacopy(0, 0, 32)
                    success := mload(0) // Set `success = returndata` of external call
                }
                default {
                    // This is an excessively non-compliant ERC-20, revert.
                    revert(0, 0)
                }
        }
        require(success, "TOKEN_TRANSFER_OUT_FAILED");
    }
}

File 2 of 14 : SafeMath.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        uint256 c = a + b;
        if (c < a) return (false, 0);
        return (true, c);
    }

    /**
     * @dev Returns the substraction of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b > a) return (false, 0);
        return (true, a - b);
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
        // benefit is lost if 'b' is also tested.
        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
        if (a == 0) return (true, 0);
        uint256 c = a * b;
        if (c / a != b) return (false, 0);
        return (true, c);
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b == 0) return (false, 0);
        return (true, a / b);
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b == 0) return (false, 0);
        return (true, a % b);
    }

    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");
        return c;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b <= a, "SafeMath: subtraction overflow");
        return a - b;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    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;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b > 0, "SafeMath: division by zero");
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b > 0, "SafeMath: modulo by zero");
        return a % b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {trySub}.
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b <= a, errorMessage);
        return a - b;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryDiv}.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting with custom message when dividing by zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryMod}.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        return a % b;
    }
}

File 3 of 14 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `sender` to `recipient` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);

    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);
}

File 4 of 14 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    constructor () internal {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and make it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;

        _;

        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }
}

File 5 of 14 : Ownable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

import "../utils/Context.sol";
/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor () internal {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), msgSender);
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        emit OwnershipTransferred(_owner, address(0));
        _owner = address(0);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }
}

File 6 of 14 : Pausable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

import "./Context.sol";

/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
abstract contract Pausable is Context {
    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

    /**
     * @dev Emitted when the pause is lifted by `account`.
     */
    event Unpaused(address account);

    bool private _paused;

    /**
     * @dev Initializes the contract in unpaused state.
     */
    constructor () internal {
        _paused = false;
    }

    /**
     * @dev Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view virtual returns (bool) {
        return _paused;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        require(!paused(), "Pausable: paused");
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        require(paused(), "Pausable: not paused");
        _;
    }

    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    function _pause() internal virtual whenNotPaused {
        _paused = true;
        emit Paused(_msgSender());
    }

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        _paused = false;
        emit Unpaused(_msgSender());
    }
}

File 7 of 14 : EIP20NonStandardInterface.sol
// "SPDX-License-Identifier: GPL-3.0-or-later"

pragma solidity 0.7.6;

/// @title EIP20NonStandardInterface
/// @dev Version of ERC20 with no return values for `transfer` and `transferFrom`
/// See https://medium.com/coinmonks/missing-return-value-bug-at-least-130-tokens-affected-d67bf08521ca
interface EIP20NonStandardInterface {
    /// @notice Get the total number of tokens in circulation
    /// @return The supply of tokens
    function totalSupply() external view returns (uint256);

    /// @notice Gets the balance of the specified address
    /// @param owner The address from which the balance will be retrieved
    /// @return balance The balance
    function balanceOf(address owner) external view returns (uint256 balance);

    //
    // !!!!!!!!!!!!!!
    // !!! NOTICE !!! `transfer` does not return a value, in violation of the ERC-20 specification
    // !!!!!!!!!!!!!!
    //

    /// @notice Transfer `amount` tokens from `msg.sender` to `dst`
    /// @param dst The address of the destination account
    /// @param amount The number of tokens to transfer
    function transfer(address dst, uint256 amount) external;

    //
    // !!!!!!!!!!!!!!
    // !!! NOTICE !!! `transferFrom` does not return a value, in violation of the ERC-20 specification
    // !!!!!!!!!!!!!!
    //

    /// @notice Transfer `amount` tokens from `src` to `dst`
    /// @param src The address of the source account
    /// @param dst The address of the destination account
    /// @param amount The number of tokens to transfer
    function transferFrom(
        address src,
        address dst,
        uint256 amount
    ) external;

    /// @notice Approve `spender` to transfer up to `amount` from `src`
    /// @dev This will overwrite the approval amount for `spender`
    ///  and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve)
    /// @param spender The address of the account which may transfer tokens
    /// @param amount The number of tokens that are approved
    /// @return success Whether or not the approval succeeded
    function approve(address spender, uint256 amount)
        external
        returns (bool success);

    /// @notice Get the current allowance from `owner` for `spender`
    /// @param owner The address of the account which owns the tokens to be spent
    /// @param spender The address of the account which may transfer tokens
    /// @return remaining The number of tokens allowed to be spent
    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
    );
}

File 8 of 14 : IDerivativeSpecification.sol
// "SPDX-License-Identifier: GPL-3.0-or-later"

pragma solidity 0.7.6;

/// @title Derivative Specification interface
/// @notice Immutable collection of derivative attributes
/// @dev Created by the derivative's author and published to the DerivativeSpecificationRegistry
interface IDerivativeSpecification {
    /// @notice Proof of a derivative specification
    /// @dev Verifies that contract is a derivative specification
    /// @return true if contract is a derivative specification
    function isDerivativeSpecification() external pure returns (bool);

    /// @notice Set of oracles that are relied upon to measure changes in the state of the world
    /// between the start and the end of the Live period
    /// @dev Should be resolved through OracleRegistry contract
    /// @return oracle symbols
    function oracleSymbols() external view returns (bytes32[] memory);

    /// @notice Algorithm that, for the type of oracle used by the derivative,
    /// finds the value closest to a given timestamp
    /// @dev Should be resolved through OracleIteratorRegistry contract
    /// @return oracle iterator symbols
    function oracleIteratorSymbols() external view returns (bytes32[] memory);

    /// @notice Type of collateral that users submit to mint the derivative
    /// @dev Should be resolved through CollateralTokenRegistry contract
    /// @return collateral token symbol
    function collateralTokenSymbol() external view returns (bytes32);

    /// @notice Mapping from the change in the underlying variable (as defined by the oracle)
    /// and the initial collateral split to the final collateral split
    /// @dev Should be resolved through CollateralSplitRegistry contract
    /// @return collateral split symbol
    function collateralSplitSymbol() external view returns (bytes32);

    /// @notice Lifecycle parameter that define the length of the derivative's Live period.
    /// @dev Set in seconds
    /// @return live period value
    function livePeriod() external view returns (uint256);

    /// @notice Parameter that determines starting nominal value of primary asset
    /// @dev Units of collateral theoretically swappable for 1 unit of primary asset
    /// @return primary nominal value
    function primaryNominalValue() external view returns (uint256);

    /// @notice Parameter that determines starting nominal value of complement asset
    /// @dev Units of collateral theoretically swappable for 1 unit of complement asset
    /// @return complement nominal value
    function complementNominalValue() external view returns (uint256);

    /// @notice Minting fee rate due to the author of the derivative specification.
    /// @dev Percentage fee multiplied by 10 ^ 12
    /// @return author fee
    function authorFee() external view returns (uint256);

    /// @notice Symbol of the derivative
    /// @dev Should be resolved through DerivativeSpecificationRegistry contract
    /// @return derivative specification symbol
    function symbol() external view returns (string memory);

    /// @notice Return optional long name of the derivative
    /// @dev Isn't used directly in the protocol
    /// @return long name
    function name() external view returns (string memory);

    /// @notice Optional URI to the derivative specs
    /// @dev Isn't used directly in the protocol
    /// @return URI to the derivative specs
    function baseURI() external view returns (string memory);

    /// @notice Derivative spec author
    /// @dev Used to set and receive author's fee
    /// @return address of the author
    function author() external view returns (address);
}

File 9 of 14 : ICollateralSplit.sol
// "SPDX-License-Identifier: GPL-3.0-or-later"

pragma solidity 0.7.6;

/// @title Collateral Split interface
/// @notice Contains mathematical functions used to calculate relative claim
/// on collateral of primary and complement assets after settlement.
/// @dev Created independently from specification and published to the CollateralSplitRegistry
interface ICollateralSplit {
    /// @notice Proof of collateral split contract
    /// @dev Verifies that contract is a collateral split contract
    /// @return true if contract is a collateral split contract
    function isCollateralSplit() external pure returns (bool);

    /// @notice Symbol of the collateral split
    /// @dev Should be resolved through CollateralSplitRegistry contract
    /// @return collateral split specification symbol
    function symbol() external pure returns (string memory);

    /// @notice Calcs primary asset class' share of collateral at settlement.
    /// @dev Returns ranged value between 0 and 1 multiplied by 10 ^ 12
    /// @param _underlyingStarts underlying values in the start of Live period
    /// @param _underlyingEndRoundHints specify for each oracle round of the end of Live period
    /// @return _split primary asset class' share of collateral at settlement
    /// @return _underlyingEnds underlying values in the end of Live period
    function split(
        address[] calldata _oracles,
        address[] calldata _oracleIterators,
        int256[] calldata _underlyingStarts,
        uint256 _settleTime,
        uint256[] calldata _underlyingEndRoundHints
    ) external view returns (uint256 _split, int256[] memory _underlyingEnds);
}

File 10 of 14 : IERC20MintedBurnable.sol
// "SPDX-License-Identifier: GPL-3.0-or-later"

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;
}

File 11 of 14 : ITokenBuilder.sol
// "SPDX-License-Identifier: GPL-3.0-or-later"

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);
}

File 12 of 14 : IFeeLogger.sol
// "SPDX-License-Identifier: GPL-3.0-or-later"

pragma solidity 0.7.6;

interface IFeeLogger {
    function log(
        address _liquidityProvider,
        address _collateral,
        uint256 _protocolFee,
        address _author
    ) external;
}

File 13 of 14 : IPausableVault.sol
// "SPDX-License-Identifier: GPL-3.0-or-later"

pragma solidity 0.7.6;

interface IPausableVault {
    function pause() external;

    function unpause() external;
}

File 14 of 14 : Context.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/*
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with GSN meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address payable) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes memory) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 1000000
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"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"}]

60806040523480156200001157600080fd5b5060405162003c0138038062003c0183398181016040526101808110156200003857600080fd5b815160208301516040808501516060860151608087015160a0880180519451969895979396929591949293820192846401000000008211156200007a57600080fd5b9083019060208201858111156200009057600080fd5b8251866020820283011164010000000082111715620000ae57600080fd5b82525081516020918201928201910280838360005b83811015620000dd578181015183820152602001620000c3565b50505050905001604052602001805160405193929190846401000000008211156200010757600080fd5b9083019060208201858111156200011d57600080fd5b82518660208202830111640100000000821117156200013b57600080fd5b82525081516020918201928201910280838360005b838110156200016a57818101518382015260200162000150565b505050509190910160409081526020830151908301516060840151608085015160a0909501519296509094509291506000620001a562000771565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3506000805460ff60a01b19169055600180558b6200023f576040805162461bcd60e51b81526020600482015260096024820152684c697665207a65726f60b81b604482015290519081900360640190fd5b428c111562000286576040805162461bcd60e51b815260206004820152600e60248201526d4c69766520696e2066757475726560901b604482015290519081900360640190fd5b60028c905560098b90556001600160a01b038a16620002d9576040805162461bcd60e51b815260206004820152600a602482015269119959481dd85b1b195d60b21b604482015290519081900360640190fd5b600b80546001600160a01b0319166001600160a01b038c81169190911790915589166200033a576040805162461bcd60e51b815260206004820152600a6024820152694465726976617469766560b01b604482015290519081900360640190fd5b600c80546001600160a01b0319166001600160a01b038b8116919091179091558816620003a1576040805162461bcd60e51b815260206004820152601060248201526f21b7b63630ba32b930b6103a37b5b2b760811b604482015290519081900360640190fd5b600d80546001600160a01b0319166001600160a01b038a161790558651620003fa576040805162461bcd60e51b81526020600482015260076024820152664f7261636c657360c81b604482015290519081900360640190fd5b60006001600160a01b0316876000815181106200041357fe5b60200260200101516001600160a01b0316141562000478576040805162461bcd60e51b815260206004820152601660248201527f4669727374206f7261636c6520697320616273656e7400000000000000000000604482015290519081900360640190fd5b86516200048d90600e9060208a019062000775565b506000865111620004d7576040805162461bcd60e51b815260206004820152600f60248201526e4f7261636c654974657261746f727360881b604482015290519081900360640190fd5b60006001600160a01b031686600081518110620004f057fe5b60200260200101516001600160a01b0316141562000555576040805162461bcd60e51b815260206004820152601f60248201527f4669727374206f7261636c65206974657261746f7220697320616273656e7400604482015290519081900360640190fd5b85516200056a90600f90602089019062000775565b506001600160a01b038516620005ba576040805162461bcd60e51b815260206004820152601060248201526f10dbdb1b185d195c985b081cdc1b1a5d60821b604482015290519081900360640190fd5b601080546001600160a01b0319166001600160a01b038781169190911790915584166200061e576040805162461bcd60e51b815260206004820152600d60248201526c2a37b5b2b710313ab4b63232b960991b604482015290519081900360640190fd5b601180546001600160a01b0319166001600160a01b038681169190911790915583166200067f576040805162461bcd60e51b815260206004820152600a6024820152692332b2903637b3b3b2b960b11b604482015290519081900360640190fd5b601280546001600160a01b0319166001600160a01b0385811691909117909155600a839055600c546040805163f686980360e01b81529051919092169163f6869803916004808301926020929190829003018186803b158015620006e257600080fd5b505afa158015620006f7573d6000803e3d6000fd5b505050506040513d60208110156200070e57600080fd5b505160025401600381905542106200075c576040805162461bcd60e51b815260206004820152600c60248201526b536574746c65642074696d6560a01b604482015290519081900360640190fd5b60045550620007f69950505050505050505050565b3390565b828054828255906000526020600020908101928215620007cd579160200282015b82811115620007cd57825182546001600160a01b0319166001600160a01b0390911617825560209092019160019091019062000796565b50620007db929150620007df565b5090565b5b80821115620007db5760008155600101620007e0565b6133fb80620008066000396000f3fe608060405234801561001057600080fd5b506004361061025c5760003560e01c806394f973d611610145578063bdd19891116100bd578063dfd105cb1161008c578063f25f4b5611610071578063f25f4b56146106a5578063f2fde38b146106ad578063fa443b53146106e05761025c565b8063dfd105cb14610695578063ef613f751461069d5761025c565b8063bdd19891146105e0578063c19d93fb146105e8578063dbcb32bf14610611578063dd12a043146106195761025c565b8063b0e21e8a11610114578063b3859789116100f9578063b3859789146105b3578063b4ba0231146105bb578063bc49abd8146105d85761025c565b8063b0e21e8a146105a3578063b2016bd4146105ab5761025c565b806394f973d6146104f15780639b2db373146104f9578063a0712d6814610569578063a5e45bec146105865761025c565b80635b69a7d8116101d857806379b03d5d116101a75780638da5cb5b1161018c5780638da5cb5b146104715780638e0fad201461047957806391ac094c146104e95761025c565b806379b03d5d146104615780638456cb59146104695761025c565b80635b69a7d8146104185780635c975abb1461043557806366101b6414610451578063715018a6146104595761025c565b8063278ecde11161022f5780633a656480116102145780633a656480146103cf5780633f4ba83a146103d7578063449a52f8146103df5761025c565b8063278ecde1146103795780632efcc8db146103965761025c565b806305a8a22c146102615780630fa578c6146102fc578063188dfdfd1461031657806321e64e4c14610333575b600080fd5b6102fa6004803603608081101561027757600080fd5b73ffffffffffffffffffffffffffffffffffffffff82351691602081013591604082013591908101906080810160608201356401000000008111156102bb57600080fd5b8201836020820111156102cd57600080fd5b803590602001918460208302840111640100000000831117156102ef57600080fd5b5090925090506106e8565b005b610304610777565b60408051918252519081900360200190f35b6103046004803603602081101561032c57600080fd5b503561077d565b6103506004803603602081101561034957600080fd5b503561079e565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b6102fa6004803603602081101561038f57600080fd5b50356107d5565b6102fa600480360360408110156103ac57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813516906020013561085d565b6103506108e6565b6102fa610902565b6102fa600480360360408110156103f557600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001356109b4565b6103506004803603602081101561042e57600080fd5b5035610a35565b61043d610a45565b604080519115158252519081900360200190f35b610304610a66565b6102fa610a6c565b610304610b83565b6102fa610b89565b610350610c39565b6102fa6004803603602081101561048f57600080fd5b8101906020810181356401000000008111156104aa57600080fd5b8201836020820111156104bc57600080fd5b803590602001918460208302840111640100000000831117156104de57600080fd5b509092509050610c55565b610350610e59565b610350610e75565b6102fa6004803603602081101561050f57600080fd5b81019060208101813564010000000081111561052a57600080fd5b82018360208201111561053c57600080fd5b8035906020019184602083028401116401000000008311171561055e57600080fd5b509092509050610e91565b6102fa6004803603602081101561057f57600080fd5b5035611541565b6103046004803603602081101561059c57600080fd5b50356115c2565b6103046115e5565b6103506115eb565b610350611607565b610304600480360360208110156105d157600080fd5b5035611623565b610304611633565b610304611639565b6105f061163f565b6040518082600281111561060057fe5b815260200191505060405180910390f35b610350611660565b6102fa6004803603606081101561062f57600080fd5b81359160208101359181019060608101604082013564010000000081111561065657600080fd5b82018360208201111561066857600080fd5b8035906020019184602083028401116401000000008311171561068a57600080fd5b50909250905061167c565b61030461170a565b610304611713565b610350611719565b6102fa600480360360208110156106c357600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611735565b6103506118d6565b6002600154141561075a57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b600260015561076c85858585856118f2565b505060018055505050565b60045481565b6006818154811061078d57600080fd5b600091825260209091200154905081565b600f81815481106107ae57600080fd5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16905081565b6002600154141561084757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b60026001556108563382611c84565b5060018055565b600260015414156108cf57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b60026001556108de8282611c84565b505060018055565b60115473ffffffffffffffffffffffffffffffffffffffff1681565b61090a61209d565b73ffffffffffffffffffffffffffffffffffffffff16610928610c39565b73ffffffffffffffffffffffffffffffffffffffff16146109aa57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6109b26120a1565b565b60026001541415610a2657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b60026001556108de828261218f565b600e81815481106107ae57600080fd5b60005474010000000000000000000000000000000000000000900460ff1690565b60035481565b610a7461209d565b73ffffffffffffffffffffffffffffffffffffffff16610a92610c39565b73ffffffffffffffffffffffffffffffffffffffff1614610b1457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6000805460405173ffffffffffffffffffffffffffffffffffffffff909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b60085481565b610b9161209d565b73ffffffffffffffffffffffffffffffffffffffff16610baf610c39565b73ffffffffffffffffffffffffffffffffffffffff1614610c3157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6109b261244f565b60005473ffffffffffffffffffffffffffffffffffffffff1690565b6000600b5474010000000000000000000000000000000000000000900460ff166002811115610c8057fe5b14610cec57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f496e636f72726563742073746174652e00000000000000000000000000000000604482015290519081900360640190fd5b610cf8600583836132e3565b50610d03600161252b565b601154600c54600354600d54604080517fb1db135800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9485166004820152602481019390935290831660448301528051929093169263b1db1358926064808401938290030181600087803b158015610d8c57600080fd5b505af1158015610da0573d6000803e3d6000fd5b505050506040513d6040811015610db657600080fd5b508051602091820151601480547fffffffffffffffffffffffff000000000000000000000000000000000000000090811673ffffffffffffffffffffffffffffffffffffffff938416179182905560138054909116938316939093179283905560408051938316845291169282019290925281517fbb039b7f29a65a98f18420615decf31660e6ebf23cf9e1766635b0b36fd6f507929181900390910190a15050565b60135473ffffffffffffffffffffffffffffffffffffffff1681565b60145473ffffffffffffffffffffffffffffffffffffffff1681565b610e99610a45565b15610f0557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a2070617573656400000000000000000000000000000000604482015290519081900360640190fd5b6001600b5474010000000000000000000000000000000000000000900460ff166002811115610f3057fe5b14610f9c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f496e636f72726563742073746174650000000000000000000000000000000000604482015290519081900360640190fd5b6004546003540142101561101157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f496e636f72726563742074696d65000000000000000000000000000000000000604482015290519081900360640190fd5b61101b600261252b565b6000601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634f9f22b6600e600f600560035488886040518763ffffffff1660e01b8152600401808060200180602001806020018781526020018060200185810385528b81815481526020019150805480156110e357602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff1681526001909101906020018083116110b8575b505085810384528a818154815260200191508054801561113957602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff16815260019091019060200180831161110e575b5050858103835289818154815260200191508054801561117857602002820191906000526020600020905b815481526020019060010190808311611164575b50508581038252878782818152602001925060200280828437600081840152601f19601f8201169050808301925050509a505050505050505050505060006040518083038186803b1580156111cc57600080fd5b505afa1580156111e0573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201604090815281101561122757600080fd5b81516020830180516040519294929383019291908464010000000082111561124e57600080fd5b90830190602082018581111561126357600080fd5b825186602082028301116401000000008211171561128057600080fd5b82525081516020918201928201910280838360005b838110156112ad578181015183820152602001611295565b5050505091909101604052505082516112cf925060069150602084019061332e565b5081925050506112de816115c2565b600d54604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905192935060009273ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b15801561135557600080fd5b505afa158015611369573d6000803e3d6000fd5b505050506040513d602081101561137f57600080fd5b5051601354604080517f18160ddd000000000000000000000000000000000000000000000000000000008152905192935060009273ffffffffffffffffffffffffffffffffffffffff909216916318160ddd91600480820192602092909190829003018186803b1580156113f257600080fd5b505afa158015611406573d6000803e3d6000fd5b505050506040513d602081101561141c57600080fd5b50519050801561146957600061143283856125e2565b905061143e818361265e565b6007556114648261145e836114588764e8d4a510006125e2565b906126df565b9061265e565b600855505b7ffde8cf4d198dfab02a09142dd69eea28c2bcf34535b5b1061125c8a36c88462e6005600660075460085460405180806020018060200185815260200184815260200183810383528781815481526020019150805480156114e957602002820191906000526020600020905b8154815260200190600101908083116114d5575b5050838103825286818154815260200191508054801561152857602002820191906000526020600020905b815481526020019060010190808311611514575b5050965050505050505060405180910390a15050505050565b600260015414156115b357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b6002600155610856338261218f565b600064e8d4a510008211156115dd575064e8d4a510006115e0565b50805b919050565b60095481565b600d5473ffffffffffffffffffffffffffffffffffffffff1681565b60105473ffffffffffffffffffffffffffffffffffffffff1681565b6005818154811061078d57600080fd5b60025481565b60075481565b600b5474010000000000000000000000000000000000000000900460ff1681565b600c5473ffffffffffffffffffffffffffffffffffffffff1681565b600260015414156116ee57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b600260015561170033858585856118f2565b5050600180555050565b64e8d4a5100081565b600a5481565b600b5473ffffffffffffffffffffffffffffffffffffffff1681565b61173d61209d565b73ffffffffffffffffffffffffffffffffffffffff1661175b610c39565b73ffffffffffffffffffffffffffffffffffffffff16146117dd57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8116611849576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602681526020018061337f6026913960400191505060405180910390fd5b6000805460405173ffffffffffffffffffffffffffffffffffffffff808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60125473ffffffffffffffffffffffffffffffffffffffff1681565b60008411806119015750600083115b61196c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f426f746820746f6b656e73207a65726f20616d6f756e74000000000000000000604482015290519081900360640190fd5b601354604080517f70a08231000000000000000000000000000000000000000000000000000000008152336004820152905173ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b1580156119dd57600080fd5b505afa1580156119f1573d6000803e3d6000fd5b505050506040513d6020811015611a0757600080fd5b5051841115611a7757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f496e73756666696369656e74207072696d61727920616d6f756e740000000000604482015290519081900360640190fd5b601454604080517f70a08231000000000000000000000000000000000000000000000000000000008152336004820152905173ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b158015611ae857600080fd5b505afa158015611afc573d6000803e3d6000fd5b505050506040513d6020811015611b1257600080fd5b5051831115611b8257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f496e73756666696369656e7420636f6d706c656d656e7420616d6f756e740000604482015290519081900360640190fd5b600454600354014210158015611bc057506001600b5474010000000000000000000000000000000000000000900460ff166002811115611bbe57fe5b145b15611bcf57611bcf8282610e91565b6002600b5474010000000000000000000000000000000000000000900460ff166002811115611bfa57fe5b1415611c7d57601354600754600091611c2d91889173ffffffffffffffffffffffffffffffffffffffff16908890612756565b9050611c6981611c6388601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1688600854612756565b90612899565b90508015611c7b57611c7b868261290d565b505b5050505050565b60008111611cf357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f5a65726f20616d6f756e74000000000000000000000000000000000000000000604482015290519081900360640190fd5b601354604080517f70a08231000000000000000000000000000000000000000000000000000000008152336004820152905173ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b158015611d6457600080fd5b505afa158015611d78573d6000803e3d6000fd5b505050506040513d6020811015611d8e57600080fd5b5051811115611dfe57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f496e73756666696369656e74207072696d61727920616d6f756e740000000000604482015290519081900360640190fd5b601454604080517f70a08231000000000000000000000000000000000000000000000000000000008152336004820152905173ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b158015611e6f57600080fd5b505afa158015611e83573d6000803e3d6000fd5b505050506040513d6020811015611e9957600080fd5b5051811115611f0957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f496e73756666696369656e7420636f6d706c656d656e7420616d6f756e740000604482015290519081900360640190fd5b601354604080517f79cc679000000000000000000000000000000000000000000000000000000000815233600482015260248101849052905173ffffffffffffffffffffffffffffffffffffffff909216916379cc67909160448082019260009290919082900301818387803b158015611f8257600080fd5b505af1158015611f96573d6000803e3d6000fd5b5050601454604080517f79cc679000000000000000000000000000000000000000000000000000000000815233600482015260248101869052905173ffffffffffffffffffffffffffffffffffffffff90921693506379cc6790925060448082019260009290919082900301818387803b15801561201357600080fd5b505af1158015612027573d6000803e3d6000fd5b50505050600061203682612a59565b90508273ffffffffffffffffffffffffffffffffffffffff167f2dc8e290002f06fc0085bbca9dfb8b415cf4d1178950c72ff9ee8f4d8878ee668383604051808381526020018281526020019250505060405180910390a2612098838261290d565b505050565b3390565b6120a9610a45565b61211457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f5061757361626c653a206e6f7420706175736564000000000000000000000000604482015290519081900360640190fd5b600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa61216561209d565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190a1565b6001600b5474010000000000000000000000000000000000000000900460ff1660028111156121ba57fe5b1461222657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f4c697665206973206f7665720000000000000000000000000000000000000000604482015290519081900360640190fd5b6000811161229557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f5a65726f20616d6f756e74000000000000000000000000000000000000000000604482015290519081900360640190fd5b61229f3382612b91565b905060006122ac82612ea1565b905060006122ba83836126df565b905060006122c78261317d565b601354604080517f40c10f1900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff89811660048301526024820185905291519394509116916340c10f199160448082019260009290919082900301818387803b15801561234457600080fd5b505af1158015612358573d6000803e3d6000fd5b5050601454604080517f40c10f1900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8a811660048301526024820187905291519190921693506340c10f199250604480830192600092919082900301818387803b1580156123d757600080fd5b505af11580156123eb573d6000803e3d6000fd5b50506040805184815260208101889052808201879052905173ffffffffffffffffffffffffffffffffffffffff891693507f5a3358a3d27a5373c0df2604662088d37894d56b7cfd27f315770440f4e0d91992509081900360600190a25050505050565b612457610a45565b156124c357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a2070617573656400000000000000000000000000000000604482015290519081900360640190fd5b600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16740100000000000000000000000000000000000000001790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861216561209d565b600b80548291907fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff167401000000000000000000000000000000000000000083600281111561257657fe5b02179055507fe8a97ea87e4388fa22d496b95a8ed5ced6717f49790318de2b928aaf37a021d8600b60149054906101000a900460ff1682604051808360028111156125bd57fe5b81526020018260028111156125ce57fe5b81526020019250505060405180910390a150565b6000826125f157506000612658565b828202828482816125fe57fe5b0414612655576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806133a56021913960400191505060405180910390fd5b90505b92915050565b60008082116126ce57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b8183816126d757fe5b049392505050565b60008282111561275057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b60008261276557506000612891565b604080517f79cc679000000000000000000000000000000000000000000000000000000000815233600482015260248101859052905173ffffffffffffffffffffffffffffffffffffffff8616916379cc679091604480830192600092919082900301818387803b1580156127d957600080fd5b505af11580156127ed573d6000803e3d6000fd5b5050505064e8d4a5100061280a83856125e290919063ffffffff16565b8161281157fe5b0490508473ffffffffffffffffffffffffffffffffffffffff167f764aeeb2d1ec3f2945d6486e2f7e3fae9ac5fe11aa56b7a9d90c92212e33050c85858585604051808573ffffffffffffffffffffffffffffffffffffffff16815260200184815260200183815260200182815260200194505050505060405180910390a25b949350505050565b60008282018381101561265557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600d54604080517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8581166004830152602482018590529151919092169163a9059cbb91604480830192600092919082900301818387803b15801561298857600080fd5b505af115801561299c573d6000803e3d6000fd5b5050505060003d600081146129b857602081146129e057600080fd5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff91506129ec565b60206000803e60005191505b508061209857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f544f4b454e5f5452414e534645525f4f55545f4641494c454400000000000000604482015290519081900360640190fd5b6000612658600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ab56c5926040518163ffffffff1660e01b815260040160206040518083038186803b158015612ac657600080fd5b505afa158015612ada573d6000803e3d6000fd5b505050506040513d6020811015612af057600080fd5b5051600c54604080517fc6bb30e2000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff9092169163c6bb30e291600480820192602092909190829003018186803b158015612b5d57600080fd5b505afa158015612b71573d6000803e3d6000fd5b505050506040513d6020811015612b8757600080fd5b50518491016125e2565b600d54604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051600092839273ffffffffffffffffffffffffffffffffffffffff909116916370a0823191602480820192602092909190829003018186803b158015612c0757600080fd5b505afa158015612c1b573d6000803e3d6000fd5b505050506040513d6020811015612c3157600080fd5b5051600d54604080517f23b872dd00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff88811660048301523060248301526044820188905291519394509116916323b872dd9160648082019260009290919082900301818387803b158015612cb657600080fd5b505af1158015612cca573d6000803e3d6000fd5b5050505060003d60008114612ce65760208114612d0e57600080fd5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9150612d1a565b60206000803e60005191505b5080612d8757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f544f4b454e5f5452414e534645525f494e5f4641494c45440000000000000000604482015290519081900360640190fd5b600d54604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905160009273ffffffffffffffffffffffffffffffffffffffff16916370a08231916024808301926020929190829003018186803b158015612df857600080fd5b505afa158015612e0c573d6000803e3d6000fd5b505050506040513d6020811015612e2257600080fd5b5051905082811015612e9557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f544f4b454e5f5452414e534645525f494e5f4f564552464c4f57000000000000604482015290519081900360640190fd5b91909103949350505050565b600080612ed383600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166009546132b5565b601254600d54600c54604080517fa6c3e6b9000000000000000000000000000000000000000000000000000000008152905194955073ffffffffffffffffffffffffffffffffffffffff93841694638da6def5943394811693889391169163a6c3e6b991600480820192602092909190829003018186803b158015612f5757600080fd5b505afa158015612f6b573d6000803e3d6000fd5b505050506040513d6020811015612f8157600080fd5b5051604080517fffffffff0000000000000000000000000000000000000000000000000000000060e088901b16815273ffffffffffffffffffffffffffffffffffffffff9586166004820152938516602485015260448401929092529290921660648201529051608480830192600092919082900301818387803b15801561300857600080fd5b505af115801561301c573d6000803e3d6000fd5b505050506000600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663de47f50b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561308a57600080fd5b505afa15801561309e573d6000803e3d6000fd5b505050506040513d60208110156130b457600080fd5b5051600a549091508111156130c85750600a545b600061316885600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a6c3e6b96040518163ffffffff1660e01b815260040160206040518083038186803b15801561313657600080fd5b505afa15801561314a573d6000803e3d6000fd5b505050506040513d602081101561316057600080fd5b5051846132b5565b90506131748382612899565b95945050505050565b6000612658600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ab56c5926040518163ffffffff1660e01b815260040160206040518083038186803b1580156131ea57600080fd5b505afa1580156131fe573d6000803e3d6000fd5b505050506040513d602081101561321457600080fd5b5051600c54604080517fc6bb30e2000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff9092169163c6bb30e291600480820192602092909190829003018186803b15801561328157600080fd5b505afa158015613295573d6000803e3d6000fd5b505050506040513d60208110156132ab57600080fd5b505184910161265e565b60006132ca64e8d4a5100061145e86856125e2565b905080156132dc576132dc838261290d565b9392505050565b82805482825590600052602060002090810192821561331e579160200282015b8281111561331e578235825591602001919060010190613303565b5061332a929150613369565b5090565b82805482825590600052602060002090810192821561331e579160200282015b8281111561331e57825182559160200191906001019061334e565b5b8082111561332a576000815560010161336a56fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a264697066735822122012fed4d2456a012e306bdb27693055187cbc4b962dcf939bc9616eb4d9b5660b64736f6c63430007060033000000000000000000000000000000000000000000000000000000006081654000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000fb21490a878aa2af08117c96f897095797bd91c0000000000000000000000003250da195662135726101e4b19ae9b8cba379321000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000001c00000000000000000000000005431ad3ca7a0ef299eb6e4c26657f046c358c1e6000000000000000000000000029fac98fdc8fb0b74e0fdd3c2d356000c8cb23200000000000000000000000069dce1f77427a5d5c31c61cce6aa0a7a13da967600000000000000000000000000000000000000000000000000000002540be400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000005f4ec3df9cbd43714fe2740f5e3616155c5b84190000000000000000000000000000000000000000000000000000000000000001000000000000000000000000fca05757a70154a8dc7b50064f1462142ee453d9

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061025c5760003560e01c806394f973d611610145578063bdd19891116100bd578063dfd105cb1161008c578063f25f4b5611610071578063f25f4b56146106a5578063f2fde38b146106ad578063fa443b53146106e05761025c565b8063dfd105cb14610695578063ef613f751461069d5761025c565b8063bdd19891146105e0578063c19d93fb146105e8578063dbcb32bf14610611578063dd12a043146106195761025c565b8063b0e21e8a11610114578063b3859789116100f9578063b3859789146105b3578063b4ba0231146105bb578063bc49abd8146105d85761025c565b8063b0e21e8a146105a3578063b2016bd4146105ab5761025c565b806394f973d6146104f15780639b2db373146104f9578063a0712d6814610569578063a5e45bec146105865761025c565b80635b69a7d8116101d857806379b03d5d116101a75780638da5cb5b1161018c5780638da5cb5b146104715780638e0fad201461047957806391ac094c146104e95761025c565b806379b03d5d146104615780638456cb59146104695761025c565b80635b69a7d8146104185780635c975abb1461043557806366101b6414610451578063715018a6146104595761025c565b8063278ecde11161022f5780633a656480116102145780633a656480146103cf5780633f4ba83a146103d7578063449a52f8146103df5761025c565b8063278ecde1146103795780632efcc8db146103965761025c565b806305a8a22c146102615780630fa578c6146102fc578063188dfdfd1461031657806321e64e4c14610333575b600080fd5b6102fa6004803603608081101561027757600080fd5b73ffffffffffffffffffffffffffffffffffffffff82351691602081013591604082013591908101906080810160608201356401000000008111156102bb57600080fd5b8201836020820111156102cd57600080fd5b803590602001918460208302840111640100000000831117156102ef57600080fd5b5090925090506106e8565b005b610304610777565b60408051918252519081900360200190f35b6103046004803603602081101561032c57600080fd5b503561077d565b6103506004803603602081101561034957600080fd5b503561079e565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b6102fa6004803603602081101561038f57600080fd5b50356107d5565b6102fa600480360360408110156103ac57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813516906020013561085d565b6103506108e6565b6102fa610902565b6102fa600480360360408110156103f557600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001356109b4565b6103506004803603602081101561042e57600080fd5b5035610a35565b61043d610a45565b604080519115158252519081900360200190f35b610304610a66565b6102fa610a6c565b610304610b83565b6102fa610b89565b610350610c39565b6102fa6004803603602081101561048f57600080fd5b8101906020810181356401000000008111156104aa57600080fd5b8201836020820111156104bc57600080fd5b803590602001918460208302840111640100000000831117156104de57600080fd5b509092509050610c55565b610350610e59565b610350610e75565b6102fa6004803603602081101561050f57600080fd5b81019060208101813564010000000081111561052a57600080fd5b82018360208201111561053c57600080fd5b8035906020019184602083028401116401000000008311171561055e57600080fd5b509092509050610e91565b6102fa6004803603602081101561057f57600080fd5b5035611541565b6103046004803603602081101561059c57600080fd5b50356115c2565b6103046115e5565b6103506115eb565b610350611607565b610304600480360360208110156105d157600080fd5b5035611623565b610304611633565b610304611639565b6105f061163f565b6040518082600281111561060057fe5b815260200191505060405180910390f35b610350611660565b6102fa6004803603606081101561062f57600080fd5b81359160208101359181019060608101604082013564010000000081111561065657600080fd5b82018360208201111561066857600080fd5b8035906020019184602083028401116401000000008311171561068a57600080fd5b50909250905061167c565b61030461170a565b610304611713565b610350611719565b6102fa600480360360208110156106c357600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611735565b6103506118d6565b6002600154141561075a57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b600260015561076c85858585856118f2565b505060018055505050565b60045481565b6006818154811061078d57600080fd5b600091825260209091200154905081565b600f81815481106107ae57600080fd5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16905081565b6002600154141561084757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b60026001556108563382611c84565b5060018055565b600260015414156108cf57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b60026001556108de8282611c84565b505060018055565b60115473ffffffffffffffffffffffffffffffffffffffff1681565b61090a61209d565b73ffffffffffffffffffffffffffffffffffffffff16610928610c39565b73ffffffffffffffffffffffffffffffffffffffff16146109aa57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6109b26120a1565b565b60026001541415610a2657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b60026001556108de828261218f565b600e81815481106107ae57600080fd5b60005474010000000000000000000000000000000000000000900460ff1690565b60035481565b610a7461209d565b73ffffffffffffffffffffffffffffffffffffffff16610a92610c39565b73ffffffffffffffffffffffffffffffffffffffff1614610b1457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6000805460405173ffffffffffffffffffffffffffffffffffffffff909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b60085481565b610b9161209d565b73ffffffffffffffffffffffffffffffffffffffff16610baf610c39565b73ffffffffffffffffffffffffffffffffffffffff1614610c3157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6109b261244f565b60005473ffffffffffffffffffffffffffffffffffffffff1690565b6000600b5474010000000000000000000000000000000000000000900460ff166002811115610c8057fe5b14610cec57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f496e636f72726563742073746174652e00000000000000000000000000000000604482015290519081900360640190fd5b610cf8600583836132e3565b50610d03600161252b565b601154600c54600354600d54604080517fb1db135800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9485166004820152602481019390935290831660448301528051929093169263b1db1358926064808401938290030181600087803b158015610d8c57600080fd5b505af1158015610da0573d6000803e3d6000fd5b505050506040513d6040811015610db657600080fd5b508051602091820151601480547fffffffffffffffffffffffff000000000000000000000000000000000000000090811673ffffffffffffffffffffffffffffffffffffffff938416179182905560138054909116938316939093179283905560408051938316845291169282019290925281517fbb039b7f29a65a98f18420615decf31660e6ebf23cf9e1766635b0b36fd6f507929181900390910190a15050565b60135473ffffffffffffffffffffffffffffffffffffffff1681565b60145473ffffffffffffffffffffffffffffffffffffffff1681565b610e99610a45565b15610f0557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a2070617573656400000000000000000000000000000000604482015290519081900360640190fd5b6001600b5474010000000000000000000000000000000000000000900460ff166002811115610f3057fe5b14610f9c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f496e636f72726563742073746174650000000000000000000000000000000000604482015290519081900360640190fd5b6004546003540142101561101157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f496e636f72726563742074696d65000000000000000000000000000000000000604482015290519081900360640190fd5b61101b600261252b565b6000601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634f9f22b6600e600f600560035488886040518763ffffffff1660e01b8152600401808060200180602001806020018781526020018060200185810385528b81815481526020019150805480156110e357602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff1681526001909101906020018083116110b8575b505085810384528a818154815260200191508054801561113957602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff16815260019091019060200180831161110e575b5050858103835289818154815260200191508054801561117857602002820191906000526020600020905b815481526020019060010190808311611164575b50508581038252878782818152602001925060200280828437600081840152601f19601f8201169050808301925050509a505050505050505050505060006040518083038186803b1580156111cc57600080fd5b505afa1580156111e0573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201604090815281101561122757600080fd5b81516020830180516040519294929383019291908464010000000082111561124e57600080fd5b90830190602082018581111561126357600080fd5b825186602082028301116401000000008211171561128057600080fd5b82525081516020918201928201910280838360005b838110156112ad578181015183820152602001611295565b5050505091909101604052505082516112cf925060069150602084019061332e565b5081925050506112de816115c2565b600d54604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905192935060009273ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b15801561135557600080fd5b505afa158015611369573d6000803e3d6000fd5b505050506040513d602081101561137f57600080fd5b5051601354604080517f18160ddd000000000000000000000000000000000000000000000000000000008152905192935060009273ffffffffffffffffffffffffffffffffffffffff909216916318160ddd91600480820192602092909190829003018186803b1580156113f257600080fd5b505afa158015611406573d6000803e3d6000fd5b505050506040513d602081101561141c57600080fd5b50519050801561146957600061143283856125e2565b905061143e818361265e565b6007556114648261145e836114588764e8d4a510006125e2565b906126df565b9061265e565b600855505b7ffde8cf4d198dfab02a09142dd69eea28c2bcf34535b5b1061125c8a36c88462e6005600660075460085460405180806020018060200185815260200184815260200183810383528781815481526020019150805480156114e957602002820191906000526020600020905b8154815260200190600101908083116114d5575b5050838103825286818154815260200191508054801561152857602002820191906000526020600020905b815481526020019060010190808311611514575b5050965050505050505060405180910390a15050505050565b600260015414156115b357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b6002600155610856338261218f565b600064e8d4a510008211156115dd575064e8d4a510006115e0565b50805b919050565b60095481565b600d5473ffffffffffffffffffffffffffffffffffffffff1681565b60105473ffffffffffffffffffffffffffffffffffffffff1681565b6005818154811061078d57600080fd5b60025481565b60075481565b600b5474010000000000000000000000000000000000000000900460ff1681565b600c5473ffffffffffffffffffffffffffffffffffffffff1681565b600260015414156116ee57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b600260015561170033858585856118f2565b5050600180555050565b64e8d4a5100081565b600a5481565b600b5473ffffffffffffffffffffffffffffffffffffffff1681565b61173d61209d565b73ffffffffffffffffffffffffffffffffffffffff1661175b610c39565b73ffffffffffffffffffffffffffffffffffffffff16146117dd57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8116611849576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602681526020018061337f6026913960400191505060405180910390fd5b6000805460405173ffffffffffffffffffffffffffffffffffffffff808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60125473ffffffffffffffffffffffffffffffffffffffff1681565b60008411806119015750600083115b61196c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f426f746820746f6b656e73207a65726f20616d6f756e74000000000000000000604482015290519081900360640190fd5b601354604080517f70a08231000000000000000000000000000000000000000000000000000000008152336004820152905173ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b1580156119dd57600080fd5b505afa1580156119f1573d6000803e3d6000fd5b505050506040513d6020811015611a0757600080fd5b5051841115611a7757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f496e73756666696369656e74207072696d61727920616d6f756e740000000000604482015290519081900360640190fd5b601454604080517f70a08231000000000000000000000000000000000000000000000000000000008152336004820152905173ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b158015611ae857600080fd5b505afa158015611afc573d6000803e3d6000fd5b505050506040513d6020811015611b1257600080fd5b5051831115611b8257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f496e73756666696369656e7420636f6d706c656d656e7420616d6f756e740000604482015290519081900360640190fd5b600454600354014210158015611bc057506001600b5474010000000000000000000000000000000000000000900460ff166002811115611bbe57fe5b145b15611bcf57611bcf8282610e91565b6002600b5474010000000000000000000000000000000000000000900460ff166002811115611bfa57fe5b1415611c7d57601354600754600091611c2d91889173ffffffffffffffffffffffffffffffffffffffff16908890612756565b9050611c6981611c6388601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1688600854612756565b90612899565b90508015611c7b57611c7b868261290d565b505b5050505050565b60008111611cf357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f5a65726f20616d6f756e74000000000000000000000000000000000000000000604482015290519081900360640190fd5b601354604080517f70a08231000000000000000000000000000000000000000000000000000000008152336004820152905173ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b158015611d6457600080fd5b505afa158015611d78573d6000803e3d6000fd5b505050506040513d6020811015611d8e57600080fd5b5051811115611dfe57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f496e73756666696369656e74207072696d61727920616d6f756e740000000000604482015290519081900360640190fd5b601454604080517f70a08231000000000000000000000000000000000000000000000000000000008152336004820152905173ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b158015611e6f57600080fd5b505afa158015611e83573d6000803e3d6000fd5b505050506040513d6020811015611e9957600080fd5b5051811115611f0957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f496e73756666696369656e7420636f6d706c656d656e7420616d6f756e740000604482015290519081900360640190fd5b601354604080517f79cc679000000000000000000000000000000000000000000000000000000000815233600482015260248101849052905173ffffffffffffffffffffffffffffffffffffffff909216916379cc67909160448082019260009290919082900301818387803b158015611f8257600080fd5b505af1158015611f96573d6000803e3d6000fd5b5050601454604080517f79cc679000000000000000000000000000000000000000000000000000000000815233600482015260248101869052905173ffffffffffffffffffffffffffffffffffffffff90921693506379cc6790925060448082019260009290919082900301818387803b15801561201357600080fd5b505af1158015612027573d6000803e3d6000fd5b50505050600061203682612a59565b90508273ffffffffffffffffffffffffffffffffffffffff167f2dc8e290002f06fc0085bbca9dfb8b415cf4d1178950c72ff9ee8f4d8878ee668383604051808381526020018281526020019250505060405180910390a2612098838261290d565b505050565b3390565b6120a9610a45565b61211457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f5061757361626c653a206e6f7420706175736564000000000000000000000000604482015290519081900360640190fd5b600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa61216561209d565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190a1565b6001600b5474010000000000000000000000000000000000000000900460ff1660028111156121ba57fe5b1461222657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f4c697665206973206f7665720000000000000000000000000000000000000000604482015290519081900360640190fd5b6000811161229557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f5a65726f20616d6f756e74000000000000000000000000000000000000000000604482015290519081900360640190fd5b61229f3382612b91565b905060006122ac82612ea1565b905060006122ba83836126df565b905060006122c78261317d565b601354604080517f40c10f1900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff89811660048301526024820185905291519394509116916340c10f199160448082019260009290919082900301818387803b15801561234457600080fd5b505af1158015612358573d6000803e3d6000fd5b5050601454604080517f40c10f1900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8a811660048301526024820187905291519190921693506340c10f199250604480830192600092919082900301818387803b1580156123d757600080fd5b505af11580156123eb573d6000803e3d6000fd5b50506040805184815260208101889052808201879052905173ffffffffffffffffffffffffffffffffffffffff891693507f5a3358a3d27a5373c0df2604662088d37894d56b7cfd27f315770440f4e0d91992509081900360600190a25050505050565b612457610a45565b156124c357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a2070617573656400000000000000000000000000000000604482015290519081900360640190fd5b600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16740100000000000000000000000000000000000000001790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861216561209d565b600b80548291907fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff167401000000000000000000000000000000000000000083600281111561257657fe5b02179055507fe8a97ea87e4388fa22d496b95a8ed5ced6717f49790318de2b928aaf37a021d8600b60149054906101000a900460ff1682604051808360028111156125bd57fe5b81526020018260028111156125ce57fe5b81526020019250505060405180910390a150565b6000826125f157506000612658565b828202828482816125fe57fe5b0414612655576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806133a56021913960400191505060405180910390fd5b90505b92915050565b60008082116126ce57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b8183816126d757fe5b049392505050565b60008282111561275057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b60008261276557506000612891565b604080517f79cc679000000000000000000000000000000000000000000000000000000000815233600482015260248101859052905173ffffffffffffffffffffffffffffffffffffffff8616916379cc679091604480830192600092919082900301818387803b1580156127d957600080fd5b505af11580156127ed573d6000803e3d6000fd5b5050505064e8d4a5100061280a83856125e290919063ffffffff16565b8161281157fe5b0490508473ffffffffffffffffffffffffffffffffffffffff167f764aeeb2d1ec3f2945d6486e2f7e3fae9ac5fe11aa56b7a9d90c92212e33050c85858585604051808573ffffffffffffffffffffffffffffffffffffffff16815260200184815260200183815260200182815260200194505050505060405180910390a25b949350505050565b60008282018381101561265557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600d54604080517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8581166004830152602482018590529151919092169163a9059cbb91604480830192600092919082900301818387803b15801561298857600080fd5b505af115801561299c573d6000803e3d6000fd5b5050505060003d600081146129b857602081146129e057600080fd5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff91506129ec565b60206000803e60005191505b508061209857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f544f4b454e5f5452414e534645525f4f55545f4641494c454400000000000000604482015290519081900360640190fd5b6000612658600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ab56c5926040518163ffffffff1660e01b815260040160206040518083038186803b158015612ac657600080fd5b505afa158015612ada573d6000803e3d6000fd5b505050506040513d6020811015612af057600080fd5b5051600c54604080517fc6bb30e2000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff9092169163c6bb30e291600480820192602092909190829003018186803b158015612b5d57600080fd5b505afa158015612b71573d6000803e3d6000fd5b505050506040513d6020811015612b8757600080fd5b50518491016125e2565b600d54604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051600092839273ffffffffffffffffffffffffffffffffffffffff909116916370a0823191602480820192602092909190829003018186803b158015612c0757600080fd5b505afa158015612c1b573d6000803e3d6000fd5b505050506040513d6020811015612c3157600080fd5b5051600d54604080517f23b872dd00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff88811660048301523060248301526044820188905291519394509116916323b872dd9160648082019260009290919082900301818387803b158015612cb657600080fd5b505af1158015612cca573d6000803e3d6000fd5b5050505060003d60008114612ce65760208114612d0e57600080fd5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9150612d1a565b60206000803e60005191505b5080612d8757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f544f4b454e5f5452414e534645525f494e5f4641494c45440000000000000000604482015290519081900360640190fd5b600d54604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905160009273ffffffffffffffffffffffffffffffffffffffff16916370a08231916024808301926020929190829003018186803b158015612df857600080fd5b505afa158015612e0c573d6000803e3d6000fd5b505050506040513d6020811015612e2257600080fd5b5051905082811015612e9557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f544f4b454e5f5452414e534645525f494e5f4f564552464c4f57000000000000604482015290519081900360640190fd5b91909103949350505050565b600080612ed383600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166009546132b5565b601254600d54600c54604080517fa6c3e6b9000000000000000000000000000000000000000000000000000000008152905194955073ffffffffffffffffffffffffffffffffffffffff93841694638da6def5943394811693889391169163a6c3e6b991600480820192602092909190829003018186803b158015612f5757600080fd5b505afa158015612f6b573d6000803e3d6000fd5b505050506040513d6020811015612f8157600080fd5b5051604080517fffffffff0000000000000000000000000000000000000000000000000000000060e088901b16815273ffffffffffffffffffffffffffffffffffffffff9586166004820152938516602485015260448401929092529290921660648201529051608480830192600092919082900301818387803b15801561300857600080fd5b505af115801561301c573d6000803e3d6000fd5b505050506000600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663de47f50b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561308a57600080fd5b505afa15801561309e573d6000803e3d6000fd5b505050506040513d60208110156130b457600080fd5b5051600a549091508111156130c85750600a545b600061316885600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a6c3e6b96040518163ffffffff1660e01b815260040160206040518083038186803b15801561313657600080fd5b505afa15801561314a573d6000803e3d6000fd5b505050506040513d602081101561316057600080fd5b5051846132b5565b90506131748382612899565b95945050505050565b6000612658600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ab56c5926040518163ffffffff1660e01b815260040160206040518083038186803b1580156131ea57600080fd5b505afa1580156131fe573d6000803e3d6000fd5b505050506040513d602081101561321457600080fd5b5051600c54604080517fc6bb30e2000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff9092169163c6bb30e291600480820192602092909190829003018186803b15801561328157600080fd5b505afa158015613295573d6000803e3d6000fd5b505050506040513d60208110156132ab57600080fd5b505184910161265e565b60006132ca64e8d4a5100061145e86856125e2565b905080156132dc576132dc838261290d565b9392505050565b82805482825590600052602060002090810192821561331e579160200282015b8281111561331e578235825591602001919060010190613303565b5061332a929150613369565b5090565b82805482825590600052602060002090810192821561331e579160200282015b8281111561331e57825182559160200191906001019061334e565b5b8082111561332a576000815560010161336a56fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a264697066735822122012fed4d2456a012e306bdb27693055187cbc4b962dcf939bc9616eb4d9b5660b64736f6c63430007060033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

000000000000000000000000000000000000000000000000000000006081654000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000fb21490a878aa2af08117c96f897095797bd91c0000000000000000000000003250da195662135726101e4b19ae9b8cba379321000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000001c00000000000000000000000005431ad3ca7a0ef299eb6e4c26657f046c358c1e6000000000000000000000000029fac98fdc8fb0b74e0fdd3c2d356000c8cb23200000000000000000000000069dce1f77427a5d5c31c61cce6aa0a7a13da967600000000000000000000000000000000000000000000000000000002540be400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000005f4ec3df9cbd43714fe2740f5e3616155c5b84190000000000000000000000000000000000000000000000000000000000000001000000000000000000000000fca05757a70154a8dc7b50064f1462142ee453d9

-----Decoded View---------------
Arg [0] : _liveTime (uint256): 1619092800
Arg [1] : _protocolFee (uint256): 0
Arg [2] : _feeWallet (address): 0x0FB21490A878AA2Af08117C96F897095797bD91C
Arg [3] : _derivativeSpecification (address): 0x3250Da195662135726101e4B19Ae9b8cbA379321
Arg [4] : _collateralToken (address): 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48
Arg [5] : _oracles (address[]): 0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419
Arg [6] : _oracleIterators (address[]): 0xFcA05757A70154A8dc7b50064F1462142eE453D9
Arg [7] : _collateralSplit (address): 0x5431AD3cA7A0EF299Eb6e4C26657F046C358c1E6
Arg [8] : _tokenBuilder (address): 0x029fAC98FdC8fB0B74E0FdD3C2D356000c8cb232
Arg [9] : _feeLogger (address): 0x69Dce1f77427a5d5c31c61CcE6aA0a7A13da9676
Arg [10] : _authorFeeLimit (uint256): 10000000000
Arg [11] : _settlementDelay (uint256): 0

-----Encoded View---------------
16 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000060816540
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [2] : 0000000000000000000000000fb21490a878aa2af08117c96f897095797bd91c
Arg [3] : 0000000000000000000000003250da195662135726101e4b19ae9b8cba379321
Arg [4] : 000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000180
Arg [6] : 00000000000000000000000000000000000000000000000000000000000001c0
Arg [7] : 0000000000000000000000005431ad3ca7a0ef299eb6e4c26657f046c358c1e6
Arg [8] : 000000000000000000000000029fac98fdc8fb0b74e0fdd3c2d356000c8cb232
Arg [9] : 00000000000000000000000069dce1f77427a5d5c31c61cce6aa0a7a13da9676
Arg [10] : 00000000000000000000000000000000000000000000000000000002540be400
Arg [11] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [12] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [13] : 0000000000000000000000005f4ec3df9cbd43714fe2740f5e3616155c5b8419
Arg [14] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [15] : 000000000000000000000000fca05757a70154a8dc7b50064f1462142ee453d9


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.