Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
- Contract name:
- NineinchStableSwapFactory
- Optimization enabled
- true
- Compiler version
- v0.8.10+commit.fc410830
- Optimization runs
- 400
- EVM Version
- istanbul
- Verified at
- 2024-05-13T11:27:19.803074Z
Constructor Arguments
0x0000000000000000000000003a589bd3a1e59cf05ba686ec7af461672f814b59000000000000000000000000e72569f027f18dd2a9a1bfdffc79709c04de6eb80000000000000000000000007f7811c71e90bb098bdbba47fd6f079b33de93c5
Arg [0] (address) : 0x3a589bd3a1e59cf05ba686ec7af461672f814b59
Arg [1] (address) : 0xe72569f027f18dd2a9a1bfdffc79709c04de6eb8
Arg [2] (address) : 0x7f7811c71e90bb098bdbba47fd6f079b33de93c5
contracts/NineinchStableSwapFactory.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;
import "@openzeppelin/contracts/access/Ownable.sol";
import "./interfaces/INineinchStableSwap.sol";
import "./interfaces/INineinchStableSwapLP.sol";
import "./interfaces/INineinchStableSwapDeployer.sol";
import "./interfaces/INineinchStableSwapLPFactory.sol";
contract NineinchStableSwapFactory 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;
INineinchStableSwapLPFactory public immutable LPFactory;
INineinchStableSwapDeployer public immutable SwapTwoPoolDeployer;
INineinchStableSwapDeployer 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(
INineinchStableSwapLPFactory _LPFactory,
INineinchStableSwapDeployer _SwapTwoPoolDeployer,
INineinchStableSwapDeployer _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);
INineinchStableSwapLP(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);
INineinchStableSwapLP(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 {
INineinchStableSwap swap = INineinchStableSwap(_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];
}
}
@openzeppelin/contracts/access/Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (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 Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling 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);
}
}
@openzeppelin/contracts/utils/Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.4) (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;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}
contracts/interfaces/INineinchStableSwap.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;
interface INineinchStableSwap {
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/INineinchStableSwapDeployer.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;
interface INineinchStableSwapDeployer {
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/INineinchStableSwapLP.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;
interface INineinchStableSwapLP {
/**
* @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/INineinchStableSwapLPFactory.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;
interface INineinchStableSwapLPFactory {
function createSwapLP(
address _tokenA,
address _tokenB,
address _tokenC,
address _minter
) external returns (address);
}
Compiler Settings
{"outputSelection":{"*":{"*":["*"],"":["*"]}},"optimizer":{"runs":400,"enabled":true},"metadata":{"bytecodeHash":"none"},"libraries":{},"evmVersion":"istanbul"}
Contract ABI
[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"_LPFactory","internalType":"contract INineinchStableSwapLPFactory"},{"type":"address","name":"_SwapTwoPoolDeployer","internalType":"contract INineinchStableSwapDeployer"},{"type":"address","name":"_SwapThreePoolDeployer","internalType":"contract INineinchStableSwapDeployer"}]},{"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 INineinchStableSwapLPFactory"}],"name":"LPFactory","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract INineinchStableSwapDeployer"}],"name":"SwapThreePoolDeployer","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract INineinchStableSwapDeployer"}],"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 NineinchStableSwapFactory.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 NineinchStableSwapFactory.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
0x60e06040523480156200001157600080fd5b50604051620018a1380380620018a18339810160408190526200003491620000c6565b6200003f336200005d565b6001600160a01b0392831660805290821660a0521660c0526200011a565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b0381168114620000c357600080fd5b50565b600080600060608486031215620000dc57600080fd5b8351620000e981620000ad565b6020850151909350620000fc81620000ad565b60408501519092506200010f81620000ad565b809150509250925092565b60805160a05160c05161173c6200016560003960008181610138015261063601526000818161028d0152610caf01526000818160f4015281816105710152610bf0015261173c6000f3fe608060405234801561001057600080fd5b50600436106100ea5760003560e01c8063715018a61161008c578063b3c0e84611610066578063b3c0e8461461032a578063ec69a0241461033d578063f2fde38b14610350578063fcc9136c1461036357600080fd5b8063715018a6146102af5780638da5cb5b146102b7578063923093cb146102c857600080fd5b8063400f7a1e116100c8578063400f7a1e146101f45780634205381b1461024a578063636e66a01461025f57806368fae3f31461028857600080fd5b806314c77a6d146100ef57806321420c4b1461013357806338802f1a1461015a575b600080fd5b6101167f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b6101167f000000000000000000000000000000000000000000000000000000000000000081565b6101ba61016836600461155c565b6001602081815260009485526040808620825293855283852090529083529120805491810154600282015460038301546004909301546001600160a01b03948516949283169391831692918216911685565b604080516001600160a01b03968716815294861660208601529285169284019290925283166060830152909116608082015260a00161012a565b6102076102023660046115a7565b61037a565b60405161012a919081516001600160a01b039081168252602080840151821690830152604080840151821690830152606092830151169181019190915260800190565b61025d6102583660046115e0565b61044a565b005b61011661026d366004611645565b6003602052600090815260409020546001600160a01b031681565b6101167f000000000000000000000000000000000000000000000000000000000000000081565b61025d61071d565b6000546001600160a01b0316610116565b6102db6102d63660046115a7565b610731565b60405161012a919081516001600160a01b039081168252602080840151821690830152604080840151821690830152606080840151821690830152608092830151169181019190915260a00190565b61025d61033836600461165e565b6107db565b61025d61034b366004611682565b610b25565b61025d61035e36600461165e565b610d94565b61036c60045481565b60405190815260200161012a565b604080516080810182526000808252602082018190529181018290526060810182905290806103a98585610e0d565b6001600160a01b0391821660009081526001602081815260408084209486168452938152838320838052815291839020835160a08101855281548616808252928201548616818501908152600283015487168287019081526003840154881660608085019190915260049094015488166080909301928352938a52518616938901939093529051841692870192909252519091169084015250909392505050565b610452610e96565b6001600160a01b0386161580159061047257506001600160a01b03851615155b801561048657506001600160a01b03841615155b80156104a45750846001600160a01b0316866001600160a01b031614155b80156104c25750836001600160a01b0316866001600160a01b031614155b80156104e05750836001600160a01b0316856001600160a01b031614155b6105215760405162461bcd60e51b815260206004820152600d60248201526c24b63632b3b0b6103a37b5b2b760991b60448201526064015b60405180910390fd5b6000806000610531898989610ef0565b604051635920110d60e11b81526001600160a01b0380851660048301528084166024830152808316604483015230606483015293965091945092506000917f0000000000000000000000000000000000000000000000000000000000000000169063b240221a906084016020604051808303816000875af11580156105ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105de91906116d3565b604051634cedbfc760e01b81526001600160a01b03868116600483015285811660248301528481166044830152606482018a90526084820189905260a482018890523360c483015280831660e48301529192506000917f00000000000000000000000000000000000000000000000000000000000000001690634cedbfc790610104016020604051808303816000875af1158015610680573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106a491906116d3565b604051637e51dad560e11b81526001600160a01b0380831660048301529192509083169063fca3b5aa90602401600060405180830381600087803b1580156106eb57600080fd5b505af11580156106ff573d6000803e3d6000fd5b505050506107108186868686610ff1565b5050505050505050505050565b610725610e96565b61072f60006114f7565b565b6040805160a081018252600080825260208201819052918101829052606081018290526080810182905290806107678585610e0d565b6001600160a01b039182166000908152600260208181526040808420948616845293815291839020835160a081018552815486168152600182015486169381019390935290810154841692820192909252600382015483166060820152600490910154909116608082015295945050505050565b6107e3610e96565b60008190506000816001600160a01b031663293577506040518163ffffffff1660e01b8152600401602060405180830381865afa158015610828573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061084c91906116f0565b9050806002141561099d5760405163c661065760e01b8152600060048201526109989084906001600160a01b0385169063c661065790602401602060405180830381865afa1580156108a2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108c691906116d3565b60405163c661065760e01b8152600160048201526001600160a01b0386169063c661065790602401602060405180830381865afa15801561090b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061092f91906116d3565b6000866001600160a01b031663fc0c546a6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561096f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061099391906116d3565b610ff1565b505050565b80600314156109985760405163c661065760e01b8152600060048201526109989084906001600160a01b0385169063c661065790602401602060405180830381865afa1580156109f1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a1591906116d3565b60405163c661065760e01b8152600160048201526001600160a01b0386169063c661065790602401602060405180830381865afa158015610a5a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a7e91906116d3565b60405163c661065760e01b8152600260048201526001600160a01b0387169063c661065790602401602060405180830381865afa158015610ac3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ae791906116d3565b866001600160a01b031663fc0c546a6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561096f573d6000803e3d6000fd5b610b2d610e96565b6001600160a01b03851615801590610b4d57506001600160a01b03841615155b8015610b6b5750836001600160a01b0316856001600160a01b031614155b610ba75760405162461bcd60e51b815260206004820152600d60248201526c24b63632b3b0b6103a37b5b2b760991b6044820152606401610518565b600080610bb48787610e0d565b604051635920110d60e11b81526001600160a01b03838116600483015282811660248301526000604483018190523060648401529395509193507f00000000000000000000000000000000000000000000000000000000000000009091169063b240221a906084016020604051808303816000875af1158015610c3b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c5f91906116d3565b604051639013148d60e01b81526001600160a01b03858116600483015284811660248301526044820189905260648201889052608482018790523360a483015280831660c48301529192506000917f00000000000000000000000000000000000000000000000000000000000000001690639013148d9060e4016020604051808303816000875af1158015610cf8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d1c91906116d3565b604051637e51dad560e11b81526001600160a01b0380831660048301529192509083169063fca3b5aa90602401600060405180830381600087803b158015610d6357600080fd5b505af1158015610d77573d6000803e3d6000fd5b50505050610d89818585600086610ff1565b505050505050505050565b610d9c610e96565b6001600160a01b038116610e015760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610518565b610e0a816114f7565b50565b600080826001600160a01b0316846001600160a01b03161415610e685760405162461bcd60e51b81526020600482015260136024820152724944454e544943414c5f41444452455353455360681b6044820152606401610518565b826001600160a01b0316846001600160a01b031610610e88578284610e8b565b83835b909590945092505050565b6000546001600160a01b0316331461072f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610518565b6000806000846001600160a01b0316866001600160a01b031614158015610f295750836001600160a01b0316866001600160a01b031614155b8015610f475750836001600160a01b0316856001600160a01b031614155b610f895760405162461bcd60e51b81526020600482015260136024820152724944454e544943414c5f41444452455353455360681b6044820152606401610518565b6000856001600160a01b0316876001600160a01b03161115610fab5750939493845b846001600160a01b0316866001600160a01b03161115610fe45750929392836001600160a01b038087169088161115610fe45750939493845b5094959394509192915050565b6001600160a01b03808516600081815260016020818152604080842089871680865290835281852089881680875290845282862080548e8a166001600160a01b03199182168117835582880180548316909a179099556002820180548216909417909355600380820180548516909317909255600480820180549a8c169a85169a909a1790995588548752935290842080549091169094179093558354929390929091906110a0908490611709565b90915550506001600160a01b03831615611497576040805160a08101825282546001600160a01b039081168252600184015481166020830152600284015481169282019290925260038301548216606082015260048301549091166080820152611497908690869086908060026000866001600160a01b03166001600160a01b031681526020019081526020016000206000856001600160a01b03166001600160a01b0316815260200190815260200160002060008201518160000160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060208201518160010160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060408201518160020160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060608201518160030160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060808201518160040160006101000a8154816001600160a01b0302191690836001600160a01b031602179055509050508060026000866001600160a01b03166001600160a01b031681526020019081526020016000206000846001600160a01b03166001600160a01b0316815260200190815260200160002060008201518160000160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060208201518160010160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060408201518160020160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060608201518160030160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060808201518160040160006101000a8154816001600160a01b0302191690836001600160a01b031602179055509050508060026000856001600160a01b03166001600160a01b031681526020019081526020016000206000846001600160a01b03166001600160a01b0316815260200190815260200160002060008201518160000160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060208201518160010160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060408201518160020160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060608201518160030160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060808201518160040160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555090505050505050565b604080516001600160a01b03878116825286811660208301528581168284015284811660608301529151918816917f48dc7a1b156fe3e70ed5ed0afcb307661905edf536f15bb5786e327ea19335329181900360800190a2505050505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b0381168114610e0a57600080fd5b60008060006060848603121561157157600080fd5b833561157c81611547565b9250602084013561158c81611547565b9150604084013561159c81611547565b809150509250925092565b600080604083850312156115ba57600080fd5b82356115c581611547565b915060208301356115d581611547565b809150509250929050565b60008060008060008060c087890312156115f957600080fd5b863561160481611547565b9550602087013561161481611547565b9450604087013561162481611547565b959894975094956060810135955060808101359460a0909101359350915050565b60006020828403121561165757600080fd5b5035919050565b60006020828403121561167057600080fd5b813561167b81611547565b9392505050565b600080600080600060a0868803121561169a57600080fd5b85356116a581611547565b945060208601356116b581611547565b94979496505050506040830135926060810135926080909101359150565b6000602082840312156116e557600080fd5b815161167b81611547565b60006020828403121561170257600080fd5b5051919050565b6000821982111561172a57634e487b7160e01b600052601160045260246000fd5b50019056fea164736f6c634300080a000a0000000000000000000000003a589bd3a1e59cf05ba686ec7af461672f814b59000000000000000000000000e72569f027f18dd2a9a1bfdffc79709c04de6eb80000000000000000000000007f7811c71e90bb098bdbba47fd6f079b33de93c5
Deployed ByteCode
0x608060405234801561001057600080fd5b50600436106100ea5760003560e01c8063715018a61161008c578063b3c0e84611610066578063b3c0e8461461032a578063ec69a0241461033d578063f2fde38b14610350578063fcc9136c1461036357600080fd5b8063715018a6146102af5780638da5cb5b146102b7578063923093cb146102c857600080fd5b8063400f7a1e116100c8578063400f7a1e146101f45780634205381b1461024a578063636e66a01461025f57806368fae3f31461028857600080fd5b806314c77a6d146100ef57806321420c4b1461013357806338802f1a1461015a575b600080fd5b6101167f0000000000000000000000003a589bd3a1e59cf05ba686ec7af461672f814b5981565b6040516001600160a01b0390911681526020015b60405180910390f35b6101167f0000000000000000000000007f7811c71e90bb098bdbba47fd6f079b33de93c581565b6101ba61016836600461155c565b6001602081815260009485526040808620825293855283852090529083529120805491810154600282015460038301546004909301546001600160a01b03948516949283169391831692918216911685565b604080516001600160a01b03968716815294861660208601529285169284019290925283166060830152909116608082015260a00161012a565b6102076102023660046115a7565b61037a565b60405161012a919081516001600160a01b039081168252602080840151821690830152604080840151821690830152606092830151169181019190915260800190565b61025d6102583660046115e0565b61044a565b005b61011661026d366004611645565b6003602052600090815260409020546001600160a01b031681565b6101167f000000000000000000000000e72569f027f18dd2a9a1bfdffc79709c04de6eb881565b61025d61071d565b6000546001600160a01b0316610116565b6102db6102d63660046115a7565b610731565b60405161012a919081516001600160a01b039081168252602080840151821690830152604080840151821690830152606080840151821690830152608092830151169181019190915260a00190565b61025d61033836600461165e565b6107db565b61025d61034b366004611682565b610b25565b61025d61035e36600461165e565b610d94565b61036c60045481565b60405190815260200161012a565b604080516080810182526000808252602082018190529181018290526060810182905290806103a98585610e0d565b6001600160a01b0391821660009081526001602081815260408084209486168452938152838320838052815291839020835160a08101855281548616808252928201548616818501908152600283015487168287019081526003840154881660608085019190915260049094015488166080909301928352938a52518616938901939093529051841692870192909252519091169084015250909392505050565b610452610e96565b6001600160a01b0386161580159061047257506001600160a01b03851615155b801561048657506001600160a01b03841615155b80156104a45750846001600160a01b0316866001600160a01b031614155b80156104c25750836001600160a01b0316866001600160a01b031614155b80156104e05750836001600160a01b0316856001600160a01b031614155b6105215760405162461bcd60e51b815260206004820152600d60248201526c24b63632b3b0b6103a37b5b2b760991b60448201526064015b60405180910390fd5b6000806000610531898989610ef0565b604051635920110d60e11b81526001600160a01b0380851660048301528084166024830152808316604483015230606483015293965091945092506000917f0000000000000000000000003a589bd3a1e59cf05ba686ec7af461672f814b59169063b240221a906084016020604051808303816000875af11580156105ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105de91906116d3565b604051634cedbfc760e01b81526001600160a01b03868116600483015285811660248301528481166044830152606482018a90526084820189905260a482018890523360c483015280831660e48301529192506000917f0000000000000000000000007f7811c71e90bb098bdbba47fd6f079b33de93c51690634cedbfc790610104016020604051808303816000875af1158015610680573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106a491906116d3565b604051637e51dad560e11b81526001600160a01b0380831660048301529192509083169063fca3b5aa90602401600060405180830381600087803b1580156106eb57600080fd5b505af11580156106ff573d6000803e3d6000fd5b505050506107108186868686610ff1565b5050505050505050505050565b610725610e96565b61072f60006114f7565b565b6040805160a081018252600080825260208201819052918101829052606081018290526080810182905290806107678585610e0d565b6001600160a01b039182166000908152600260208181526040808420948616845293815291839020835160a081018552815486168152600182015486169381019390935290810154841692820192909252600382015483166060820152600490910154909116608082015295945050505050565b6107e3610e96565b60008190506000816001600160a01b031663293577506040518163ffffffff1660e01b8152600401602060405180830381865afa158015610828573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061084c91906116f0565b9050806002141561099d5760405163c661065760e01b8152600060048201526109989084906001600160a01b0385169063c661065790602401602060405180830381865afa1580156108a2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108c691906116d3565b60405163c661065760e01b8152600160048201526001600160a01b0386169063c661065790602401602060405180830381865afa15801561090b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061092f91906116d3565b6000866001600160a01b031663fc0c546a6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561096f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061099391906116d3565b610ff1565b505050565b80600314156109985760405163c661065760e01b8152600060048201526109989084906001600160a01b0385169063c661065790602401602060405180830381865afa1580156109f1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a1591906116d3565b60405163c661065760e01b8152600160048201526001600160a01b0386169063c661065790602401602060405180830381865afa158015610a5a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a7e91906116d3565b60405163c661065760e01b8152600260048201526001600160a01b0387169063c661065790602401602060405180830381865afa158015610ac3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ae791906116d3565b866001600160a01b031663fc0c546a6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561096f573d6000803e3d6000fd5b610b2d610e96565b6001600160a01b03851615801590610b4d57506001600160a01b03841615155b8015610b6b5750836001600160a01b0316856001600160a01b031614155b610ba75760405162461bcd60e51b815260206004820152600d60248201526c24b63632b3b0b6103a37b5b2b760991b6044820152606401610518565b600080610bb48787610e0d565b604051635920110d60e11b81526001600160a01b03838116600483015282811660248301526000604483018190523060648401529395509193507f0000000000000000000000003a589bd3a1e59cf05ba686ec7af461672f814b599091169063b240221a906084016020604051808303816000875af1158015610c3b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c5f91906116d3565b604051639013148d60e01b81526001600160a01b03858116600483015284811660248301526044820189905260648201889052608482018790523360a483015280831660c48301529192506000917f000000000000000000000000e72569f027f18dd2a9a1bfdffc79709c04de6eb81690639013148d9060e4016020604051808303816000875af1158015610cf8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d1c91906116d3565b604051637e51dad560e11b81526001600160a01b0380831660048301529192509083169063fca3b5aa90602401600060405180830381600087803b158015610d6357600080fd5b505af1158015610d77573d6000803e3d6000fd5b50505050610d89818585600086610ff1565b505050505050505050565b610d9c610e96565b6001600160a01b038116610e015760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610518565b610e0a816114f7565b50565b600080826001600160a01b0316846001600160a01b03161415610e685760405162461bcd60e51b81526020600482015260136024820152724944454e544943414c5f41444452455353455360681b6044820152606401610518565b826001600160a01b0316846001600160a01b031610610e88578284610e8b565b83835b909590945092505050565b6000546001600160a01b0316331461072f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610518565b6000806000846001600160a01b0316866001600160a01b031614158015610f295750836001600160a01b0316866001600160a01b031614155b8015610f475750836001600160a01b0316856001600160a01b031614155b610f895760405162461bcd60e51b81526020600482015260136024820152724944454e544943414c5f41444452455353455360681b6044820152606401610518565b6000856001600160a01b0316876001600160a01b03161115610fab5750939493845b846001600160a01b0316866001600160a01b03161115610fe45750929392836001600160a01b038087169088161115610fe45750939493845b5094959394509192915050565b6001600160a01b03808516600081815260016020818152604080842089871680865290835281852089881680875290845282862080548e8a166001600160a01b03199182168117835582880180548316909a179099556002820180548216909417909355600380820180548516909317909255600480820180549a8c169a85169a909a1790995588548752935290842080549091169094179093558354929390929091906110a0908490611709565b90915550506001600160a01b03831615611497576040805160a08101825282546001600160a01b039081168252600184015481166020830152600284015481169282019290925260038301548216606082015260048301549091166080820152611497908690869086908060026000866001600160a01b03166001600160a01b031681526020019081526020016000206000856001600160a01b03166001600160a01b0316815260200190815260200160002060008201518160000160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060208201518160010160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060408201518160020160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060608201518160030160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060808201518160040160006101000a8154816001600160a01b0302191690836001600160a01b031602179055509050508060026000866001600160a01b03166001600160a01b031681526020019081526020016000206000846001600160a01b03166001600160a01b0316815260200190815260200160002060008201518160000160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060208201518160010160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060408201518160020160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060608201518160030160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060808201518160040160006101000a8154816001600160a01b0302191690836001600160a01b031602179055509050508060026000856001600160a01b03166001600160a01b031681526020019081526020016000206000846001600160a01b03166001600160a01b0316815260200190815260200160002060008201518160000160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060208201518160010160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060408201518160020160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060608201518160030160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060808201518160040160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555090505050505050565b604080516001600160a01b03878116825286811660208301528581168284015284811660608301529151918816917f48dc7a1b156fe3e70ed5ed0afcb307661905edf536f15bb5786e327ea19335329181900360800190a2505050505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b0381168114610e0a57600080fd5b60008060006060848603121561157157600080fd5b833561157c81611547565b9250602084013561158c81611547565b9150604084013561159c81611547565b809150509250925092565b600080604083850312156115ba57600080fd5b82356115c581611547565b915060208301356115d581611547565b809150509250929050565b60008060008060008060c087890312156115f957600080fd5b863561160481611547565b9550602087013561161481611547565b9450604087013561162481611547565b959894975094956060810135955060808101359460a0909101359350915050565b60006020828403121561165757600080fd5b5035919050565b60006020828403121561167057600080fd5b813561167b81611547565b9392505050565b600080600080600060a0868803121561169a57600080fd5b85356116a581611547565b945060208601356116b581611547565b94979496505050506040830135926060810135926080909101359150565b6000602082840312156116e557600080fd5b815161167b81611547565b60006020828403121561170257600080fd5b5051919050565b6000821982111561172a57634e487b7160e01b600052601160045260246000fd5b50019056fea164736f6c634300080a000a