false
false
0
Contract Address Details
contract

0x11206B5439DD6623Cf7B14b7DfB84c5d88787695

Sponsored: ERAM, a pioneering Central Bank Blockchain. The First Banking Regulatory Blockchain, Licensed by the Central Bank.

ERAM, Central Bank Digital Currency (CBDC) (STABLE COIN)

Overview

ERAM Balance

0 ERAM

ERAM Value

$0.00

Token Holdings

Fetching tokens...

More Info

Private Name Tags

Last Balance Update

Blocks Validated

Sponsored

Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
Contract name:
PancakeStableSwapFactory




Optimization enabled
true
Compiler version
v0.8.10+commit.fc410830




Optimization runs
100
EVM Version
default




Verified at
2024-07-20T03:10:31.034140Z

Constructor Arguments

0x000000000000000000000000148b0b890c7eed2e5491e68e62c36d3146cf227d000000000000000000000000ce0bee769ac2fb0539e8b01c19a642d4d2657520000000000000000000000000944755fe99c2d9cca56042af0f2ef2abf159bab4

Arg [0] (address) : 0x148b0b890c7eed2e5491e68e62c36d3146cf227d
Arg [1] (address) : 0xce0bee769ac2fb0539e8b01c19a642d4d2657520
Arg [2] (address) : 0x944755fe99c2d9cca56042af0f2ef2abf159bab4

              

contracts/PancakeStableSwapFactory.sol

Sol2uml
new
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;

import "./openzeppelin/access/Ownable.sol";
import "./interfaces/IPancakeStableSwap.sol";
import "./interfaces/IPancakeStableSwapLP.sol";
import "./interfaces/IPancakeStableSwapDeployer.sol";
import "./interfaces/IPancakeStableSwapLPFactory.sol";

