ETH Price: $2,556.73 (+3.80%)

Contract

0x649f1A91a9693C94747e95C9CE3d9A952Ef652A9
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Claim123216972021-04-27 9:47:571219 days ago1619516877IN
0x649f1A91...52Ef652A9
0 ETH0.0034402641.8
Withdraw123216922021-04-27 9:47:341219 days ago1619516854IN
0x649f1A91...52Ef652A9
0 ETH0.0030694842
Withdraw123192022021-04-27 0:34:161220 days ago1619483656IN
0x649f1A91...52Ef652A9
0 ETH0.002996441
Unbond123138362021-04-26 4:41:571221 days ago1619412117IN
0x649f1A91...52Ef652A9
0 ETH0.0045653941.8
Unbond121056782021-03-25 3:34:061253 days ago1616643246IN
0x649f1A91...52Ef652A9
0 ETH0.01196352144
Unbond119656842021-03-03 13:54:311274 days ago1614779671IN
0x649f1A91...52Ef652A9
0 ETH0.0112792115
Withdraw117717292021-02-01 17:39:241304 days ago1612201164IN
0x649f1A91...52Ef652A9
0 ETH0.00572086114
Claim117717272021-02-01 17:39:181304 days ago1612201158IN
0x649f1A91...52Ef652A9
0 ETH0.00580294114
Withdraw117498362021-01-29 8:52:431307 days ago1611910363IN
0x649f1A91...52Ef652A9
0 ETH0.01029891158
Withdraw117496242021-01-29 8:00:281307 days ago1611907228IN
0x649f1A91...52Ef652A9
0 ETH0.00658348101
Withdraw117451462021-01-28 15:41:141308 days ago1611848474IN
0x649f1A91...52Ef652A9
0 ETH0.006127294
Withdraw117443302021-01-28 12:38:071308 days ago1611837487IN
0x649f1A91...52Ef652A9
0 ETH0.00658348101
Unbond117418852021-01-28 3:21:041309 days ago1611804064IN
0x649f1A91...52Ef652A9
0 ETH0.0064566757
Unbond117405752021-01-27 22:31:571309 days ago1611786717IN
0x649f1A91...52Ef652A9
0 ETH0.0059632455.8775
Withdraw117404612021-01-27 22:05:141309 days ago1611785114IN
0x649f1A91...52Ef652A9
0 ETH0.0056709287
Claim117404562021-01-27 22:04:091309 days ago1611785049IN
0x649f1A91...52Ef652A9
0 ETH0.0057335687
Withdraw117369152021-01-27 9:08:561309 days ago1611738536IN
0x649f1A91...52Ef652A9
0 ETH0.0055405585
Unbond117355482021-01-27 3:55:291310 days ago1611719729IN
0x649f1A91...52Ef652A9
0 ETH0.0067233663
Unbond117351952021-01-27 2:39:341310 days ago1611715174IN
0x649f1A91...52Ef652A9
0 ETH0.0062964859
Unbond117333652021-01-26 19:51:441310 days ago1611690704IN
0x649f1A91...52Ef652A9
0 ETH0.0052340463
Claim117333602021-01-26 19:50:401310 days ago1611690640IN
0x649f1A91...52Ef652A9
0 ETH0.0040722480
Withdraw117328592021-01-26 17:58:361310 days ago1611683916IN
0x649f1A91...52Ef652A9
0 ETH0.00677903104
Claim117328542021-01-26 17:58:051310 days ago1611683885IN
0x649f1A91...52Ef652A9
0 ETH0.00529391104
Bond117322022021-01-26 15:43:321310 days ago1611675812IN
0x649f1A91...52Ef652A9
0 ETH0.0109161990
Deposit117321992021-01-26 15:42:581310 days ago1611675778IN
0x649f1A91...52Ef652A9
0 ETH0.0061673192
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Pool

Compiler Version
v0.5.17+commit.d19bba13

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity)

/**
 *Submitted for verification at Etherscan.io on 2021-01-13
*/

pragma solidity ^0.5.17;
pragma experimental ABIEncoderV2;


/**
 * @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, 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) {
        return sub(a, b, "SafeMath: subtraction overflow");
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     * - Subtraction cannot overflow.
     *
     * _Available since v2.4.0._
     */
    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b <= a, errorMessage);
        uint256 c = a - b;

        return c;
    }

    /**
     * @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) {
        // 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 0;
        }

        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");

        return c;
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts 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) {
        return div(a, b, "SafeMath: division by zero");
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts with custom message 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.
     *
     * _Available since v2.4.0._
     */
    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        // Solidity only automatically asserts when dividing by 0
        require(b > 0, errorMessage);
        uint256 c = a / b;
        // assert(a == b * c + a % b); // There is no case in which this doesn't hold

        return c;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts 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) {
        return mod(a, b, "SafeMath: modulo by zero");
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts with custom message 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.
     *
     * _Available since v2.4.0._
     */
    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b != 0, errorMessage);
        return a % b;
    }
}

/**
 * @dev Interface of the ERC20 standard as defined in the EIP. Does not include
 * the optional functions; to access them see {ERC20Detailed}.
 */
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);
}

/*
    Copyright 2019 dYdX Trading Inc.

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
*/
/**
 * @title Require
 * @author dYdX
 *
 * Stringifies parameters to pretty-print revert messages. Costs more gas than regular require()
 */
library Require {

    // ============ Constants ============

    uint256 constant ASCII_ZERO = 48; // '0'
    uint256 constant ASCII_RELATIVE_ZERO = 87; // 'a' - 10
    uint256 constant ASCII_LOWER_EX = 120; // 'x'
    bytes2 constant COLON = 0x3a20; // ': '
    bytes2 constant COMMA = 0x2c20; // ', '
    bytes2 constant LPAREN = 0x203c; // ' <'
    byte constant RPAREN = 0x3e; // '>'
    uint256 constant FOUR_BIT_MASK = 0xf;

    // ============ Library Functions ============

    function that(
        bool must,
        bytes32 file,
        bytes32 reason
    )
    internal
    pure
    {
        if (!must) {
            revert(
                string(
                    abi.encodePacked(
                        stringifyTruncated(file),
                        COLON,
                        stringifyTruncated(reason)
                    )
                )
            );
        }
    }

    function that(
        bool must,
        bytes32 file,
        bytes32 reason,
        uint256 payloadA
    )
    internal
    pure
    {
        if (!must) {
            revert(
                string(
                    abi.encodePacked(
                        stringifyTruncated(file),
                        COLON,
                        stringifyTruncated(reason),
                        LPAREN,
                        stringify(payloadA),
                        RPAREN
                    )
                )
            );
        }
    }

    function that(
        bool must,
        bytes32 file,
        bytes32 reason,
        uint256 payloadA,
        uint256 payloadB
    )
    internal
    pure
    {
        if (!must) {
            revert(
                string(
                    abi.encodePacked(
                        stringifyTruncated(file),
                        COLON,
                        stringifyTruncated(reason),
                        LPAREN,
                        stringify(payloadA),
                        COMMA,
                        stringify(payloadB),
                        RPAREN
                    )
                )
            );
        }
    }

    function that(
        bool must,
        bytes32 file,
        bytes32 reason,
        address payloadA
    )
    internal
    pure
    {
        if (!must) {
            revert(
                string(
                    abi.encodePacked(
                        stringifyTruncated(file),
                        COLON,
                        stringifyTruncated(reason),
                        LPAREN,
                        stringify(payloadA),
                        RPAREN
                    )
                )
            );
        }
    }

    function that(
        bool must,
        bytes32 file,
        bytes32 reason,
        address payloadA,
        uint256 payloadB
    )
    internal
    pure
    {
        if (!must) {
            revert(
                string(
                    abi.encodePacked(
                        stringifyTruncated(file),
                        COLON,
                        stringifyTruncated(reason),
                        LPAREN,
                        stringify(payloadA),
                        COMMA,
                        stringify(payloadB),
                        RPAREN
                    )
                )
            );
        }
    }

    function that(
        bool must,
        bytes32 file,
        bytes32 reason,
        address payloadA,
        uint256 payloadB,
        uint256 payloadC
    )
    internal
    pure
    {
        if (!must) {
            revert(
                string(
                    abi.encodePacked(
                        stringifyTruncated(file),
                        COLON,
                        stringifyTruncated(reason),
                        LPAREN,
                        stringify(payloadA),
                        COMMA,
                        stringify(payloadB),
                        COMMA,
                        stringify(payloadC),
                        RPAREN
                    )
                )
            );
        }
    }

    function that(
        bool must,
        bytes32 file,
        bytes32 reason,
        bytes32 payloadA
    )
    internal
    pure
    {
        if (!must) {
            revert(
                string(
                    abi.encodePacked(
                        stringifyTruncated(file),
                        COLON,
                        stringifyTruncated(reason),
                        LPAREN,
                        stringify(payloadA),
                        RPAREN
                    )
                )
            );
        }
    }

    function that(
        bool must,
        bytes32 file,
        bytes32 reason,
        bytes32 payloadA,
        uint256 payloadB,
        uint256 payloadC
    )
    internal
    pure
    {
        if (!must) {
            revert(
                string(
                    abi.encodePacked(
                        stringifyTruncated(file),
                        COLON,
                        stringifyTruncated(reason),
                        LPAREN,
                        stringify(payloadA),
                        COMMA,
                        stringify(payloadB),
                        COMMA,
                        stringify(payloadC),
                        RPAREN
                    )
                )
            );
        }
    }

    // ============ Private Functions ============

    function stringifyTruncated(
        bytes32 input
    )
    private
    pure
    returns (bytes memory)
    {
        // put the input bytes into the result
        bytes memory result = abi.encodePacked(input);

        // determine the length of the input by finding the location of the last non-zero byte
        for (uint256 i = 32; i > 0; ) {
            // reverse-for-loops with unsigned integer
            /* solium-disable-next-line security/no-modify-for-iter-var */
            i--;

            // find the last non-zero byte in order to determine the length
            if (result[i] != 0) {
                uint256 length = i + 1;

                /* solium-disable-next-line security/no-inline-assembly */
                assembly {
                    mstore(result, length) // r.length = length;
                }

                return result;
            }
        }

        // all bytes are zero
        return new bytes(0);
    }

    function stringify(
        uint256 input
    )
    private
    pure
    returns (bytes memory)
    {
        if (input == 0) {
            return "0";
        }

        // get the final string length
        uint256 j = input;
        uint256 length;
        while (j != 0) {
            length++;
            j /= 10;
        }

        // allocate the string
        bytes memory bstr = new bytes(length);

        // populate the string starting with the least-significant character
        j = input;
        for (uint256 i = length; i > 0; ) {
            // reverse-for-loops with unsigned integer
            /* solium-disable-next-line security/no-modify-for-iter-var */
            i--;

            // take last decimal digit
            bstr[i] = byte(uint8(ASCII_ZERO + (j % 10)));

            // remove the last decimal digit
            j /= 10;
        }

        return bstr;
    }

    function stringify(
        address input
    )
    private
    pure
    returns (bytes memory)
    {
        uint256 z = uint256(input);

        // addresses are "0x" followed by 20 bytes of data which take up 2 characters each
        bytes memory result = new bytes(42);

        // populate the result with "0x"
        result[0] = byte(uint8(ASCII_ZERO));
        result[1] = byte(uint8(ASCII_LOWER_EX));

        // for each byte (starting from the lowest byte), populate the result with two characters
        for (uint256 i = 0; i < 20; i++) {
            // each byte takes two characters
            uint256 shift = i * 2;

            // populate the least-significant character
            result[41 - shift] = char(z & FOUR_BIT_MASK);
            z = z >> 4;

            // populate the most-significant character
            result[40 - shift] = char(z & FOUR_BIT_MASK);
            z = z >> 4;
        }

        return result;
    }

    function stringify(
        bytes32 input
    )
    private
    pure
    returns (bytes memory)
    {
        uint256 z = uint256(input);

        // bytes32 are "0x" followed by 32 bytes of data which take up 2 characters each
        bytes memory result = new bytes(66);

        // populate the result with "0x"
        result[0] = byte(uint8(ASCII_ZERO));
        result[1] = byte(uint8(ASCII_LOWER_EX));

        // for each byte (starting from the lowest byte), populate the result with two characters
        for (uint256 i = 0; i < 32; i++) {
            // each byte takes two characters
            uint256 shift = i * 2;

            // populate the least-significant character
            result[65 - shift] = char(z & FOUR_BIT_MASK);
            z = z >> 4;

            // populate the most-significant character
            result[64 - shift] = char(z & FOUR_BIT_MASK);
            z = z >> 4;
        }

        return result;
    }

    function char(
        uint256 input
    )
    private
    pure
    returns (byte)
    {
        // return ASCII digit (0-9)
        if (input < 10) {
            return byte(uint8(input + ASCII_ZERO));
        }

        // return ASCII letter (a-f)
        return byte(uint8(input + ASCII_RELATIVE_ZERO));
    }
}

