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
- 1000
- EVM Version
- default
- Verified at
- 2024-11-08T12:29:10.906031Z
Constructor Arguments
0x0000000000000000000000000fafe29bc793dc4828b151e655e6df0277721cbb000000000000000000000000e3dbdf64f1cd412506efacf066024787daaa2b56000000000000000000000000feffe0d393b7849a2fff0aba2d7d12565797eefd
Arg [0] (address) : 0x0fafe29bc793dc4828b151e655e6df0277721cbb
Arg [1] (address) : 0xe3dbdf64f1cd412506efacf066024787daaa2b56
Arg [2] (address) : 0xfeffe0d393b7849a2fff0aba2d7d12565797eefd
contracts/PancakeStableSwapFactory.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;
pragma abicoder v2;
import "../interfaces/IPancakeStableSwap.sol";
import "../interfaces/IPancakeStableSwapLP.sol";
import "../interfaces/IPancakeStableSwapDeployer.sol";
import "../interfaces/IPancakeStableSwapLPFactory.sol";
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;
}
}
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);
}
}
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];
}
}
interfaces/IPancakeStableSwap.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.5;
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);
}
interfaces/IPancakeStableSwapDeployer.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.5;
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);
}
interfaces/IPancakeStableSwapLP.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.5;
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;
}
interfaces/IPancakeStableSwapLPFactory.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.5;
interface IPancakeStableSwapLPFactory {
function createSwapLP(
address _tokenA,
address _tokenB,
address _tokenC,
address _minter
) external returns (address);
}
Compiler Settings
{"outputSelection":{"*":{"*":["abi","evm.bytecode","evm.deployedBytecode","evm.methodIdentifiers","metadata"],"":["ast"]}},"optimizer":{"runs":1000,"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
0x60e06040523480156200001157600080fd5b506040516200195a3803806200195a8339810160408190526200003491620000c6565b6200003f336200005d565b6001600160a01b0392831660805290821660a0521660c0526200011a565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b0381168114620000c357600080fd5b50565b600080600060608486031215620000dc57600080fd5b8351620000e981620000ad565b6020850151909350620000fc81620000ad565b60408501519092506200010f81620000ad565b809150509250925092565b60805160a05160c0516117f56200016560003960008181610138015261064f01526000818161028d0152610ce101526000818160f4015281816105710152610c0901526117f56000f3fe608060405234801561001057600080fd5b50600436106100ea5760003560e01c8063715018a61161008c578063b3c0e84611610066578063b3c0e8461461032a578063ec69a0241461033d578063f2fde38b14610350578063fcc9136c1461036357600080fd5b8063715018a6146102af5780638da5cb5b146102b7578063923093cb146102c857600080fd5b8063400f7a1e116100c8578063400f7a1e146101f45780634205381b1461024a578063636e66a01461025f57806368fae3f31461028857600080fd5b806314c77a6d146100ef57806321420c4b1461013357806338802f1a1461015a575b600080fd5b6101167f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b6101167f000000000000000000000000000000000000000000000000000000000000000081565b6101ba6101683660046115d3565b6001602081815260009485526040808620825293855283852090529083529120805491810154600282015460038301546004909301546001600160a01b03948516949283169391831692918216911685565b604080516001600160a01b03968716815294861660208601529285169284019290925283166060830152909116608082015260a00161012a565b61020761020236600461161e565b61037a565b60405161012a919081516001600160a01b039081168252602080840151821690830152604080840151821690830152606092830151169181019190915260800190565b61025d610258366004611657565b61044a565b005b61011661026d3660046116bc565b6003602052600090815260409020546001600160a01b031681565b6101167f000000000000000000000000000000000000000000000000000000000000000081565b61025d610736565b6000546001600160a01b0316610116565b6102db6102d636600461161e565b61074a565b60405161012a919081516001600160a01b039081168252602080840151821690830152604080840151821690830152606080840151821690830152608092830151169181019190915260a00190565b61025d6103383660046116d5565b6107f4565b61025d61034b3660046116f9565b610b3e565b61025d61035e3660046116d5565b610dc6565b61036c60045481565b60405190815260200161012a565b604080516080810182526000808252602082018190529181018290526060810182905290806103a98585610e56565b6001600160a01b0391821660009081526001602081815260408084209486168452938152838320838052815291839020835160a08101855281548616808252928201548616818501908152600283015487168287019081526003840154881660608085019190915260049094015488166080909301928352938a52518616938901939093529051841692870192909252519091169084015250909392505050565b610452610ee9565b6001600160a01b0386161580159061047257506001600160a01b03851615155b801561048657506001600160a01b03841615155b80156104a45750846001600160a01b0316866001600160a01b031614155b80156104c25750836001600160a01b0316866001600160a01b031614155b80156104e05750836001600160a01b0316856001600160a01b031614155b6105215760405162461bcd60e51b815260206004820152600d60248201526c24b63632b3b0b6103a37b5b2b760991b60448201526064015b60405180910390fd5b6000806000610531898989610f43565b604051635920110d60e11b81526001600160a01b0380851660048301528084166024830152808316604483015230606483015293965091945092506000917f0000000000000000000000000000000000000000000000000000000000000000169063b240221a906084016020604051808303816000875af11580156105ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105de919061174a565b6040517f4cedbfc70000000000000000000000000000000000000000000000000000000081526001600160a01b03868116600483015285811660248301528481166044830152606482018a90526084820189905260a482018890523360c483015280831660e48301529192506000917f00000000000000000000000000000000000000000000000000000000000000001690634cedbfc790610104016020604051808303816000875af1158015610699573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106bd919061174a565b604051637e51dad560e11b81526001600160a01b0380831660048301529192509083169063fca3b5aa90602401600060405180830381600087803b15801561070457600080fd5b505af1158015610718573d6000803e3d6000fd5b50505050610729818686868661104e565b5050505050505050505050565b61073e610ee9565b6107486000611561565b565b6040805160a081018252600080825260208201819052918101829052606081018290526080810182905290806107808585610e56565b6001600160a01b039182166000908152600260208181526040808420948616845293815291839020835160a081018552815486168152600182015486169381019390935290810154841692820192909252600382015483166060820152600490910154909116608082015295945050505050565b6107fc610ee9565b60008190506000816001600160a01b031663293577506040518163ffffffff1660e01b8152600401602060405180830381865afa158015610841573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108659190611767565b905080600214156109b65760405163c661065760e01b8152600060048201526109b19084906001600160a01b0385169063c661065790602401602060405180830381865afa1580156108bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108df919061174a565b60405163c661065760e01b8152600160048201526001600160a01b0386169063c661065790602401602060405180830381865afa158015610924573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610948919061174a565b6000866001600160a01b031663fc0c546a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610988573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ac919061174a565b61104e565b505050565b80600314156109b15760405163c661065760e01b8152600060048201526109b19084906001600160a01b0385169063c661065790602401602060405180830381865afa158015610a0a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a2e919061174a565b60405163c661065760e01b8152600160048201526001600160a01b0386169063c661065790602401602060405180830381865afa158015610a73573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a97919061174a565b60405163c661065760e01b8152600260048201526001600160a01b0387169063c661065790602401602060405180830381865afa158015610adc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b00919061174a565b866001600160a01b031663fc0c546a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610988573d6000803e3d6000fd5b610b46610ee9565b6001600160a01b03851615801590610b6657506001600160a01b03841615155b8015610b845750836001600160a01b0316856001600160a01b031614155b610bc05760405162461bcd60e51b815260206004820152600d60248201526c24b63632b3b0b6103a37b5b2b760991b6044820152606401610518565b600080610bcd8787610e56565b604051635920110d60e11b81526001600160a01b03838116600483015282811660248301526000604483018190523060648401529395509193507f00000000000000000000000000000000000000000000000000000000000000009091169063b240221a906084016020604051808303816000875af1158015610c54573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c78919061174a565b6040517f9013148d0000000000000000000000000000000000000000000000000000000081526001600160a01b03858116600483015284811660248301526044820189905260648201889052608482018790523360a483015280831660c48301529192506000917f00000000000000000000000000000000000000000000000000000000000000001690639013148d9060e4016020604051808303816000875af1158015610d2a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4e919061174a565b604051637e51dad560e11b81526001600160a01b0380831660048301529192509083169063fca3b5aa90602401600060405180830381600087803b158015610d9557600080fd5b505af1158015610da9573d6000803e3d6000fd5b50505050610dbb81858560008661104e565b505050505050505050565b610dce610ee9565b6001600160a01b038116610e4a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610518565b610e5381611561565b50565b600080826001600160a01b0316846001600160a01b03161415610ebb5760405162461bcd60e51b815260206004820152601360248201527f4944454e544943414c5f414444524553534553000000000000000000000000006044820152606401610518565b826001600160a01b0316846001600160a01b031610610edb578284610ede565b83835b909590945092505050565b6000546001600160a01b031633146107485760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610518565b6000806000846001600160a01b0316866001600160a01b031614158015610f7c5750836001600160a01b0316866001600160a01b031614155b8015610f9a5750836001600160a01b0316856001600160a01b031614155b610fe65760405162461bcd60e51b815260206004820152601360248201527f4944454e544943414c5f414444524553534553000000000000000000000000006044820152606401610518565b6000856001600160a01b0316876001600160a01b031611156110085750939493845b846001600160a01b0316866001600160a01b031611156110415750929392836001600160a01b0380871690881611156110415750939493845b5094959394509192915050565b6001600160a01b03808516600081815260016020818152604080842089871680865290835281852089881680875290845282862080548e8a1673ffffffffffffffffffffffffffffffffffffffff199182168117835582880180548316909a179099556002820180548216909417909355600380820180548516909317909255600480820180549a8c169a85169a909a17909955885487529352908420805490911690941790935583549293909290919061110a908490611780565b90915550506001600160a01b03831615611501576040805160a08101825282546001600160a01b039081168252600184015481166020830152600284015481169282019290925260038301548216606082015260048301549091166080820152611501908690869086908060026000866001600160a01b03166001600160a01b031681526020019081526020016000206000856001600160a01b03166001600160a01b0316815260200190815260200160002060008201518160000160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060208201518160010160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060408201518160020160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060608201518160030160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060808201518160040160006101000a8154816001600160a01b0302191690836001600160a01b031602179055509050508060026000866001600160a01b03166001600160a01b031681526020019081526020016000206000846001600160a01b03166001600160a01b0316815260200190815260200160002060008201518160000160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060208201518160010160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060408201518160020160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060608201518160030160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060808201518160040160006101000a8154816001600160a01b0302191690836001600160a01b031602179055509050508060026000856001600160a01b03166001600160a01b031681526020019081526020016000206000846001600160a01b03166001600160a01b0316815260200190815260200160002060008201518160000160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060208201518160010160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060408201518160020160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060608201518160030160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060808201518160040160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555090505050505050565b604080516001600160a01b03878116825286811660208301528581168284015284811660608301529151918816917f48dc7a1b156fe3e70ed5ed0afcb307661905edf536f15bb5786e327ea19335329181900360800190a2505050505050565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b0381168114610e5357600080fd5b6000806000606084860312156115e857600080fd5b83356115f3816115be565b92506020840135611603816115be565b91506040840135611613816115be565b809150509250925092565b6000806040838503121561163157600080fd5b823561163c816115be565b9150602083013561164c816115be565b809150509250929050565b60008060008060008060c0878903121561167057600080fd5b863561167b816115be565b9550602087013561168b816115be565b9450604087013561169b816115be565b959894975094956060810135955060808101359460a0909101359350915050565b6000602082840312156116ce57600080fd5b5035919050565b6000602082840312156116e757600080fd5b81356116f2816115be565b9392505050565b600080600080600060a0868803121561171157600080fd5b853561171c816115be565b9450602086013561172c816115be565b94979496505050506040830135926060810135926080909101359150565b60006020828403121561175c57600080fd5b81516116f2816115be565b60006020828403121561177957600080fd5b5051919050565b600082198211156117ba577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b50019056fea2646970667358221220337df0ae8a848464e5534ec3600906ee2c71d9f12a1b1de0e256187dc9b854cb64736f6c634300080a00330000000000000000000000000fafe29bc793dc4828b151e655e6df0277721cbb000000000000000000000000e3dbdf64f1cd412506efacf066024787daaa2b56000000000000000000000000feffe0d393b7849a2fff0aba2d7d12565797eefd
Deployed ByteCode
0x608060405234801561001057600080fd5b50600436106100ea5760003560e01c8063715018a61161008c578063b3c0e84611610066578063b3c0e8461461032a578063ec69a0241461033d578063f2fde38b14610350578063fcc9136c1461036357600080fd5b8063715018a6146102af5780638da5cb5b146102b7578063923093cb146102c857600080fd5b8063400f7a1e116100c8578063400f7a1e146101f45780634205381b1461024a578063636e66a01461025f57806368fae3f31461028857600080fd5b806314c77a6d146100ef57806321420c4b1461013357806338802f1a1461015a575b600080fd5b6101167f0000000000000000000000000fafe29bc793dc4828b151e655e6df0277721cbb81565b6040516001600160a01b0390911681526020015b60405180910390f35b6101167f000000000000000000000000feffe0d393b7849a2fff0aba2d7d12565797eefd81565b6101ba6101683660046115d3565b6001602081815260009485526040808620825293855283852090529083529120805491810154600282015460038301546004909301546001600160a01b03948516949283169391831692918216911685565b604080516001600160a01b03968716815294861660208601529285169284019290925283166060830152909116608082015260a00161012a565b61020761020236600461161e565b61037a565b60405161012a919081516001600160a01b039081168252602080840151821690830152604080840151821690830152606092830151169181019190915260800190565b61025d610258366004611657565b61044a565b005b61011661026d3660046116bc565b6003602052600090815260409020546001600160a01b031681565b6101167f000000000000000000000000e3dbdf64f1cd412506efacf066024787daaa2b5681565b61025d610736565b6000546001600160a01b0316610116565b6102db6102d636600461161e565b61074a565b60405161012a919081516001600160a01b039081168252602080840151821690830152604080840151821690830152606080840151821690830152608092830151169181019190915260a00190565b61025d6103383660046116d5565b6107f4565b61025d61034b3660046116f9565b610b3e565b61025d61035e3660046116d5565b610dc6565b61036c60045481565b60405190815260200161012a565b604080516080810182526000808252602082018190529181018290526060810182905290806103a98585610e56565b6001600160a01b0391821660009081526001602081815260408084209486168452938152838320838052815291839020835160a08101855281548616808252928201548616818501908152600283015487168287019081526003840154881660608085019190915260049094015488166080909301928352938a52518616938901939093529051841692870192909252519091169084015250909392505050565b610452610ee9565b6001600160a01b0386161580159061047257506001600160a01b03851615155b801561048657506001600160a01b03841615155b80156104a45750846001600160a01b0316866001600160a01b031614155b80156104c25750836001600160a01b0316866001600160a01b031614155b80156104e05750836001600160a01b0316856001600160a01b031614155b6105215760405162461bcd60e51b815260206004820152600d60248201526c24b63632b3b0b6103a37b5b2b760991b60448201526064015b60405180910390fd5b6000806000610531898989610f43565b604051635920110d60e11b81526001600160a01b0380851660048301528084166024830152808316604483015230606483015293965091945092506000917f0000000000000000000000000fafe29bc793dc4828b151e655e6df0277721cbb169063b240221a906084016020604051808303816000875af11580156105ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105de919061174a565b6040517f4cedbfc70000000000000000000000000000000000000000000000000000000081526001600160a01b03868116600483015285811660248301528481166044830152606482018a90526084820189905260a482018890523360c483015280831660e48301529192506000917f000000000000000000000000feffe0d393b7849a2fff0aba2d7d12565797eefd1690634cedbfc790610104016020604051808303816000875af1158015610699573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106bd919061174a565b604051637e51dad560e11b81526001600160a01b0380831660048301529192509083169063fca3b5aa90602401600060405180830381600087803b15801561070457600080fd5b505af1158015610718573d6000803e3d6000fd5b50505050610729818686868661104e565b5050505050505050505050565b61073e610ee9565b6107486000611561565b565b6040805160a081018252600080825260208201819052918101829052606081018290526080810182905290806107808585610e56565b6001600160a01b039182166000908152600260208181526040808420948616845293815291839020835160a081018552815486168152600182015486169381019390935290810154841692820192909252600382015483166060820152600490910154909116608082015295945050505050565b6107fc610ee9565b60008190506000816001600160a01b031663293577506040518163ffffffff1660e01b8152600401602060405180830381865afa158015610841573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108659190611767565b905080600214156109b65760405163c661065760e01b8152600060048201526109b19084906001600160a01b0385169063c661065790602401602060405180830381865afa1580156108bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108df919061174a565b60405163c661065760e01b8152600160048201526001600160a01b0386169063c661065790602401602060405180830381865afa158015610924573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610948919061174a565b6000866001600160a01b031663fc0c546a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610988573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ac919061174a565b61104e565b505050565b80600314156109b15760405163c661065760e01b8152600060048201526109b19084906001600160a01b0385169063c661065790602401602060405180830381865afa158015610a0a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a2e919061174a565b60405163c661065760e01b8152600160048201526001600160a01b0386169063c661065790602401602060405180830381865afa158015610a73573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a97919061174a565b60405163c661065760e01b8152600260048201526001600160a01b0387169063c661065790602401602060405180830381865afa158015610adc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b00919061174a565b866001600160a01b031663fc0c546a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610988573d6000803e3d6000fd5b610b46610ee9565b6001600160a01b03851615801590610b6657506001600160a01b03841615155b8015610b845750836001600160a01b0316856001600160a01b031614155b610bc05760405162461bcd60e51b815260206004820152600d60248201526c24b63632b3b0b6103a37b5b2b760991b6044820152606401610518565b600080610bcd8787610e56565b604051635920110d60e11b81526001600160a01b03838116600483015282811660248301526000604483018190523060648401529395509193507f0000000000000000000000000fafe29bc793dc4828b151e655e6df0277721cbb9091169063b240221a906084016020604051808303816000875af1158015610c54573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c78919061174a565b6040517f9013148d0000000000000000000000000000000000000000000000000000000081526001600160a01b03858116600483015284811660248301526044820189905260648201889052608482018790523360a483015280831660c48301529192506000917f000000000000000000000000e3dbdf64f1cd412506efacf066024787daaa2b561690639013148d9060e4016020604051808303816000875af1158015610d2a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4e919061174a565b604051637e51dad560e11b81526001600160a01b0380831660048301529192509083169063fca3b5aa90602401600060405180830381600087803b158015610d9557600080fd5b505af1158015610da9573d6000803e3d6000fd5b50505050610dbb81858560008661104e565b505050505050505050565b610dce610ee9565b6001600160a01b038116610e4a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610518565b610e5381611561565b50565b600080826001600160a01b0316846001600160a01b03161415610ebb5760405162461bcd60e51b815260206004820152601360248201527f4944454e544943414c5f414444524553534553000000000000000000000000006044820152606401610518565b826001600160a01b0316846001600160a01b031610610edb578284610ede565b83835b909590945092505050565b6000546001600160a01b031633146107485760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610518565b6000806000846001600160a01b0316866001600160a01b031614158015610f7c5750836001600160a01b0316866001600160a01b031614155b8015610f9a5750836001600160a01b0316856001600160a01b031614155b610fe65760405162461bcd60e51b815260206004820152601360248201527f4944454e544943414c5f414444524553534553000000000000000000000000006044820152606401610518565b6000856001600160a01b0316876001600160a01b031611156110085750939493845b846001600160a01b0316866001600160a01b031611156110415750929392836001600160a01b0380871690881611156110415750939493845b5094959394509192915050565b6001600160a01b03808516600081815260016020818152604080842089871680865290835281852089881680875290845282862080548e8a1673ffffffffffffffffffffffffffffffffffffffff199182168117835582880180548316909a179099556002820180548216909417909355600380820180548516909317909255600480820180549a8c169a85169a909a17909955885487529352908420805490911690941790935583549293909290919061110a908490611780565b90915550506001600160a01b03831615611501576040805160a08101825282546001600160a01b039081168252600184015481166020830152600284015481169282019290925260038301548216606082015260048301549091166080820152611501908690869086908060026000866001600160a01b03166001600160a01b031681526020019081526020016000206000856001600160a01b03166001600160a01b0316815260200190815260200160002060008201518160000160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060208201518160010160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060408201518160020160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060608201518160030160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060808201518160040160006101000a8154816001600160a01b0302191690836001600160a01b031602179055509050508060026000866001600160a01b03166001600160a01b031681526020019081526020016000206000846001600160a01b03166001600160a01b0316815260200190815260200160002060008201518160000160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060208201518160010160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060408201518160020160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060608201518160030160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060808201518160040160006101000a8154816001600160a01b0302191690836001600160a01b031602179055509050508060026000856001600160a01b03166001600160a01b031681526020019081526020016000206000846001600160a01b03166001600160a01b0316815260200190815260200160002060008201518160000160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060208201518160010160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060408201518160020160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060608201518160030160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060808201518160040160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555090505050505050565b604080516001600160a01b03878116825286811660208301528581168284015284811660608301529151918816917f48dc7a1b156fe3e70ed5ed0afcb307661905edf536f15bb5786e327ea19335329181900360800190a2505050505050565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b0381168114610e5357600080fd5b6000806000606084860312156115e857600080fd5b83356115f3816115be565b92506020840135611603816115be565b91506040840135611613816115be565b809150509250925092565b6000806040838503121561163157600080fd5b823561163c816115be565b9150602083013561164c816115be565b809150509250929050565b60008060008060008060c0878903121561167057600080fd5b863561167b816115be565b9550602087013561168b816115be565b9450604087013561169b816115be565b959894975094956060810135955060808101359460a0909101359350915050565b6000602082840312156116ce57600080fd5b5035919050565b6000602082840312156116e757600080fd5b81356116f2816115be565b9392505050565b600080600080600060a0868803121561171157600080fd5b853561171c816115be565b9450602086013561172c816115be565b94979496505050506040830135926060810135926080909101359150565b60006020828403121561175c57600080fd5b81516116f2816115be565b60006020828403121561177957600080fd5b5051919050565b600082198211156117ba577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b50019056fea2646970667358221220337df0ae8a848464e5534ec3600906ee2c71d9f12a1b1de0e256187dc9b854cb64736f6c634300080a0033