contract PancakeStableSwapFactory is Ownable {
    struct StableSwapPairInfo {
        address swapContract;
        address token0;
        address token1;
        address LPContract;
    }
    struct StableSwapThreePoolPairInfo {
        address swapContract;
        address token0;
        address token1;
        address token2;
        address LPContract;
    }

    mapping(address => mapping(address => mapping(address => StableSwapThreePoolPairInfo))) public stableSwapPairInfo;
    // Query three pool pair infomation by two tokens.
    mapping(address => mapping(address => StableSwapThreePoolPairInfo)) threePoolInfo;
    mapping(uint256 => address) public swapPairContract;

    IPancakeStableSwapLPFactory public immutable LPFactory;
    IPancakeStableSwapDeployer public immutable SwapTwoPoolDeployer;
    IPancakeStableSwapDeployer public immutable SwapThreePoolDeployer;

    address constant ZEROADDRESS = address(0);

    uint256 public pairLength;

    event NewStableSwapPair(address indexed swapContract, address tokenA, address tokenB, address tokenC, address LP);

    /**
     * @notice constructor
     * _LPFactory: LP factory
     * _SwapTwoPoolDeployer: Swap two pool deployer
     * _SwapThreePoolDeployer: Swap three pool deployer
     */
    constructor(
        IPancakeStableSwapLPFactory _LPFactory,
        IPancakeStableSwapDeployer _SwapTwoPoolDeployer,
        IPancakeStableSwapDeployer _SwapThreePoolDeployer
    ) {
        LPFactory = _LPFactory;
        SwapTwoPoolDeployer = _SwapTwoPoolDeployer;
        SwapThreePoolDeployer = _SwapThreePoolDeployer;
    }

    // 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, "IDENTICAL_ADDRESSES");
        (token0, token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA);
    }

    function sortTokens(
        address tokenA,
        address tokenB,
        address tokenC
    ) internal pure returns (address, address, address) {
        require(tokenA != tokenB && tokenA != tokenC && tokenB != tokenC, "IDENTICAL_ADDRESSES");
        address tmp;
        if (tokenA > tokenB) {
            tmp = tokenA;
            tokenA = tokenB;
            tokenB = tmp;
        }
        if (tokenB > tokenC) {
            tmp = tokenB;
            tokenB = tokenC;
            tokenC = tmp;
            if (tokenA > tokenB) {
                tmp = tokenA;
                tokenA = tokenB;
                tokenB = tmp;
            }
        }
        return (tokenA, tokenB, tokenC);
    }

    /**
     * @notice createSwapPair
     * @param _tokenA: Addresses of ERC20 conracts .
     * @param _tokenB: Addresses of ERC20 conracts .
     * @param _A: Amplification coefficient multiplied by n * (n - 1)
     * @param _fee: Fee to charge for exchanges
     * @param _admin_fee: Admin fee
     */
    function createSwapPair(
        address _tokenA,
        address _tokenB,
        uint256 _A,
        uint256 _fee,
        uint256 _admin_fee
    ) external onlyOwner {
        require(_tokenA != ZEROADDRESS && _tokenB != ZEROADDRESS && _tokenA != _tokenB, "Illegal token");
        (address t0, address t1) = sortTokens(_tokenA, _tokenB);
        address LP = LPFactory.createSwapLP(t0, t1, ZEROADDRESS, address(this));
        address swapContract = SwapTwoPoolDeployer.createSwapPair(t0, t1, _A, _fee, _admin_fee, msg.sender, LP);
        IPancakeStableSwapLP(LP).setMinter(swapContract);
        addPairInfoInternal(swapContract, t0, t1, ZEROADDRESS, LP);
    }

    /**
     * @notice createThreePoolPair
     * @param _tokenA: Addresses of ERC20 conracts .
     * @param _tokenB: Addresses of ERC20 conracts .
     * @param _tokenC: Addresses of ERC20 conracts .
     * @param _A: Amplification coefficient multiplied by n * (n - 1)
     * @param _fee: Fee to charge for exchanges
     * @param _admin_fee: Admin fee
     */
    function createThreePoolPair(
        address _tokenA,
        address _tokenB,
        address _tokenC,
        uint256 _A,
        uint256 _fee,
        uint256 _admin_fee
    ) external onlyOwner {
        require(
            _tokenA != ZEROADDRESS &&
                _tokenB != ZEROADDRESS &&
                _tokenC != ZEROADDRESS &&
                _tokenA != _tokenB &&
                _tokenA != _tokenC &&
                _tokenB != _tokenC,
            "Illegal token"
        );
        (address t0, address t1, address t2) = sortTokens(_tokenA, _tokenB, _tokenC);
        address LP = LPFactory.createSwapLP(t0, t1, t2, address(this));
        address swapContract = SwapThreePoolDeployer.createSwapPair(t0, t1, t2, _A, _fee, _admin_fee, msg.sender, LP);
        IPancakeStableSwapLP(LP).setMinter(swapContract);
        addPairInfoInternal(swapContract, t0, t1, t2, LP);
    }

    function addPairInfoInternal(address _swapContract, address _t0, address _t1, address _t2, address _LP) internal {
        StableSwapThreePoolPairInfo storage info = stableSwapPairInfo[_t0][_t1][_t2];
        info.swapContract = _swapContract;
        info.token0 = _t0;
        info.token1 = _t1;
        info.token2 = _t2;
        info.LPContract = _LP;
        swapPairContract[pairLength] = _swapContract;
        pairLength += 1;
        if (_t2 != ZEROADDRESS) {
            addThreePoolPairInfo(_t0, _t1, _t2, info);
        }

        emit NewStableSwapPair(_swapContract, _t0, _t1, _t2, _LP);
    }

    function addThreePoolPairInfo(
        address _t0,
        address _t1,
        address _t2,
        StableSwapThreePoolPairInfo memory info
    ) internal {
        threePoolInfo[_t0][_t1] = info;
        threePoolInfo[_t0][_t2] = info;
        threePoolInfo[_t1][_t2] = info;
    }

    function addPairInfo(address _swapContract) external onlyOwner {
        IPancakeStableSwap swap = IPancakeStableSwap(_swapContract);
        uint256 N_COINS = swap.N_COINS();
        if (N_COINS == 2) {
            addPairInfoInternal(_swapContract, swap.coins(0), swap.coins(1), ZEROADDRESS, swap.token());
        } else if (N_COINS == 3) {
            addPairInfoInternal(_swapContract, swap.coins(0), swap.coins(1), swap.coins(2), swap.token());
        }
    }

    function getPairInfo(address _tokenA, address _tokenB) external view returns (StableSwapPairInfo memory info) {
        (address t0, address t1) = sortTokens(_tokenA, _tokenB);
        StableSwapThreePoolPairInfo memory pairInfo = stableSwapPairInfo[t0][t1][ZEROADDRESS];
        info.swapContract = pairInfo.swapContract;
        info.token0 = pairInfo.token0;
        info.token1 = pairInfo.token1;
        info.LPContract = pairInfo.LPContract;
    }

    function getThreePoolPairInfo(
        address _tokenA,
        address _tokenB
    ) external view returns (StableSwapThreePoolPairInfo memory info) {
        (address t0, address t1) = sortTokens(_tokenA, _tokenB);
        info = threePoolInfo[t0][t1];
    }
}
        