/*
    Copyright 2019 dYdX Trading Inc.
    Copyright 2020 VTD team, based on the works of Dynamic Dollar Devs and Empty Set Squad

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
*/
/**
 * @title Decimal
 * @author dYdX
 *
 * Library that defines a fixed-point number with 18 decimal places.
 */
library Decimal {
    using SafeMath for uint256;

    // ============ Constants ============

    uint256 constant BASE = 10**18;

    // ============ Structs ============


    struct D256 {
        uint256 value;
    }

    // ============ Static Functions ============

    function zero()
    internal
    pure
    returns (D256 memory)
    {
        return D256({ value: 0 });
    }

    function one()
    internal
    pure
    returns (D256 memory)
    {
        return D256({ value: BASE });
    }

    function from(
        uint256 a
    )
    internal
    pure
    returns (D256 memory)
    {
        return D256({ value: a.mul(BASE) });
    }

    function ratio(
        uint256 a,
        uint256 b
    )
    internal
    pure
    returns (D256 memory)
    {
        return D256({ value: getPartial(a, BASE, b) });
    }

    // ============ Self Functions ============

    function add(
        D256 memory self,
        uint256 b
    )
    internal
    pure
    returns (D256 memory)
    {
        return D256({ value: self.value.add(b.mul(BASE)) });
    }

    function sub(
        D256 memory self,
        uint256 b
    )
    internal
    pure
    returns (D256 memory)
    {
        return D256({ value: self.value.sub(b.mul(BASE)) });
    }

    function sub(
        D256 memory self,
        uint256 b,
        string memory reason
    )
    internal
    pure
    returns (D256 memory)
    {
        return D256({ value: self.value.sub(b.mul(BASE), reason) });
    }

    function mul(
        D256 memory self,
        uint256 b
    )
    internal
    pure
    returns (D256 memory)
    {
        return D256({ value: self.value.mul(b) });
    }

    function div(
        D256 memory self,
        uint256 b
    )
    internal
    pure
    returns (D256 memory)
    {
        return D256({ value: self.value.div(b) });
    }

    function pow(
        D256 memory self,
        uint256 b
    )
    internal
    pure
    returns (D256 memory)
    {
        if (b == 0) {
            return from(1);
        }

        D256 memory temp = D256({ value: self.value });
        for (uint256 i = 1; i < b; i++) {
            temp = mul(temp, self);
        }

        return temp;
    }

    function add(
        D256 memory self,
        D256 memory b
    )
    internal
    pure
    returns (D256 memory)
    {
        return D256({ value: self.value.add(b.value) });
    }

    function sub(
        D256 memory self,
        D256 memory b
    )
    internal
    pure
    returns (D256 memory)
    {
        return D256({ value: self.value.sub(b.value) });
    }

    function sub(
        D256 memory self,
        D256 memory b,
        string memory reason
    )
    internal
    pure
    returns (D256 memory)
    {
        return D256({ value: self.value.sub(b.value, reason) });
    }

    function mul(
        D256 memory self,
        D256 memory b
    )
    internal
    pure
    returns (D256 memory)
    {
        return D256({ value: getPartial(self.value, b.value, BASE) });
    }

    function div(
        D256 memory self,
        D256 memory b
    )
    internal
    pure
    returns (D256 memory)
    {
        return D256({ value: getPartial(self.value, BASE, b.value) });
    }

    function equals(D256 memory self, D256 memory b) internal pure returns (bool) {
        return self.value == b.value;
    }

    function greaterThan(D256 memory self, D256 memory b) internal pure returns (bool) {
        return compareTo(self, b) == 2;
    }

    function lessThan(D256 memory self, D256 memory b) internal pure returns (bool) {
        return compareTo(self, b) == 0;
    }

    function greaterThanOrEqualTo(D256 memory self, D256 memory b) internal pure returns (bool) {
        return compareTo(self, b) > 0;
    }

    function lessThanOrEqualTo(D256 memory self, D256 memory b) internal pure returns (bool) {
        return compareTo(self, b) < 2;
    }

    function isZero(D256 memory self) internal pure returns (bool) {
        return self.value == 0;
    }

    function asUint256(D256 memory self) internal pure returns (uint256) {
        return self.value.div(BASE);
    }

    // ============ Core Methods ============

    function getPartial(
        uint256 target,
        uint256 numerator,
        uint256 denominator
    )
    private
    pure
    returns (uint256)
    {
        return target.mul(numerator).div(denominator);
    }

    function compareTo(
        D256 memory a,
        D256 memory b
    )
    private
    pure
    returns (uint256)
    {
        if (a.value == b.value) {
            return 1;
        }
        return a.value > b.value ? 2 : 0;
    }
}

/*
    Copyright 2020 VTD team, based on the works of Dynamic Dollar Devs and Empty Set Squad

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
*/
contract IOracle {
    function setup() public;
    function capture() public returns (Decimal.D256 memory, bool);
    function pair() external view returns (address);
    function getLastVtdReserve() public view returns (uint256); 
    function getLastPrice() public view returns (Decimal.D256 memory, bool);
}

