ETH Price: $2,411.31 (-2.46%)
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
0x60806040106265412020-08-09 15:27:161548 days ago1596986836IN
 Create: PriceCalculator
0 ETH0.06037735110

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
PriceCalculator

Compiler Version
v0.6.6+commit.6c089d02

Optimization Enabled:
Yes with 200 runs

Other Settings:
constantinople EvmVersion, None license

Contract Source Code (Solidity)

/**
 *Submitted for verification at Etherscan.io on 2020-08-12
*/

// File: contracts/Interfaces/PriceCalculatorInterface.sol

pragma solidity >=0.6.6;

interface PriceCalculatorInterface {
    function calculatePrice(
        uint256 buyAmount,
        uint256 buyAmountLimit,
        uint256 sellAmount,
        uint256 sellAmountLimit,
        uint256 baseTokenPool,
        uint256 settlementTokenPool
    ) external view returns (uint256[5] memory);
}

// File: @openzeppelin/contracts/math/SafeMath.sol

// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, 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.
     */
    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.
     */
    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        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.
     */
    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b != 0, errorMessage);
        return a % b;
    }
}

// File: contracts/Libraries/RateMath.sol

pragma solidity >=0.6.6;


library RateMath {
    using SafeMath for uint256;
    uint256 public constant RATE_POINT_MULTIPLIER = 1000000000000000000; // 10^18

    function getRate(uint256 a, uint256 b) internal pure returns (uint256) {
        return a.mul(RATE_POINT_MULTIPLIER).div(b);
    }

    function divByRate(uint256 self, uint256 rate)
        internal
        pure
        returns (uint256)
    {
        return self.mul(RATE_POINT_MULTIPLIER).div(rate);
    }

    function mulByRate(uint256 self, uint256 rate)
        internal
        pure
        returns (uint256)
    {
        return self.mul(rate).div(RATE_POINT_MULTIPLIER);
    }
}

// File: @openzeppelin/contracts/utils/SafeCast.sol

// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;


/**
 * @dev Wrappers over Solidity's uintXX/intXX casting operators with added overflow
 * checks.
 *
 * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can
 * easily result in undesired exploitation or bugs, since developers usually
 * assume that overflows raise errors. `SafeCast` restores this intuition by
 * reverting the transaction when such 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.
 *
 * Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing
 * all math on `uint256` and `int256` and then downcasting.
 */