contracts/interfaces/IPancakeStableSwap.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;

interface IPancakeStableSwap {
    function token() external view returns (address);

    function balances(uint256 i) external view returns (uint256);

    function N_COINS() external view returns (uint256);

    function RATES(uint256 i) external view returns (uint256);

    function coins(uint256 i) external view returns (address);

    function PRECISION_MUL(uint256 i) external view returns (uint256);

    function fee() external view returns (uint256);

    function admin_fee() external view returns (uint256);

    function A() external view returns (uint256);

    function get_D_mem(uint256[2] memory _balances, uint256 amp) external view returns (uint256);

    function get_y(uint256 i, uint256 j, uint256 x, uint256[2] memory xp_) external view returns (uint256);

    function calc_withdraw_one_coin(uint256 _token_amount, uint256 i) external view returns (uint256);
}
          

contracts/interfaces/IPancakeStableSwapDeployer.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;

interface IPancakeStableSwapDeployer {
    function createSwapPair(
        address _tokenA,
        address _tokenB,
        uint256 _A,
        uint256 _fee,
        uint256 _admin_fee,
        address _admin,
        address _LP
    ) external returns (address);

    function createSwapPair(
        address _tokenA,
        address _tokenB,
        address _tokenC,
        uint256 _A,
        uint256 _fee,
        uint256 _admin_fee,
        address _admin,
        address _LP
    ) external returns (address);
}
          

contracts/interfaces/IPancakeStableSwapLP.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;

interface IPancakeStableSwapLP {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    function mint(address _to, uint256 _amount) external;

    function burnFrom(address _to, uint256 _amount) external;

    function setMinter(address _newMinter) external;
}
          

contracts/interfaces/IPancakeStableSwapLPFactory.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;

interface IPancakeStableSwapLPFactory {
    function createSwapLP(
        address _tokenA,
        address _tokenB,
        address _tokenC,
        address _minter
    ) external returns (address);
}
          

contracts/openzeppelin/access/Ownable.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

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

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

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

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

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

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

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}
          

contracts/openzeppelin/utils/Context.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

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

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}
          

Compiler Settings

{"outputSelection":{"*":{"*":["abi","evm.bytecode","evm.deployedBytecode","evm.methodIdentifiers","metadata"],"":["ast"]}},"optimizer":{"runs":100,"enabled":true},"libraries":{}}
              

Contract ABI

[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"_LPFactory","internalType":"contract IPancakeStableSwapLPFactory"},{"type":"address","name":"_SwapTwoPoolDeployer","internalType":"contract IPancakeStableSwapDeployer"},{"type":"address","name":"_SwapThreePoolDeployer","internalType":"contract IPancakeStableSwapDeployer"}]},{"type":"event","name":"NewStableSwapPair","inputs":[{"type":"address","name":"swapContract","internalType":"address","indexed":true},{"type":"address","name":"tokenA","internalType":"address","indexed":false},{"type":"address","name":"tokenB","internalType":"address","indexed":false},{"type":"address","name":"tokenC","internalType":"address","indexed":false},{"type":"address","name":"LP","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IPancakeStableSwapLPFactory"}],"name":"LPFactory","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IPancakeStableSwapDeployer"}],"name":"SwapThreePoolDeployer","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IPancakeStableSwapDeployer"}],"name":"SwapTwoPoolDeployer","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"addPairInfo","inputs":[{"type":"address","name":"_swapContract","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"createSwapPair","inputs":[{"type":"address","name":"_tokenA","internalType":"address"},{"type":"address","name":"_tokenB","internalType":"address"},{"type":"uint256","name":"_A","internalType":"uint256"},{"type":"uint256","name":"_fee","internalType":"uint256"},{"type":"uint256","name":"_admin_fee","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"createThreePoolPair","inputs":[{"type":"address","name":"_tokenA","internalType":"address"},{"type":"address","name":"_tokenB","internalType":"address"},{"type":"address","name":"_tokenC","internalType":"address"},{"type":"uint256","name":"_A","internalType":"uint256"},{"type":"uint256","name":"_fee","internalType":"uint256"},{"type":"uint256","name":"_admin_fee","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"tuple","name":"info","internalType":"struct PancakeStableSwapFactory.StableSwapPairInfo","components":[{"type":"address","name":"swapContract","internalType":"address"},{"type":"address","name":"token0","internalType":"address"},{"type":"address","name":"token1","internalType":"address"},{"type":"address","name":"LPContract","internalType":"address"}]}],"name":"getPairInfo","inputs":[{"type":"address","name":"_tokenA","internalType":"address"},{"type":"address","name":"_tokenB","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"tuple","name":"info","internalType":"struct PancakeStableSwapFactory.StableSwapThreePoolPairInfo","components":[{"type":"address","name":"swapContract","internalType":"address"},{"type":"address","name":"token0","internalType":"address"},{"type":"address","name":"token1","internalType":"address"},{"type":"address","name":"token2","internalType":"address"},{"type":"address","name":"LPContract","internalType":"address"}]}],"name":"getThreePoolPairInfo","inputs":[{"type":"address","name":"_tokenA","internalType":"address"},{"type":"address","name":"_tokenB","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"pairLength","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"swapContract","internalType":"address"},{"type":"address","name":"token0","internalType":"address"},{"type":"address","name":"token1","internalType":"address"},{"type":"address","name":"token2","internalType":"address"},{"type":"address","name":"LPContract","internalType":"address"}],"name":"stableSwapPairInfo","inputs":[{"type":"address","name":"","internalType":"address"},{"type":"address","name":"","internalType":"address"},{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"swapPairContract","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]}]
              