/*
    Copyright 2020 VTD team, based on the works of Dynamic Dollar Devs and Empty Set Squad

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
*/
library Constants {
    /* Chain */
    uint256 private constant CHAIN_ID = 1; // Mainnet

    /* Bootstrapping */
    uint256 private constant BOOTSTRAPPING_PERIOD = 36; // 36 epochs IMPORTANT
    uint256 private constant BOOTSTRAPPING_PERIOD_PHASE1 = 0; // set to 0
    uint256 private constant BOOTSTRAPPING_PRICE = 196e16; // 1.96 pegged token (targeting 8% inflation)

    /* Oracle */
    //IMPORTANT 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 deprecated
    address private constant USDC = address(0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48); 
    uint256 private constant ORACLE_RESERVE_MINIMUM = 1e9; // 1,000 pegged token, 1e9 IMPORTANT

    /* Bonding */
    uint256 private constant INITIAL_STAKE_MULTIPLE = 1e6; // 100 VTD -> 100M VTDD

    /* Epoch */
    uint256 private constant EPOCH_START = 1609405200;
    uint256 private constant EPOCH_BASE = 7200; //two hours IMPORTANT
    uint256 private constant EPOCH_GROWTH_CONSTANT = 12000; //1 hour
    uint256 private constant P1_EPOCH_BASE = 300; // IMPORTANT
    uint256 private constant P1_EPOCH_GROWTH_CONSTANT = 12000; // IMPORTANT 12000
    uint256 private constant ADVANCE_LOTTERY_TIME = 91; // deprecated

    /* Governance */
    uint256 private constant GOVERNANCE_PERIOD = 8; // 1 dayish governance period IMPORTANT
    uint256 private constant GOVERNANCE_QUORUM = 20e16; // 20%
    uint256 private constant GOVERNANCE_SUPER_MAJORITY = 51e16; // 51%
    uint256 private constant GOVERNANCE_FASTTRACK_PERIOD = 3; // 3 epochs
    uint256 private constant GOVERNANCE_EMERGENCY_DELAY = 14400; // 4 hours in case multi-lp has a critical bug

    /* DAO */
    uint256 private constant ADVANCE_INCENTIVE = 50e18; // 50 VTD IMPORTANT
    uint256 private constant ADVANCE_INCENTIVE_BOOTSTRAP = 50e18; // 50 VTD deprecated
    uint256 private constant DAO_EXIT_LOCKUP_EPOCHS = 18; // 18 epoch fluid IMPORTANT

    /* Pool */
    uint256 private constant POOL_EXIT_LOCKUP_EPOCHS = 9; // 9 epoch fluid IMPORTANT

    /* Market */
    uint256 private constant COUPON_EXPIRATION = 180; //30 days
    uint256 private constant DEBT_RATIO_CAP = 35e16; // 35%
    uint256 private constant INITIAL_COUPON_REDEMPTION_PENALTY = 50e16; // 50%
    uint256 private constant COUPON_REDEMPTION_PENALTY_DECAY = 3600; // 1 hour

    /* Regulator */
    uint256 private constant SUPPLY_CHANGE_LIMIT = 10e16; // 10%
    uint256 private constant EPOCH_GROWTH_BETA = 90e16; // 90%
    uint256 private constant ORACLE_POOL_RATIO = 40; // 40% IMPORTANT Increased to 40% for 2 pools

    // Pegs
    uint256 private constant USDC_START = 240;
    uint256 private constant USDT_START = 120;
    uint256 private constant WBTC_START = 180;

    // IMPORTANT, double check addresses
    address private constant USDC_POOL = address(0xBD2F0Cd039E0BFcf88901C98c0bFAc5ab27566e3);
    address private constant USDT_POOL = address(0x6950929E1379E64DE376e56068103d145B81dC6A); 
    address private constant WETH_POOL = address(0x7a6fbec053D5475B2eb732239F794131cBFc172B); 
    address private constant WBTC_POOL = address(0x7023A104906Fc120b662ADE8Aeede41ba57F59e7); 
    address private constant DSD_POOL = address(0x623EA23a36bF98a065701B08Be1Ad17246d0E337);

    address private constant USDC_ORACLE = address(0xd51efebF258e2119Cc8a71A1c4406ec5BFD608Bc);
    address private constant USDT_ORACLE = address(0x16148886CEFF9baD1042a59Cd3E85Ac66f54D639); 
    address private constant WETH_ORACLE = address(0x7a6fbec053D5475B2eb732239F794131cBFc172B); 
    address private constant WBTC_ORACLE = address(0x7023A104906Fc120b662ADE8Aeede41ba57F59e7); 
    address private constant DSD_ORACLE = address(0x368897f053e9838db281751B722e7F6969802B31);

    /**
     * Getters
     */
    function getEpochStart() internal pure returns (uint256) {
        return EPOCH_START;
    }

    function getP1EpochBase() internal pure returns (uint256) {
        return P1_EPOCH_BASE;
    }

    function getP1EpochGrowthConstant() internal pure returns (uint256) {
        return P1_EPOCH_GROWTH_CONSTANT;
    }

    function getEpochBase() internal pure returns (uint256) {
        return EPOCH_BASE;
    }

    function getEpochGrowthConstant() internal pure returns (uint256) {
        return EPOCH_GROWTH_CONSTANT;
    }

    function getOracleReserveMinimum() internal pure returns (uint256) {
        return ORACLE_RESERVE_MINIMUM;
    }

    function getInitialStakeMultiple() internal pure returns (uint256) {
        return INITIAL_STAKE_MULTIPLE;
    }

    function getAdvanceLotteryTime() internal pure returns (uint256){
        return ADVANCE_LOTTERY_TIME;
    }

    function getBootstrappingPeriod() internal pure returns (uint256) {
        return BOOTSTRAPPING_PERIOD;
    }

    function getPhaseOnePeriod() internal pure returns (uint256) {
        return BOOTSTRAPPING_PERIOD_PHASE1;
    }

    function getBootstrappingPrice() internal pure returns (Decimal.D256 memory) {
        return Decimal.D256({value: BOOTSTRAPPING_PRICE});
    }

    function getGovernancePeriod() internal pure returns (uint256) {
        return GOVERNANCE_PERIOD;
    }

     function getFastTrackPeriod() internal pure returns (uint256) {
        return GOVERNANCE_FASTTRACK_PERIOD;
    }

    function getGovernanceQuorum() internal pure returns (Decimal.D256 memory) {
        return Decimal.D256({value: GOVERNANCE_QUORUM});
    }

    function getGovernanceSuperMajority() internal pure returns (Decimal.D256 memory) {
        return Decimal.D256({value: GOVERNANCE_SUPER_MAJORITY});
    }

    function getGovernanceEmergencyDelay() internal pure returns (uint256) {
        return GOVERNANCE_EMERGENCY_DELAY;
    }

    function getAdvanceIncentive() internal pure returns (uint256) {
        return ADVANCE_INCENTIVE;
    }

    function getAdvanceIncentiveBootstrap() internal pure returns (uint256) {
        return ADVANCE_INCENTIVE_BOOTSTRAP;
    }

    function getDAOExitLockupEpochs() internal pure returns (uint256) {
        return DAO_EXIT_LOCKUP_EPOCHS;
    }

    function getPoolExitLockupEpochs() internal pure returns (uint256) {
        return POOL_EXIT_LOCKUP_EPOCHS;
    }

    function getCouponExpiration() internal pure returns (uint256) {
        return COUPON_EXPIRATION;
    }

    function getDebtRatioCap() internal pure returns (Decimal.D256 memory) {
        return Decimal.D256({value: DEBT_RATIO_CAP});
    }
    
    function getInitialCouponRedemptionPenalty() internal pure returns (Decimal.D256 memory) {
        return Decimal.D256({value: INITIAL_COUPON_REDEMPTION_PENALTY});
    }

    function getCouponRedemptionPenaltyDecay() internal pure returns (uint256) {
        return COUPON_REDEMPTION_PENALTY_DECAY;
    }

    function getSupplyChangeLimit() internal pure returns (Decimal.D256 memory) {
        return Decimal.D256({value: SUPPLY_CHANGE_LIMIT});
    }

    function getEpochGrowthBeta() internal pure returns (Decimal.D256 memory) {
        return Decimal.D256({value: EPOCH_GROWTH_BETA});
    }

    function getOraclePoolRatio() internal pure returns (uint256) {
        return ORACLE_POOL_RATIO;
    }

    function getChainId() internal pure returns (uint256) {
        return CHAIN_ID;
    }

    function getWbtcStart() internal pure returns (uint256) {
        return WBTC_START;
    }

    function getUsdtStart() internal pure returns (uint256) {
        return USDT_START;
    }

    function getUsdcStart() internal pure returns (uint256) {
        return USDC_START;
    }

// pools
    function getUsdcPool() internal pure returns (address) {
        return USDC_POOL;
    }

    function getUsdtPool() internal pure returns (address) {
        return USDT_POOL;
    }

    function getEthPool() internal pure returns (address) {
        return WETH_POOL;
    }

    function getWbtcPool() internal pure returns (address) {
        return WBTC_POOL;
    }

    function getDsdPool() internal pure returns (address) {
        return DSD_POOL;
    }

// oracles
    function getUsdcOracle() internal pure returns (IOracle) {
        return IOracle(USDC_ORACLE);
    }

    function getUsdtOracle() internal pure returns (IOracle) {
        return IOracle(USDT_ORACLE);
    }

    function getEthOracle() internal pure returns (IOracle) {
        return IOracle(WETH_ORACLE);
    }

    function getWbtcOracle() internal pure returns (IOracle) {
        return IOracle(WBTC_ORACLE);
    }

    function getDsdOracle() internal pure returns (IOracle) {
        return IOracle(DSD_ORACLE);
    }
}

/*
    Copyright 2020 VTD team, based on the works of Dynamic Dollar Devs and Empty Set Squad

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
*/
contract IDollar is IERC20 {
    function burn(uint256 amount) public;
    function burnFrom(address account, uint256 amount) public;
    function mint(address account, uint256 amount) public returns (bool);
}

/*
    Copyright 2020 VTD team, based on the works of Dynamic Dollar Devs and Empty Set Squad

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
*/
contract IDAO {
    function epoch() external view returns (uint256);
}

/*
    Copyright 2020 VTD team, based on the works of Dynamic Dollar Devs and Empty Set Squad

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
*/
contract IUSDC {
    // function isBlacklisted(address _account) external view returns (bool);
}

/*
    Copyright 2020 VTD team, based on the works of Dynamic Dollar Devs and Empty Set Squad

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
*/
contract PoolAccount {
    enum Status {
        Frozen,
        Fluid,
        Locked
    }

    struct State {
        uint256 staged;
        uint256 claimable;
        uint256 bonded;
        uint256 phantom;
        uint256 fluidUntil;
    }
}

contract PoolStorage {
    struct Provider {
        IDAO dao;
        IDollar dollar;
        IERC20 univ2;
        address peggedToken;
    }
    
    struct Balance {
        uint256 staged;
        uint256 claimable;
        uint256 bonded;
        uint256 phantom;
    }

    struct State {
        Balance balance;
        Provider provider;

        bool paused;

        mapping(address => PoolAccount.State) accounts;
    }
}

contract PoolState {
    PoolStorage.State _state;
}