library SafeCast {

    /**
     * @dev Returns the downcasted uint128 from uint256, reverting on
     * overflow (when the input is greater than largest uint128).
     *
     * Counterpart to Solidity's `uint128` operator.
     *
     * Requirements:
     *
     * - input must fit into 128 bits
     */
    function toUint128(uint256 value) internal pure returns (uint128) {
        require(value < 2**128, "SafeCast: value doesn\'t fit in 128 bits");
        return uint128(value);
    }

    /**
     * @dev Returns the downcasted uint64 from uint256, reverting on
     * overflow (when the input is greater than largest uint64).
     *
     * Counterpart to Solidity's `uint64` operator.
     *
     * Requirements:
     *
     * - input must fit into 64 bits
     */
    function toUint64(uint256 value) internal pure returns (uint64) {
        require(value < 2**64, "SafeCast: value doesn\'t fit in 64 bits");
        return uint64(value);
    }

    /**
     * @dev Returns the downcasted uint32 from uint256, reverting on
     * overflow (when the input is greater than largest uint32).
     *
     * Counterpart to Solidity's `uint32` operator.
     *
     * Requirements:
     *
     * - input must fit into 32 bits
     */
    function toUint32(uint256 value) internal pure returns (uint32) {
        require(value < 2**32, "SafeCast: value doesn\'t fit in 32 bits");
        return uint32(value);
    }

    /**
     * @dev Returns the downcasted uint16 from uint256, reverting on
     * overflow (when the input is greater than largest uint16).
     *
     * Counterpart to Solidity's `uint16` operator.
     *
     * Requirements:
     *
     * - input must fit into 16 bits
     */
    function toUint16(uint256 value) internal pure returns (uint16) {
        require(value < 2**16, "SafeCast: value doesn\'t fit in 16 bits");
        return uint16(value);
    }

    /**
     * @dev Returns the downcasted uint8 from uint256, reverting on
     * overflow (when the input is greater than largest uint8).
     *
     * Counterpart to Solidity's `uint8` operator.
     *
     * Requirements:
     *
     * - input must fit into 8 bits.
     */
    function toUint8(uint256 value) internal pure returns (uint8) {
        require(value < 2**8, "SafeCast: value doesn\'t fit in 8 bits");
        return uint8(value);
    }

    /**
     * @dev Converts a signed int256 into an unsigned uint256.
     *
     * Requirements:
     *
     * - input must be greater than or equal to 0.
     */
    function toUint256(int256 value) internal pure returns (uint256) {
        require(value >= 0, "SafeCast: value must be positive");
        return uint256(value);
    }

    /**
     * @dev Returns the downcasted int128 from int256, reverting on
     * overflow (when the input is less than smallest int128 or
     * greater than largest int128).
     *
     * Counterpart to Solidity's `int128` operator.
     *
     * Requirements:
     *
     * - input must fit into 128 bits
     *
     * _Available since v3.1._
     */
    function toInt128(int256 value) internal pure returns (int128) {
        require(value >= -2**127 && value < 2**127, "SafeCast: value doesn\'t fit in 128 bits");
        return int128(value);
    }

    /**
     * @dev Returns the downcasted int64 from int256, reverting on
     * overflow (when the input is less than smallest int64 or
     * greater than largest int64).
     *
     * Counterpart to Solidity's `int64` operator.
     *
     * Requirements:
     *
     * - input must fit into 64 bits
     *
     * _Available since v3.1._
     */
    function toInt64(int256 value) internal pure returns (int64) {
        require(value >= -2**63 && value < 2**63, "SafeCast: value doesn\'t fit in 64 bits");
        return int64(value);
    }

    /**
     * @dev Returns the downcasted int32 from int256, reverting on
     * overflow (when the input is less than smallest int32 or
     * greater than largest int32).
     *
     * Counterpart to Solidity's `int32` operator.
     *
     * Requirements:
     *
     * - input must fit into 32 bits
     *
     * _Available since v3.1._
     */
    function toInt32(int256 value) internal pure returns (int32) {
        require(value >= -2**31 && value < 2**31, "SafeCast: value doesn\'t fit in 32 bits");
        return int32(value);
    }

    /**
     * @dev Returns the downcasted int16 from int256, reverting on
     * overflow (when the input is less than smallest int16 or
     * greater than largest int16).
     *
     * Counterpart to Solidity's `int16` operator.
     *
     * Requirements:
     *
     * - input must fit into 16 bits
     *
     * _Available since v3.1._
     */
    function toInt16(int256 value) internal pure returns (int16) {
        require(value >= -2**15 && value < 2**15, "SafeCast: value doesn\'t fit in 16 bits");
        return int16(value);
    }

    /**
     * @dev Returns the downcasted int8 from int256, reverting on
     * overflow (when the input is less than smallest int8 or
     * greater than largest int8).
     *
     * Counterpart to Solidity's `int8` operator.
     *
     * Requirements:
     *
     * - input must fit into 8 bits.
     *
     * _Available since v3.1._
     */
    function toInt8(int256 value) internal pure returns (int8) {
        require(value >= -2**7 && value < 2**7, "SafeCast: value doesn\'t fit in 8 bits");
        return int8(value);
    }

    /**
     * @dev Converts an unsigned uint256 into a signed int256.
     *
     * Requirements:
     *
     * - input must be less than or equal to maxInt256.
     */
    function toInt256(uint256 value) internal pure returns (int256) {
        require(value < 2**255, "SafeCast: value doesn't fit in an int256");
        return int256(value);
    }
}

// File: contracts/utils/PriceCalculator.sol

pragma solidity >=0.6.6;