Contract Creation Code

0x60e06040523480156200001157600080fd5b5060405162001926380380620019268339810160408190526200003491620000c6565b6200003f336200005d565b6001600160a01b0392831660805290821660a0521660c0526200011a565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b0381168114620000c357600080fd5b50565b600080600060608486031215620000dc57600080fd5b8351620000e981620000ad565b6020850151909350620000fc81620000ad565b60408501519092506200010f81620000ad565b809150509250925092565b60805160a05160c0516117c1620001656000396000818161011101526106010152600081816102660152610cd101526000818160d4015281816105160152610bed01526117c16000f3fe608060405234801561001057600080fd5b50600436106100ca5760003560e01c8063715018a61161007c578063715018a6146102885780638da5cb5b14610290578063923093cb14610298578063b3c0e846146102fa578063ec69a0241461030d578063f2fde38b14610320578063fcc9136c1461033357600080fd5b806314c77a6d146100cf57806321420c4b1461010c57806338802f1a14610133578063400f7a1e146101cd5780634205381b14610223578063636e66a01461023857806368fae3f314610261575b600080fd5b6100f67f000000000000000000000000000000000000000000000000000000000000000081565b60405161010391906114db565b60405180910390f35b6100f67f000000000000000000000000000000000000000000000000000000000000000081565b610193610141366004611504565b6001602081815260009485526040808620825293855283852090529083529120805491810154600282015460038301546004909301546001600160a01b03948516949283169391831692918216911685565b604080516001600160a01b03968716815294861660208601529285169284019290925283166060830152909116608082015260a001610103565b6101e06101db36600461154f565b61034a565b604051610103919081516001600160a01b039081168252602080840151821690830152604080840151821690830152606092830151169181019190915260800190565b610236610231366004611588565b61041a565b005b6100f66102463660046115ed565b6003602052600090815260409020546001600160a01b031681565b6100f67f000000000000000000000000000000000000000000000000000000000000000081565b6102366106ea565b6100f6610725565b6102ab6102a636600461154f565b610734565b604051610103919081516001600160a01b039081168252602080840151821690830152604080840151821690830152606080840151821690830152608092830151169181019190915260a00190565b610236610308366004611606565b6107de565b61023661031b36600461162a565b610b4f565b61023661032e366004611606565b610db8565b61033c60045481565b604051908152602001610103565b604080516080810182526000808252602082018190529181018290526060810182905290806103798585610e58565b6001600160a01b0391821660009081526001602081815260408084209486168452938152838320838052815291839020835160a08101855281548616808252928201548616818501908152600283015487168287019081526003840154881660608085019190915260049094015488166080909301928352938a52518616938901939093529051841692870192909252519091169084015250909392505050565b33610423610725565b6001600160a01b0316146104525760405162461bcd60e51b81526004016104499061167b565b60405180910390fd5b6001600160a01b0386161580159061047257506001600160a01b03851615155b801561048657506001600160a01b03841615155b80156104a45750846001600160a01b0316866001600160a01b031614155b80156104c25750836001600160a01b0316866001600160a01b031614155b80156104e05750836001600160a01b0316856001600160a01b031614155b6104fc5760405162461bcd60e51b8152600401610449906116b0565b600080600061050c898989610ebb565b92509250925060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663b240221a858585306040518563ffffffff1660e01b815260040161056694939291906116d7565b6020604051808303816000875af1158015610585573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105a99190611702565b604051634cedbfc760e01b81526001600160a01b03868116600483015285811660248301528481166044830152606482018a90526084820189905260a482018890523360c483015280831660e48301529192506000917f00000000000000000000000000000000000000000000000000000000000000001690634cedbfc790610104016020604051808303816000875af115801561064b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061066f9190611702565b604051637e51dad560e11b81529091506001600160a01b0383169063fca3b5aa9061069e9084906004016114db565b600060405180830381600087803b1580156106b857600080fd5b505af11580156106cc573d6000803e3d6000fd5b505050506106dd8186868686610f96565b5050505050505050505050565b336106f3610725565b6001600160a01b0316146107195760405162461bcd60e51b81526004016104499061167b565b610723600061148b565b565b6000546001600160a01b031690565b6040805160a0810182526000808252602082018190529181018290526060810182905260808101829052908061076a8585610e58565b6001600160a01b039182166000908152600260208181526040808420948616845293815291839020835160a081018552815486168152600182015486169381019390935290810154841692820192909252600382015483166060820152600490910154909116608082015295945050505050565b336107e7610725565b6001600160a01b03161461080d5760405162461bcd60e51b81526004016104499061167b565b60008190506000816001600160a01b031663293577506040518163ffffffff1660e01b8152600401602060405180830381865afa158015610852573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610876919061171f565b905080600214156109c75760405163c661065760e01b8152600060048201526109c29084906001600160a01b0385169063c661065790602401602060405180830381865afa1580156108cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108f09190611702565b60405163c661065760e01b8152600160048201526001600160a01b0386169063c661065790602401602060405180830381865afa158015610935573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109599190611702565b6000866001600160a01b031663fc0c546a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610999573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109bd9190611702565b610f96565b505050565b80600314156109c25760405163c661065760e01b8152600060048201526109c29084906001600160a01b0385169063c661065790602401602060405180830381865afa158015610a1b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a3f9190611702565b60405163c661065760e01b8152600160048201526001600160a01b0386169063c661065790602401602060405180830381865afa158015610a84573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aa89190611702565b60405163c661065760e01b8152600260048201526001600160a01b0387169063c661065790602401602060405180830381865afa158015610aed573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b119190611702565b866001600160a01b031663fc0c546a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610999573d6000803e3d6000fd5b33610b58610725565b6001600160a01b031614610b7e5760405162461bcd60e51b81526004016104499061167b565b6001600160a01b03851615801590610b9e57506001600160a01b03841615155b8015610bbc5750836001600160a01b0316856001600160a01b031614155b610bd85760405162461bcd60e51b8152600401610449906116b0565b600080610be58787610e58565b9150915060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663b240221a84846000306040518563ffffffff1660e01b8152600401610c3e94939291906116d7565b6020604051808303816000875af1158015610c5d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c819190611702565b604051639013148d60e01b81526001600160a01b03858116600483015284811660248301526044820189905260648201889052608482018790523360a483015280831660c48301529192506000917f00000000000000000000000000000000000000000000000000000000000000001690639013148d9060e4016020604051808303816000875af1158015610d1a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d3e9190611702565b604051637e51dad560e11b81529091506001600160a01b0383169063fca3b5aa90610d6d9084906004016114db565b600060405180830381600087803b158015610d8757600080fd5b505af1158015610d9b573d6000803e3d6000fd5b50505050610dad818585600086610f96565b505050505050505050565b33610dc1610725565b6001600160a01b031614610de75760405162461bcd60e51b81526004016104499061167b565b6001600160a01b038116610e4c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610449565b610e558161148b565b50565b600080826001600160a01b0316846001600160a01b03161415610e8d5760405162461bcd60e51b815260040161044990611738565b826001600160a01b0316846001600160a01b031610610ead578284610eb0565b83835b909590945092505050565b6000806000846001600160a01b0316866001600160a01b031614158015610ef45750836001600160a01b0316866001600160a01b031614155b8015610f125750836001600160a01b0316856001600160a01b031614155b610f2e5760405162461bcd60e51b815260040161044990611738565b6000856001600160a01b0316876001600160a01b03161115610f505750939493845b846001600160a01b0316866001600160a01b03161115610f895750929392836001600160a01b038087169088161115610f895750939493845b5094959394509192915050565b6001600160a01b03808516600081815260016020818152604080842089871680865290835281852089881680875290845282862080548e8a166001600160a01b03199182168117835582880180548316909a179099556002820180548216909417909355600380820180548516909317909255600480820180549a8c169a85169a909a179099558854875293529084208054909116909417909355835492939092909190611045908490611765565b90915550506001600160a01b0383161561143c576040805160a08101825282546001600160a01b03908116825260018401548116602083015260028401548116928201929092526003830154821660608201526004830154909116608082015261143c908690869086908060026000866001600160a01b03166001600160a01b031681526020019081526020016000206000856001600160a01b03166001600160a01b0316815260200190815260200160002060008201518160000160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060208201518160010160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060408201518160020160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060608201518160030160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060808201518160040160006101000a8154816001600160a01b0302191690836001600160a01b031602179055509050508060026000866001600160a01b03166001600160a01b031681526020019081526020016000206000846001600160a01b03166001600160a01b0316815260200190815260200160002060008201518160000160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060208201518160010160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060408201518160020160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060608201518160030160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060808201518160040160006101000a8154816001600160a01b0302191690836001600160a01b031602179055509050508060026000856001600160a01b03166001600160a01b031681526020019081526020016000206000846001600160a01b03166001600160a01b0316815260200190815260200160002060008201518160000160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060208201518160010160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060408201518160020160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060608201518160030160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060808201518160040160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555090505050505050565b856001600160a01b03167f48dc7a1b156fe3e70ed5ed0afcb307661905edf536f15bb5786e327ea19335328686868660405161147b94939291906116d7565b60405180910390a2505050505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b0391909116815260200190565b6001600160a01b0381168114610e5557600080fd5b60008060006060848603121561151957600080fd5b8335611524816114ef565b92506020840135611534816114ef565b91506040840135611544816114ef565b809150509250925092565b6000806040838503121561156257600080fd5b823561156d816114ef565b9150602083013561157d816114ef565b809150509250929050565b60008060008060008060c087890312156115a157600080fd5b86356115ac816114ef565b955060208701356115bc816114ef565b945060408701356115cc816114ef565b959894975094956060810135955060808101359460a0909101359350915050565b6000602082840312156115ff57600080fd5b5035919050565b60006020828403121561161857600080fd5b8135611623816114ef565b9392505050565b600080600080600060a0868803121561164257600080fd5b853561164d816114ef565b9450602086013561165d816114ef565b94979496505050506040830135926060810135926080909101359150565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252600d908201526c24b63632b3b0b6103a37b5b2b760991b604082015260600190565b6001600160a01b03948516815292841660208401529083166040830152909116606082015260800190565b60006020828403121561171457600080fd5b8151611623816114ef565b60006020828403121561173157600080fd5b5051919050565b6020808252601390820152724944454e544943414c5f41444452455353455360681b604082015260600190565b6000821982111561178657634e487b7160e01b600052601160045260246000fd5b50019056fea2646970667358221220a97a1120f3143483f21a745926d2bd6b452b42a6e8689517b6ab1ef0c09c2b1164736f6c634300080a0033000000000000000000000000148b0b890c7eed2e5491e68e62c36d3146cf227d000000000000000000000000ce0bee769ac2fb0539e8b01c19a642d4d2657520000000000000000000000000944755fe99c2d9cca56042af0f2ef2abf159bab4