/*
    Copyright 2020 VTD team, based on the works of Dynamic Dollar Devs and Empty Set Squad

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
*/
contract PoolGetters is PoolState {
    using SafeMath for uint256;

    /**
     * Global
     */
    function peggedToken() public view returns (address) {
        return _state.provider.peggedToken;
    }

    function dao() public view returns (IDAO) {
        return _state.provider.dao;
    }

    function dollar() public view returns (IDollar) {
        return _state.provider.dollar;
    }

    function univ2() public view returns (IERC20) {
        return _state.provider.univ2;
    }

    function totalBonded() public view returns (uint256) {
        return _state.balance.bonded;
    }

    function totalStaged() public view returns (uint256) {
        return _state.balance.staged;
    }

    function totalClaimable() public view returns (uint256) {
        return _state.balance.claimable;
    }

    function totalPhantom() public view returns (uint256) {
        return _state.balance.phantom;
    }

    function totalRewarded() public view returns (uint256) {
        return dollar().balanceOf(address(this)).sub(totalClaimable());
    }

    function paused() public view returns (bool) {
        return _state.paused;
    }

    /**
     * Account
     */

    function balanceOfStaged(address account) public view returns (uint256) {
        return _state.accounts[account].staged;
    }

    function balanceOfClaimable(address account) public view returns (uint256) {
        return _state.accounts[account].claimable;
    }

    function balanceOfBonded(address account) public view returns (uint256) {
        return _state.accounts[account].bonded;
    }

    function balanceOfPhantom(address account) public view returns (uint256) {
        return _state.accounts[account].phantom;
    }

    function balanceOfRewarded(address account) public view returns (uint256) {
        uint256 totalBonded = totalBonded();
        if (totalBonded == 0) {
            return 0;
        }

        uint256 totalRewardedWithPhantom = totalRewarded().add(totalPhantom());
        uint256 balanceOfRewardedWithPhantom = totalRewardedWithPhantom
            .mul(balanceOfBonded(account))
            .div(totalBonded);

        uint256 balanceOfPhantom = balanceOfPhantom(account);
        if (balanceOfRewardedWithPhantom > balanceOfPhantom) {
            return balanceOfRewardedWithPhantom.sub(balanceOfPhantom);
        }
        return 0;
    }

    function fluidUntil(address account) public view returns (uint256) {
        return _state.accounts[account].fluidUntil;
    }

    function statusOf(address account) public view returns (PoolAccount.Status) {
        return epoch() >= _state.accounts[account].fluidUntil ?
            PoolAccount.Status.Frozen :
            PoolAccount.Status.Fluid;
    }

    /**
     * Epoch
     */

    function epoch() internal view returns (uint256) {
        return dao().epoch();
    }
}

/*
    Copyright 2020 VTD team, based on the works of Dynamic Dollar Devs and Empty Set Squad

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
*/
contract PoolSetters is PoolState, PoolGetters {
    using SafeMath for uint256;

    /**
     * Global
     */

    function pause() internal {
        _state.paused = true;
    }

    /**
     * Account
     */

    function incrementBalanceOfBonded(address account, uint256 amount) internal {
        _state.accounts[account].bonded = _state.accounts[account].bonded.add(amount);
        _state.balance.bonded = _state.balance.bonded.add(amount);
    }

    function decrementBalanceOfBonded(address account, uint256 amount, string memory reason) internal {
        _state.accounts[account].bonded = _state.accounts[account].bonded.sub(amount, reason);
        _state.balance.bonded = _state.balance.bonded.sub(amount, reason);
    }

    function incrementBalanceOfStaged(address account, uint256 amount) internal {
        _state.accounts[account].staged = _state.accounts[account].staged.add(amount);
        _state.balance.staged = _state.balance.staged.add(amount);
    }

    function decrementBalanceOfStaged(address account, uint256 amount, string memory reason) internal {
        _state.accounts[account].staged = _state.accounts[account].staged.sub(amount, reason);
        _state.balance.staged = _state.balance.staged.sub(amount, reason);
    }

    function incrementBalanceOfClaimable(address account, uint256 amount) internal {
        _state.accounts[account].claimable = _state.accounts[account].claimable.add(amount);
        _state.balance.claimable = _state.balance.claimable.add(amount);
    }

    function decrementBalanceOfClaimable(address account, uint256 amount, string memory reason) internal {
        _state.accounts[account].claimable = _state.accounts[account].claimable.sub(amount, reason);
        _state.balance.claimable = _state.balance.claimable.sub(amount, reason);
    }

    function incrementBalanceOfPhantom(address account, uint256 amount) internal {
        _state.accounts[account].phantom = _state.accounts[account].phantom.add(amount);
        _state.balance.phantom = _state.balance.phantom.add(amount);
    }

    function decrementBalanceOfPhantom(address account, uint256 amount, string memory reason) internal {
        _state.accounts[account].phantom = _state.accounts[account].phantom.sub(amount, reason);
        _state.balance.phantom = _state.balance.phantom.sub(amount, reason);
    }

    function unfreeze(address account) internal {
        _state.accounts[account].fluidUntil = epoch().add(Constants.getPoolExitLockupEpochs());
    }
}

interface IUniswapV2Pair {
    event Approval(address indexed owner, address indexed spender, uint value);
    event Transfer(address indexed from, address indexed to, uint value);

    function name() external pure returns (string memory);
    function symbol() external pure returns (string memory);
    function decimals() external pure returns (uint8);
    function totalSupply() external view returns (uint);
    function balanceOf(address owner) external view returns (uint);
    function allowance(address owner, address spender) external view returns (uint);

    function approve(address spender, uint value) external returns (bool);
    function transfer(address to, uint value) external returns (bool);
    function transferFrom(address from, address to, uint value) external returns (bool);

    function DOMAIN_SEPARATOR() external view returns (bytes32);
    function PERMIT_TYPEHASH() external pure returns (bytes32);
    function nonces(address owner) external view returns (uint);

    function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;

    event Mint(address indexed sender, uint amount0, uint amount1);
    event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
    event Swap(
        address indexed sender,
        uint amount0In,
        uint amount1In,
        uint amount0Out,
        uint amount1Out,
        address indexed to
    );
    event Sync(uint112 reserve0, uint112 reserve1);

    function MINIMUM_LIQUIDITY() external pure returns (uint);
    function factory() external view returns (address);
    function token0() external view returns (address);
    function token1() external view returns (address);
    function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
    function price0CumulativeLast() external view returns (uint);
    function price1CumulativeLast() external view returns (uint);
    function kLast() external view returns (uint);

    function mint(address to) external returns (uint liquidity);
    function burn(address to) external returns (uint amount0, uint amount1);
    function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
    function skim(address to) external;
    function sync() external;

    function initialize(address, address) external;
}