contract PriceCalculator is PriceCalculatorInterface {
    using RateMath for uint256;
    using SafeMath for uint256;
    using SafeCast for uint256;
    uint256 public constant TOLERANCE_RATE = 1001000000000000000; //= 100.1%
    uint256 public constant SECURE_RATE = 1050000000000000000; //105% max slippage for all orders
    uint256 public constant DECIMAL = 1000000000000000000;

    /**
     * @notice calculates and return price, and refund rates
     * @param AmountFLEX0_1 Amount of flex order of token0 to token1
     * @param AmountSTRICT0_1 Amount of strict order of token0 to token1
     * @param AmountFLEX1_0  Amount of flex order of token1 to token0
     * @param AmountSTRICT1_0 Amount of strict order of token1 to token0
     * @param reserve0 Amount of reserve0
     * @param reserve1 Amount of reserve1
     * @return [price, refundStatus, partiallyRefundRate, executed amount of token0 to token1, executed amount of token1 to token0]
     * @dev Refund for careful users if change of price is bigger than TORELANCE_RATE
     * @dev Refund for all traders if change of price is bigger than SECURE_RATE
     **/
    function calculatePrice(
        uint256 AmountFLEX0_1,
        uint256 AmountSTRICT0_1,
        uint256 AmountFLEX1_0,
        uint256 AmountSTRICT1_0,
        uint256 reserve0,
        uint256 reserve1
    ) external override view returns (uint256[5] memory) {
        require(
            reserve0 != 0 && reserve1 != 0,
            "There are no reserves. Please add liquidity or redeploy exchange"
        );
        // initial price = reserve1 / reserve0
        // price = (reserve1 + sell order amount) / (reserve0 + sell order amount)
        uint256 price = (reserve1.add(AmountFLEX1_0).add(AmountSTRICT1_0))
            .divByRate(reserve0.add(AmountFLEX0_1).add(AmountSTRICT0_1));
        // initial low Price is price of Limit order(initial price / 1.001)
        uint256 lowPrice = (reserve1.divByRate(reserve0)).divByRate(
            TOLERANCE_RATE
        );
        // initial high Price is price of Limit order(initial price * 1.001)
        uint256 highPrice = (reserve1.divByRate(reserve0)).mulByRate(
            TOLERANCE_RATE
        );
        // if initial price is within the TORELANCE_RATE, return initial price and execute all orders
        if (price > lowPrice && price < highPrice) {
            return [
                price,
                0,
                0,
                AmountFLEX0_1.add(AmountSTRICT0_1),
                AmountFLEX1_0.add(AmountSTRICT1_0)
            ];
        } else if (price <= lowPrice) {
            return
                _calculatePriceAnd0_1RefundRate(
                    price,
                    lowPrice,
                    AmountFLEX0_1,
                    AmountSTRICT0_1,
                    AmountFLEX1_0.add(AmountSTRICT1_0),
                    reserve0,
                    reserve1
                );
        } else {
            return
                _calculatePriceAnd1_0RefundRate(
                    price,
                    highPrice,
                    AmountFLEX0_1.add(AmountSTRICT0_1),
                    AmountFLEX1_0,
                    AmountSTRICT1_0,
                    reserve0,
                    reserve1
                );
        }
    }

    /**
     * @notice calculates price and refund rates if price is lower than `lowPrice`
     * @param price price which is calculated in _calculatePrice()
     * @param lowPrice reserve1 / reserve0 * 0.999
     * @param AmountFLEX0_1 Amount of no-limit token0 to token1
     * @param AmountSTRICT0_1 Amount of limit token0 to token1
     * @param all1_0Amount Amount of all token1 to token0 order. In this function, all token1 to token0 order will be executed
     * @return [price, refundStatus, partiallyRefundRate, executed amount of token0 to token1 order, executed amount of token1 to token0 order]
     **/
    function _calculatePriceAnd0_1RefundRate(
        uint256 price,
        uint256 lowPrice,
        uint256 AmountFLEX0_1,
        uint256 AmountSTRICT0_1,
        uint256 all1_0Amount,
        uint256 reserve0,
        uint256 reserve1
    ) private pure returns (uint256[5] memory) {
        // executeAmount is amount of buy orders in lowPrice(initial price * 0.999)
        uint256 executeAmount = _calculateExecuteAmount0_1(
            reserve0,
            reserve1,
            all1_0Amount,
            lowPrice
        );

        // if executeAmount > AmountFLEX0_1, (AmountFLEX0_1 - executeAmount) in limit order will be executed
        if (executeAmount > AmountFLEX0_1) {
            uint256 refundRate = (
                AmountFLEX0_1.add(AmountSTRICT0_1).sub(executeAmount)
            )
                .divByRate(AmountSTRICT0_1);
            return [lowPrice, 1, refundRate, executeAmount, all1_0Amount];
        } else {
            // refund all limit buy orders
            // update lowPrice to SECURE_RATE
            uint256 nextLowPrice = (reserve1.divByRate(reserve0)).divByRate(
                SECURE_RATE
            );
            // update price
            price = (reserve1.add(all1_0Amount)).divByRate(
                reserve0.add(AmountFLEX0_1)
            );
            if (nextLowPrice > price) {
                // executeAmount is amount of buy orders when the price is lower than lowPrice (initial price * 0.95)
                executeAmount = _calculateExecuteAmount0_1(
                    reserve0,
                    reserve1,
                    all1_0Amount,
                    nextLowPrice
                );

                // if executeAmount < AmountFLEX0_1, refund all of limit buy orders and refund some parts of no-limit buy orders
                if (executeAmount < AmountFLEX0_1) {
                    uint256 refundRate = (AmountFLEX0_1.sub(executeAmount))
                        .divByRate(AmountFLEX0_1);
                    return [
                        nextLowPrice,
                        2,
                        refundRate,
                        executeAmount,
                        all1_0Amount
                    ];
                }
            }
            // execute all no-limit buy orders and refund all limit buy orders
            return [price, 1, DECIMAL, AmountFLEX0_1, all1_0Amount];
        }
    }

    /**
     * @notice calculates price and refund rates if price is higher than highPrice
     * @param price price which is calculated in _calculatePrice()
     * @param highPrice reserve1 / reserve0 * 1.001
     * @param all0_1Amount Amount of all token0 to token1 order. In this function, all token0 to token1 order will be executed
     * @param AmountFLEX1_0  Amount of limit token0 to token1 order.
     * @param AmountSTRICT1_0 Amount of no-limit token1 to token0 order
     * @return [price, refundStatus, partiallyRefundRate, executed amount of token0 to token1 order, executed amount of token1 to token0 order]
     **/
    function _calculatePriceAnd1_0RefundRate(
        uint256 price,
        uint256 highPrice,
        uint256 all0_1Amount,
        uint256 AmountFLEX1_0,
        uint256 AmountSTRICT1_0,
        uint256 reserve0,
        uint256 reserve1
    ) private pure returns (uint256[5] memory) {
        // executeAmount is amount of sell orders when the price is higher than highPrice(initial price * 1.001)
        uint256 executeAmount = _calculateExecuteAmount1_0(
            reserve1,
            reserve0,
            all0_1Amount,
            highPrice
        );

        if (executeAmount > AmountFLEX1_0) {
            //if executeAmount > AmountFLEX1_0 , (AmountFLEX1_0  - executeAmount) in limit order will be executed
            uint256 refundRate = (
                AmountFLEX1_0.add(AmountSTRICT1_0).sub(executeAmount)
            )
                .divByRate(AmountSTRICT1_0);
            return [highPrice, 3, refundRate, all0_1Amount, executeAmount];
        } else {
            // refund all limit sell orders
            // update highPrice to SECURE_RATE
            uint256 nextHighPrice = (reserve1.divByRate(reserve0)).mulByRate(
                SECURE_RATE
            );
            // update price
            price = (reserve1.add(AmountFLEX1_0)).divByRate(
                reserve0.add(all0_1Amount)
            );
            if (nextHighPrice < price) {
                // executeAmount is amount of sell orders when the price is higher than highPrice(initial price * 1.05)
                executeAmount = _calculateExecuteAmount1_0(
                    reserve1,
                    reserve0,
                    all0_1Amount,
                    nextHighPrice
                );
                // if executeAmount < AmountFLEX1_0 , refund all of limit sell orders and refund some parts of no-limit sell orders
                if (executeAmount < AmountFLEX1_0) {
                    uint256 refundRate = (AmountFLEX1_0.sub(executeAmount))
                        .divByRate(AmountFLEX1_0);
                    return [
                        nextHighPrice,
                        4,
                        refundRate,
                        all0_1Amount,
                        executeAmount
                    ];
                }
            }
            // execute all no-limit sell orders and refund all limit sell orders
            return [price, 3, DECIMAL, all0_1Amount, AmountFLEX1_0];
        }
    }

    /**
     * @notice Calculates TOKEN0 amount to execute in price `price`
     **/
    function _calculateExecuteAmount0_1(
        uint256 reserve,
        uint256 opponentReserve,
        uint256 opppnentAmount,
        uint256 price
    ) private pure returns (uint256) {
        uint256 possibleReserve = (opponentReserve.add(opppnentAmount))
            .divByRate(price);

        if (possibleReserve > reserve) {
            return possibleReserve.sub(reserve);
        } else {
            return 0;
        }
    }

    /**
     * @notice Calculates TOKEN1 amount to execute in price `price`
     **/
    function _calculateExecuteAmount1_0(
        uint256 reserve,
        uint256 opponentReserve,
        uint256 opppnentAmount,
        uint256 price
    ) private pure returns (uint256) {
        uint256 possibleReserve = (opponentReserve.add(opppnentAmount))
            .mulByRate(price);

        if (possibleReserve > reserve) {
            return possibleReserve.sub(reserve);
        } else {
            return 0;
        }
    }
}