Deployed ByteCode

0x608060405234801561001057600080fd5b50600436106100ca5760003560e01c8063715018a61161007c578063715018a6146102885780638da5cb5b14610290578063923093cb14610298578063b3c0e846146102fa578063ec69a0241461030d578063f2fde38b14610320578063fcc9136c1461033357600080fd5b806314c77a6d146100cf57806321420c4b1461010c57806338802f1a14610133578063400f7a1e146101cd5780634205381b14610223578063636e66a01461023857806368fae3f314610261575b600080fd5b6100f67f000000000000000000000000148b0b890c7eed2e5491e68e62c36d3146cf227d81565b60405161010391906114db565b60405180910390f35b6100f67f000000000000000000000000944755fe99c2d9cca56042af0f2ef2abf159bab481565b610193610141366004611504565b6001602081815260009485526040808620825293855283852090529083529120805491810154600282015460038301546004909301546001600160a01b03948516949283169391831692918216911685565b604080516001600160a01b03968716815294861660208601529285169284019290925283166060830152909116608082015260a001610103565b6101e06101db36600461154f565b61034a565b604051610103919081516001600160a01b039081168252602080840151821690830152604080840151821690830152606092830151169181019190915260800190565b610236610231366004611588565b61041a565b005b6100f66102463660046115ed565b6003602052600090815260409020546001600160a01b031681565b6100f67f000000000000000000000000ce0bee769ac2fb0539e8b01c19a642d4d265752081565b6102366106ea565b6100f6610725565b6102ab6102a636600461154f565b610734565b604051610103919081516001600160a01b039081168252602080840151821690830152604080840151821690830152606080840151821690830152608092830151169181019190915260a00190565b610236610308366004611606565b6107de565b61023661031b36600461162a565b610b4f565b61023661032e366004611606565b610db8565b61033c60045481565b604051908152602001610103565b604080516080810182526000808252602082018190529181018290526060810182905290806103798585610e58565b6001600160a01b0391821660009081526001602081815260408084209486168452938152838320838052815291839020835160a08101855281548616808252928201548616818501908152600283015487168287019081526003840154881660608085019190915260049094015488166080909301928352938a52518616938901939093529051841692870192909252519091169084015250909392505050565b33610423610725565b6001600160a01b0316146104525760405162461bcd60e51b81526004016104499061167b565b60405180910390fd5b6001600160a01b0386161580159061047257506001600160a01b03851615155b801561048657506001600160a01b03841615155b80156104a45750846001600160a01b0316866001600160a01b031614155b80156104c25750836001600160a01b0316866001600160a01b031614155b80156104e05750836001600160a01b0316856001600160a01b031614155b6104fc5760405162461bcd60e51b8152600401610449906116b0565b600080600061050c898989610ebb565b92509250925060007f000000000000000000000000148b0b890c7eed2e5491e68e62c36d3146cf227d6001600160a01b031663b240221a858585306040518563ffffffff1660e01b815260040161056694939291906116d7565b6020604051808303816000875af1158015610585573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105a99190611702565b604051634cedbfc760e01b81526001600160a01b03868116600483015285811660248301528481166044830152606482018a90526084820189905260a482018890523360c483015280831660e48301529192506000917f000000000000000000000000944755fe99c2d9cca56042af0f2ef2abf159bab41690634cedbfc790610104016020604051808303816000875af115801561064b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061066f9190611702565b604051637e51dad560e11b81529091506001600160a01b0383169063fca3b5aa9061069e9084906004016114db565b600060405180830381600087803b1580156106b857600080fd5b505af11580156106cc573d6000803e3d6000fd5b505050506106dd8186868686610f96565b5050505050505050505050565b336106f3610725565b6001600160a01b0316146107195760405162461bcd60e51b81526004016104499061167b565b610723600061148b565b565b6000546001600160a01b031690565b6040805160a0810182526000808252602082018190529181018290526060810182905260808101829052908061076a8585610e58565b6001600160a01b039182166000908152600260208181526040808420948616845293815291839020835160a081018552815486168152600182015486169381019390935290810154841692820192909252600382015483166060820152600490910154909116608082015295945050505050565b336107e7610725565b6001600160a01b03161461080d5760405162461bcd60e51b81526004016104499061167b565b60008190506000816001600160a01b031663293577506040518163ffffffff1660e01b8152600401602060405180830381865afa158015610852573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610876919061171f565b905080600214156109c75760405163c661065760e01b8152600060048201526109c29084906001600160a01b0385169063c661065790602401602060405180830381865afa1580156108cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108f09190611702565b60405163c661065760e01b8152600160048201526001600160a01b0386169063c661065790602401602060405180830381865afa158015610935573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109599190611702565b6000866001600160a01b031663fc0c546a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610999573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109bd9190611702565b610f96565b505050565b80600314156109c25760405163c661065760e01b8152600060048201526109c29084906001600160a01b0385169063c661065790602401602060405180830381865afa158015610a1b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a3f9190611702565b60405163c661065760e01b8152600160048201526001600160a01b0386169063c661065790602401602060405180830381865afa158015610a84573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aa89190611702565b60405163c661065760e01b8152600260048201526001600160a01b0387169063c661065790602401602060405180830381865afa158015610aed573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b119190611702565b866001600160a01b031663fc0c546a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610999573d6000803e3d6000fd5b33610b58610725565b6001600160a01b031614610b7e5760405162461bcd60e51b81526004016104499061167b565b6001600160a01b03851615801590610b9e57506001600160a01b03841615155b8015610bbc5750836001600160a01b0316856001600160a01b031614155b610bd85760405162461bcd60e51b8152600401610449906116b0565b600080610be58787610e58565b9150915060007f000000000000000000000000148b0b890c7eed2e5491e68e62c36d3146cf227d6001600160a01b031663b240221a84846000306040518563ffffffff1660e01b8152600401610c3e94939291906116d7565b6020604051808303816000875af1158015610c5d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c819190611702565b604051639013148d60e01b81526001600160a01b03858116600483015284811660248301526044820189905260648201889052608482018790523360a483015280831660c48301529192506000917f000000000000000000000000ce0bee769ac2fb0539e8b01c19a642d4d26575201690639013148d9060e4016020604051808303816000875af1158015610d1a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d3e9190611702565b604051637e51dad560e11b81529091506001600160a01b0383169063fca3b5aa90610d6d9084906004016114db565b600060405180830381600087803b158015610d8757600080fd5b505af1158015610d9b573d6000803e3d6000fd5b50505050610dad818585600086610f96565b505050505050505050565b33610dc1610725565b6001600160a01b031614610de75760405162461bcd60e51b81526004016104499061167b565b6001600160a01b038116610e4c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610449565b610e558161148b565b50565b600080826001600160a01b0316846001600160a01b03161415610e8d5760405162461bcd60e51b815260040161044990611738565b826001600160a01b0316846001600160a01b031610610ead578284610eb0565b83835b909590945092505050565b6000806000846001600160a01b0316866001600160a01b031614158015610ef45750836001600160a01b0316866001600160a01b031614155b8015610f125750836001600160a01b0316856001600160a01b031614155b610f2e5760405162461bcd60e51b815260040161044990611738565b6000856001600160a01b0316876001600160a01b03161115610f505750939493845b846001600160a01b0316866001600160a01b03161115610f895750929392836001600160a01b038087169088161115610f895750939493845b5094959394509192915050565b6001600160a01b03808516600081815260016020818152604080842089871680865290835281852089881680875290845282862080548e8a166001600160a01b03199182168117835582880180548316909a179099556002820180548216909417909355600380820180548516909317909255600480820180549a8c169a85169a909a179099558854875293529084208054909116909417909355835492939092909190611045908490611765565b90915550506001600160a01b0383161561143c576040805160a08101825282546001600160a01b03908116825260018401548116602083015260028401548116928201929092526003830154821660608201526004830154909116608082015261143c908690869086908060026000866001600160a01b03166001600160a01b031681526020019081526020016000206000856001600160a01b03166001600160a01b0316815260200190815260200160002060008201518160000160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060208201518160010160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060408201518160020160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060608201518160030160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060808201518160040160006101000a8154816001600160a01b0302191690836001600160a01b031602179055509050508060026000866001600160a01b03166001600160a01b031681526020019081526020016000206000846001600160a01b03166001600160a01b0316815260200190815260200160002060008201518160000160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060208201518160010160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060408201518160020160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060608201518160030160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060808201518160040160006101000a8154816001600160a01b0302191690836001600160a01b031602179055509050508060026000856001600160a01b03166001600160a01b031681526020019081526020016000206000846001600160a01b03166001600160a01b0316815260200190815260200160002060008201518160000160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060208201518160010160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060408201518160020160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060608201518160030160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060808201518160040160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555090505050505050565b856001600160a01b03167f48dc7a1b156fe3e70ed5ed0afcb307661905edf536f15bb5786e327ea19335328686868660405161147b94939291906116d7565b60405180910390a2505050505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b0391909116815260200190565b6001600160a01b0381168114610e5557600080fd5b60008060006060848603121561151957600080fd5b8335611524816114ef565b92506020840135611534816114ef565b91506040840135611544816114ef565b809150509250925092565b6000806040838503121561156257600080fd5b823561156d816114ef565b9150602083013561157d816114ef565b809150509250929050565b60008060008060008060c087890312156115a157600080fd5b86356115ac816114ef565b955060208701356115bc816114ef565b945060408701356115cc816114ef565b959894975094956060810135955060808101359460a0909101359350915050565b6000602082840312156115ff57600080fd5b5035919050565b60006020828403121561161857600080fd5b8135611623816114ef565b9392505050565b600080600080600060a0868803121561164257600080fd5b853561164d816114ef565b9450602086013561165d816114ef565b94979496505050506040830135926060810135926080909101359150565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252600d908201526c24b63632b3b0b6103a37b5b2b760991b604082015260600190565b6001600160a01b03948516815292841660208401529083166040830152909116606082015260800190565b60006020828403121561171457600080fd5b8151611623816114ef565b60006020828403121561173157600080fd5b5051919050565b6020808252601390820152724944454e544943414c5f41444452455353455360681b604082015260600190565b6000821982111561178657634e487b7160e01b600052601160045260246000fd5b50019056fea2646970667358221220a97a1120f3143483f21a745926d2bd6b452b42a6e8689517b6ab1ef0c09c2b1164736f6c634300080a0033