library UniswapV2Library {
    using SafeMath for uint;

    // returns sorted token addresses, used to handle return values from pairs sorted in this order
    function sortTokens(address tokenA, address tokenB) internal pure returns (address token0, address token1) {
        require(tokenA != tokenB, 'UniswapV2Library: IDENTICAL_ADDRESSES');
        (token0, token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA);
        require(token0 != address(0), 'UniswapV2Library: ZERO_ADDRESS');
    }

    // calculates the CREATE2 address for a pair without making any external calls
    function pairFor(address factory, address tokenA, address tokenB) internal pure returns (address pair) {
        (address token0, address token1) = sortTokens(tokenA, tokenB);
        pair = address(uint(keccak256(abi.encodePacked(
                hex'ff',
                factory,
                keccak256(abi.encodePacked(token0, token1)),
                hex'96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f' // init code hash
            ))));
    }

    // fetches and sorts the reserves for a pair
    function getReserves(address factory, address tokenA, address tokenB) internal view returns (uint reserveA, uint reserveB) {
        (address token0,) = sortTokens(tokenA, tokenB);
        (uint reserve0, uint reserve1,) = IUniswapV2Pair(pairFor(factory, tokenA, tokenB)).getReserves();
        (reserveA, reserveB) = tokenA == token0 ? (reserve0, reserve1) : (reserve1, reserve0);
    }

    // given some amount of an asset and pair reserves, returns an equivalent amount of the other asset
    function quote(uint amountA, uint reserveA, uint reserveB) internal pure returns (uint amountB) {
        require(amountA > 0, 'UniswapV2Library: INSUFFICIENT_AMOUNT');
        require(reserveA > 0 && reserveB > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY');
        amountB = amountA.mul(reserveB) / reserveA;
    }
}

/*
    Copyright 2020 VTD team, based on the works of Dynamic Dollar Devs and Empty Set Squad

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
*/
contract Liquidity is PoolGetters {
    address private constant UNISWAP_FACTORY = address(0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f);

    function addLiquidity(uint256 dollarAmount) internal returns (uint256, uint256) {
        (address dollar, address peggedToken) = (address(dollar()), peggedToken());
        (uint reserveA, uint reserveB) = getReserves(dollar, peggedToken);

        uint256 pegAmount = (reserveA == 0 && reserveB == 0) ?
             dollarAmount :
             UniswapV2Library.quote(dollarAmount, reserveA, reserveB);

        address pair = address(univ2());
        IERC20(dollar).transfer(pair, dollarAmount);
        IERC20(peggedToken).transferFrom(msg.sender, pair, pegAmount);
        return (pegAmount, IUniswapV2Pair(pair).mint(address(this)));
    }

    // overridable for testing
    function getReserves(address tokenA, address tokenB) internal view returns (uint reserveA, uint reserveB) {
        (address token0,) = UniswapV2Library.sortTokens(tokenA, tokenB);
        (uint reserve0, uint reserve1,) = IUniswapV2Pair(UniswapV2Library.pairFor(UNISWAP_FACTORY, tokenA, tokenB)).getReserves();
        (reserveA, reserveB) = tokenA == token0 ? (reserve0, reserve1) : (reserve1, reserve0);
    }
}

/*
    Copyright 2020 VTD team, based on the works of Dynamic Dollar Devs and Empty Set Squad

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
*/
contract Pool is PoolSetters, Liquidity {
    using SafeMath for uint256;

    constructor(address dollar, address univ2, address peggedToken) public {
        // IMPORTANT only use msg.sender if deploying from the proxy factory
        // _state.provider.dao = IDAO(msg.sender);
        _state.provider.dao= IDAO(address(0x530608409991C36Ba922B69623BEc57e22B8d331));
        _state.provider.dollar = IDollar(dollar);
        _state.provider.univ2 = IERC20(univ2);
        _state.provider.peggedToken = peggedToken;
    }

    bytes32 private constant FILE = "Pool";

    event Deposit(address indexed account, uint256 value);
    event Withdraw(address indexed account, uint256 value);
    event Claim(address indexed account, uint256 value);
    event Bond(address indexed account, uint256 start, uint256 value);
    event Unbond(address indexed account, uint256 start, uint256 value, uint256 newClaimable);
    event Provide(address indexed account, uint256 value, uint256 lessUsdc, uint256 newUniv2);

    function deposit(uint256 value) external onlyFrozen(msg.sender) notPaused {
        univ2().transferFrom(msg.sender, address(this), value);
        incrementBalanceOfStaged(msg.sender, value);

        balanceCheck();

        emit Deposit(msg.sender, value);
    }

    function withdraw(uint256 value) external onlyFrozen(msg.sender) {
        univ2().transfer(msg.sender, value);
        decrementBalanceOfStaged(msg.sender, value, "Pool: insufficient staged balance");

        balanceCheck();

        emit Withdraw(msg.sender, value);
    }

    function claim(uint256 value) external onlyFrozen(msg.sender) {
        dollar().transfer(msg.sender, value);
        decrementBalanceOfClaimable(msg.sender, value, "Pool: insufficient claimable balance");

        balanceCheck();

        emit Claim(msg.sender, value);
    }

    function bond(uint256 value) external notPaused {
        unfreeze(msg.sender);

        uint256 totalRewardedWithPhantom = totalRewarded().add(totalPhantom());
        uint256 newPhantom = totalBonded() == 0 ?
            totalRewarded() == 0 ? Constants.getInitialStakeMultiple().mul(value) : 0 :
            totalRewardedWithPhantom.mul(value).div(totalBonded());

        incrementBalanceOfBonded(msg.sender, value);
        incrementBalanceOfPhantom(msg.sender, newPhantom);
        decrementBalanceOfStaged(msg.sender, value, "Pool: insufficient staged balance");

        balanceCheck();

        emit Bond(msg.sender, epoch().add(1), value);
    }

    function unbond(uint256 value) external {
        unfreeze(msg.sender);

        uint256 balanceOfBonded = balanceOfBonded(msg.sender);
        Require.that(
            balanceOfBonded > 0,
            FILE,
            "insufficient bonded balance"
        );

        uint256 newClaimable = balanceOfRewarded(msg.sender).mul(value).div(balanceOfBonded);
        uint256 lessPhantom = balanceOfPhantom(msg.sender).mul(value).div(balanceOfBonded);

        incrementBalanceOfStaged(msg.sender, value);
        incrementBalanceOfClaimable(msg.sender, newClaimable);
        decrementBalanceOfBonded(msg.sender, value, "Pool: insufficient bonded balance");
        decrementBalanceOfPhantom(msg.sender, lessPhantom, "Pool: insufficient phantom balance");

        balanceCheck();

        emit Unbond(msg.sender, epoch().add(1), value, newClaimable);
    }

    function provide(uint256 value) external onlyFrozen(msg.sender) notPaused {
        Require.that(
            totalBonded() > 0,
            FILE,
            "insufficient total bonded"
        );

        Require.that(
            totalRewarded() > 0,
            FILE,
            "insufficient total rewarded"
        );

        Require.that(
            balanceOfRewarded(msg.sender) >= value,
            FILE,
            "insufficient rewarded balance"
        );

        (uint256 lessUsdc, uint256 newUniv2) = addLiquidity(value);

        uint256 totalRewardedWithPhantom = totalRewarded().add(totalPhantom()).add(value);
        uint256 newPhantomFromBonded = totalRewardedWithPhantom.mul(newUniv2).div(totalBonded());

        incrementBalanceOfBonded(msg.sender, newUniv2);
        incrementBalanceOfPhantom(msg.sender, value.add(newPhantomFromBonded));


        balanceCheck();

        emit Provide(msg.sender, value, lessUsdc, newUniv2);
    }

    function emergencyWithdraw(address token, uint256 value) external onlyDao {
        IERC20(token).transfer(address(dao()), value);
    }

    function emergencyPause() external onlyDao {
        pause();
    }

    function balanceCheck() private {
        Require.that(
            univ2().balanceOf(address(this)) >= totalStaged().add(totalBonded()),
            FILE,
            "Inconsistent UNI-V2 balances"
        );
    }

    modifier onlyFrozen(address account) {
        Require.that(
            statusOf(account) == PoolAccount.Status.Frozen,
            FILE,
            "Not frozen"
        );

        _;
    }

    modifier onlyDao() {
        Require.that(
            msg.sender == address(dao()),
            FILE,
            "Not dao"
        );

        _;
    }

    modifier notPaused() {
        Require.that(
            !paused(),
            FILE,
            "Paused"
        );

        _;
    }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"dollar","type":"address"},{"internalType":"address","name":"univ2","type":"address"},{"internalType":"address","name":"peggedToken","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"start","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Bond","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Claim","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"lessUsdc","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newUniv2","type":"uint256"}],"name":"Provide","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"start","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newClaimable","type":"uint256"}],"name":"Unbond","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Withdraw","type":"event"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOfBonded","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOfClaimable","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOfPhantom","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOfRewarded","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOfStaged","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"value","type":"uint256"}],"name":"bond","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"value","type":"uint256"}],"name":"claim","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"dao","outputs":[{"internalType":"contract IDAO","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"value","type":"uint256"}],"name":"deposit","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"dollar","outputs":[{"internalType":"contract IDollar","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"emergencyPause","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"emergencyWithdraw","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"fluidUntil","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"peggedToken","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"value","type":"uint256"}],"name":"provide","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"statusOf","outputs":[{"internalType":"enum PoolAccount.Status","name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalBonded","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalClaimable","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalPhantom","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalRewarded","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalStaged","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"value","type":"uint256"}],"name":"unbond","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"univ2","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"value","type":"uint256"}],"name":"withdraw","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"}]