Contract Security Audit

Contract ABI

[{"inputs":[],"name":"DECIMAL","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SECURE_RATE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TOLERANCE_RATE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"AmountFLEX0_1","type":"uint256"},{"internalType":"uint256","name":"AmountSTRICT0_1","type":"uint256"},{"internalType":"uint256","name":"AmountFLEX1_0","type":"uint256"},{"internalType":"uint256","name":"AmountSTRICT1_0","type":"uint256"},{"internalType":"uint256","name":"reserve0","type":"uint256"},{"internalType":"uint256","name":"reserve1","type":"uint256"}],"name":"calculatePrice","outputs":[{"internalType":"uint256[5]","name":"","type":"uint256[5]"}],"stateMutability":"view","type":"function"}]

608060405234801561001057600080fd5b506108f8806100206000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c80635fa15024146100515780636ab55fd91461006b578063f5eeb35714610073578063f9ed72f9146100e6575b600080fd5b6100596100ee565b60408051918252519081900360200190f35b6100596100fa565b6100ae600480360360c081101561008957600080fd5b5080359060208101359060408101359060608101359060808101359060a00135610106565b604051808260a080838360005b838110156100d35781810151838201526020016100bb565b5050505090500191505060405180910390f35b6100596102a8565b670e92596fd629000081565b670de0b6b3a764000081565b61010e610843565b821580159061011c57508115155b6101575760405162461bcd60e51b81526004018080602001828103825260408152602001806108626040913960400191505060405180910390fd5b600061019c61017c88610170878c63ffffffff6102b416565b9063ffffffff6102b416565b61019087610170878b63ffffffff6102b416565b9063ffffffff61031716565b905060006101bc670de444324c2a8000610190868863ffffffff61031716565b905060006101e8670de444324c2a80006101dc878963ffffffff61031716565b9063ffffffff61034116565b905081831180156101f857508083105b15610251576040518060a00160405280848152602001600081526020016000815260200161022f8b8d6102b490919063ffffffff16565b81526020016102448a8a63ffffffff6102b416565b815250935050505061029e565b8183116102805761027683838c8c61026f8d8d63ffffffff6102b416565b8b8b61035f565b935050505061029e565b61027683826102958d8d63ffffffff6102b416565b8b8b8b8b6104bf565b9695505050505050565b670de444324c2a800081565b60008282018381101561030e576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b90505b92915050565b600061030e8261033585670de0b6b3a764000063ffffffff61060c16565b9063ffffffff61066516565b600061030e670de0b6b3a7640000610335858563ffffffff61060c16565b610367610843565b60006103758484878b6106a7565b9050868111156103d85760006103a587610190846103998c8463ffffffff6102b416565b9063ffffffff6106ee16565b90506040518060a001604052808a81526020016001815260200182815260200183815260200187815250925050506104b4565b60006103f6670e92596fd6290000610190868863ffffffff61031716565b905061041b61040b868a63ffffffff6102b416565b610190868963ffffffff6102b416565b99508981111561047f57610431858588846106a7565b91508782101561047f57600061045189610190818663ffffffff6106ee16565b6040805160a081018252938452600260208501528301525060608101919091526080810185905290506104b4565b6040518060a001604052808b815260200160018152602001670de0b6b3a7640000815260200189815260200187815250925050505b979650505050505050565b6104c7610843565b60006104d58385898b610730565b90508581111561052c5760006104f986610190846103998b8463ffffffff6102b416565b90506040518060a001604052808a81526020016003815260200182815260200189815260200183815250925050506104b4565b600061054a670e92596fd62900006101dc868863ffffffff61031716565b905061056f61055f868a63ffffffff6102b416565b610190868a63ffffffff6102b416565b9950898110156105d35761058584868a84610730565b9150868210156105d35760006105a588610190818663ffffffff6106ee16565b6040805160a081018252938452600460208501528301525060608101889052608081019190915290506104b4565b6040518060a001604052808b815260200160038152602001670de0b6b3a7640000815260200189815260200188815250925050506104b4565b60008261061b57506000610311565b8282028284828161062857fe5b041461030e5760405162461bcd60e51b81526004018080602001828103825260218152602001806108a26021913960400191505060405180910390fd5b600061030e83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610747565b6000806106be83610190878763ffffffff6102b416565b9050858111156106e0576106d8818763ffffffff6106ee16565b9150506106e6565b60009150505b949350505050565b600061030e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506107e9565b6000806106be836101dc878763ffffffff6102b416565b600081836107d35760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610798578181015183820152602001610780565b50505050905090810190601f1680156107c55780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385816107df57fe5b0495945050505050565b6000818484111561083b5760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315610798578181015183820152602001610780565b505050900390565b6040518060a00160405280600590602082028036833750919291505056fe546865726520617265206e6f2072657365727665732e20506c6561736520616464206c6971756964697479206f722072656465706c6f792065786368616e6765536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a2646970667358221220955d21ca411553100f44ae9e41e27089c5541d476143852e83cba004182b82f864736f6c63430006060033

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061004c5760003560e01c80635fa15024146100515780636ab55fd91461006b578063f5eeb35714610073578063f9ed72f9146100e6575b600080fd5b6100596100ee565b60408051918252519081900360200190f35b6100596100fa565b6100ae600480360360c081101561008957600080fd5b5080359060208101359060408101359060608101359060808101359060a00135610106565b604051808260a080838360005b838110156100d35781810151838201526020016100bb565b5050505090500191505060405180910390f35b6100596102a8565b670e92596fd629000081565b670de0b6b3a764000081565b61010e610843565b821580159061011c57508115155b6101575760405162461bcd60e51b81526004018080602001828103825260408152602001806108626040913960400191505060405180910390fd5b600061019c61017c88610170878c63ffffffff6102b416565b9063ffffffff6102b416565b61019087610170878b63ffffffff6102b416565b9063ffffffff61031716565b905060006101bc670de444324c2a8000610190868863ffffffff61031716565b905060006101e8670de444324c2a80006101dc878963ffffffff61031716565b9063ffffffff61034116565b905081831180156101f857508083105b15610251576040518060a00160405280848152602001600081526020016000815260200161022f8b8d6102b490919063ffffffff16565b81526020016102448a8a63ffffffff6102b416565b815250935050505061029e565b8183116102805761027683838c8c61026f8d8d63ffffffff6102b416565b8b8b61035f565b935050505061029e565b61027683826102958d8d63ffffffff6102b416565b8b8b8b8b6104bf565b9695505050505050565b670de444324c2a800081565b60008282018381101561030e576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b90505b92915050565b600061030e8261033585670de0b6b3a764000063ffffffff61060c16565b9063ffffffff61066516565b600061030e670de0b6b3a7640000610335858563ffffffff61060c16565b610367610843565b60006103758484878b6106a7565b9050868111156103d85760006103a587610190846103998c8463ffffffff6102b416565b9063ffffffff6106ee16565b90506040518060a001604052808a81526020016001815260200182815260200183815260200187815250925050506104b4565b60006103f6670e92596fd6290000610190868863ffffffff61031716565b905061041b61040b868a63ffffffff6102b416565b610190868963ffffffff6102b416565b99508981111561047f57610431858588846106a7565b91508782101561047f57600061045189610190818663ffffffff6106ee16565b6040805160a081018252938452600260208501528301525060608101919091526080810185905290506104b4565b6040518060a001604052808b815260200160018152602001670de0b6b3a7640000815260200189815260200187815250925050505b979650505050505050565b6104c7610843565b60006104d58385898b610730565b90508581111561052c5760006104f986610190846103998b8463ffffffff6102b416565b90506040518060a001604052808a81526020016003815260200182815260200189815260200183815250925050506104b4565b600061054a670e92596fd62900006101dc868863ffffffff61031716565b905061056f61055f868a63ffffffff6102b416565b610190868a63ffffffff6102b416565b9950898110156105d35761058584868a84610730565b9150868210156105d35760006105a588610190818663ffffffff6106ee16565b6040805160a081018252938452600460208501528301525060608101889052608081019190915290506104b4565b6040518060a001604052808b815260200160038152602001670de0b6b3a7640000815260200189815260200188815250925050506104b4565b60008261061b57506000610311565b8282028284828161062857fe5b041461030e5760405162461bcd60e51b81526004018080602001828103825260218152602001806108a26021913960400191505060405180910390fd5b600061030e83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610747565b6000806106be83610190878763ffffffff6102b416565b9050858111156106e0576106d8818763ffffffff6106ee16565b9150506106e6565b60009150505b949350505050565b600061030e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506107e9565b6000806106be836101dc878763ffffffff6102b416565b600081836107d35760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610798578181015183820152602001610780565b50505050905090810190601f1680156107c55780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385816107df57fe5b0495945050505050565b6000818484111561083b5760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315610798578181015183820152602001610780565b505050900390565b6040518060a00160405280600590602082028036833750919291505056fe546865726520617265206e6f2072657365727665732e20506c6561736520616464206c6971756964697479206f722072656465706c6f792065786368616e6765536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a2646970667358221220955d21ca411553100f44ae9e41e27089c5541d476143852e83cba004182b82f864736f6c63430006060033

Deployed Bytecode Sourcemap

13437:10697:0:-:0;;;;5:9:-1;2:2;;;27:1;24;17:12;2:2;13437:10697:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;12:1:-1;9;2:12;13674:57:0;;;:::i;:::-;;;;;;;;;;;;;;;;13773:53;;;:::i;14593:2207::-;;;;;;15:3:-1;10;7:12;4:2;;;32:1;29;22:12;4:2;-1:-1;14593:2207:0;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;14593:2207:0;;;;;;;;;;;;;;;;13596:60;;;:::i;13674:57::-;13712:19;13674:57;:::o;13773:53::-;13807:19;13773:53;:::o;14593:2207::-;14842:17;;:::i;:::-;14894:13;;;;;:30;;-1:-1:-1;14911:13:0;;;14894:30;14872:144;;;;-1:-1:-1;;;14872:144:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;15159:13;15175:124;15250:48;15282:15;15250:27;:8;15263:13;15250:27;:12;:27;:::i;:::-;:31;:48;:31;:48;:::i;:::-;15176;15208:15;15176:27;:8;15189:13;15176:27;:12;:27;:::i;:48::-;15175:74;:124;:74;:124;:::i;:::-;15159:140;-1:-1:-1;15387:16:0;15406:80;13637:19;15407:28;:8;15426;15407:28;:18;:28;:::i;15406:80::-;15387:99;-1:-1:-1;15575:17:0;15595:80;13637:19;15596:28;:8;15615;15596:28;:18;:28;:::i;:::-;15595:40;:80;:40;:80;:::i;:::-;15575:100;;15801:8;15793:5;:16;:37;;;;;15821:9;15813:5;:17;15793:37;15789:1004;;;15847:192;;;;;;;;15873:5;15847:192;;;;15897:1;15847:192;;;;15917:1;15847:192;;;;15937:34;15955:15;15937:13;:17;;:34;;;;:::i;:::-;15847:192;;;;15990:34;:13;16008:15;15990:34;:17;:34;:::i;:::-;15847:192;;;;;;;;;;15789:1004;16070:8;16061:5;:17;16057:736;;16119:302;16173:5;16201:8;16232:13;16268:15;16306:34;:13;16324:15;16306:34;:17;:34;:::i;:::-;16363:8;16394;16119:31;:302::i;:::-;16095:326;;;;;;;16057:736;16478:303;16532:5;16560:9;16592:34;:13;16610:15;16592:34;:17;:34;:::i;:::-;16649:13;16685:15;16723:8;16754;16478:31;:303::i;14593:2207::-;;;;;;;;;:::o;13596:60::-;13637:19;13596:60;:::o;1362:181::-;1420:7;1452:5;;;1476:6;;;;1468:46;;;;;-1:-1:-1;;;1468:46:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;1534:1;-1:-1:-1;1362:181:0;;;;;:::o;6179:178::-;6276:7;6308:41;6344:4;6308:31;:4;6002:19;6308:31;:8;:31;:::i;:::-;:35;:41;:35;:41;:::i;6365:178::-;6462:7;6494:41;6002:19;6494:14;:4;6503;6494:14;:8;:14;:::i;17433:2455::-;17705:17;;:::i;:::-;17820:21;17844:133;17885:8;17908;17931:12;17958:8;17844:26;:133::i;:::-;17820:157;;18120:13;18104;:29;18100:1781;;;18150:18;18171:132;18287:15;18190:53;18229:13;18190:34;:13;18287:15;18190:34;:17;:34;:::i;:::-;:38;:53;:38;:53;:::i;18171:132::-;18150:153;;18318:61;;;;;;;;18326:8;18318:61;;;;18336:1;18318:61;;;;18339:10;18318:61;;;;18351:13;18318:61;;;;18366:12;18318:61;;;;;;;;;18100:1781;18503:20;18526:85;13712:19;18527:28;:8;18546;18527:28;:18;:28;:::i;18526:85::-;18503:108;-1:-1:-1;18663:99:0;18720:27;:8;18733:13;18720:27;:12;:27;:::i;:::-;18664:26;:8;18677:12;18664:26;:12;:26;:::i;18663:99::-;18655:107;;18796:5;18781:12;:20;18777:943;;;18957:177;19006:8;19037;19068:12;19103;18957:26;:177::i;:::-;18941:193;;19305:13;19289;:29;19285:420;;;19343:18;19364:85;19435:13;19365:32;19435:13;19383;19365:32;:17;:32;:::i;19364:85::-;19472:213;;;;;;;;;;;19545:1;19472:213;;;;;;;-1:-1:-1;19472:213:0;;;;;;;;;;;;;;-1:-1:-1;19472:213:0;;19285:420;19814:55;;;;;;;;19822:5;19814:55;;;;19829:1;19814:55;;;;13807:19;19814:55;;;;19841:13;19814:55;;;;19856:12;19814:55;;;;;;;17433:2455;;;;;;;;;;:::o;20536:2503::-;20809:17;;:::i;:::-;20953:21;20977:134;21018:8;21041;21064:12;21091:9;20977:26;:134::i;:::-;20953:158;;21144:13;21128;:29;21124:1908;;;21289:18;21310:132;21426:15;21329:53;21368:13;21329:34;:13;21426:15;21329:34;:17;:34;:::i;21310:132::-;21289:153;;21457:62;;;;;;;;21465:9;21457:62;;;;21476:1;21457:62;;;;21479:10;21457:62;;;;21491:12;21457:62;;;;21505:13;21457:62;;;;;;;;;21124:1908;21645:21;21669:85;13712:19;21670:28;:8;21689;21670:28;:18;:28;:::i;21669:85::-;21645:109;-1:-1:-1;21806:99:0;21864:26;:8;21877:12;21864:26;:12;:26;:::i;:::-;21807:27;:8;21820:13;21807:27;:12;:27;:::i;21806:99::-;21798:107;;21940:5;21924:13;:21;21920:949;;;22103:178;22152:8;22183;22214:12;22249:13;22103:26;:178::i;:::-;22087:194;;22453:13;22437;:29;22433:421;;;22491:18;22512:85;22583:13;22513:32;22583:13;22531;22513:32;:17;:32;:::i;22512:85::-;22620:214;;;;;;;;;;;22694:1;22620:214;;;;;;;-1:-1:-1;22620:214:0;;;;;;;;;;;;;;-1:-1:-1;22620:214:0;;22433:421;22965:55;;;;;;;;22973:5;22965:55;;;;22980:1;22965:55;;;;13807:19;22965:55;;;;22992:12;22965:55;;;;23006:13;22965:55;;;;;;;;;2716:471;2774:7;3019:6;3015:47;;-1:-1:-1;3049:1:0;3042:8;;3015:47;3086:5;;;3090:1;3086;:5;:1;3110:5;;;;;:10;3102:56;;;;-1:-1:-1;;;3102:56:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3663:132;3721:7;3748:39;3752:1;3755;3748:39;;;;;;;;;;;;;;;;;:3;:39::i;23135:450::-;23317:7;;23363:68;23425:5;23364:35;:15;23384:14;23364:35;:19;:35;:::i;23363:68::-;23337:94;;23466:7;23448:15;:25;23444:134;;;23497:28;:15;23517:7;23497:28;:19;:28;:::i;:::-;23490:35;;;;;23444:134;23565:1;23558:8;;;23135:450;;;;;;;:::o;1826:136::-;1884:7;1911:43;1915:1;1918;1911:43;;;;;;;;;;;;;;;;;:3;:43::i;23681:450::-;23863:7;;23909:68;23971:5;23910:35;:15;23930:14;23910:35;:19;:35;:::i;4291:278::-;4377:7;4412:12;4405:5;4397:28;;;;-1:-1:-1;;;4397:28:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;4397:28:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4436:9;4452:1;4448;:5;;;;;;;4291:278;-1:-1:-1;;;;;4291:278:0:o;2265:192::-;2351:7;2387:12;2379:6;;;;2371:29;;;;-1:-1:-1;;;2371:29:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;27:10:-1;;8:100;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;2371:29:0;-1:-1:-1;;;2423:5:0;;;2265:192::o;13437:10697::-;;;;;;;;;;;29:2:-1;21:6;17:15;125:4;109:14;101:6;88:42;-1:-1;13437:10697:0;;;-1:-1:-1;;13437:10697:0:o

Swarm Source

ipfs://955d21ca411553100f44ae9e41e27089c5541d476143852e83cba004182b82f8

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.