- Contract name:
- CreateManage
- Optimization enabled
- true
- Compiler version
- v0.8.13+commit.abaa5c0e
- Optimization runs
- 5000
- EVM Version
- default
- Verified at
- 2024-07-20T06:17:45.199642Z
contracts/CreateToken/Meter/CreateVerify.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
import "@openzeppelin/contracts/utils/Context.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "./SharedStructs.sol";
import "./StandardToken.sol";
import "./LiquidityToken.sol";
import "./StandardTokenFactory.sol";
import "./LiquidityTokenFactory.sol";
contract CreateManage {
struct feeInfo {
uint256 normal;
uint256 mint;
uint256 burn;
uint256 pause;
uint256 blacklist;
uint256 deflation;
}
address public owner;
// address factory_address;
address router_address;
mapping(address => address[]) tokens;
feeInfo public fee;
StandardTokenFactory internal standardTokenFactory;
LiquidityTokenFactory internal liquidityTokenFactory;
event OwnerWithdrawSuccess(uint256 value);
event CreateStandardSuccess(address);
event setOwnerSucess(address);
event createLiquditySuccess(address);
event InitFeeSuccess();
// constructor(address _owner, address factory_addr, address router_Addr) {
constructor(
address _owner,
address router_Addr,
StandardTokenFactory _standardTokenFactory,
LiquidityTokenFactory _liquidityTokenFactory
) {
owner = _owner;
fee = feeInfo(100000000000000000,100000000000000000,100000000000000000,100000000000000000,100000000000000000,100000000000000000);
// factory_address = factory_addr;
router_address = router_Addr;
standardTokenFactory = _standardTokenFactory;
liquidityTokenFactory = _liquidityTokenFactory;
}
function setOwner(address newowner) public {
require(msg.sender == owner, "Only manager can do it");
owner = newowner;
emit setOwnerSucess(owner);
}
function ownerWithdraw() public {
require(msg.sender == owner, "Only manager can withdraw");
address payable reciever = payable(owner);
reciever.transfer(address(this).balance);
// owner.transfer(address(this).balance);
emit OwnerWithdrawSuccess(address(this).balance);
}
function initFee(feeInfo memory _fee) public {
fee = _fee;
emit InitFeeSuccess();
}
function calcFee(SharedStructs.status memory _state)
internal
view
returns (uint256)
{
uint256 totalfee = fee.normal;
if (_state.mintflag > 0) {
totalfee = totalfee + fee.mint;
}
if (_state.burnflag > 0) {
totalfee = totalfee + fee.burn;
}
if (_state.pauseflag > 0) {
totalfee = totalfee + fee.pause;
}
if (_state.blacklistflag > 0) {
totalfee = totalfee + fee.blacklist;
}
return totalfee;
}
/*
* @notice Creates a new Presale contract and registers it in the PresaleFactory.sol.
*/
function createStandard(
address creator_,
string memory name_,
string memory symbol_,
uint8 decimals_,
uint256 tokenSupply_,
SharedStructs.status memory _state
) public payable {
require(msg.value >= calcFee(_state), "Balance is insufficent");
StandardToken token = standardTokenFactory.deploy(
creator_,
name_,
symbol_,
decimals_,
tokenSupply_,
_state
);
tokens[address(creator_)].push(address(token));
emit CreateStandardSuccess(address(token));
}
function createLiquidity(
address creator_,
address reciever,
string memory name_,
string memory symbol_,
uint8 decimal_,
uint256 supply,
uint256 settingflag,
uint256[4] memory fees,
SharedStructs.status memory _state
) public payable {
require(msg.value >= calcFee(_state), "Balance is insufficent");
// LiquidityToken token = liquidityTokenFactory.deploy(
// router_address,
// creator_,
// reciever,
// name_,
// symbol_,
// decimal_,
// supply
// );
LiquidityToken token = new LiquidityToken(
creator_,
router_address,
reciever,
decimal_,
supply,
name_,
symbol_
);
token.setFee(settingflag, fees);
token.setStatus(_state);
tokens[creator_].push(address(token));
emit createLiquditySuccess(address(token));
}
function getBalance() public view returns (uint256) {
return address(this).balance;
}
function getCreatedToken(address creater)
public
view
returns (address[] memory)
{
return tokens[address(creater)];
}
}
contracts/CreateToken/Meter/LiquidityTokenFactory.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./StandardToken.sol";
import "./LiquidityToken.sol";
contract LiquidityTokenFactory {
function deploy(
address router_address,
address creator_,
address reciever,
string memory name_,
string memory symbol_,
uint8 decimal_,
uint256 supply
) external returns (LiquidityToken) {
return
new LiquidityToken(
creator_,
router_address,
reciever,
decimal_,
supply,
name_,
symbol_
);
}
}
contracts/CreateToken/Meter/SharedStructs.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
library SharedStructs {
struct status {
uint256 mintflag;
uint256 pauseflag;
uint256 burnflag;
uint256 blacklistflag;
}
}
contracts/CreateToken/Meter/StandardToken.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
import "@openzeppelin/contracts/utils/Context.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "./SharedStructs.sol";
contract StandardToken is Context, IERC20, IERC20Metadata {
// address public owner;
address public owner;
string private _name;
string private _symbol;
uint8 private _decimals;
uint256 private _totalSupply;
uint256 public isstandard = 1;
bool private _paused;
SharedStructs.status public state;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) _blacklist;
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
modifier canMint() {
require(state.mintflag > 0, "Mintable: Disabled Mint");
_;
}
modifier canPause() {
require(state.mintflag > 0, "Pausable: Disabled Pause");
_;
}
modifier canBurn() {
require(state.burnflag > 0, "Burnable: Disabled Burn");
_;
}
modifier canBlacklist() {
require(state.blacklistflag > 0, "Blacklist: Disabled Blacklist");
_;
}
modifier whenNotPaused() {
require(!paused(), "Pausable: paused");
_;
}
modifier whenPaused() {
require(paused(), "Pausable: not paused");
_;
}
event BlacklistUpdated(address indexed user, bool value);
event Paused(address account);
event Unpaused(address account);
/**
* @dev Sets the values for {name}, {symbol} and {decimals}.
*
*
* All two of these values are immutable: they can only be set once during
* construction.
*/
constructor(
address creator_,
string memory name_,
string memory symbol_,
uint8 decimals_,
uint256 tokenSupply_,
SharedStructs.status memory _state
) {
_name = name_;
_symbol = symbol_;
_decimals = decimals_;
owner = creator_;
state = _state;
_mint(creator_, tokenSupply_);
_paused = false;
}
function setStatus(SharedStructs.status memory _state) internal virtual {
state = _state;
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5,05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the value {ERC20} uses, unless this function is
* overridden;
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view virtual override returns (uint8) {
return _decimals;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account)
public
view
virtual
override
returns (uint256)
{
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount)
public
virtual
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address _owner, address spender)
public
view
virtual
override
returns (uint256)
{
return _allowances[_owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount)
public
virtual
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* Requirements:
*
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
* - the caller must have allowance for ``sender``'s tokens of at least
* `amount`.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
uint256 currentAllowance = _allowances[sender][_msgSender()];
require(
currentAllowance >= amount,
"ERC20: transfer amount exceeds allowance"
);
_approve(sender, _msgSender(), currentAllowance - amount);
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue)
public
virtual
returns (bool)
{
_approve(
_msgSender(),
spender,
_allowances[_msgSender()][spender] + addedValue
);
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue)
public
virtual
returns (bool)
{
uint256 currentAllowance = _allowances[_msgSender()][spender];
require(
currentAllowance >= subtractedValue,
"ERC20: decreased allowance below zero"
);
_approve(_msgSender(), spender, currentAllowance - subtractedValue);
return true;
}
/**
* @dev Moves tokens `amount` from `sender` to `recipient`.
*
* This is internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
function _transfer(
address sender,
address recipient,
uint256 amount
) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
uint256 senderBalance = _balances[sender];
require(
senderBalance >= amount,
"ERC20: transfer amount exceeds balance"
);
_balances[sender] = senderBalance - amount;
_balances[recipient] += amount;
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply += amount;
_balances[account] += amount;
emit Transfer(address(0), account, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function mint(address account, uint256 amount)
public
virtual
onlyOwner
canMint
{
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply += amount;
_balances[account] += amount;
emit Transfer(address(0), account, amount);
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function burn(uint256 amount) public virtual onlyOwner canBurn {
require(
_msgSender() != address(0),
"ERC20: burn from the zero address"
);
_beforeTokenTransfer(_msgSender(), address(0), amount);
uint256 accountBalance = _balances[_msgSender()];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
_balances[_msgSender()] = accountBalance - amount;
_totalSupply -= amount;
emit Transfer(_msgSender(), address(0), amount);
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(
address _owner,
address spender,
uint256 amount
) internal virtual {
require(_owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[_owner][spender] = amount;
emit Approval(_owner, spender, amount);
}
function blacklistUpdate(address user, bool value)
public
virtual
onlyOwner
canBlacklist
{
// require(_owner == _msgSender(), "Only owner is allowed to modify blacklist.");
_blacklist[user] = value;
emit BlacklistUpdated(user, value);
}
function isBlackListed(address user)
public
view
virtual
canBlacklist
returns (bool)
{
return _blacklist[user];
}
function paused() public view virtual canPause returns (bool) {
return _paused;
}
function _pause() public virtual onlyOwner canPause whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
function _unpause() public virtual onlyOwner canPause whenPaused {
_paused = false;
emit Unpaused(_msgSender());
}
/**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be to transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address sender,
address to,
uint256 amount
) internal virtual {
// require(sender != address(0), "ERC20: transfer from the zero address");
// require(to != address(0), "ERC20: transfer to the zero address");
require(amount >= 0, "ERC20: transfer to the zero address");
if (state.blacklistflag > 0) {
require(
!isBlackListed(sender),
"Token transfer refused. Receiver is on blacklist"
);
require(
!isBlackListed(to),
"Token transfer refused. Receiver is on blacklist"
);
}
if (state.pauseflag > 0) {
require(!paused(), "Token is Paused.");
}
}
}
contracts/CreateToken/Meter/StandardTokenFactory.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./StandardToken.sol";
contract StandardTokenFactory {
function deploy(
address creator_,
string memory name_,
string memory symbol_,
uint8 decimals_,
uint256 tokenSupply_,
SharedStructs.status memory _state
) external returns (StandardToken) {
return
new StandardToken(
creator_,
name_,
symbol_,
decimals_,
tokenSupply_,
_state
);
}
}
@openzeppelin/contracts/token/ERC20/IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `from` to `to` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 amount) external returns (bool);
}
@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)
pragma solidity ^0.8.0;
import "../IERC20.sol";
/**
* @dev Interface for the optional metadata functions from the ERC20 standard.
*
* _Available since v4.1._
*/
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}
@openzeppelin/contracts/utils/Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
*
* Furthermore, `isContract` will also return true if the target contract within
* the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
* which only has an effect at the end of a transaction.
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
* the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
*
* _Available since v4.8._
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
// only check isContract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
/**
* @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason or using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) private pure {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
@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/CreateToken/Meter/LiquidityToken.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
import "@openzeppelin/contracts/utils/Context.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "./SharedStructs.sol";
import "../../interfaces/IUniswapV2Router02.sol";
import "../../interfaces/IUniswapV2Factory.sol";
contract LiquidityToken is Context, IERC20 {
using Address for address;
address payable public marketingAddress; // Marketing Address
address public immutable deadAddress =
0x000000000000000000000000000000000000dEaD;
address public owner;
address private manager;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
mapping(address => bool) private _isExcluded;
address[] private _excluded;
uint256 private constant MAX = type(uint256).max;
uint256 private _tTotal;
uint256 private _rTotal;
uint256 private _tFeeTotal;
string private _name;
string private _symbol;
uint8 private _decimals;
bool private _paused;
SharedStructs.status public state;
mapping(address => bool) _blacklist;
uint256 public _taxFee;
uint256 private _previousTaxFee;
uint256 public _liquidityFee;
uint256 private _previousLiquidityFee;
uint256 public marketingDivisor;
uint256 public _maxTxAmount = 5000000 * 10**6 * 10**9;
uint256 private minimumTokensBeforeSwap = 300000 * 10**6 * 10**9;
uint256 private buyBackUpperLimit = 1 * 10**18;
IUniswapV2Router02 public immutable UniswapRouter;
address public immutable UniswapPair;
bool inSwapAndLiquify;
bool public swapAndLiquifyEnabled;
bool public buyBackEnabled;
uint256 public isstandard = 2;
modifier onlyOwner() {
require(owner == msg.sender, "Ownable: caller is not the creator");
_;
}
modifier onlyManager() {
require(manager == _msgSender(), "Manage:caller is not the manager");
_;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier canMint() {
require(state.mintflag > 0, "Mintable: Disabled Mint");
_;
}
modifier canPause() {
require(state.mintflag > 0, "Pausable: Disabled Pause");
_;
}
modifier canBurn() {
require(state.burnflag > 0, "Burnable: Disabled Burn");
_;
}
modifier canBlacklist() {
require(state.blacklistflag > 0, "Blacklist: Disabled Blacklist");
_;
}
modifier whenNotPaused() {
require(!paused(), "Pausable: paused");
_;
}
modifier whenPaused() {
require(paused(), "Pausable: not paused");
_;
}
event BlacklistUpdated(address indexed user, bool value);
event Paused(address account);
event Unpaused(address account);
event BurnSuccess(uint256);
event MintSuccess(uint256);
event RewardLiquidityProviders(uint256 tokenAmount);
event BuyBackEnabledUpdated(bool enabled);
event SwapAndLiquifyEnabledUpdated(bool enabled);
event SwapAndLiquify(
uint256 tokensSwapped,
uint256 ethReceived,
uint256 tokensIntoLiqudity
);
event SwapETHForTokens(uint256 amountIn, address[] path);
event SwapTokensForETH(uint256 amountIn, address[] path);
modifier lockTheSwap() {
inSwapAndLiquify = true;
_;
inSwapAndLiquify = false;
}
constructor(
address creator_,
address unirouter,
address reciever,
uint8 decimal_,
uint256 supply,
string memory name_,
string memory symbol_
) {
_name = name_;
_symbol = symbol_;
_decimals = decimal_;
IUniswapV2Router02 _UniswapRouter = IUniswapV2Router02(unirouter);
UniswapPair = IUniswapV2Factory(_UniswapRouter.factory()).createPair(
address(this),
_UniswapRouter.WETH()
);
UniswapRouter = _UniswapRouter;
manager = _msgSender();
set(creator_, reciever, supply);
emit Transfer(address(0), _msgSender(), _tTotal);
}
function set(
address creator_,
address reciever,
uint256 supply
) private {
marketingAddress = payable(reciever);
owner = creator_;
_tTotal = supply;
_rTotal = (MAX - (MAX % supply));
_rOwned[creator_] = _rTotal;
buyBackEnabled = false;
swapAndLiquifyEnabled = false;
_isExcludedFromFee[creator_] = true;
_isExcludedFromFee[address(this)] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function setStatus(SharedStructs.status memory _state)
external
onlyManager
{
state = _state;
}
function setFee(uint256 settingflag, uint256[4] memory fee)
external
onlyManager
{
if (settingflag != 0 && settingflag != 1) {
swapAndLiquifyEnabled = true;
}
if (settingflag == 1 || settingflag == 2) {
buyBackEnabled = true;
}
if (settingflag != 3) {
_taxFee = fee[0];
marketingDivisor = fee[1];
}
if (settingflag == 1 || settingflag == 2) {
marketingDivisor = fee[2];
}
if (settingflag == 3 || settingflag == 4) {
_liquidityFee = fee[3];
}
// if(settingflag != 0) {
// _holdersfee = fee[0];
// // _buybackFee = fee[1];
// }
_previousTaxFee = _taxFee;
_previousLiquidityFee = _liquidityFee;
}
function mint(uint256 amount) public onlyOwner canMint {
require(_tTotal + amount <= MAX, "exceeds limit");
_beforeTokenTransfer(msg.sender, msg.sender, amount);
_tTotal = _tTotal + amount;
_tFeeTotal = _tFeeTotal + amount;
// uint256 tAmount;
// if (_isExcluded[account]) {
// _tOwned[account] = _tOwned[account].add(amount);
// } else {
// tAmount = tokenFromReflection(_rOwned[account]);
// tAmount = tAmount.add(amount);
// _rOwned[account] = tokenFromReflection(tAmount);
// }
emit MintSuccess(amount);
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function burn(uint256 amount) public onlyOwner canBurn {
require(amount <= MAX, "exceeds limit");
_beforeTokenTransfer(msg.sender, address(0), amount);
_tTotal = _tTotal - amount;
_tFeeTotal = _tFeeTotal + amount;
emit BurnSuccess(amount);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
if (_isExcluded[account]) return _tOwned[account];
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_beforeTokenTransfer(msg.sender, recipient, amount);
_transfer(msg.sender, recipient, amount);
return true;
}
function allowance(address _owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[_owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_beforeTokenTransfer(msg.sender, spender, amount);
_approve(msg.sender, spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_beforeTokenTransfer(sender, recipient, amount);
_transfer(sender, recipient, amount);
require(
amount <= _allowances[sender][msg.sender],
"ERC20: transfer amount exceeds allowance"
);
_approve(sender, msg.sender, _allowances[sender][msg.sender] - amount);
return true;
}
function increaseAllowance(address spender, uint256 addedValue)
public
virtual
returns (bool)
{
_approve(
msg.sender,
spender,
_allowances[msg.sender][spender] + addedValue
);
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue)
public
virtual
returns (bool)
{
require(
subtractedValue <= _allowances[msg.sender][spender],
"ERC20: decreased allowance below zero"
);
_approve(
msg.sender,
spender,
_allowances[msg.sender][spender] - subtractedValue
);
return true;
}
function isExcludedFromReward(address account) public view returns (bool) {
return _isExcluded[account];
}
function totalFees() public view returns (uint256) {
return _tFeeTotal;
}
function minimumTokensBeforeSwapAmount() public view returns (uint256) {
return minimumTokensBeforeSwap;
}
function buyBackUpperLimitAmount() public view returns (uint256) {
return buyBackUpperLimit;
}
function deliver(uint256 tAmount) public {
_beforeTokenTransfer(msg.sender, msg.sender, tAmount);
address sender = msg.sender;
require(
!_isExcluded[sender],
"Excluded addresses cannot call this function"
);
(uint256 rAmount, , , , , ) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender] - rAmount;
_rTotal = _rTotal - rAmount;
_tFeeTotal = _tFeeTotal + tAmount;
}
function reflectionFromToken(uint256 tAmount, bool deductTransferFee)
public
view
returns (uint256)
{
require(tAmount <= _tTotal, "Amount must be less than supply");
if (!deductTransferFee) {
(uint256 rAmount, , , , , ) = _getValues(tAmount);
return rAmount;
} else {
(, uint256 rTransferAmount, , , , ) = _getValues(tAmount);
return rTransferAmount;
}
}
function tokenFromReflection(uint256 rAmount)
public
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount / currentRate;
}
function excludeFromReward(address account) public onlyOwner {
require(!_isExcluded[account], "Account is already excluded");
if (_rOwned[account] > 0) {
_tOwned[account] = tokenFromReflection(_rOwned[account]);
}
_isExcluded[account] = true;
_excluded.push(account);
}
function includeInReward(address account) external onlyOwner {
require(_isExcluded[account], "Account is already excluded");
for (uint256 i = 0; i < _excluded.length; i++) {
if (_excluded[i] == account) {
_excluded[i] = _excluded[_excluded.length - 1];
_tOwned[account] = 0;
_isExcluded[account] = false;
_excluded.pop();
break;
}
}
}
function _approve(
address _owner,
address spender,
uint256 amount
) private {
require(_owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner && to != owner) {
require(
amount <= _maxTxAmount,
"Transfer amount exceeds the maxTxAmount."
);
}
uint256 contractTokenBalance = balanceOf(address(this));
bool overMinimumTokenBalance = contractTokenBalance >=
minimumTokensBeforeSwap;
if (!inSwapAndLiquify && swapAndLiquifyEnabled && to == UniswapPair) {
if (overMinimumTokenBalance) {
contractTokenBalance = minimumTokensBeforeSwap;
swapTokens(contractTokenBalance);
}
uint256 balance = address(this).balance;
if (buyBackEnabled && balance > uint256(1 * 10**18)) {
if (balance > buyBackUpperLimit) balance = buyBackUpperLimit;
buyBackTokens(balance / 100);
}
}
bool takeFee = true;
//if any account belongs to _isExcludedFromFee account then remove the fee
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokens(uint256 contractTokenBalance) private lockTheSwap {
uint256 initialBalance = address(this).balance;
swapTokensForETH(contractTokenBalance);
uint256 transferredBalance = address(this).balance - initialBalance;
//Send to Marketing address
transferToAddressETH(
marketingAddress,
(transferredBalance / _liquidityFee) * marketingDivisor
);
}
function buyBackTokens(uint256 amount) private lockTheSwap {
if (amount > 0) {
swapETHForTokens(amount);
}
}
function swapTokensForETH(uint256 tokenAmount) private {
// generate the Uniswap pair path of token -> wETH
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = UniswapRouter.WETH();
_approve(address(this), address(UniswapRouter), tokenAmount);
// make the swap
UniswapRouter.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0, // accept any amount of ETH
path,
address(this), // The contract
block.timestamp
);
emit SwapTokensForETH(tokenAmount, path);
}
function swapETHForTokens(uint256 amount) private {
// generate the Uniswap pair path of token -> wETH
address[] memory path = new address[](2);
path[0] = UniswapRouter.WETH();
path[1] = address(this);
// make the swap
UniswapRouter.swapExactETHForTokensSupportingFeeOnTransferTokens{
value: amount
}(
0, // accept any amount of Tokens
path,
deadAddress, // Burn address
block.timestamp + 300
);
emit SwapETHForTokens(amount, path);
}
function addLiquidity(uint256 tokenAmount, uint256 ETHAmount) private {
// approve token transfer to cover all possible scenarios
_approve(address(this), address(UniswapRouter), tokenAmount);
// add the liquidity
UniswapRouter.addLiquidityETH{value: ETHAmount}(
address(this),
tokenAmount,
0, // slippage is unavoidable
0, // slippage is unavoidable
owner,
block.timestamp
);
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
if (_isExcluded[sender] && !_isExcluded[recipient]) {
_transferFromExcluded(sender, recipient, amount);
} else if (!_isExcluded[sender] && _isExcluded[recipient]) {
_transferToExcluded(sender, recipient, amount);
} else if (_isExcluded[sender] && _isExcluded[recipient]) {
_transferBothExcluded(sender, recipient, amount);
} else {
_transferStandard(sender, recipient, amount);
}
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tLiquidity
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender] - rAmount;
_rOwned[recipient] = _rOwned[recipient] + rTransferAmount;
_takeLiquidity(tLiquidity);
// _reflectFee(rFee, tFee);
_rOwned[marketingAddress] = _rOwned[marketingAddress] + rFee;
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferToExcluded(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tLiquidity
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender] - rAmount;
_tOwned[recipient] = _tOwned[recipient] + tTransferAmount;
_rOwned[recipient] = _rOwned[recipient] + rTransferAmount;
_takeLiquidity(tLiquidity);
//_reflectFee(rFee, tFee);
_rOwned[marketingAddress] = _rOwned[marketingAddress] + rFee;
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferFromExcluded(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tLiquidity
) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender] - tAmount;
_rOwned[sender] = _rOwned[sender] - rAmount;
_rOwned[recipient] = _rOwned[recipient] + rTransferAmount;
_takeLiquidity(tLiquidity);
// _reflectFee(rFee, tFee);
_rOwned[marketingAddress] = _rOwned[marketingAddress] + rFee;
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferBothExcluded(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tLiquidity
) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender] - tAmount;
_rOwned[sender] = _rOwned[sender] - rAmount;
_tOwned[recipient] = _tOwned[recipient] + tTransferAmount;
_rOwned[recipient] = _rOwned[recipient] + rTransferAmount;
_takeLiquidity(tLiquidity);
// _reflectFee(rFee, tFee);
_rOwned[marketingAddress] = _rOwned[marketingAddress] + rFee;
emit Transfer(sender, recipient, tTransferAmount);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal - rFee;
_tFeeTotal = _tFeeTotal + tFee;
}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(
uint256 tTransferAmount,
uint256 tFee,
uint256 tLiquidity
) = _getTValues(tAmount);
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(
tAmount,
tFee,
tLiquidity,
_getRate()
);
return (
rAmount,
rTransferAmount,
rFee,
tTransferAmount,
tFee,
tLiquidity
);
}
function _getTValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = calculateTaxFee(tAmount);
uint256 tLiquidity = calculateLiquidityFee(tAmount);
uint256 tTransferAmount = tAmount - tFee - tLiquidity;
return (tTransferAmount, tFee, tLiquidity);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tLiquidity,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount * currentRate;
uint256 rFee = tFee * currentRate;
uint256 rLiquidity = tLiquidity * currentRate;
uint256 rTransferAmount = rAmount - rFee - rLiquidity;
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply / tSupply;
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
for (uint256 i = 0; i < _excluded.length; i++) {
if (
_rOwned[_excluded[i]] > rSupply ||
_tOwned[_excluded[i]] > tSupply
) return (_rTotal, _tTotal);
rSupply = rSupply - _rOwned[_excluded[i]];
tSupply = tSupply - _tOwned[_excluded[i]];
}
if (rSupply < _rTotal / _tTotal) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function _takeLiquidity(uint256 tLiquidity) private {
uint256 currentRate = _getRate();
uint256 rLiquidity = tLiquidity * currentRate;
_rOwned[address(this)] = _rOwned[address(this)] + rLiquidity;
if (_isExcluded[address(this)])
_tOwned[address(this)] = _tOwned[address(this)] + tLiquidity;
}
function calculateTaxFee(uint256 _amount) private view returns (uint256) {
return (_amount * _taxFee) / (10**2);
}
function calculateLiquidityFee(uint256 _amount)
private
view
returns (uint256)
{
return (_amount * _liquidityFee) / (10**2);
}
function removeAllFee() private {
if (_taxFee == 0 && _liquidityFee == 0) return;
_previousTaxFee = _taxFee;
_previousLiquidityFee = _liquidityFee;
_taxFee = 0;
_liquidityFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_liquidityFee = _previousLiquidityFee;
}
function isExcludedFromFee(address account) public view returns (bool) {
return _isExcludedFromFee[account];
}
function excludeFromFee(address account) public onlyOwner {
_isExcludedFromFee[account] = true;
}
function includeInFee(address account) public onlyOwner {
_isExcludedFromFee[account] = false;
}
function blacklistUpdate(address user, bool value)
public
virtual
onlyOwner
canBlacklist
{
// require(_owner == msg.sender, "Only owner is allowed to modify blacklist.");
_blacklist[user] = value;
emit BlacklistUpdated(user, value);
}
function isBlackListed(address user)
public
view
virtual
canBlacklist
returns (bool)
{
return _blacklist[user];
}
function paused() public view virtual canPause returns (bool) {
return _paused;
}
function _pause() public virtual onlyOwner canPause whenNotPaused {
_paused = true;
emit Paused(msg.sender);
}
function _unpause() public virtual onlyOwner canPause whenPaused {
_paused = false;
emit Unpaused(msg.sender);
}
function _beforeTokenTransfer(
address sender,
address to,
uint256 amount
) internal virtual {
// require(sender != address(0), "ERC20: transfer from the zero address");
// require(to != address(0), "ERC20: transfer to the zero address");
require(amount >= 0, "ERC20: transfer to the zero address");
if (state.blacklistflag > 0) {
require(
!isBlackListed(sender),
"Token transfer refused. Receiver is on blacklist"
);
require(
!isBlackListed(to),
"Token transfer refused. Receiver is on blacklist"
);
}
if (state.pauseflag > 0) {
require(!paused(), "Token is Paused.");
}
}
function transferToAddressETH(address payable recipient, uint256 amount)
private
{
recipient.transfer(amount);
}
//to recieve ETH from UniswapRouter when swaping
receive() external payable {}
}
contracts/interfaces/IUniswapV2Factory.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface IUniswapV2Factory {
event PairCreated(
address indexed token0,
address indexed token1,
address pair,
uint256
);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(address tokenA, address tokenB)
external
view
returns (address pair);
function allPairs(uint256) external view returns (address pair);
function allPairsLength() external view returns (uint256);
function createPair(address tokenA, address tokenB)
external
returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
}
contracts/interfaces/IUniswapV2Router01.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface IUniswapV2Router01 {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidity(
address tokenA,
address tokenB,
uint256 amountADesired,
uint256 amountBDesired,
uint256 amountAMin,
uint256 amountBMin,
address to,
uint256 deadline
)
external
returns (
uint256 amountA,
uint256 amountB,
uint256 liquidity
);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
function removeLiquidity(
address tokenA,
address tokenB,
uint256 liquidity,
uint256 amountAMin,
uint256 amountBMin,
address to,
uint256 deadline
) external returns (uint256 amountA, uint256 amountB);
function removeLiquidityETH(
address token,
uint256 liquidity,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
) external returns (uint256 amountToken, uint256 amountETH);
function removeLiquidityWithPermit(
address tokenA,
address tokenB,
uint256 liquidity,
uint256 amountAMin,
uint256 amountBMin,
address to,
uint256 deadline,
bool approveMax,
uint8 v,
bytes32 r,
bytes32 s
) external returns (uint256 amountA, uint256 amountB);
function removeLiquidityETHWithPermit(
address token,
uint256 liquidity,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline,
bool approveMax,
uint8 v,
bytes32 r,
bytes32 s
) external returns (uint256 amountToken, uint256 amountETH);
function swapExactTokensForTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external returns (uint256[] memory amounts);
function swapTokensForExactTokens(
uint256 amountOut,
uint256 amountInMax,
address[] calldata path,
address to,
uint256 deadline
) external returns (uint256[] memory amounts);
function swapExactETHForTokens(
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external payable returns (uint256[] memory amounts);
function swapTokensForExactETH(
uint256 amountOut,
uint256 amountInMax,
address[] calldata path,
address to,
uint256 deadline
) external returns (uint256[] memory amounts);
function swapExactTokensForETH(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external returns (uint256[] memory amounts);
function swapETHForExactTokens(
uint256 amountOut,
address[] calldata path,
address to,
uint256 deadline
) external payable returns (uint256[] memory amounts);
function quote(
uint256 amountA,
uint256 reserveA,
uint256 reserveB
) external pure returns (uint256 amountB);
function getAmountOut(
uint256 amountIn,
uint256 reserveIn,
uint256 reserveOut
) external pure returns (uint256 amountOut);
function getAmountIn(
uint256 amountOut,
uint256 reserveIn,
uint256 reserveOut
) external pure returns (uint256 amountIn);
function getAmountsOut(uint256 amountIn, address[] calldata path)
external
view
returns (uint256[] memory amounts);
function getAmountsIn(uint256 amountOut, address[] calldata path)
external
view
returns (uint256[] memory amounts);
}
contracts/interfaces/IUniswapV2Router02.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./IUniswapV2Router01.sol";
interface IUniswapV2Router02 is IUniswapV2Router01 {
function removeLiquidityETHSupportingFeeOnTransferTokens(
address token,
uint256 liquidity,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
) external returns (uint256 amountETH);
function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
address token,
uint256 liquidity,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline,
bool approveMax,
uint8 v,
bytes32 r,
bytes32 s
) external returns (uint256 amountETH);
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external payable;
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
}
Compiler Settings
{"outputSelection":{"*":{"*":["abi","evm.bytecode","evm.deployedBytecode","evm.methodIdentifiers","metadata","devdoc","userdoc","storageLayout","evm.gasEstimates"],"":["ast"]}},"optimizer":{"runs":5000,"enabled":true},"metadata":{"useLiteralContent":true},"libraries":{}}
Contract ABI
[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"_owner","internalType":"address"},{"type":"address","name":"router_Addr","internalType":"address"},{"type":"address","name":"_standardTokenFactory","internalType":"contract StandardTokenFactory"},{"type":"address","name":"_liquidityTokenFactory","internalType":"contract LiquidityTokenFactory"}]},{"type":"event","name":"CreateStandardSuccess","inputs":[{"type":"address","name":"","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"InitFeeSuccess","inputs":[],"anonymous":false},{"type":"event","name":"OwnerWithdrawSuccess","inputs":[{"type":"uint256","name":"value","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"createLiquditySuccess","inputs":[{"type":"address","name":"","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"setOwnerSucess","inputs":[{"type":"address","name":"","internalType":"address","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"payable","outputs":[],"name":"createLiquidity","inputs":[{"type":"address","name":"creator_","internalType":"address"},{"type":"address","name":"reciever","internalType":"address"},{"type":"string","name":"name_","internalType":"string"},{"type":"string","name":"symbol_","internalType":"string"},{"type":"uint8","name":"decimal_","internalType":"uint8"},{"type":"uint256","name":"supply","internalType":"uint256"},{"type":"uint256","name":"settingflag","internalType":"uint256"},{"type":"uint256[4]","name":"fees","internalType":"uint256[4]"},{"type":"tuple","name":"_state","internalType":"struct SharedStructs.status","components":[{"type":"uint256","name":"mintflag","internalType":"uint256"},{"type":"uint256","name":"pauseflag","internalType":"uint256"},{"type":"uint256","name":"burnflag","internalType":"uint256"},{"type":"uint256","name":"blacklistflag","internalType":"uint256"}]}]},{"type":"function","stateMutability":"payable","outputs":[],"name":"createStandard","inputs":[{"type":"address","name":"creator_","internalType":"address"},{"type":"string","name":"name_","internalType":"string"},{"type":"string","name":"symbol_","internalType":"string"},{"type":"uint8","name":"decimals_","internalType":"uint8"},{"type":"uint256","name":"tokenSupply_","internalType":"uint256"},{"type":"tuple","name":"_state","internalType":"struct SharedStructs.status","components":[{"type":"uint256","name":"mintflag","internalType":"uint256"},{"type":"uint256","name":"pauseflag","internalType":"uint256"},{"type":"uint256","name":"burnflag","internalType":"uint256"},{"type":"uint256","name":"blacklistflag","internalType":"uint256"}]}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"normal","internalType":"uint256"},{"type":"uint256","name":"mint","internalType":"uint256"},{"type":"uint256","name":"burn","internalType":"uint256"},{"type":"uint256","name":"pause","internalType":"uint256"},{"type":"uint256","name":"blacklist","internalType":"uint256"},{"type":"uint256","name":"deflation","internalType":"uint256"}],"name":"fee","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getBalance","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address[]","name":"","internalType":"address[]"}],"name":"getCreatedToken","inputs":[{"type":"address","name":"creater","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"initFee","inputs":[{"type":"tuple","name":"_fee","internalType":"struct CreateManage.feeInfo","components":[{"type":"uint256","name":"normal","internalType":"uint256"},{"type":"uint256","name":"mint","internalType":"uint256"},{"type":"uint256","name":"burn","internalType":"uint256"},{"type":"uint256","name":"pause","internalType":"uint256"},{"type":"uint256","name":"blacklist","internalType":"uint256"},{"type":"uint256","name":"deflation","internalType":"uint256"}]}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"ownerWithdraw","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setOwner","inputs":[{"type":"address","name":"newowner","internalType":"address"}]}]
Contract Creation Code
0x608060405234801561001057600080fd5b5060405162004ca338038062004ca3833981016040819052610031916100ef565b600080546001600160a01b039586166001600160a01b0319918216179091556040805160c08101825267016345785d8a000080825260208201819052918101829052606081018290526080810182905260a0018190526003819055600481905560058190556006819055600781905560085560018054948616948216949094179093556009805492851692841692909217909155600a805491909316911617905561014e565b6001600160a01b03811681146100ec57600080fd5b50565b6000806000806080858703121561010557600080fd5b8451610110816100d7565b6020860151909450610121816100d7565b6040860151909350610132816100d7565b6060860151909250610143816100d7565b939692955090935050565b614b45806200015e6000396000f3fe608060405260043610620000a25760003560e01c806376f444a31162000071578063cf3059721162000054578063cf30597214620001a7578063ddca3f4314620001be578063df251962146200021957600080fd5b806376f444a3146200013b5780638da5cb5b146200015257600080fd5b806312065fe014620000a757806313af403514620000c85780633664618014620000ef5780634311de8f1462000123575b600080fd5b348015620000b457600080fd5b506040514781526020015b60405180910390f35b348015620000d557600080fd5b50620000ed620000e736600462000a34565b6200023e565b005b348015620000fc57600080fd5b50620001146200010e36600462000a34565b6200033f565b604051620000bf919062000a5b565b3480156200013057600080fd5b50620000ed620003d1565b620000ed6200014c36600462000c8f565b620004d1565b3480156200015f57600080fd5b50600054620001819073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001620000bf565b620000ed620001b836600462000d71565b62000768565b348015620001cb57600080fd5b50600354600454600554600654600754600854620001eb95949392919086565b604080519687526020870195909552938501929092526060840152608083015260a082015260c001620000bf565b3480156200022657600080fd5b50620000ed6200023836600462000e20565b6200092a565b60005473ffffffffffffffffffffffffffffffffffffffff163314620002c5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c79206d616e616765722063616e20646f2069740000000000000000000060448201526064015b60405180910390fd5b600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081179091556040519081527f2ad00119c52384b34359201efdeae8e4bcc95b285f433b645adb782ef8ffb367906020015b60405180910390a150565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260026020908152604091829020805483518184028101840190945280845260609392830182828015620003c557602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff16815260019091019060200180831162000399575b50505050509050919050565b60005473ffffffffffffffffffffffffffffffffffffffff16331462000454576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4f6e6c79206d616e616765722063616e207769746864726177000000000000006044820152606401620002bc565b6000805460405173ffffffffffffffffffffffffffffffffffffffff9091169182914780156108fc0292909190818181858888f193505050501580156200049f573d6000803e3d6000fd5b506040514781527fc67a6e2c9e13b320d5ce7e24743ea93ba9261320310966dd6240569493690eff9060200162000334565b620004dc8162000982565b34101562000547576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f42616c616e636520697320696e737566666963656e74000000000000000000006044820152606401620002bc565b600089600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168a88888c8c604051620005809062000a00565b62000592979695949392919062000f0c565b604051809103906000f080158015620005af573d6000803e3d6000fd5b506040517f67d2465600000000000000000000000000000000000000000000000000000000815290915073ffffffffffffffffffffffffffffffffffffffff8216906367d246569062000609908790879060040162000f80565b600060405180830381600087803b1580156200062457600080fd5b505af115801562000639573d6000803e3d6000fd5b50506040517f245e579800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8416925063245e579891506200069190859060040162000fba565b600060405180830381600087803b158015620006ac57600080fd5b505af1158015620006c1573d6000803e3d6000fd5b5050505073ffffffffffffffffffffffffffffffffffffffff8a8116600090815260026020908152604080832080546001810182559084529282902090920180547fffffffffffffffffffffffff000000000000000000000000000000000000000016938516938417905590519182527fd38b5c5c827552bf78686fe20cff5da58946cbe6fab7a370a203e365ced42253910160405180910390a150505050505050505050565b620007738162000982565b341015620007de576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f42616c616e636520697320696e737566666963656e74000000000000000000006044820152606401620002bc565b6009546040517f213db6b700000000000000000000000000000000000000000000000000000000815260009173ffffffffffffffffffffffffffffffffffffffff169063213db6b79062000841908a908a908a908a908a908a9060040162000fe6565b6020604051808303816000875af115801562000861573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200088791906200107a565b73ffffffffffffffffffffffffffffffffffffffff888116600090815260026020908152604080832080546001810182559084529282902090920180547fffffffffffffffffffffffff000000000000000000000000000000000000000016938516938417905590519182529192507f11d95a3a35d0b4b9b14fd17216057aeefef842668d998184cb9f2e114a467a91910160405180910390a150505050505050565b805160035560208101516004556040808201516005556060820151600655608082015160075560a0820151600855517f03855d30824d2deef7728a39f080e5bdad2c59aaeaf4397540a00186095d463a90600090a150565b60035481516000919015620009a357600454620009a090826200109a565b90505b604083015115620009c057600554620009bd90826200109a565b90505b602083015115620009dd57600654620009da90826200109a565b90505b606083015115620009fa57600754620009f790826200109a565b90505b92915050565b613a3580620010db83390190565b73ffffffffffffffffffffffffffffffffffffffff8116811462000a3157600080fd5b50565b60006020828403121562000a4757600080fd5b813562000a548162000a0e565b9392505050565b6020808252825182820181905260009190848201906040850190845b8181101562000aab57835173ffffffffffffffffffffffffffffffffffffffff168352928401929184019160010162000a77565b50909695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f83011262000af857600080fd5b813567ffffffffffffffff8082111562000b165762000b1662000ab7565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190828211818310171562000b5f5762000b5f62000ab7565b8160405283815286602085880101111562000b7957600080fd5b836020870160208301376000602085830101528094505050505092915050565b803560ff8116811462000bab57600080fd5b919050565b600082601f83011262000bc257600080fd5b6040516080810181811067ffffffffffffffff8211171562000be85762000be862000ab7565b60405280608084018581111562000bfe57600080fd5b845b8181101562000c1a57803583526020928301920162000c00565b509195945050505050565b60006080828403121562000c3857600080fd5b6040516080810181811067ffffffffffffffff8211171562000c5e5762000c5e62000ab7565b8060405250809150823581526020830135602082015260408301356040820152606083013560608201525092915050565b60008060008060008060008060006101e08a8c03121562000caf57600080fd5b893562000cbc8162000a0e565b985060208a013562000cce8162000a0e565b975060408a013567ffffffffffffffff8082111562000cec57600080fd5b62000cfa8d838e0162000ae6565b985060608c013591508082111562000d1157600080fd5b5062000d208c828d0162000ae6565b96505062000d3160808b0162000b99565b945060a08a0135935060c08a0135925062000d508b60e08c0162000bb0565b915062000d628b6101608c0162000c25565b90509295985092959850929598565b600080600080600080610120878903121562000d8c57600080fd5b863562000d998162000a0e565b9550602087013567ffffffffffffffff8082111562000db757600080fd5b62000dc58a838b0162000ae6565b9650604089013591508082111562000ddc57600080fd5b5062000deb89828a0162000ae6565b94505062000dfc6060880162000b99565b92506080870135915062000e148860a0890162000c25565b90509295509295509295565b600060c0828403121562000e3357600080fd5b60405160c0810181811067ffffffffffffffff8211171562000e595762000e5962000ab7565b8060405250823581526020830135602082015260408301356040820152606083013560608201526080830135608082015260a083013560a08201528091505092915050565b6000815180845260005b8181101562000ec65760208185018101518683018201520162000ea8565b8181111562000ed9576000602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b600073ffffffffffffffffffffffffffffffffffffffff808a168352808916602084015280881660408401525060ff8616606083015284608083015260e060a083015262000f5e60e083018562000e9e565b82810360c084015262000f72818562000e9e565b9a9950505050505050505050565b82815260a0810160208083018460005b600481101562000faf5781518352918301919083019060010162000f90565b505050509392505050565b8151815260208083015190820152604080830151908201526060808301519082015260808101620009fa565b600061012073ffffffffffffffffffffffffffffffffffffffff89168352806020840152620010188184018962000e9e565b905082810360408401526200102e818862000e9e565b91505060ff851660608301528360808301526200106f60a0830184805182526020810151602083015260408101516040830152606081015160608301525050565b979650505050505050565b6000602082840312156200108d57600080fd5b815162000a548162000a0e565b60008219821115620010d5577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b50019056fe60e060405261dead60805269010f0cf064dd59200000601955681043561a8829300000601a55670de0b6b3a7640000601b556002601d553480156200004357600080fd5b5060405162003a3538038062003a358339810160408190526200006691620004c3565b81516200007b90600c90602085019062000333565b5080516200009190600d90602084019062000333565b50600e805460ff191660ff86161790556040805163c45a015560e01b8152905187916001600160a01b0383169163c45a0155916004808201926020929091908290030181865afa158015620000ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000110919062000589565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156200015e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000184919062000589565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015620001d2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001f8919062000589565b6001600160a01b0390811660c052811660a052600280546001600160a01b031916331790556200022a88878662000262565b600954604051908152339060009060008051602062003a158339815191529060200160405180910390a3505050505050505062000633565b600080546001600160a01b038085166001600160a01b03199283161790925560018054928616929091169190911790556009819055620002a581600019620005ae565b620002b390600019620005d1565b600a8190556001600160a01b038416600090815260036020908152604080832093909355601c805462ffff001916905560068152828220805460ff199081166001908117909255308452848420805490911690911790556009549251928352339260008051602062003a15833981519152910160405180910390a3505050565b8280546200034190620005f7565b90600052602060002090601f016020900481019282620003655760008555620003b0565b82601f106200038057805160ff1916838001178555620003b0565b82800160010185558215620003b0579182015b82811115620003b057825182559160200191906001019062000393565b50620003be929150620003c2565b5090565b5b80821115620003be5760008155600101620003c3565b80516001600160a01b0381168114620003f157600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126200041e57600080fd5b81516001600160401b03808211156200043b576200043b620003f6565b604051601f8301601f19908116603f01168101908282118183101715620004665762000466620003f6565b816040528381526020925086838588010111156200048357600080fd5b600091505b83821015620004a7578582018301518183018401529082019062000488565b83821115620004b95760008385830101525b9695505050505050565b600080600080600080600060e0888a031215620004df57600080fd5b620004ea88620003d9565b9650620004fa60208901620003d9565b95506200050a60408901620003d9565b9450606088015160ff811681146200052157600080fd5b608089015160a08a015191955093506001600160401b03808211156200054657600080fd5b620005548b838c016200040c565b935060c08a01519150808211156200056b57600080fd5b506200057a8a828b016200040c565b91505092959891949750929550565b6000602082840312156200059c57600080fd5b620005a782620003d9565b9392505050565b600082620005cc57634e487b7160e01b600052601260045260246000fd5b500690565b600082821015620005f257634e487b7160e01b600052601160045260246000fd5b500390565b600181811c908216806200060c57607f821691505b6020821081036200062d57634e487b7160e01b600052602260045260246000fd5b50919050565b60805160a05160c0516133816200069460003960008181610677015261210201526000818161083c0152818161269901528181612752015281816127a7015281816128ad015261298c0152600081816103e501526129b701526133816000f3fe6080604052600436106102f65760003560e01c80636053a0e31161018f578063a457c2d7116100e1578063c7639d801161008a578063e47d606011610064578063e47d6060146108ba578063ea2f0b37146108da578063fc8234cb146108fa57600080fd5b8063c7639d801461082a578063d6b513cf1461085e578063dd62ed3e1461087457600080fd5b8063b351dfe8116100bb578063b351dfe8146107b2578063bdc653ef146107d2578063c19d93fb146107e757600080fd5b8063a457c2d714610752578063a5ece94114610772578063a9059cbb1461079257600080fd5b80637d1db4a51161014357806395d89b411161011d57806395d89b4114610708578063a0712d681461071d578063a073d37f1461073d57600080fd5b80637d1db4a51461069957806388f82020146106af5780638da5cb5b146106e857600080fd5b80636bc87c3a116101745780636bc87c3a1461062f57806370a082311461064557806378a63f341461066557600080fd5b80636053a0e3146105ef57806367d246561461060f57600080fd5b806339509351116102485780634549b039116101fc57806352390c02116101d657806352390c02146105815780635342acb4146105a15780635c975abb146105da57600080fd5b80634549b0391461052c57806349538af41461054c5780634a74bb021461056257600080fd5b80633bd5d1731161022d5780633bd5d173146104cc57806342966c68146104ec578063437823ec1461050c57600080fd5b806339509351146104965780633b124fe7146104b657600080fd5b8063245e5798116102aa578063313ce56711610284578063313ce5671461043f578063320b2ad9146104615780633685d4191461047657600080fd5b8063245e5798146103b157806327c8f835146103d35780632d8381191461041f57600080fd5b806313114a9d116102db57806313114a9d1461035d57806318160ddd1461037c57806323b872dd1461039157600080fd5b806306fdde0314610302578063095ea7b31461032d57600080fd5b366102fd57005b600080fd5b34801561030e57600080fd5b5061031761090f565b6040516103249190612e05565b60405180910390f35b34801561033957600080fd5b5061034d610348366004612e90565b6109a1565b6040519015158152602001610324565b34801561036957600080fd5b50600b545b604051908152602001610324565b34801561038857600080fd5b5060095461036e565b34801561039d57600080fd5b5061034d6103ac366004612ebc565b6109c3565b3480156103bd57600080fd5b506103d16103cc366004612f4d565b610abe565b005b3480156103df57600080fd5b506104077f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610324565b34801561042b57600080fd5b5061036e61043a366004612f93565b610b36565b34801561044b57600080fd5b50600e5460405160ff9091168152602001610324565b34801561046d57600080fd5b506103d1610bcd565b34801561048257600080fd5b506103d1610491366004612fac565b610d1b565b3480156104a257600080fd5b5061034d6104b1366004612e90565b610f3c565b3480156104c257600080fd5b5061036e60145481565b3480156104d857600080fd5b506103d16104e7366004612f93565b610f73565b3480156104f857600080fd5b506103d1610507366004612f93565b61107b565b34801561051857600080fd5b506103d1610527366004612fac565b611194565b34801561053857600080fd5b5061036e610547366004612fd9565b61121d565b34801561055857600080fd5b5061036e601d5481565b34801561056e57600080fd5b50601c5461034d90610100900460ff1681565b34801561058d57600080fd5b506103d161059c366004612fac565b6112aa565b3480156105ad57600080fd5b5061034d6105bc366004612fac565b6001600160a01b031660009081526006602052604090205460ff1690565b3480156105e657600080fd5b5061034d611450565b3480156105fb57600080fd5b50601c5461034d9062010000900460ff1681565b34801561061b57600080fd5b506103d161062a366004613005565b6114b1565b34801561063b57600080fd5b5061036e60165481565b34801561065157600080fd5b5061036e610660366004612fac565b6115d2565b34801561067157600080fd5b506104077f000000000000000000000000000000000000000000000000000000000000000081565b3480156106a557600080fd5b5061036e60195481565b3480156106bb57600080fd5b5061034d6106ca366004612fac565b6001600160a01b031660009081526007602052604090205460ff1690565b3480156106f457600080fd5b50600154610407906001600160a01b031681565b34801561071457600080fd5b50610317611631565b34801561072957600080fd5b506103d1610738366004612f93565b611640565b34801561074957600080fd5b50601a5461036e565b34801561075e57600080fd5b5061034d61076d366004612e90565b6117b0565b34801561077e57600080fd5b50600054610407906001600160a01b031681565b34801561079e57600080fd5b5061034d6107ad366004612e90565b61187f565b3480156107be57600080fd5b506103d16107cd366004613070565b611897565b3480156107de57600080fd5b50601b5461036e565b3480156107f357600080fd5b50600f5460105460115460125461080a9392919084565b604080519485526020850193909352918301526060820152608001610324565b34801561083657600080fd5b506104077f000000000000000000000000000000000000000000000000000000000000000081565b34801561086a57600080fd5b5061036e60185481565b34801561088057600080fd5b5061036e61088f36600461309c565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b3480156108c657600080fd5b5061034d6108d5366004612fac565b6119aa565b3480156108e657600080fd5b506103d16108f5366004612fac565b611a1f565b34801561090657600080fd5b506103d1611aa5565b6060600c805461091e906130d5565b80601f016020809104026020016040519081016040528092919081815260200182805461094a906130d5565b80156109975780601f1061096c57610100808354040283529160200191610997565b820191906000526020600020905b81548152906001019060200180831161097a57829003601f168201915b5050505050905090565b60006109ae338484611be8565b6109b9338484611d4a565b5060015b92915050565b60006109d0848484611be8565b6109db848484611eb3565b6001600160a01b0384166000908152600560209081526040808320338452909152902054821115610a795760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206160448201527f6c6c6f77616e636500000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6001600160a01b038416600090815260056020908152604080832033808552925290912054610ab4918691610aaf908690613157565b611d4a565b5060019392505050565b6002546001600160a01b03163314610b185760405162461bcd60e51b815260206004820181905260248201527f4d616e6167653a63616c6c6572206973206e6f7420746865206d616e616765726044820152606401610a70565b8051600f556020810151601055604081015160115560600151601255565b6000600a54821115610bb05760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201527f65666c656374696f6e73000000000000000000000000000000000000000000006064820152608401610a70565b6000610bba6121f8565b9050610bc6818461316e565b9392505050565b6001546001600160a01b03163314610c325760405162461bcd60e51b815260206004820152602260248201527f4f776e61626c653a2063616c6c6572206973206e6f742074686520637265617460448201526137b960f11b6064820152608401610a70565b600f54610c815760405162461bcd60e51b815260206004820152601860248201527f5061757361626c653a2044697361626c656420506175736500000000000000006044820152606401610a70565b610c89611450565b15610cd65760405162461bcd60e51b815260206004820152601060248201527f5061757361626c653a20706175736564000000000000000000000000000000006044820152606401610a70565b600e805461ff0019166101001790556040513381527f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258906020015b60405180910390a1565b6001546001600160a01b03163314610d805760405162461bcd60e51b815260206004820152602260248201527f4f776e61626c653a2063616c6c6572206973206e6f742074686520637265617460448201526137b960f11b6064820152608401610a70565b6001600160a01b03811660009081526007602052604090205460ff16610de85760405162461bcd60e51b815260206004820152601b60248201527f4163636f756e7420697320616c7265616479206578636c7564656400000000006044820152606401610a70565b60005b600854811015610f3857816001600160a01b031660088281548110610e1257610e126131a9565b6000918252602090912001546001600160a01b031603610f265760088054610e3c90600190613157565b81548110610e4c57610e4c6131a9565b600091825260209091200154600880546001600160a01b039092169183908110610e7857610e786131a9565b600091825260208083209190910180547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b039485161790559184168152600482526040808220829055600790925220805460ff191690556008805480610ee857610ee86131d8565b600082815260209020810160001990810180547fffffffffffffffffffffffff00000000000000000000000000000000000000001690550190555050565b80610f3081613207565b915050610deb565b5050565b3360008181526005602090815260408083206001600160a01b038716845290915281205490916109b9918590610aaf908690613221565b610f7e333383611be8565b3360008181526007602052604090205460ff16156110045760405162461bcd60e51b815260206004820152602c60248201527f4578636c75646564206164647265737365732063616e6e6f742063616c6c207460448201527f6869732066756e6374696f6e00000000000000000000000000000000000000006064820152608401610a70565b600061100f8361221b565b505050506001600160a01b03841660009081526003602052604090205491925061103b91839150613157565b6001600160a01b038316600090815260036020526040902055600a54611062908290613157565b600a55600b54611073908490613221565b600b55505050565b6001546001600160a01b031633146110e05760405162461bcd60e51b815260206004820152602260248201527f4f776e61626c653a2063616c6c6572206973206e6f742074686520637265617460448201526137b960f11b6064820152608401610a70565b60115461112f5760405162461bcd60e51b815260206004820152601760248201527f4275726e61626c653a2044697361626c6564204275726e0000000000000000006044820152606401610a70565b61113b33600083611be8565b806009546111499190613157565b600955600b5461115a908290613221565b600b556040518181527fb3871d378eeb4c3372ea4c46076e44c52a1b329359d0f7f90c7b03ee8c0792ce906020015b60405180910390a150565b6001546001600160a01b031633146111f95760405162461bcd60e51b815260206004820152602260248201527f4f776e61626c653a2063616c6c6572206973206e6f742074686520637265617460448201526137b960f11b6064820152608401610a70565b6001600160a01b03166000908152600660205260409020805460ff19166001179055565b60006009548311156112715760405162461bcd60e51b815260206004820152601f60248201527f416d6f756e74206d757374206265206c657373207468616e20737570706c79006044820152606401610a70565b816112905760006112818461221b565b509395506109bd945050505050565b600061129b8461221b565b509295506109bd945050505050565b6001546001600160a01b0316331461130f5760405162461bcd60e51b815260206004820152602260248201527f4f776e61626c653a2063616c6c6572206973206e6f742074686520637265617460448201526137b960f11b6064820152608401610a70565b6001600160a01b03811660009081526007602052604090205460ff16156113785760405162461bcd60e51b815260206004820152601b60248201527f4163636f756e7420697320616c7265616479206578636c7564656400000000006044820152606401610a70565b6001600160a01b038116600090815260036020526040902054156113d2576001600160a01b0381166000908152600360205260409020546113b890610b36565b6001600160a01b0382166000908152600460205260409020555b6001600160a01b03166000818152600760205260408120805460ff191660019081179091556008805491820181559091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169091179055565b600f546000906114a25760405162461bcd60e51b815260206004820152601860248201527f5061757361626c653a2044697361626c656420506175736500000000000000006044820152606401610a70565b50600e54610100900460ff1690565b6002546001600160a01b0316331461150b5760405162461bcd60e51b815260206004820181905260248201527f4d616e6167653a63616c6c6572206973206e6f7420746865206d616e616765726044820152606401610a70565b811580159061151b575081600114155b1561153057601c805461ff0019166101001790555b816001148061153f5750816002145b1561157257601c80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ffff16620100001790555b8160031461158857805160145560208101516018555b81600114806115975750816002145b156115a55760408101516018555b81600314806115b45750816004145b156115c25760608101516016555b5050601454601555601654601755565b6001600160a01b03811660009081526007602052604081205460ff161561160f57506001600160a01b031660009081526004602052604090205490565b6001600160a01b0382166000908152600360205260409020546109bd90610b36565b6060600d805461091e906130d5565b6001546001600160a01b031633146116a55760405162461bcd60e51b815260206004820152602260248201527f4f776e61626c653a2063616c6c6572206973206e6f742074686520637265617460448201526137b960f11b6064820152608401610a70565b600f546116f45760405162461bcd60e51b815260206004820152601760248201527f4d696e7461626c653a2044697361626c6564204d696e740000000000000000006044820152606401610a70565b600019816009546117059190613221565b11156117535760405162461bcd60e51b815260206004820152600d60248201527f65786365656473206c696d6974000000000000000000000000000000000000006044820152606401610a70565b61175e333383611be8565b8060095461176c9190613221565b600955600b5461177d908290613221565b600b556040518181527fdd779ccd34929e417fc56a3ffb2acea0e3ce9ff756ef2107f4a75b6b00132aeb90602001611189565b3360009081526005602090815260408083206001600160a01b03861684529091528120548211156118495760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f0000000000000000000000000000000000000000000000000000006064820152608401610a70565b3360008181526005602090815260408083206001600160a01b03881684529091529020546109b991908590610aaf908690613157565b600061188c338484611be8565b6109b9338484611eb3565b6001546001600160a01b031633146118fc5760405162461bcd60e51b815260206004820152602260248201527f4f776e61626c653a2063616c6c6572206973206e6f742074686520637265617460448201526137b960f11b6064820152608401610a70565b60125461194b5760405162461bcd60e51b815260206004820152601d60248201527f426c61636b6c6973743a2044697361626c656420426c61636b6c6973740000006044820152606401610a70565b6001600160a01b038216600081815260136020908152604091829020805460ff191685151590811790915591519182527f6a12b3df6cba4203bd7fd06b816789f87de8c594299aed5717ae070fac781bac910160405180910390a25050565b6012546000906119fc5760405162461bcd60e51b815260206004820152601d60248201527f426c61636b6c6973743a2044697361626c656420426c61636b6c6973740000006044820152606401610a70565b506001600160a01b03811660009081526013602052604090205460ff165b919050565b6001546001600160a01b03163314611a845760405162461bcd60e51b815260206004820152602260248201527f4f776e61626c653a2063616c6c6572206973206e6f742074686520637265617460448201526137b960f11b6064820152608401610a70565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6001546001600160a01b03163314611b0a5760405162461bcd60e51b815260206004820152602260248201527f4f776e61626c653a2063616c6c6572206973206e6f742074686520637265617460448201526137b960f11b6064820152608401610a70565b600f54611b595760405162461bcd60e51b815260206004820152601860248201527f5061757361626c653a2044697361626c656420506175736500000000000000006044820152606401610a70565b611b61611450565b611bad5760405162461bcd60e51b815260206004820152601460248201527f5061757361626c653a206e6f74207061757365640000000000000000000000006044820152606401610a70565b600e805461ff00191690556040513381527f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa90602001610d11565b60125415611ce857611bf9836119aa565b15611c6c5760405162461bcd60e51b815260206004820152603060248201527f546f6b656e207472616e7366657220726566757365642e20526563656976657260448201527f206973206f6e20626c61636b6c697374000000000000000000000000000000006064820152608401610a70565b611c75826119aa565b15611ce85760405162461bcd60e51b815260206004820152603060248201527f546f6b656e207472616e7366657220726566757365642e20526563656976657260448201527f206973206f6e20626c61636b6c697374000000000000000000000000000000006064820152608401610a70565b60105415611d4557611cf8611450565b15611d455760405162461bcd60e51b815260206004820152601060248201527f546f6b656e206973205061757365642e000000000000000000000000000000006044820152606401610a70565b505050565b6001600160a01b038316611dc55760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610a70565b6001600160a01b038216611e415760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f73730000000000000000000000000000000000000000000000000000000000006064820152608401610a70565b600180546001600160a01b039081166000908152600560209081526040808320878516808552925291829020859055925490519116907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590611ea69085815260200190565b60405180910390a3505050565b6001600160a01b038316611f2f5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610a70565b6001600160a01b038216611fab5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f65737300000000000000000000000000000000000000000000000000000000006064820152608401610a70565b600081116120215760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d75737420626520677265617465722060448201527f7468616e207a65726f00000000000000000000000000000000000000000000006064820152608401610a70565b6001546001600160a01b0384811691161480159061204d57506001546001600160a01b03838116911614155b156120ca576019548111156120ca5760405162461bcd60e51b815260206004820152602860248201527f5472616e7366657220616d6f756e74206578636565647320746865206d61785460448201527f78416d6f756e742e0000000000000000000000000000000000000000000000006064820152608401610a70565b60006120d5306115d2565b601a54601c549192508210159060ff161580156120f95750601c54610100900460ff165b801561213657507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316846001600160a01b0316145b1561219957801561214f57601a54915061214f8261226a565b601c54479062010000900460ff1680156121705750670de0b6b3a764000081115b1561219757601b548111156121845750601b545b61219761219260648361316e565b6122d1565b505b6001600160a01b03851660009081526006602052604090205460019060ff16806121db57506001600160a01b03851660009081526006602052604090205460ff165b156121e4575060005b6121f0868686846122fa565b505050505050565b6000806000612205612425565b9092509050612214818361316e565b9250505090565b60008060008060008060008060006122328a6125a8565b92509250925060008060006122508d868661224b6121f8565b6125eb565b919f909e50909c50959a5093985091965092945050505050565b601c805460ff191660011790554761228182612642565b600061228d8247613157565b6000546018546016549293506122c2926001600160a01b03909216916122b3908561316e565b6122bd9190613239565b612854565b5050601c805460ff1916905550565b601c805460ff1916600117905580156122ed576122ed8161288a565b50601c805460ff19169055565b8061230757612307612a64565b6001600160a01b03841660009081526007602052604090205460ff16801561234857506001600160a01b03831660009081526007602052604090205460ff16155b1561235d57612358848484612a92565b612409565b6001600160a01b03841660009081526007602052604090205460ff1615801561239e57506001600160a01b03831660009081526007602052604090205460ff165b156123ae57612358848484612be7565b6001600160a01b03841660009081526007602052604090205460ff1680156123ee57506001600160a01b03831660009081526007602052604090205460ff165b156123fe57612358848484612c93565b612409848484612d08565b8061241f5761241f601554601455601754601655565b50505050565b600a546009546000918291825b60085481101561257757826003600060088481548110612454576124546131a9565b60009182526020808320909101546001600160a01b0316835282019290925260400190205411806124bf5750816004600060088481548110612498576124986131a9565b60009182526020808320909101546001600160a01b03168352820192909252604001902054115b156124d557600a54600954945094505050509091565b60036000600883815481106124ec576124ec6131a9565b60009182526020808320909101546001600160a01b0316835282019290925260400190205461251b9084613157565b92506004600060088381548110612534576125346131a9565b60009182526020808320909101546001600160a01b031683528201929092526040019020546125639083613157565b91508061256f81613207565b915050612432565b50600954600a54612588919061316e565b82101561259f57600a546009549350935050509091565b90939092509050565b6000806000806125b785612d4d565b905060006125c486612d69565b90506000816125d38489613157565b6125dd9190613157565b979296509094509092505050565b60008080806125fa8589613239565b905060006126088689613239565b905060006126168789613239565b90506000816126258486613157565b61262f9190613157565b939b939a50919850919650505050505050565b6040805160028082526060820183526000926020830190803683370190505090503081600081518110612677576126776131a9565b60200260200101906001600160a01b031690816001600160a01b0316815250507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156126f5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127199190613258565b8160018151811061272c5761272c6131a9565b60200260200101906001600160a01b031690816001600160a01b031681525050612777307f000000000000000000000000000000000000000000000000000000000000000084611d4a565b6040517f791ac9470000000000000000000000000000000000000000000000000000000081526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063791ac947906127e59085906000908690309042906004016132b9565b600060405180830381600087803b1580156127ff57600080fd5b505af1158015612813573d6000803e3d6000fd5b505050507f32cde87eb454f3a0b875ab23547023107cfad454363ec88ba5695e2c24aa52a782826040516128489291906132f5565b60405180910390a15050565b6040516001600160a01b0383169082156108fc029083906000818181858888f19350505050158015611d45573d6000803e3d6000fd5b6040805160028082526060820183526000926020830190803683370190505090507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015612909573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061292d9190613258565b81600081518110612940576129406131a9565b60200260200101906001600160a01b031690816001600160a01b0316815250503081600181518110612974576129746131a9565b6001600160a01b0392831660209182029290920101527f00000000000000000000000000000000000000000000000000000000000000001663b6f9de95836000847f00000000000000000000000000000000000000000000000000000000000000006129e24261012c613221565b6040518663ffffffff1660e01b8152600401612a019493929190613316565b6000604051808303818588803b158015612a1a57600080fd5b505af1158015612a2e573d6000803e3d6000fd5b50505050507f6fd378a9d8b7345c2e5b18229aaf1e39d32b177b501d0a0d26a0a858a23a962482826040516128489291906132f5565b601454158015612a745750601654155b15612a7b57565b601480546015556016805460175560009182905555565b600080600080600080612aa48761221b565b6001600160a01b038f16600090815260046020526040902054959b50939950919750955093509150612ad7908890613157565b6001600160a01b038a16600090815260046020908152604080832093909355600390522054612b07908790613157565b6001600160a01b03808b1660009081526003602052604080822093909355908a1681522054612b37908690613221565b6001600160a01b038916600090815260036020526040902055612b5981612d7b565b600080546001600160a01b0316815260036020526040902054612b7d908590613221565b600080546001600160a01b03908116825260036020526040918290209290925551898216918b16907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90612bd49087815260200190565b60405180910390a3505050505050505050565b600080600080600080612bf98761221b565b6001600160a01b038f16600090815260036020526040902054959b50939950919750955093509150612c2c908790613157565b6001600160a01b03808b16600090815260036020908152604080832094909455918b16815260049091522054612c63908490613221565b6001600160a01b038916600090815260046020908152604080832093909355600390522054612b37908690613221565b600080600080600080612ca58761221b565b6001600160a01b038f16600090815260046020526040902054959b50939950919750955093509150612cd8908890613157565b6001600160a01b038a16600090815260046020908152604080832093909355600390522054612c2c908790613157565b600080600080600080612d1a8761221b565b6001600160a01b038f16600090815260036020526040902054959b50939950919750955093509150612b07908790613157565b6000606460145483612d5f9190613239565b6109bd919061316e565b6000606460165483612d5f9190613239565b6000612d856121f8565b90506000612d938284613239565b30600090815260036020526040902054909150612db1908290613221565b3060009081526003602090815260408083209390935560079052205460ff1615611d455730600090815260046020526040902054612df0908490613221565b30600090815260046020526040902055505050565b600060208083528351808285015260005b81811015612e3257858101830151858201604001528201612e16565b81811115612e44576000604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b6001600160a01b0381168114612e8d57600080fd5b50565b60008060408385031215612ea357600080fd5b8235612eae81612e78565b946020939093013593505050565b600080600060608486031215612ed157600080fd5b8335612edc81612e78565b92506020840135612eec81612e78565b929592945050506040919091013590565b6040516080810167ffffffffffffffff81118282101715612f47577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405290565b600060808284031215612f5f57600080fd5b612f67612efd565b823581526020830135602082015260408301356040820152606083013560608201528091505092915050565b600060208284031215612fa557600080fd5b5035919050565b600060208284031215612fbe57600080fd5b8135610bc681612e78565b80358015158114611a1a57600080fd5b60008060408385031215612fec57600080fd5b82359150612ffc60208401612fc9565b90509250929050565b60008060a0838503121561301857600080fd5b82359150602084603f85011261302d57600080fd5b613035612efd565b8060a086018781111561304757600080fd5b8387015b81811015613062578035845292840192840161304b565b509497909650945050505050565b6000806040838503121561308357600080fd5b823561308e81612e78565b9150612ffc60208401612fc9565b600080604083850312156130af57600080fd5b82356130ba81612e78565b915060208301356130ca81612e78565b809150509250929050565b600181811c908216806130e957607f821691505b602082108103613122577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60008282101561316957613169613128565b500390565b6000826131a4577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b6000600019820361321a5761321a613128565b5060010190565b6000821982111561323457613234613128565b500190565b600081600019048311821515161561325357613253613128565b500290565b60006020828403121561326a57600080fd5b8151610bc681612e78565b600081518084526020808501945080840160005b838110156132ae5781516001600160a01b031687529582019590820190600101613289565b509495945050505050565b85815284602082015260a0604082015260006132d860a0830186613275565b6001600160a01b0394909416606083015250608001529392505050565b82815260406020820152600061330e6040830184613275565b949350505050565b84815260806020820152600061332f6080830186613275565b6001600160a01b0394909416604083015250606001529291505056fea26469706673582212201360c1cf3dd82d373880e8c5cf21cae27615a978eda8044683a8af49ab8b282b64736f6c634300080d0033ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa2646970667358221220eb68d82bf2689e365e1fafe4ca27dadacf157c3b909a39a3dd9d10921b3b1c2264736f6c634300080d00330000000000000000000000008df97eab2651e87a8a4080008ddabf6824c9f67200000000000000000000000002232dabaffedfc136843c26d951dfe87ab00dca00000000000000000000000089cd72823774fd86c15fd8b5a27ce231e232f7900000000000000000000000007e1e4b30f318117dee6874759796a2619876559e
Deployed ByteCode
0x608060405260043610620000a25760003560e01c806376f444a31162000071578063cf3059721162000054578063cf30597214620001a7578063ddca3f4314620001be578063df251962146200021957600080fd5b806376f444a3146200013b5780638da5cb5b146200015257600080fd5b806312065fe014620000a757806313af403514620000c85780633664618014620000ef5780634311de8f1462000123575b600080fd5b348015620000b457600080fd5b506040514781526020015b60405180910390f35b348015620000d557600080fd5b50620000ed620000e736600462000a34565b6200023e565b005b348015620000fc57600080fd5b50620001146200010e36600462000a34565b6200033f565b604051620000bf919062000a5b565b3480156200013057600080fd5b50620000ed620003d1565b620000ed6200014c36600462000c8f565b620004d1565b3480156200015f57600080fd5b50600054620001819073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001620000bf565b620000ed620001b836600462000d71565b62000768565b348015620001cb57600080fd5b50600354600454600554600654600754600854620001eb95949392919086565b604080519687526020870195909552938501929092526060840152608083015260a082015260c001620000bf565b3480156200022657600080fd5b50620000ed6200023836600462000e20565b6200092a565b60005473ffffffffffffffffffffffffffffffffffffffff163314620002c5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c79206d616e616765722063616e20646f2069740000000000000000000060448201526064015b60405180910390fd5b600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081179091556040519081527f2ad00119c52384b34359201efdeae8e4bcc95b285f433b645adb782ef8ffb367906020015b60405180910390a150565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260026020908152604091829020805483518184028101840190945280845260609392830182828015620003c557602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff16815260019091019060200180831162000399575b50505050509050919050565b60005473ffffffffffffffffffffffffffffffffffffffff16331462000454576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4f6e6c79206d616e616765722063616e207769746864726177000000000000006044820152606401620002bc565b6000805460405173ffffffffffffffffffffffffffffffffffffffff9091169182914780156108fc0292909190818181858888f193505050501580156200049f573d6000803e3d6000fd5b506040514781527fc67a6e2c9e13b320d5ce7e24743ea93ba9261320310966dd6240569493690eff9060200162000334565b620004dc8162000982565b34101562000547576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f42616c616e636520697320696e737566666963656e74000000000000000000006044820152606401620002bc565b600089600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168a88888c8c604051620005809062000a00565b62000592979695949392919062000f0c565b604051809103906000f080158015620005af573d6000803e3d6000fd5b506040517f67d2465600000000000000000000000000000000000000000000000000000000815290915073ffffffffffffffffffffffffffffffffffffffff8216906367d246569062000609908790879060040162000f80565b600060405180830381600087803b1580156200062457600080fd5b505af115801562000639573d6000803e3d6000fd5b50506040517f245e579800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8416925063245e579891506200069190859060040162000fba565b600060405180830381600087803b158015620006ac57600080fd5b505af1158015620006c1573d6000803e3d6000fd5b5050505073ffffffffffffffffffffffffffffffffffffffff8a8116600090815260026020908152604080832080546001810182559084529282902090920180547fffffffffffffffffffffffff000000000000000000000000000000000000000016938516938417905590519182527fd38b5c5c827552bf78686fe20cff5da58946cbe6fab7a370a203e365ced42253910160405180910390a150505050505050505050565b620007738162000982565b341015620007de576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f42616c616e636520697320696e737566666963656e74000000000000000000006044820152606401620002bc565b6009546040517f213db6b700000000000000000000000000000000000000000000000000000000815260009173ffffffffffffffffffffffffffffffffffffffff169063213db6b79062000841908a908a908a908a908a908a9060040162000fe6565b6020604051808303816000875af115801562000861573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200088791906200107a565b73ffffffffffffffffffffffffffffffffffffffff888116600090815260026020908152604080832080546001810182559084529282902090920180547fffffffffffffffffffffffff000000000000000000000000000000000000000016938516938417905590519182529192507f11d95a3a35d0b4b9b14fd17216057aeefef842668d998184cb9f2e114a467a91910160405180910390a150505050505050565b805160035560208101516004556040808201516005556060820151600655608082015160075560a0820151600855517f03855d30824d2deef7728a39f080e5bdad2c59aaeaf4397540a00186095d463a90600090a150565b60035481516000919015620009a357600454620009a090826200109a565b90505b604083015115620009c057600554620009bd90826200109a565b90505b602083015115620009dd57600654620009da90826200109a565b90505b606083015115620009fa57600754620009f790826200109a565b90505b92915050565b613a3580620010db83390190565b73ffffffffffffffffffffffffffffffffffffffff8116811462000a3157600080fd5b50565b60006020828403121562000a4757600080fd5b813562000a548162000a0e565b9392505050565b6020808252825182820181905260009190848201906040850190845b8181101562000aab57835173ffffffffffffffffffffffffffffffffffffffff168352928401929184019160010162000a77565b50909695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f83011262000af857600080fd5b813567ffffffffffffffff8082111562000b165762000b1662000ab7565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190828211818310171562000b5f5762000b5f62000ab7565b8160405283815286602085880101111562000b7957600080fd5b836020870160208301376000602085830101528094505050505092915050565b803560ff8116811462000bab57600080fd5b919050565b600082601f83011262000bc257600080fd5b6040516080810181811067ffffffffffffffff8211171562000be85762000be862000ab7565b60405280608084018581111562000bfe57600080fd5b845b8181101562000c1a57803583526020928301920162000c00565b509195945050505050565b60006080828403121562000c3857600080fd5b6040516080810181811067ffffffffffffffff8211171562000c5e5762000c5e62000ab7565b8060405250809150823581526020830135602082015260408301356040820152606083013560608201525092915050565b60008060008060008060008060006101e08a8c03121562000caf57600080fd5b893562000cbc8162000a0e565b985060208a013562000cce8162000a0e565b975060408a013567ffffffffffffffff8082111562000cec57600080fd5b62000cfa8d838e0162000ae6565b985060608c013591508082111562000d1157600080fd5b5062000d208c828d0162000ae6565b96505062000d3160808b0162000b99565b945060a08a0135935060c08a0135925062000d508b60e08c0162000bb0565b915062000d628b6101608c0162000c25565b90509295985092959850929598565b600080600080600080610120878903121562000d8c57600080fd5b863562000d998162000a0e565b9550602087013567ffffffffffffffff8082111562000db757600080fd5b62000dc58a838b0162000ae6565b9650604089013591508082111562000ddc57600080fd5b5062000deb89828a0162000ae6565b94505062000dfc6060880162000b99565b92506080870135915062000e148860a0890162000c25565b90509295509295509295565b600060c0828403121562000e3357600080fd5b60405160c0810181811067ffffffffffffffff8211171562000e595762000e5962000ab7565b8060405250823581526020830135602082015260408301356040820152606083013560608201526080830135608082015260a083013560a08201528091505092915050565b6000815180845260005b8181101562000ec65760208185018101518683018201520162000ea8565b8181111562000ed9576000602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b600073ffffffffffffffffffffffffffffffffffffffff808a168352808916602084015280881660408401525060ff8616606083015284608083015260e060a083015262000f5e60e083018562000e9e565b82810360c084015262000f72818562000e9e565b9a9950505050505050505050565b82815260a0810160208083018460005b600481101562000faf5781518352918301919083019060010162000f90565b505050509392505050565b8151815260208083015190820152604080830151908201526060808301519082015260808101620009fa565b600061012073ffffffffffffffffffffffffffffffffffffffff89168352806020840152620010188184018962000e9e565b905082810360408401526200102e818862000e9e565b91505060ff851660608301528360808301526200106f60a0830184805182526020810151602083015260408101516040830152606081015160608301525050565b979650505050505050565b6000602082840312156200108d57600080fd5b815162000a548162000a0e565b60008219821115620010d5577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b50019056fe60e060405261dead60805269010f0cf064dd59200000601955681043561a8829300000601a55670de0b6b3a7640000601b556002601d553480156200004357600080fd5b5060405162003a3538038062003a358339810160408190526200006691620004c3565b81516200007b90600c90602085019062000333565b5080516200009190600d90602084019062000333565b50600e805460ff191660ff86161790556040805163c45a015560e01b8152905187916001600160a01b0383169163c45a0155916004808201926020929091908290030181865afa158015620000ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000110919062000589565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156200015e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000184919062000589565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015620001d2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001f8919062000589565b6001600160a01b0390811660c052811660a052600280546001600160a01b031916331790556200022a88878662000262565b600954604051908152339060009060008051602062003a158339815191529060200160405180910390a3505050505050505062000633565b600080546001600160a01b038085166001600160a01b03199283161790925560018054928616929091169190911790556009819055620002a581600019620005ae565b620002b390600019620005d1565b600a8190556001600160a01b038416600090815260036020908152604080832093909355601c805462ffff001916905560068152828220805460ff199081166001908117909255308452848420805490911690911790556009549251928352339260008051602062003a15833981519152910160405180910390a3505050565b8280546200034190620005f7565b90600052602060002090601f016020900481019282620003655760008555620003b0565b82601f106200038057805160ff1916838001178555620003b0565b82800160010185558215620003b0579182015b82811115620003b057825182559160200191906001019062000393565b50620003be929150620003c2565b5090565b5b80821115620003be5760008155600101620003c3565b80516001600160a01b0381168114620003f157600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126200041e57600080fd5b81516001600160401b03808211156200043b576200043b620003f6565b604051601f8301601f19908116603f01168101908282118183101715620004665762000466620003f6565b816040528381526020925086838588010111156200048357600080fd5b600091505b83821015620004a7578582018301518183018401529082019062000488565b83821115620004b95760008385830101525b9695505050505050565b600080600080600080600060e0888a031215620004df57600080fd5b620004ea88620003d9565b9650620004fa60208901620003d9565b95506200050a60408901620003d9565b9450606088015160ff811681146200052157600080fd5b608089015160a08a015191955093506001600160401b03808211156200054657600080fd5b620005548b838c016200040c565b935060c08a01519150808211156200056b57600080fd5b506200057a8a828b016200040c565b91505092959891949750929550565b6000602082840312156200059c57600080fd5b620005a782620003d9565b9392505050565b600082620005cc57634e487b7160e01b600052601260045260246000fd5b500690565b600082821015620005f257634e487b7160e01b600052601160045260246000fd5b500390565b600181811c908216806200060c57607f821691505b6020821081036200062d57634e487b7160e01b600052602260045260246000fd5b50919050565b60805160a05160c0516133816200069460003960008181610677015261210201526000818161083c0152818161269901528181612752015281816127a7015281816128ad015261298c0152600081816103e501526129b701526133816000f3fe6080604052600436106102f65760003560e01c80636053a0e31161018f578063a457c2d7116100e1578063c7639d801161008a578063e47d606011610064578063e47d6060146108ba578063ea2f0b37146108da578063fc8234cb146108fa57600080fd5b8063c7639d801461082a578063d6b513cf1461085e578063dd62ed3e1461087457600080fd5b8063b351dfe8116100bb578063b351dfe8146107b2578063bdc653ef146107d2578063c19d93fb146107e757600080fd5b8063a457c2d714610752578063a5ece94114610772578063a9059cbb1461079257600080fd5b80637d1db4a51161014357806395d89b411161011d57806395d89b4114610708578063a0712d681461071d578063a073d37f1461073d57600080fd5b80637d1db4a51461069957806388f82020146106af5780638da5cb5b146106e857600080fd5b80636bc87c3a116101745780636bc87c3a1461062f57806370a082311461064557806378a63f341461066557600080fd5b80636053a0e3146105ef57806367d246561461060f57600080fd5b806339509351116102485780634549b039116101fc57806352390c02116101d657806352390c02146105815780635342acb4146105a15780635c975abb146105da57600080fd5b80634549b0391461052c57806349538af41461054c5780634a74bb021461056257600080fd5b80633bd5d1731161022d5780633bd5d173146104cc57806342966c68146104ec578063437823ec1461050c57600080fd5b806339509351146104965780633b124fe7146104b657600080fd5b8063245e5798116102aa578063313ce56711610284578063313ce5671461043f578063320b2ad9146104615780633685d4191461047657600080fd5b8063245e5798146103b157806327c8f835146103d35780632d8381191461041f57600080fd5b806313114a9d116102db57806313114a9d1461035d57806318160ddd1461037c57806323b872dd1461039157600080fd5b806306fdde0314610302578063095ea7b31461032d57600080fd5b366102fd57005b600080fd5b34801561030e57600080fd5b5061031761090f565b6040516103249190612e05565b60405180910390f35b34801561033957600080fd5b5061034d610348366004612e90565b6109a1565b6040519015158152602001610324565b34801561036957600080fd5b50600b545b604051908152602001610324565b34801561038857600080fd5b5060095461036e565b34801561039d57600080fd5b5061034d6103ac366004612ebc565b6109c3565b3480156103bd57600080fd5b506103d16103cc366004612f4d565b610abe565b005b3480156103df57600080fd5b506104077f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610324565b34801561042b57600080fd5b5061036e61043a366004612f93565b610b36565b34801561044b57600080fd5b50600e5460405160ff9091168152602001610324565b34801561046d57600080fd5b506103d1610bcd565b34801561048257600080fd5b506103d1610491366004612fac565b610d1b565b3480156104a257600080fd5b5061034d6104b1366004612e90565b610f3c565b3480156104c257600080fd5b5061036e60145481565b3480156104d857600080fd5b506103d16104e7366004612f93565b610f73565b3480156104f857600080fd5b506103d1610507366004612f93565b61107b565b34801561051857600080fd5b506103d1610527366004612fac565b611194565b34801561053857600080fd5b5061036e610547366004612fd9565b61121d565b34801561055857600080fd5b5061036e601d5481565b34801561056e57600080fd5b50601c5461034d90610100900460ff1681565b34801561058d57600080fd5b506103d161059c366004612fac565b6112aa565b3480156105ad57600080fd5b5061034d6105bc366004612fac565b6001600160a01b031660009081526006602052604090205460ff1690565b3480156105e657600080fd5b5061034d611450565b3480156105fb57600080fd5b50601c5461034d9062010000900460ff1681565b34801561061b57600080fd5b506103d161062a366004613005565b6114b1565b34801561063b57600080fd5b5061036e60165481565b34801561065157600080fd5b5061036e610660366004612fac565b6115d2565b34801561067157600080fd5b506104077f000000000000000000000000000000000000000000000000000000000000000081565b3480156106a557600080fd5b5061036e60195481565b3480156106bb57600080fd5b5061034d6106ca366004612fac565b6001600160a01b031660009081526007602052604090205460ff1690565b3480156106f457600080fd5b50600154610407906001600160a01b031681565b34801561071457600080fd5b50610317611631565b34801561072957600080fd5b506103d1610738366004612f93565b611640565b34801561074957600080fd5b50601a5461036e565b34801561075e57600080fd5b5061034d61076d366004612e90565b6117b0565b34801561077e57600080fd5b50600054610407906001600160a01b031681565b34801561079e57600080fd5b5061034d6107ad366004612e90565b61187f565b3480156107be57600080fd5b506103d16107cd366004613070565b611897565b3480156107de57600080fd5b50601b5461036e565b3480156107f357600080fd5b50600f5460105460115460125461080a9392919084565b604080519485526020850193909352918301526060820152608001610324565b34801561083657600080fd5b506104077f000000000000000000000000000000000000000000000000000000000000000081565b34801561086a57600080fd5b5061036e60185481565b34801561088057600080fd5b5061036e61088f36600461309c565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b3480156108c657600080fd5b5061034d6108d5366004612fac565b6119aa565b3480156108e657600080fd5b506103d16108f5366004612fac565b611a1f565b34801561090657600080fd5b506103d1611aa5565b6060600c805461091e906130d5565b80601f016020809104026020016040519081016040528092919081815260200182805461094a906130d5565b80156109975780601f1061096c57610100808354040283529160200191610997565b820191906000526020600020905b81548152906001019060200180831161097a57829003601f168201915b5050505050905090565b60006109ae338484611be8565b6109b9338484611d4a565b5060015b92915050565b60006109d0848484611be8565b6109db848484611eb3565b6001600160a01b0384166000908152600560209081526040808320338452909152902054821115610a795760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206160448201527f6c6c6f77616e636500000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6001600160a01b038416600090815260056020908152604080832033808552925290912054610ab4918691610aaf908690613157565b611d4a565b5060019392505050565b6002546001600160a01b03163314610b185760405162461bcd60e51b815260206004820181905260248201527f4d616e6167653a63616c6c6572206973206e6f7420746865206d616e616765726044820152606401610a70565b8051600f556020810151601055604081015160115560600151601255565b6000600a54821115610bb05760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201527f65666c656374696f6e73000000000000000000000000000000000000000000006064820152608401610a70565b6000610bba6121f8565b9050610bc6818461316e565b9392505050565b6001546001600160a01b03163314610c325760405162461bcd60e51b815260206004820152602260248201527f4f776e61626c653a2063616c6c6572206973206e6f742074686520637265617460448201526137b960f11b6064820152608401610a70565b600f54610c815760405162461bcd60e51b815260206004820152601860248201527f5061757361626c653a2044697361626c656420506175736500000000000000006044820152606401610a70565b610c89611450565b15610cd65760405162461bcd60e51b815260206004820152601060248201527f5061757361626c653a20706175736564000000000000000000000000000000006044820152606401610a70565b600e805461ff0019166101001790556040513381527f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258906020015b60405180910390a1565b6001546001600160a01b03163314610d805760405162461bcd60e51b815260206004820152602260248201527f4f776e61626c653a2063616c6c6572206973206e6f742074686520637265617460448201526137b960f11b6064820152608401610a70565b6001600160a01b03811660009081526007602052604090205460ff16610de85760405162461bcd60e51b815260206004820152601b60248201527f4163636f756e7420697320616c7265616479206578636c7564656400000000006044820152606401610a70565b60005b600854811015610f3857816001600160a01b031660088281548110610e1257610e126131a9565b6000918252602090912001546001600160a01b031603610f265760088054610e3c90600190613157565b81548110610e4c57610e4c6131a9565b600091825260209091200154600880546001600160a01b039092169183908110610e7857610e786131a9565b600091825260208083209190910180547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b039485161790559184168152600482526040808220829055600790925220805460ff191690556008805480610ee857610ee86131d8565b600082815260209020810160001990810180547fffffffffffffffffffffffff00000000000000000000000000000000000000001690550190555050565b80610f3081613207565b915050610deb565b5050565b3360008181526005602090815260408083206001600160a01b038716845290915281205490916109b9918590610aaf908690613221565b610f7e333383611be8565b3360008181526007602052604090205460ff16156110045760405162461bcd60e51b815260206004820152602c60248201527f4578636c75646564206164647265737365732063616e6e6f742063616c6c207460448201527f6869732066756e6374696f6e00000000000000000000000000000000000000006064820152608401610a70565b600061100f8361221b565b505050506001600160a01b03841660009081526003602052604090205491925061103b91839150613157565b6001600160a01b038316600090815260036020526040902055600a54611062908290613157565b600a55600b54611073908490613221565b600b55505050565b6001546001600160a01b031633146110e05760405162461bcd60e51b815260206004820152602260248201527f4f776e61626c653a2063616c6c6572206973206e6f742074686520637265617460448201526137b960f11b6064820152608401610a70565b60115461112f5760405162461bcd60e51b815260206004820152601760248201527f4275726e61626c653a2044697361626c6564204275726e0000000000000000006044820152606401610a70565b61113b33600083611be8565b806009546111499190613157565b600955600b5461115a908290613221565b600b556040518181527fb3871d378eeb4c3372ea4c46076e44c52a1b329359d0f7f90c7b03ee8c0792ce906020015b60405180910390a150565b6001546001600160a01b031633146111f95760405162461bcd60e51b815260206004820152602260248201527f4f776e61626c653a2063616c6c6572206973206e6f742074686520637265617460448201526137b960f11b6064820152608401610a70565b6001600160a01b03166000908152600660205260409020805460ff19166001179055565b60006009548311156112715760405162461bcd60e51b815260206004820152601f60248201527f416d6f756e74206d757374206265206c657373207468616e20737570706c79006044820152606401610a70565b816112905760006112818461221b565b509395506109bd945050505050565b600061129b8461221b565b509295506109bd945050505050565b6001546001600160a01b0316331461130f5760405162461bcd60e51b815260206004820152602260248201527f4f776e61626c653a2063616c6c6572206973206e6f742074686520637265617460448201526137b960f11b6064820152608401610a70565b6001600160a01b03811660009081526007602052604090205460ff16156113785760405162461bcd60e51b815260206004820152601b60248201527f4163636f756e7420697320616c7265616479206578636c7564656400000000006044820152606401610a70565b6001600160a01b038116600090815260036020526040902054156113d2576001600160a01b0381166000908152600360205260409020546113b890610b36565b6001600160a01b0382166000908152600460205260409020555b6001600160a01b03166000818152600760205260408120805460ff191660019081179091556008805491820181559091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169091179055565b600f546000906114a25760405162461bcd60e51b815260206004820152601860248201527f5061757361626c653a2044697361626c656420506175736500000000000000006044820152606401610a70565b50600e54610100900460ff1690565b6002546001600160a01b0316331461150b5760405162461bcd60e51b815260206004820181905260248201527f4d616e6167653a63616c6c6572206973206e6f7420746865206d616e616765726044820152606401610a70565b811580159061151b575081600114155b1561153057601c805461ff0019166101001790555b816001148061153f5750816002145b1561157257601c80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ffff16620100001790555b8160031461158857805160145560208101516018555b81600114806115975750816002145b156115a55760408101516018555b81600314806115b45750816004145b156115c25760608101516016555b5050601454601555601654601755565b6001600160a01b03811660009081526007602052604081205460ff161561160f57506001600160a01b031660009081526004602052604090205490565b6001600160a01b0382166000908152600360205260409020546109bd90610b36565b6060600d805461091e906130d5565b6001546001600160a01b031633146116a55760405162461bcd60e51b815260206004820152602260248201527f4f776e61626c653a2063616c6c6572206973206e6f742074686520637265617460448201526137b960f11b6064820152608401610a70565b600f546116f45760405162461bcd60e51b815260206004820152601760248201527f4d696e7461626c653a2044697361626c6564204d696e740000000000000000006044820152606401610a70565b600019816009546117059190613221565b11156117535760405162461bcd60e51b815260206004820152600d60248201527f65786365656473206c696d6974000000000000000000000000000000000000006044820152606401610a70565b61175e333383611be8565b8060095461176c9190613221565b600955600b5461177d908290613221565b600b556040518181527fdd779ccd34929e417fc56a3ffb2acea0e3ce9ff756ef2107f4a75b6b00132aeb90602001611189565b3360009081526005602090815260408083206001600160a01b03861684529091528120548211156118495760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f0000000000000000000000000000000000000000000000000000006064820152608401610a70565b3360008181526005602090815260408083206001600160a01b03881684529091529020546109b991908590610aaf908690613157565b600061188c338484611be8565b6109b9338484611eb3565b6001546001600160a01b031633146118fc5760405162461bcd60e51b815260206004820152602260248201527f4f776e61626c653a2063616c6c6572206973206e6f742074686520637265617460448201526137b960f11b6064820152608401610a70565b60125461194b5760405162461bcd60e51b815260206004820152601d60248201527f426c61636b6c6973743a2044697361626c656420426c61636b6c6973740000006044820152606401610a70565b6001600160a01b038216600081815260136020908152604091829020805460ff191685151590811790915591519182527f6a12b3df6cba4203bd7fd06b816789f87de8c594299aed5717ae070fac781bac910160405180910390a25050565b6012546000906119fc5760405162461bcd60e51b815260206004820152601d60248201527f426c61636b6c6973743a2044697361626c656420426c61636b6c6973740000006044820152606401610a70565b506001600160a01b03811660009081526013602052604090205460ff165b919050565b6001546001600160a01b03163314611a845760405162461bcd60e51b815260206004820152602260248201527f4f776e61626c653a2063616c6c6572206973206e6f742074686520637265617460448201526137b960f11b6064820152608401610a70565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6001546001600160a01b03163314611b0a5760405162461bcd60e51b815260206004820152602260248201527f4f776e61626c653a2063616c6c6572206973206e6f742074686520637265617460448201526137b960f11b6064820152608401610a70565b600f54611b595760405162461bcd60e51b815260206004820152601860248201527f5061757361626c653a2044697361626c656420506175736500000000000000006044820152606401610a70565b611b61611450565b611bad5760405162461bcd60e51b815260206004820152601460248201527f5061757361626c653a206e6f74207061757365640000000000000000000000006044820152606401610a70565b600e805461ff00191690556040513381527f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa90602001610d11565b60125415611ce857611bf9836119aa565b15611c6c5760405162461bcd60e51b815260206004820152603060248201527f546f6b656e207472616e7366657220726566757365642e20526563656976657260448201527f206973206f6e20626c61636b6c697374000000000000000000000000000000006064820152608401610a70565b611c75826119aa565b15611ce85760405162461bcd60e51b815260206004820152603060248201527f546f6b656e207472616e7366657220726566757365642e20526563656976657260448201527f206973206f6e20626c61636b6c697374000000000000000000000000000000006064820152608401610a70565b60105415611d4557611cf8611450565b15611d455760405162461bcd60e51b815260206004820152601060248201527f546f6b656e206973205061757365642e000000000000000000000000000000006044820152606401610a70565b505050565b6001600160a01b038316611dc55760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610a70565b6001600160a01b038216611e415760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f73730000000000000000000000000000000000000000000000000000000000006064820152608401610a70565b600180546001600160a01b039081166000908152600560209081526040808320878516808552925291829020859055925490519116907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590611ea69085815260200190565b60405180910390a3505050565b6001600160a01b038316611f2f5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610a70565b6001600160a01b038216611fab5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f65737300000000000000000000000000000000000000000000000000000000006064820152608401610a70565b600081116120215760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d75737420626520677265617465722060448201527f7468616e207a65726f00000000000000000000000000000000000000000000006064820152608401610a70565b6001546001600160a01b0384811691161480159061204d57506001546001600160a01b03838116911614155b156120ca576019548111156120ca5760405162461bcd60e51b815260206004820152602860248201527f5472616e7366657220616d6f756e74206578636565647320746865206d61785460448201527f78416d6f756e742e0000000000000000000000000000000000000000000000006064820152608401610a70565b60006120d5306115d2565b601a54601c549192508210159060ff161580156120f95750601c54610100900460ff165b801561213657507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316846001600160a01b0316145b1561219957801561214f57601a54915061214f8261226a565b601c54479062010000900460ff1680156121705750670de0b6b3a764000081115b1561219757601b548111156121845750601b545b61219761219260648361316e565b6122d1565b505b6001600160a01b03851660009081526006602052604090205460019060ff16806121db57506001600160a01b03851660009081526006602052604090205460ff165b156121e4575060005b6121f0868686846122fa565b505050505050565b6000806000612205612425565b9092509050612214818361316e565b9250505090565b60008060008060008060008060006122328a6125a8565b92509250925060008060006122508d868661224b6121f8565b6125eb565b919f909e50909c50959a5093985091965092945050505050565b601c805460ff191660011790554761228182612642565b600061228d8247613157565b6000546018546016549293506122c2926001600160a01b03909216916122b3908561316e565b6122bd9190613239565b612854565b5050601c805460ff1916905550565b601c805460ff1916600117905580156122ed576122ed8161288a565b50601c805460ff19169055565b8061230757612307612a64565b6001600160a01b03841660009081526007602052604090205460ff16801561234857506001600160a01b03831660009081526007602052604090205460ff16155b1561235d57612358848484612a92565b612409565b6001600160a01b03841660009081526007602052604090205460ff1615801561239e57506001600160a01b03831660009081526007602052604090205460ff165b156123ae57612358848484612be7565b6001600160a01b03841660009081526007602052604090205460ff1680156123ee57506001600160a01b03831660009081526007602052604090205460ff165b156123fe57612358848484612c93565b612409848484612d08565b8061241f5761241f601554601455601754601655565b50505050565b600a546009546000918291825b60085481101561257757826003600060088481548110612454576124546131a9565b60009182526020808320909101546001600160a01b0316835282019290925260400190205411806124bf5750816004600060088481548110612498576124986131a9565b60009182526020808320909101546001600160a01b03168352820192909252604001902054115b156124d557600a54600954945094505050509091565b60036000600883815481106124ec576124ec6131a9565b60009182526020808320909101546001600160a01b0316835282019290925260400190205461251b9084613157565b92506004600060088381548110612534576125346131a9565b60009182526020808320909101546001600160a01b031683528201929092526040019020546125639083613157565b91508061256f81613207565b915050612432565b50600954600a54612588919061316e565b82101561259f57600a546009549350935050509091565b90939092509050565b6000806000806125b785612d4d565b905060006125c486612d69565b90506000816125d38489613157565b6125dd9190613157565b979296509094509092505050565b60008080806125fa8589613239565b905060006126088689613239565b905060006126168789613239565b90506000816126258486613157565b61262f9190613157565b939b939a50919850919650505050505050565b6040805160028082526060820183526000926020830190803683370190505090503081600081518110612677576126776131a9565b60200260200101906001600160a01b031690816001600160a01b0316815250507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156126f5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127199190613258565b8160018151811061272c5761272c6131a9565b60200260200101906001600160a01b031690816001600160a01b031681525050612777307f000000000000000000000000000000000000000000000000000000000000000084611d4a565b6040517f791ac9470000000000000000000000000000000000000000000000000000000081526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063791ac947906127e59085906000908690309042906004016132b9565b600060405180830381600087803b1580156127ff57600080fd5b505af1158015612813573d6000803e3d6000fd5b505050507f32cde87eb454f3a0b875ab23547023107cfad454363ec88ba5695e2c24aa52a782826040516128489291906132f5565b60405180910390a15050565b6040516001600160a01b0383169082156108fc029083906000818181858888f19350505050158015611d45573d6000803e3d6000fd5b6040805160028082526060820183526000926020830190803683370190505090507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015612909573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061292d9190613258565b81600081518110612940576129406131a9565b60200260200101906001600160a01b031690816001600160a01b0316815250503081600181518110612974576129746131a9565b6001600160a01b0392831660209182029290920101527f00000000000000000000000000000000000000000000000000000000000000001663b6f9de95836000847f00000000000000000000000000000000000000000000000000000000000000006129e24261012c613221565b6040518663ffffffff1660e01b8152600401612a019493929190613316565b6000604051808303818588803b158015612a1a57600080fd5b505af1158015612a2e573d6000803e3d6000fd5b50505050507f6fd378a9d8b7345c2e5b18229aaf1e39d32b177b501d0a0d26a0a858a23a962482826040516128489291906132f5565b601454158015612a745750601654155b15612a7b57565b601480546015556016805460175560009182905555565b600080600080600080612aa48761221b565b6001600160a01b038f16600090815260046020526040902054959b50939950919750955093509150612ad7908890613157565b6001600160a01b038a16600090815260046020908152604080832093909355600390522054612b07908790613157565b6001600160a01b03808b1660009081526003602052604080822093909355908a1681522054612b37908690613221565b6001600160a01b038916600090815260036020526040902055612b5981612d7b565b600080546001600160a01b0316815260036020526040902054612b7d908590613221565b600080546001600160a01b03908116825260036020526040918290209290925551898216918b16907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90612bd49087815260200190565b60405180910390a3505050505050505050565b600080600080600080612bf98761221b565b6001600160a01b038f16600090815260036020526040902054959b50939950919750955093509150612c2c908790613157565b6001600160a01b03808b16600090815260036020908152604080832094909455918b16815260049091522054612c63908490613221565b6001600160a01b038916600090815260046020908152604080832093909355600390522054612b37908690613221565b600080600080600080612ca58761221b565b6001600160a01b038f16600090815260046020526040902054959b50939950919750955093509150612cd8908890613157565b6001600160a01b038a16600090815260046020908152604080832093909355600390522054612c2c908790613157565b600080600080600080612d1a8761221b565b6001600160a01b038f16600090815260036020526040902054959b50939950919750955093509150612b07908790613157565b6000606460145483612d5f9190613239565b6109bd919061316e565b6000606460165483612d5f9190613239565b6000612d856121f8565b90506000612d938284613239565b30600090815260036020526040902054909150612db1908290613221565b3060009081526003602090815260408083209390935560079052205460ff1615611d455730600090815260046020526040902054612df0908490613221565b30600090815260046020526040902055505050565b600060208083528351808285015260005b81811015612e3257858101830151858201604001528201612e16565b81811115612e44576000604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b6001600160a01b0381168114612e8d57600080fd5b50565b60008060408385031215612ea357600080fd5b8235612eae81612e78565b946020939093013593505050565b600080600060608486031215612ed157600080fd5b8335612edc81612e78565b92506020840135612eec81612e78565b929592945050506040919091013590565b6040516080810167ffffffffffffffff81118282101715612f47577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405290565b600060808284031215612f5f57600080fd5b612f67612efd565b823581526020830135602082015260408301356040820152606083013560608201528091505092915050565b600060208284031215612fa557600080fd5b5035919050565b600060208284031215612fbe57600080fd5b8135610bc681612e78565b80358015158114611a1a57600080fd5b60008060408385031215612fec57600080fd5b82359150612ffc60208401612fc9565b90509250929050565b60008060a0838503121561301857600080fd5b82359150602084603f85011261302d57600080fd5b613035612efd565b8060a086018781111561304757600080fd5b8387015b81811015613062578035845292840192840161304b565b509497909650945050505050565b6000806040838503121561308357600080fd5b823561308e81612e78565b9150612ffc60208401612fc9565b600080604083850312156130af57600080fd5b82356130ba81612e78565b915060208301356130ca81612e78565b809150509250929050565b600181811c908216806130e957607f821691505b602082108103613122577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60008282101561316957613169613128565b500390565b6000826131a4577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b6000600019820361321a5761321a613128565b5060010190565b6000821982111561323457613234613128565b500190565b600081600019048311821515161561325357613253613128565b500290565b60006020828403121561326a57600080fd5b8151610bc681612e78565b600081518084526020808501945080840160005b838110156132ae5781516001600160a01b031687529582019590820190600101613289565b509495945050505050565b85815284602082015260a0604082015260006132d860a0830186613275565b6001600160a01b0394909416606083015250608001529392505050565b82815260406020820152600061330e6040830184613275565b949350505050565b84815260806020820152600061332f6080830186613275565b6001600160a01b0394909416604083015250606001529291505056fea26469706673582212201360c1cf3dd82d373880e8c5cf21cae27615a978eda8044683a8af49ab8b282b64736f6c634300080d0033ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa2646970667358221220eb68d82bf2689e365e1fafe4ca27dadacf157c3b909a39a3dd9d10921b3b1c2264736f6c634300080d0033