60806040523480156200001157600080fd5b506040516200214a3803806200214a8339810160408190526200003491620000a9565b600480546001600160a01b031990811673530608409991c36ba922b69623bec57e22b8d33117909155600580546001600160a01b0395861690831617905560068054938516938216939093179092556007805491909316911617905562000129565b8051620000a3816200010f565b92915050565b600080600060608486031215620000bf57600080fd5b6000620000cd868662000096565b9350506020620000e08682870162000096565b9250506040620000f38682870162000096565b9150509250925092565b60006001600160a01b038216620000a3565b6200011a81620000fd565b81146200012657600080fd5b50565b61201180620001396000396000f3fe608060405234801561001057600080fd5b50600436106101725760003560e01c806351bf21d8116100de57806397a5d5b511610097578063b6b55f2511610071578063b6b55f25146102ef578063c0d7a94f14610302578063cf02377914610315578063e0cf72851461031d57610172565b806397a5d5b5146102b45780639940686e146102d4578063aed29d07146102e757610172565b806351bf21d81461024b5780635c975abb1461025e5780637298d36e14610273578063825ad6071461027b57806386cf9f141461028e57806395ccea67146102a157610172565b8063379607f511610130578063379607f5146102035780634162169f1461021657806344d96e951461022b5780634838ed191461023357806351858e271461023b57806351adeb571461024357610172565b8062e77aa6146101775780631667eb171461019557806327de9e32146101b557806329f32ed4146101ca5780632e1a7d4d146101dd5780632e2ebe06146101f0575b600080fd5b61017f610325565b60405161018c9190611d0a565b60405180910390f35b6101a86101a33660046118a9565b610334565b60405161018c9190611e04565b6101c86101c3366004611974565b610356565b005b6101a86101d83660046118a9565b61049f565b6101c86101eb366004611974565b6104bd565b6101c86101fe366004611974565b6105ec565b6101c8610211366004611974565b610791565b61021e610888565b60405161018c9190611d77565b6101a8610897565b6101a861089d565b6101c86108a3565b61021e6108e4565b6101a86102593660046118a9565b6108f3565b610266610911565b60405161018c9190611d69565b61021e61091a565b6101a86102893660046118a9565b610929565b6101a861029c3660046118a9565b610947565b6101c86102af3660046118cf565b610962565b6102c76102c23660046118a9565b6109f9565b60405161018c9190611d85565b6101c86102e2366004611974565b610a33565b6101a8610b21565b6101c86102fd366004611974565b610bc2565b6101a86103103660046118a9565b610cad565b6101a8610d35565b6101a8610d3b565b6007546001600160a01b031690565b6001600160a01b0381166000908152600960205260409020600101545b919050565b61035f33610d41565b600061036a33610929565b90506103a16000821163141bdbdb60e21b7f696e73756666696369656e7420626f6e6465642062616c616e63650000000000610d73565b60006103cc826103c0856103b433610cad565b9063ffffffff610dd116565b9063ffffffff610e1216565b905060006103e1836103c0866103b43361049f565b90506103ed3385610e54565b6103f73383610eb1565b61041a3385604051806060016040528060218152602001611fae60219139610f16565b61043d3382604051806060016040528060228152602001611f6b60229139610f7e565b610445610fe6565b337f93530ac0ee8c50e696e13c5ac62355d0c0ba4bd943620d5bda1eb08b64ae751261048060016104746110af565b9063ffffffff61112916565b868560405161049193929190611e20565b60405180910390a250505050565b6001600160a01b031660009081526009602052604090206003015490565b336104f460005b6104cd836109f9565b60028111156104d857fe5b1463141bdbdb60e21b692737ba10333937bd32b760b11b610d73565b6104fc61091a565b6001600160a01b031663a9059cbb33846040518363ffffffff1660e01b8152600401610529929190611d40565b602060405180830381600087803b15801561054357600080fd5b505af1158015610557573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061057b9190810190611909565b5061059f3383604051806060016040528060218152602001611f8d6021913961114e565b6105a7610fe6565b336001600160a01b03167f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364836040516105e09190611e04565b60405180910390a25050565b336105f760006104c4565b61061a610602610911565b1563141bdbdb60e21b6514185d5cd95960d21b610d73565b6106566000610627610897565b1163141bdbdb60e21b7f696e73756666696369656e7420746f74616c20626f6e64656400000000000000610d73565b6106926000610663610b21565b1163141bdbdb60e21b7f696e73756666696369656e7420746f74616c2072657761726465640000000000610d73565b6106cf8261069f33610cad565b101563141bdbdb60e21b7f696e73756666696369656e742072657761726465642062616c616e6365000000610d73565b6000806106db846111ae565b9150915060006106f8856104746106f0610d3b565b610474610b21565b90506000610717610707610897565b6103c0848663ffffffff610dd116565b905061072333846113a1565b61073c33610737888463ffffffff61112916565b611406565b610744610fe6565b336001600160a01b03167fbe9d8078818a53534ce225882a00e0c6f709b5296c8a08c3a1f23f9ffd44838087868660405161078193929190611e20565b60405180910390a2505050505050565b3361079c60006104c4565b6107a46108e4565b6001600160a01b031663a9059cbb33846040518363ffffffff1660e01b81526004016107d1929190611d40565b602060405180830381600087803b1580156107eb57600080fd5b505af11580156107ff573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506108239190810190611909565b506108473383604051806060016040528060248152602001611f476024913961146b565b61084f610fe6565b336001600160a01b03167f47cee97cb7acd717b3c0aa1435d004cd5b3c8c57d70dbceb4e4458bbd60e39d4836040516105e09190611e04565b6004546001600160a01b031690565b60025490565b60015490565b6108da6108ae610888565b6001600160a01b0316336001600160a01b03161463141bdbdb60e21b664e6f742064616f60c81b610d73565b6108e26114d3565b565b6005546001600160a01b031690565b6001600160a01b031660009081526009602052604090206004015490565b60085460ff1690565b6006546001600160a01b031690565b6001600160a01b031660009081526009602052604090206002015490565b6001600160a01b031660009081526009602052604090205490565b61096d6108ae610888565b816001600160a01b031663a9059cbb610984610888565b836040518363ffffffff1660e01b81526004016109a2929190611d5b565b602060405180830381600087803b1580156109bc57600080fd5b505af11580156109d0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506109f49190810190611909565b505050565b6001600160a01b038116600090815260096020526040812060040154610a1d6110af565b1015610a2a576001610a2d565b60005b92915050565b610a3e610602610911565b610a4733610d41565b6000610a546106f0610d3b565b90506000610a60610897565b15610a7557610a70610707610897565b610a95565b610a7d610b21565b15610a89576000610a95565b610a95836103b46114e2565b9050610aa133846113a1565b610aab3382611406565b610ace3384604051806060016040528060218152602001611f8d6021913961114e565b610ad6610fe6565b337f3ae9ad26d7d47616d306d7757b947fe7b0f9a7c61a5f0dc784b0ddb6c7c40b5a610b0560016104746110af565b85604051610b14929190611e12565b60405180910390a2505050565b6000610bbd610b2e61089d565b610b366108e4565b6001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401610b619190611d0a565b60206040518083038186803b158015610b7957600080fd5b505afa158015610b8d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610bb19190810190611992565b9063ffffffff6114e916565b905090565b33610bcd60006104c4565b610bd8610602610911565b610be061091a565b6001600160a01b03166323b872dd3330856040518463ffffffff1660e01b8152600401610c0f93929190611d18565b602060405180830381600087803b158015610c2957600080fd5b505af1158015610c3d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610c619190810190611909565b50610c6c3383610e54565b610c74610fe6565b336001600160a01b03167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c836040516105e09190611e04565b600080610cb8610897565b905080610cc9576000915050610351565b6000610cd66106f0610d3b565b90506000610cf7836103c0610cea88610929565b859063ffffffff610dd116565b90506000610d048661049f565b905080821115610d2957610d1e828263ffffffff6114e916565b945050505050610351565b50600095945050505050565b60005490565b60035490565b610d54610d4c61152b565b6104746110af565b6001600160a01b03909116600090815260096020526040902060040155565b826109f457610d8182611530565b6101d160f51b610d9083611530565b604051602001610da293929190611ca3565b60408051601f198184030181529082905262461bcd60e51b8252610dc891600401611d93565b60405180910390fd5b600082610de057506000610a2d565b82820282848281610ded57fe5b0414610e0b5760405162461bcd60e51b8152600401610dc890611dd4565b9392505050565b6000610e0b83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506115b0565b6001600160a01b038216600090815260096020526040902054610e7d908263ffffffff61112916565b6001600160a01b03831660009081526009602052604081209190915554610eaa908263ffffffff61112916565b6000555050565b6001600160a01b038216600090815260096020526040902060010154610edd908263ffffffff61112916565b6001600160a01b038316600090815260096020526040902060019081019190915554610f0f908263ffffffff61112916565b6001555050565b6001600160a01b038316600090815260096020526040902060020154610f4390838363ffffffff6115e716565b6001600160a01b038416600090815260096020526040902060029081019190915554610f7690838363ffffffff6115e716565b600255505050565b6001600160a01b038316600090815260096020526040902060030154610fab90838363ffffffff6115e716565b6001600160a01b038416600090815260096020526040902060039081019190915554610fde90838363ffffffff6115e716565b600355505050565b6108e2610ffc610ff4610897565b610474610d35565b61100461091a565b6001600160a01b03166370a08231306040518263ffffffff1660e01b815260040161102f9190611d0a565b60206040518083038186803b15801561104757600080fd5b505afa15801561105b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061107f9190810190611992565b101563141bdbdb60e21b7f496e636f6e73697374656e7420554e492d56322062616c616e63657300000000610d73565b60006110b9610888565b6001600160a01b031663900cf0cf6040518163ffffffff1660e01b815260040160206040518083038186803b1580156110f157600080fd5b505afa158015611105573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610bbd9190810190611992565b600082820183811015610e0b5760405162461bcd60e51b8152600401610dc890611da4565b6001600160a01b03831660009081526009602052604090205461117890838363ffffffff6115e716565b6001600160a01b038416600090815260096020526040812091909155546111a690838363ffffffff6115e716565b600055505050565b6000806000806111bc6108e4565b6111c4610325565b915091506000806111d58484611613565b9150915060008260001480156111e9575081155b6111fd576111f88884846116ff565b6111ff565b875b9050600061120b61091a565b60405163a9059cbb60e01b81529091506001600160a01b0387169063a9059cbb9061123c9084908d90600401611d5b565b602060405180830381600087803b15801561125657600080fd5b505af115801561126a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061128e9190810190611909565b506040516323b872dd60e01b81526001600160a01b038616906323b872dd906112bf90339085908790600401611d18565b602060405180830381600087803b1580156112d957600080fd5b505af11580156112ed573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506113119190810190611909565b506040516335313c2160e11b815282906001600160a01b03831690636a62784290611340903090600401611d0a565b602060405180830381600087803b15801561135a57600080fd5b505af115801561136e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506113929190810190611992565b97509750505050505050915091565b6001600160a01b0382166000908152600960205260409020600201546113cd908263ffffffff61112916565b6001600160a01b0383166000908152600960205260409020600290810191909155546113ff908263ffffffff61112916565b6002555050565b6001600160a01b038216600090815260096020526040902060030154611432908263ffffffff61112916565b6001600160a01b038316600090815260096020526040902060039081019190915554611464908263ffffffff61112916565b6003555050565b6001600160a01b03831660009081526009602052604090206001015461149890838363ffffffff6115e716565b6001600160a01b0384166000908152600960205260409020600190810191909155546114cb90838363ffffffff6115e716565b600155505050565b6008805460ff19166001179055565b620f424090565b6000610e0b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506115e7565b600990565b606080826040516020016115449190611c8e565b60408051601f19818403018152919052905060205b80156115995781516000199091019082908290811061157457fe5b01602001516001600160f81b031916156115945760010181529050610351565b611559565b505060408051600081526020810190915292915050565b600081836115d15760405162461bcd60e51b8152600401610dc89190611d93565b5060008385816115dd57fe5b0495945050505050565b6000818484111561160b5760405162461bcd60e51b8152600401610dc89190611d93565b505050900390565b6000806000611622858561176d565b509050600080611647735c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f88886117f7565b6001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561167f57600080fd5b505afa158015611693573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506116b79190810190611927565b506001600160701b031691506001600160701b03169150826001600160a01b0316876001600160a01b0316146116ee5780826116f1565b81815b909890975095505050505050565b60008084116117205760405162461bcd60e51b8152600401610dc890611de4565b6000831180156117305750600082115b61174c5760405162461bcd60e51b8152600401610dc890611dc4565b8261175d858463ffffffff610dd116565b8161176457fe5b04949350505050565b600080826001600160a01b0316846001600160a01b031614156117a25760405162461bcd60e51b8152600401610dc890611db4565b826001600160a01b0316846001600160a01b0316106117c25782846117c5565b83835b90925090506001600160a01b0382166117f05760405162461bcd60e51b8152600401610dc890611df4565b9250929050565b6000806000611806858561176d565b9150915085828260405160200161181e929190611c68565b60405160208183030381529060405280519060200120604051602001611845929190611cd4565b60408051601f1981840301815291905280516020909101209695505050505050565b8035610a2d81611f0e565b8051610a2d81611f22565b8051610a2d81611f2b565b8035610a2d81611f34565b8051610a2d81611f34565b8051610a2d81611f3d565b6000602082840312156118bb57600080fd5b60006118c78484611867565b949350505050565b600080604083850312156118e257600080fd5b60006118ee8585611867565b92505060206118ff85828601611888565b9150509250929050565b60006020828403121561191b57600080fd5b60006118c78484611872565b60008060006060848603121561193c57600080fd5b6000611948868661187d565b93505060206119598682870161187d565b925050604061196a8682870161189e565b9150509250925092565b60006020828403121561198657600080fd5b60006118c78484611888565b6000602082840312156119a457600080fd5b60006118c78484611893565b6119b981611e93565b82525050565b6119b981611e48565b6119b96119d482611e48565b611ee0565b6119b981611e53565b6119b96119ee82611e58565b611e65565b6119b96119ee82611e65565b6000611a0a82611e3b565b611a148185610351565b9350611a24818560208601611eb0565b9290920192915050565b6119b981611e9a565b6119b981611ea5565b6000611a4b82611e3b565b611a558185611e3f565b9350611a65818560208601611eb0565b611a6e81611ef1565b9093019392505050565b6000611a85601b83611e3f565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000815260200192915050565b6000611abe602583611e3f565b7f556e697377617056324c6962726172793a204944454e544943414c5f41444452815264455353455360d81b602082015260400192915050565b6000611b05602083610351565b7f96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f815260200192915050565b6000611b3e602883611e3f565b7f556e697377617056324c6962726172793a20494e53554646494349454e545f4c815267495155494449545960c01b602082015260400192915050565b6000611b88600183610351565b6001600160f81b0319815260010192915050565b6000611ba9602183611e3f565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f8152607760f81b602082015260400192915050565b6000611bec602583611e3f565b7f556e697377617056324c6962726172793a20494e53554646494349454e545f418152641353d5539560da1b602082015260400192915050565b6000611c33601e83611e3f565b7f556e697377617056324c6962726172793a205a45524f5f414444524553530000815260200192915050565b6119b981611e65565b6000611c7482856119c8565b601482019150611c8482846119c8565b5060140192915050565b6000611c9a82846119f3565b50602001919050565b6000611caf82866119ff565b9150611cbb82856119e2565b600282019150611ccb82846119ff565b95945050505050565b6000611cdf82611b7b565b9150611ceb82856119c8565b601482019150611cfb82846119f3565b6020820191506118c782611af8565b60208101610a2d82846119bf565b60608101611d2682866119b0565b611d3360208301856119bf565b6118c76040830184611c5f565b60408101611d4e82856119b0565b610e0b6020830184611c5f565b60408101611d4e82856119bf565b60208101610a2d82846119d9565b60208101610a2d8284611a2e565b60208101610a2d8284611a37565b60208082528101610e0b8184611a40565b60208082528101610a2d81611a78565b60208082528101610a2d81611ab1565b60208082528101610a2d81611b31565b60208082528101610a2d81611b9c565b60208082528101610a2d81611bdf565b60208082528101610a2d81611c26565b60208101610a2d8284611c5f565b60408101611d4e8285611c5f565b60608101611e2e8286611c5f565b611d336020830185611c5f565b5190565b90815260200190565b6000610a2d82611e7e565b151590565b6001600160f01b03191690565b90565b8061035181611f01565b6001600160701b031690565b6001600160a01b031690565b63ffffffff1690565b6000610a2d825b6000610a2d82611e48565b6000610a2d82611e68565b60005b83811015611ecb578181015183820152602001611eb3565b83811115611eda576000848401525b50505050565b6000610a2d826000610a2d82611efb565b601f01601f191690565b60601b90565b60038110611f0b57fe5b50565b611f1781611e48565b8114611f0b57600080fd5b611f1781611e53565b611f1781611e72565b611f1781611e65565b611f1781611e8a56fe506f6f6c3a20696e73756666696369656e7420636c61696d61626c652062616c616e6365506f6f6c3a20696e73756666696369656e74207068616e746f6d2062616c616e6365506f6f6c3a20696e73756666696369656e74207374616765642062616c616e6365506f6f6c3a20696e73756666696369656e7420626f6e6465642062616c616e6365a365627a7a723158200d26c0fbcaff8d0f92722c7f435f82a312bfa3e2c0bdf71b32a41f9deadb48b36c6578706572696d656e74616cf564736f6c63430005110040000000000000000000000000f0e3543744afced8042131582f2a19b6aeb82794000000000000000000000000e6f3fa003ea33962a4b71095165375bb9eb42a4c000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101725760003560e01c806351bf21d8116100de57806397a5d5b511610097578063b6b55f2511610071578063b6b55f25146102ef578063c0d7a94f14610302578063cf02377914610315578063e0cf72851461031d57610172565b806397a5d5b5146102b45780639940686e146102d4578063aed29d07146102e757610172565b806351bf21d81461024b5780635c975abb1461025e5780637298d36e14610273578063825ad6071461027b57806386cf9f141461028e57806395ccea67146102a157610172565b8063379607f511610130578063379607f5146102035780634162169f1461021657806344d96e951461022b5780634838ed191461023357806351858e271461023b57806351adeb571461024357610172565b8062e77aa6146101775780631667eb171461019557806327de9e32146101b557806329f32ed4146101ca5780632e1a7d4d146101dd5780632e2ebe06146101f0575b600080fd5b61017f610325565b60405161018c9190611d0a565b60405180910390f35b6101a86101a33660046118a9565b610334565b60405161018c9190611e04565b6101c86101c3366004611974565b610356565b005b6101a86101d83660046118a9565b61049f565b6101c86101eb366004611974565b6104bd565b6101c86101fe366004611974565b6105ec565b6101c8610211366004611974565b610791565b61021e610888565b60405161018c9190611d77565b6101a8610897565b6101a861089d565b6101c86108a3565b61021e6108e4565b6101a86102593660046118a9565b6108f3565b610266610911565b60405161018c9190611d69565b61021e61091a565b6101a86102893660046118a9565b610929565b6101a861029c3660046118a9565b610947565b6101c86102af3660046118cf565b610962565b6102c76102c23660046118a9565b6109f9565b60405161018c9190611d85565b6101c86102e2366004611974565b610a33565b6101a8610b21565b6101c86102fd366004611974565b610bc2565b6101a86103103660046118a9565b610cad565b6101a8610d35565b6101a8610d3b565b6007546001600160a01b031690565b6001600160a01b0381166000908152600960205260409020600101545b919050565b61035f33610d41565b600061036a33610929565b90506103a16000821163141bdbdb60e21b7f696e73756666696369656e7420626f6e6465642062616c616e63650000000000610d73565b60006103cc826103c0856103b433610cad565b9063ffffffff610dd116565b9063ffffffff610e1216565b905060006103e1836103c0866103b43361049f565b90506103ed3385610e54565b6103f73383610eb1565b61041a3385604051806060016040528060218152602001611fae60219139610f16565b61043d3382604051806060016040528060228152602001611f6b60229139610f7e565b610445610fe6565b337f93530ac0ee8c50e696e13c5ac62355d0c0ba4bd943620d5bda1eb08b64ae751261048060016104746110af565b9063ffffffff61112916565b868560405161049193929190611e20565b60405180910390a250505050565b6001600160a01b031660009081526009602052604090206003015490565b336104f460005b6104cd836109f9565b60028111156104d857fe5b1463141bdbdb60e21b692737ba10333937bd32b760b11b610d73565b6104fc61091a565b6001600160a01b031663a9059cbb33846040518363ffffffff1660e01b8152600401610529929190611d40565b602060405180830381600087803b15801561054357600080fd5b505af1158015610557573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061057b9190810190611909565b5061059f3383604051806060016040528060218152602001611f8d6021913961114e565b6105a7610fe6565b336001600160a01b03167f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364836040516105e09190611e04565b60405180910390a25050565b336105f760006104c4565b61061a610602610911565b1563141bdbdb60e21b6514185d5cd95960d21b610d73565b6106566000610627610897565b1163141bdbdb60e21b7f696e73756666696369656e7420746f74616c20626f6e64656400000000000000610d73565b6106926000610663610b21565b1163141bdbdb60e21b7f696e73756666696369656e7420746f74616c2072657761726465640000000000610d73565b6106cf8261069f33610cad565b101563141bdbdb60e21b7f696e73756666696369656e742072657761726465642062616c616e6365000000610d73565b6000806106db846111ae565b9150915060006106f8856104746106f0610d3b565b610474610b21565b90506000610717610707610897565b6103c0848663ffffffff610dd116565b905061072333846113a1565b61073c33610737888463ffffffff61112916565b611406565b610744610fe6565b336001600160a01b03167fbe9d8078818a53534ce225882a00e0c6f709b5296c8a08c3a1f23f9ffd44838087868660405161078193929190611e20565b60405180910390a2505050505050565b3361079c60006104c4565b6107a46108e4565b6001600160a01b031663a9059cbb33846040518363ffffffff1660e01b81526004016107d1929190611d40565b602060405180830381600087803b1580156107eb57600080fd5b505af11580156107ff573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506108239190810190611909565b506108473383604051806060016040528060248152602001611f476024913961146b565b61084f610fe6565b336001600160a01b03167f47cee97cb7acd717b3c0aa1435d004cd5b3c8c57d70dbceb4e4458bbd60e39d4836040516105e09190611e04565b6004546001600160a01b031690565b60025490565b60015490565b6108da6108ae610888565b6001600160a01b0316336001600160a01b03161463141bdbdb60e21b664e6f742064616f60c81b610d73565b6108e26114d3565b565b6005546001600160a01b031690565b6001600160a01b031660009081526009602052604090206004015490565b60085460ff1690565b6006546001600160a01b031690565b6001600160a01b031660009081526009602052604090206002015490565b6001600160a01b031660009081526009602052604090205490565b61096d6108ae610888565b816001600160a01b031663a9059cbb610984610888565b836040518363ffffffff1660e01b81526004016109a2929190611d5b565b602060405180830381600087803b1580156109bc57600080fd5b505af11580156109d0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506109f49190810190611909565b505050565b6001600160a01b038116600090815260096020526040812060040154610a1d6110af565b1015610a2a576001610a2d565b60005b92915050565b610a3e610602610911565b610a4733610d41565b6000610a546106f0610d3b565b90506000610a60610897565b15610a7557610a70610707610897565b610a95565b610a7d610b21565b15610a89576000610a95565b610a95836103b46114e2565b9050610aa133846113a1565b610aab3382611406565b610ace3384604051806060016040528060218152602001611f8d6021913961114e565b610ad6610fe6565b337f3ae9ad26d7d47616d306d7757b947fe7b0f9a7c61a5f0dc784b0ddb6c7c40b5a610b0560016104746110af565b85604051610b14929190611e12565b60405180910390a2505050565b6000610bbd610b2e61089d565b610b366108e4565b6001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401610b619190611d0a565b60206040518083038186803b158015610b7957600080fd5b505afa158015610b8d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610bb19190810190611992565b9063ffffffff6114e916565b905090565b33610bcd60006104c4565b610bd8610602610911565b610be061091a565b6001600160a01b03166323b872dd3330856040518463ffffffff1660e01b8152600401610c0f93929190611d18565b602060405180830381600087803b158015610c2957600080fd5b505af1158015610c3d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610c619190810190611909565b50610c6c3383610e54565b610c74610fe6565b336001600160a01b03167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c836040516105e09190611e04565b600080610cb8610897565b905080610cc9576000915050610351565b6000610cd66106f0610d3b565b90506000610cf7836103c0610cea88610929565b859063ffffffff610dd116565b90506000610d048661049f565b905080821115610d2957610d1e828263ffffffff6114e916565b945050505050610351565b50600095945050505050565b60005490565b60035490565b610d54610d4c61152b565b6104746110af565b6001600160a01b03909116600090815260096020526040902060040155565b826109f457610d8182611530565b6101d160f51b610d9083611530565b604051602001610da293929190611ca3565b60408051601f198184030181529082905262461bcd60e51b8252610dc891600401611d93565b60405180910390fd5b600082610de057506000610a2d565b82820282848281610ded57fe5b0414610e0b5760405162461bcd60e51b8152600401610dc890611dd4565b9392505050565b6000610e0b83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506115b0565b6001600160a01b038216600090815260096020526040902054610e7d908263ffffffff61112916565b6001600160a01b03831660009081526009602052604081209190915554610eaa908263ffffffff61112916565b6000555050565b6001600160a01b038216600090815260096020526040902060010154610edd908263ffffffff61112916565b6001600160a01b038316600090815260096020526040902060019081019190915554610f0f908263ffffffff61112916565b6001555050565b6001600160a01b038316600090815260096020526040902060020154610f4390838363ffffffff6115e716565b6001600160a01b038416600090815260096020526040902060029081019190915554610f7690838363ffffffff6115e716565b600255505050565b6001600160a01b038316600090815260096020526040902060030154610fab90838363ffffffff6115e716565b6001600160a01b038416600090815260096020526040902060039081019190915554610fde90838363ffffffff6115e716565b600355505050565b6108e2610ffc610ff4610897565b610474610d35565b61100461091a565b6001600160a01b03166370a08231306040518263ffffffff1660e01b815260040161102f9190611d0a565b60206040518083038186803b15801561104757600080fd5b505afa15801561105b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061107f9190810190611992565b101563141bdbdb60e21b7f496e636f6e73697374656e7420554e492d56322062616c616e63657300000000610d73565b60006110b9610888565b6001600160a01b031663900cf0cf6040518163ffffffff1660e01b815260040160206040518083038186803b1580156110f157600080fd5b505afa158015611105573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610bbd9190810190611992565b600082820183811015610e0b5760405162461bcd60e51b8152600401610dc890611da4565b6001600160a01b03831660009081526009602052604090205461117890838363ffffffff6115e716565b6001600160a01b038416600090815260096020526040812091909155546111a690838363ffffffff6115e716565b600055505050565b6000806000806111bc6108e4565b6111c4610325565b915091506000806111d58484611613565b9150915060008260001480156111e9575081155b6111fd576111f88884846116ff565b6111ff565b875b9050600061120b61091a565b60405163a9059cbb60e01b81529091506001600160a01b0387169063a9059cbb9061123c9084908d90600401611d5b565b602060405180830381600087803b15801561125657600080fd5b505af115801561126a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061128e9190810190611909565b506040516323b872dd60e01b81526001600160a01b038616906323b872dd906112bf90339085908790600401611d18565b602060405180830381600087803b1580156112d957600080fd5b505af11580156112ed573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506113119190810190611909565b506040516335313c2160e11b815282906001600160a01b03831690636a62784290611340903090600401611d0a565b602060405180830381600087803b15801561135a57600080fd5b505af115801561136e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506113929190810190611992565b97509750505050505050915091565b6001600160a01b0382166000908152600960205260409020600201546113cd908263ffffffff61112916565b6001600160a01b0383166000908152600960205260409020600290810191909155546113ff908263ffffffff61112916565b6002555050565b6001600160a01b038216600090815260096020526040902060030154611432908263ffffffff61112916565b6001600160a01b038316600090815260096020526040902060039081019190915554611464908263ffffffff61112916565b6003555050565b6001600160a01b03831660009081526009602052604090206001015461149890838363ffffffff6115e716565b6001600160a01b0384166000908152600960205260409020600190810191909155546114cb90838363ffffffff6115e716565b600155505050565b6008805460ff19166001179055565b620f424090565b6000610e0b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506115e7565b600990565b606080826040516020016115449190611c8e565b60408051601f19818403018152919052905060205b80156115995781516000199091019082908290811061157457fe5b01602001516001600160f81b031916156115945760010181529050610351565b611559565b505060408051600081526020810190915292915050565b600081836115d15760405162461bcd60e51b8152600401610dc89190611d93565b5060008385816115dd57fe5b0495945050505050565b6000818484111561160b5760405162461bcd60e51b8152600401610dc89190611d93565b505050900390565b6000806000611622858561176d565b509050600080611647735c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f88886117f7565b6001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561167f57600080fd5b505afa158015611693573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506116b79190810190611927565b506001600160701b031691506001600160701b03169150826001600160a01b0316876001600160a01b0316146116ee5780826116f1565b81815b909890975095505050505050565b60008084116117205760405162461bcd60e51b8152600401610dc890611de4565b6000831180156117305750600082115b61174c5760405162461bcd60e51b8152600401610dc890611dc4565b8261175d858463ffffffff610dd116565b8161176457fe5b04949350505050565b600080826001600160a01b0316846001600160a01b031614156117a25760405162461bcd60e51b8152600401610dc890611db4565b826001600160a01b0316846001600160a01b0316106117c25782846117c5565b83835b90925090506001600160a01b0382166117f05760405162461bcd60e51b8152600401610dc890611df4565b9250929050565b6000806000611806858561176d565b9150915085828260405160200161181e929190611c68565b60405160208183030381529060405280519060200120604051602001611845929190611cd4565b60408051601f1981840301815291905280516020909101209695505050505050565b8035610a2d81611f0e565b8051610a2d81611f22565b8051610a2d81611f2b565b8035610a2d81611f34565b8051610a2d81611f34565b8051610a2d81611f3d565b6000602082840312156118bb57600080fd5b60006118c78484611867565b949350505050565b600080604083850312156118e257600080fd5b60006118ee8585611867565b92505060206118ff85828601611888565b9150509250929050565b60006020828403121561191b57600080fd5b60006118c78484611872565b60008060006060848603121561193c57600080fd5b6000611948868661187d565b93505060206119598682870161187d565b925050604061196a8682870161189e565b9150509250925092565b60006020828403121561198657600080fd5b60006118c78484611888565b6000602082840312156119a457600080fd5b60006118c78484611893565b6119b981611e93565b82525050565b6119b981611e48565b6119b96119d482611e48565b611ee0565b6119b981611e53565b6119b96119ee82611e58565b611e65565b6119b96119ee82611e65565b6000611a0a82611e3b565b611a148185610351565b9350611a24818560208601611eb0565b9290920192915050565b6119b981611e9a565b6119b981611ea5565b6000611a4b82611e3b565b611a558185611e3f565b9350611a65818560208601611eb0565b611a6e81611ef1565b9093019392505050565b6000611a85601b83611e3f565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000815260200192915050565b6000611abe602583611e3f565b7f556e697377617056324c6962726172793a204944454e544943414c5f41444452815264455353455360d81b602082015260400192915050565b6000611b05602083610351565b7f96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f815260200192915050565b6000611b3e602883611e3f565b7f556e697377617056324c6962726172793a20494e53554646494349454e545f4c815267495155494449545960c01b602082015260400192915050565b6000611b88600183610351565b6001600160f81b0319815260010192915050565b6000611ba9602183611e3f565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f8152607760f81b602082015260400192915050565b6000611bec602583611e3f565b7f556e697377617056324c6962726172793a20494e53554646494349454e545f418152641353d5539560da1b602082015260400192915050565b6000611c33601e83611e3f565b7f556e697377617056324c6962726172793a205a45524f5f414444524553530000815260200192915050565b6119b981611e65565b6000611c7482856119c8565b601482019150611c8482846119c8565b5060140192915050565b6000611c9a82846119f3565b50602001919050565b6000611caf82866119ff565b9150611cbb82856119e2565b600282019150611ccb82846119ff565b95945050505050565b6000611cdf82611b7b565b9150611ceb82856119c8565b601482019150611cfb82846119f3565b6020820191506118c782611af8565b60208101610a2d82846119bf565b60608101611d2682866119b0565b611d3360208301856119bf565b6118c76040830184611c5f565b60408101611d4e82856119b0565b610e0b6020830184611c5f565b60408101611d4e82856119bf565b60208101610a2d82846119d9565b60208101610a2d8284611a2e565b60208101610a2d8284611a37565b60208082528101610e0b8184611a40565b60208082528101610a2d81611a78565b60208082528101610a2d81611ab1565b60208082528101610a2d81611b31565b60208082528101610a2d81611b9c565b60208082528101610a2d81611bdf565b60208082528101610a2d81611c26565b60208101610a2d8284611c5f565b60408101611d4e8285611c5f565b60608101611e2e8286611c5f565b611d336020830185611c5f565b5190565b90815260200190565b6000610a2d82611e7e565b151590565b6001600160f01b03191690565b90565b8061035181611f01565b6001600160701b031690565b6001600160a01b031690565b63ffffffff1690565b6000610a2d825b6000610a2d82611e48565b6000610a2d82611e68565b60005b83811015611ecb578181015183820152602001611eb3565b83811115611eda576000848401525b50505050565b6000610a2d826000610a2d82611efb565b601f01601f191690565b60601b90565b60038110611f0b57fe5b50565b611f1781611e48565b8114611f0b57600080fd5b611f1781611e53565b611f1781611e72565b611f1781611e65565b611f1781611e8a56fe506f6f6c3a20696e73756666696369656e7420636c61696d61626c652062616c616e6365506f6f6c3a20696e73756666696369656e74207068616e746f6d2062616c616e6365506f6f6c3a20696e73756666696369656e74207374616765642062616c616e6365506f6f6c3a20696e73756666696369656e7420626f6e6465642062616c616e6365a365627a7a723158200d26c0fbcaff8d0f92722c7f435f82a312bfa3e2c0bdf71b32a41f9deadb48b36c6578706572696d656e74616cf564736f6c63430005110040

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

000000000000000000000000f0e3543744afced8042131582f2a19b6aeb82794000000000000000000000000e6f3fa003ea33962a4b71095165375bb9eb42a4c000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7

-----Decoded View---------------
Arg [0] : dollar (address): 0xf0E3543744AFcEd8042131582f2A19b6AEb82794
Arg [1] : univ2 (address): 0xe6f3FA003EA33962A4b71095165375bb9Eb42A4c
Arg [2] : peggedToken (address): 0xdAC17F958D2ee523a2206206994597C13D831ec7

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000f0e3543744afced8042131582f2a19b6aeb82794
Arg [1] : 000000000000000000000000e6f3fa003ea33962a4b71095165375bb9eb42a4c
Arg [2] : 000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7


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  ]

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.