Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
This contract has been partially verified via Sourcify.
- Contract name:
- IDOFactory
- Optimization enabled
- true
- Compiler version
- v0.8.18+commit.87f61d96
- Optimization runs
- 100
- EVM Version
- default
- Verified at
- 2025-04-03T09:09:08.304051Z
Constructor Arguments
0x000000000000000000000000abccefb00528c9c792ac7c46997f0f6ee5dcdddd0000000000000000000000000000000000000000000000008ac7230489e800000000000000000000000000000000000000000000000000000000000000000064
Arg [0] (address) : 0xabccefb00528c9c792ac7c46997f0f6ee5dcdddd
Arg [1] (uint256) : 10000000000000000000
Arg [2] (uint256) : 100
contracts/factory/IDOFactory.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol";
import "./IDOPool.sol";
contract IDOFactory is Ownable {
using SafeMath for uint256;
using SafeERC20 for ERC20Burnable;
using SafeERC20 for ERC20;
ERC20Burnable public feeToken;
address public feeWallet;
uint256 public feeAmount;
uint256 public burnPercent; // use this state only if your token is ERC20Burnable and has burnFrom method
uint256 public divider;
address[] public idoPools;
event IDOCreated(
address indexed owner,
address idoPool,
address indexed rewardToken,
string tokenURI
);
event IDOCreatedByHelper(
address indexed owner,
address idoPool,
address indexed rewardToken,
string tokenURI,
uint256 idoTokenAmount, // IDO token exact amount
uint256 lpTokenAmount // LP token exact amount
);
event TokenFeeUpdated(address newFeeToken);
event FeeAmountUpdated(uint256 newFeeAmount);
event BurnPercentUpdated(uint256 newBurnPercent, uint256 divider);
event FeeWalletUpdated(address newFeeWallet);
event IDOPoolInitialized(
address indexed idoPool,
address indexed rewardToken,
IDOPool.FinInfo finInfo,
IDOPool.Timestamps timestamps,
IDOPool.DEXInfo dexInfo,
address lockerFactory,
string metadataURL
);
constructor(
ERC20Burnable _feeToken,
uint256 _feeAmount,
uint256 _burnPercent
){
feeToken = _feeToken;
feeAmount = _feeAmount;
burnPercent = _burnPercent;
divider = 100;
}
function getIdoPools() public view returns (address[] memory) {
return idoPools;
}
function setFeeToken(address _newFeeToken) external onlyOwner {
require(isContract(_newFeeToken), "New address is not a token");
feeToken = ERC20Burnable(_newFeeToken);
emit TokenFeeUpdated(_newFeeToken);
}
function setFeeAmount(uint256 _newFeeAmount) external onlyOwner {
feeAmount = _newFeeAmount;
emit FeeAmountUpdated(_newFeeAmount);
}
function setFeeWallet(address _newFeeWallet) external onlyOwner {
feeWallet = _newFeeWallet;
emit FeeWalletUpdated(_newFeeWallet);
}
function setBurnPercent(uint256 _newBurnPercent, uint256 _newDivider)
external
onlyOwner
{
require(_newBurnPercent <= _newDivider, "Burn percent must be less than divider");
burnPercent = _newBurnPercent;
divider = _newDivider;
emit BurnPercentUpdated(_newBurnPercent, _newDivider);
}
function handleFees() internal {
if(feeAmount > 0){
if (burnPercent > 0){
uint256 burnAmount = feeAmount.mul(burnPercent).div(divider);
feeToken.safeTransferFrom(
msg.sender,
feeWallet,
feeAmount.sub(burnAmount)
);
feeToken.burnFrom(msg.sender, burnAmount);
} else {
feeToken.safeTransferFrom(
msg.sender,
feeWallet,
feeAmount
);
}
}
}
function createIDO(
ERC20 _rewardToken,
IDOPool.FinInfo memory _finInfo,
IDOPool.Timestamps memory _timestamps,
IDOPool.DEXInfo memory _dexInfo,
address _lockerFactoryAddress,
string memory _metadataURL
) external returns (address idoPoolAddress) {
IDOPool idoPool =
new IDOPool(
_rewardToken,
_finInfo,
_timestamps,
_dexInfo,
_lockerFactoryAddress,
_metadataURL
);
uint8 tokenDecimals = _rewardToken.decimals();
uint256 transferAmount = getTokenAmount(_finInfo.hardCap, _finInfo.tokenPrice, tokenDecimals);
if (_finInfo.lpInterestRate > 0 && _finInfo.listingPrice > 0) {
transferAmount += getTokenAmount(_finInfo.hardCap * _finInfo.lpInterestRate / 100, _finInfo.listingPrice, tokenDecimals);
}
idoPool.transferOwnership(msg.sender);
idoPoolAddress = address(idoPool);
_rewardToken.safeTransferFrom(
msg.sender,
idoPoolAddress,
transferAmount
);
idoPools.push(idoPoolAddress);
emit IDOCreated(
msg.sender,
idoPoolAddress,
address(_rewardToken),
_metadataURL
);
handleFees();
}
function createIDOByHelper(
ERC20 _rewardToken,
IDOPool.FinInfo memory _finInfo,
IDOPool.Timestamps memory _timestamps,
IDOPool.DEXInfo memory _dexInfo,
address _lockerFactoryAddress,
string memory _metadataURL,
uint256 idoTokenAmount,
uint256 lpTokenAmount
) external returns (address idoPoolAddress) {
IDOPool idoPool = new IDOPool(
_rewardToken,
_finInfo,
_timestamps,
_dexInfo,
_lockerFactoryAddress,
_metadataURL
);
// trigger initialized event
emit IDOPoolInitialized(
address(idoPool),
address(_rewardToken),
_finInfo,
_timestamps,
_dexInfo,
_lockerFactoryAddress,
_metadataURL
);
// use exact token amount
uint256 transferAmount = idoTokenAmount + lpTokenAmount;
// transfer ownership
idoPool.transferOwnership(msg.sender);
// set pool address
idoPoolAddress = address(idoPool);
// transfer token to pool
_rewardToken.safeTransferFrom(
msg.sender,
idoPoolAddress,
transferAmount
);
// record pool address
idoPools.push(idoPoolAddress);
// trigger event
emit IDOCreatedByHelper(
msg.sender,
idoPoolAddress,
address(_rewardToken),
_metadataURL,
idoTokenAmount,
lpTokenAmount
);
handleFees();
}
function getTokenAmount(
uint256 ethAmount,
uint256 tokenPrice,
uint8 decimals
) internal pure returns (uint256) {
return (ethAmount / tokenPrice) * (10**decimals);
}
function isContract(address _addr) private view returns (bool) {
uint32 size;
assembly {
size := extcodesize(_addr)
}
return (size > 0);
}
}
@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol
// SPDX-License-Identifier: MIT
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/token/ERC20/extensions/ERC20Burnable.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../ERC20.sol";
import "../../../utils/Context.sol";
/**
* @dev Extension of {ERC20} that allows token holders to destroy both their own
* tokens and those that they have an allowance for, in a way that can be
* recognized off-chain (via event analysis).
*/
abstract contract ERC20Burnable is Context, ERC20 {
/**
* @dev Destroys `amount` tokens from the caller.
*
* See {ERC20-_burn}.
*/
function burn(uint256 amount) public virtual {
_burn(_msgSender(), amount);
}
/**
* @dev Destroys `amount` tokens from `account`, deducting from the caller's
* allowance.
*
* See {ERC20-_burn} and {ERC20-allowance}.
*
* Requirements:
*
* - the caller must have allowance for ``accounts``'s tokens of at least
* `amount`.
*/
function burnFrom(address account, uint256 amount) public virtual {
uint256 currentAllowance = allowance(account, _msgSender());
require(currentAllowance >= amount, "ERC20: burn amount exceeds allowance");
unchecked {
_approve(account, _msgSender(), currentAllowance - amount);
}
_burn(account, amount);
}
}
@openzeppelin/contracts/access/Ownable.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_setOwner(_msgSender());
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_setOwner(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_setOwner(newOwner);
}
function _setOwner(address newOwner) private {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
@openzeppelin/contracts/security/ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and make it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
// On the first call to nonReentrant, _notEntered will be true
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
_;
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
}
@openzeppelin/contracts/token/ERC20/ERC20.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./IERC20.sol";
import "./extensions/IERC20Metadata.sol";
import "../../utils/Context.sol";
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our guide
* https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* We have followed general OpenZeppelin Contracts guidelines: functions revert
* instead returning `false` on failure. This behavior is nonetheless
* conventional and does not conflict with the expectations of ERC20
* applications.
*
* Additionally, an {Approval} event is emitted on calls to {transferFrom}.
* This allows applications to reconstruct the allowance for all accounts just
* by listening to said events. Other implementations of the EIP may not emit
* these events, as it isn't required by the specification.
*
* Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
* functions have been added to mitigate the well-known issues around setting
* allowances. See {IERC20-approve}.
*/
contract ERC20 is Context, IERC20, IERC20Metadata {
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
/**
* @dev Sets the values for {name} and {symbol}.
*
* The default value of {decimals} is 18. To select a different value for
* {decimals} you should overload it.
*
* All two of these values are immutable: they can only be set once during
* construction.
*/
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
/**
* @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 18;
}
/**
* @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");
unchecked {
_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");
unchecked {
_approve(_msgSender(), spender, currentAllowance - subtractedValue);
}
return true;
}
/**
* @dev Moves `amount` of tokens from `sender` to `recipient`.
*
* This 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");
unchecked {
_balances[sender] = senderBalance - amount;
}
_balances[recipient] += amount;
emit Transfer(sender, recipient, amount);
_afterTokenTransfer(sender, recipient, 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) 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);
_afterTokenTransfer(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(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
unchecked {
_balances[account] = accountBalance - amount;
}
_totalSupply -= amount;
emit Transfer(account, address(0), amount);
_afterTokenTransfer(account, 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);
}
/**
* @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 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 from,
address to,
uint256 amount
) internal virtual {}
/**
* @dev Hook that is called after any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* has been transferred to `to`.
* - when `from` is zero, `amount` tokens have been minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens have been 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 _afterTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
}
@openzeppelin/contracts/token/ERC20/IERC20.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @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 `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, 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 `sender` to `recipient` 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 sender,
address recipient,
uint256 amount
) external returns (bool);
/**
* @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);
}
@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../IERC20.sol";
import "../../../utils/Address.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using Address for address;
function safeTransfer(
IERC20 token,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(
IERC20 token,
address from,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
/**
* @dev Deprecated. This function has issues similar to the ones found in
* {IERC20-approve}, and its usage is discouraged.
*
* Whenever possible, use {safeIncreaseAllowance} and
* {safeDecreaseAllowance} instead.
*/
function safeApprove(
IERC20 token,
address spender,
uint256 value
) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
require(
(value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
uint256 newAllowance = token.allowance(address(this), spender) + value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
uint256 newAllowance = oldAllowance - value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
if (returndata.length > 0) {
// Return data is optional
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
@openzeppelin/contracts/utils/Address.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @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
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
assembly {
size := extcodesize(account)
}
return size > 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://diligence.consensys.net/posts/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.5.11/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 functionCall(target, data, "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");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResult(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) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResult(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) {
require(isContract(target), "Address: delegate call to non-contract");
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason 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 {
// 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
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
@openzeppelin/contracts/utils/Context.sol
// SPDX-License-Identifier: MIT
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;
}
}
@openzeppelin/contracts/utils/math/SafeMath.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.
/**
* @dev Wrappers over Solidity's arithmetic operations.
*
* NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler
* now has built in overflow checking.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the substraction of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b > a) return (false, 0);
return (true, a - b);
}
}
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the division of two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a / b);
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a % b);
}
}
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
return a + b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return a - b;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
return a * b;
}
/**
* @dev Returns the integer division of two unsigned integers, reverting on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator.
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return a / b;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return a % b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {trySub}.
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b <= a, errorMessage);
return a - b;
}
}
/**
* @dev Returns the integer division of two unsigned integers, reverting with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a / b;
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting with custom message when dividing by zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryMod}.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a % b;
}
}
}
contracts/factory/IDOPool.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "./IUniswapV2Router02.sol";
import "./IUniswapV2Factory.sol";
import "./TokenLockerFactory.sol";
contract IDOPool is Ownable, ReentrancyGuard {
using SafeMath for uint256;
using SafeERC20 for ERC20;
struct FinInfo {
uint256 tokenPrice; // one token in WEI
uint256 softCap;
uint256 hardCap;
uint256 minEthPayment;
uint256 maxEthPayment;
uint256 listingPrice; // one token in WEI
uint256 lpInterestRate;
}
struct Timestamps {
uint256 startTimestamp;
uint256 endTimestamp;
uint256 unlockTimestamp;
}
struct DEXInfo {
address router;
address factory;
address weth;
}
struct UserInfo {
uint debt;
uint total;
uint totalInvestedETH;
}
ERC20 public rewardToken;
uint256 public decimals;
string public metadataURL;
FinInfo public finInfo;
Timestamps public timestamps;
DEXInfo public dexInfo;
TokenLockerFactory public lockerFactory;
uint256 public totalInvestedETH;
uint256 public tokensForDistribution;
uint256 public distributedTokens;
bool public distributed = false;
mapping(address => UserInfo) public userInfo;
event TokensDebt(
address indexed holder,
uint256 ethAmount,
uint256 tokenAmount
);
event TokensWithdrawn(address indexed holder, uint256 amount);
// Events for detailed parameter logging
event AddLiquidityETHParams(
address token, // Token address
uint256 amountToken, // Token amount
uint256 amountETH, // ETH amount
uint256 amountTokenMin, // Minimum token amount (slippage protection)
uint256 amountETHMin, // Minimum ETH amount (slippage protection)
address to, // LP token recipient
uint256 deadline // Transaction deadline
);
event TokenLockerParams(
address lpToken, // LP token address
string lockerName, // Locker name
uint256 amount, // Amount to lock
address owner, // Locker owner
uint256 unlockTime, // Unlock timestamp
uint256 value // ETH value sent for fee
);
event ETHTransferParams(
address to, // Recipient address
uint256 amount, // Amount to transfer
bool isLockFee // Whether it's a lock fee
);
// Debug parameters event
event DebugParams(
string label, // Parameter label for identification
uint256 value1, // Primary value
uint256 value2, // Secondary value
address addr1, // Primary address
address addr2 // Secondary address
);
constructor(
ERC20 _rewardToken,
FinInfo memory _finInfo,
Timestamps memory _timestamps,
DEXInfo memory _dexInfo,
address _lockerFactoryAddress,
string memory _metadataURL
) {
rewardToken = _rewardToken;
decimals = rewardToken.decimals();
lockerFactory = TokenLockerFactory(_lockerFactoryAddress);
finInfo = _finInfo;
setTimestamps(_timestamps);
dexInfo = _dexInfo;
setMetadataURL(_metadataURL);
}
function setTimestamps(Timestamps memory _timestamps) internal {
require(
_timestamps.startTimestamp < _timestamps.endTimestamp,
"Start timestamp must be less than finish timestamp"
);
require(
_timestamps.endTimestamp > block.timestamp,
"Finish timestamp must be more than current block"
);
timestamps = _timestamps;
}
function setMetadataURL(string memory _metadataURL) public{
metadataURL = _metadataURL;
}
function pay() payable external {
require(block.timestamp >= timestamps.startTimestamp, "Not started");
require(block.timestamp < timestamps.endTimestamp, "Ended");
require(msg.value >= finInfo.minEthPayment, "Less then min amount");
require(msg.value <= finInfo.maxEthPayment, "More then max amount");
require(totalInvestedETH.add(msg.value) <= finInfo.hardCap, "Overfilled");
UserInfo storage user = userInfo[msg.sender];
require(user.totalInvestedETH.add(msg.value) <= finInfo.maxEthPayment, "More then max amount");
uint256 tokenAmount = getTokenAmount(msg.value, finInfo.tokenPrice);
totalInvestedETH = totalInvestedETH.add(msg.value);
tokensForDistribution = tokensForDistribution.add(tokenAmount);
user.totalInvestedETH = user.totalInvestedETH.add(msg.value);
user.total = user.total.add(tokenAmount);
user.debt = user.debt.add(tokenAmount);
emit TokensDebt(msg.sender, msg.value, tokenAmount);
}
function refund() external {
require(block.timestamp > timestamps.endTimestamp, "The IDO pool has not ended.");
require(totalInvestedETH < finInfo.softCap, "The IDO pool has reach soft cap.");
UserInfo storage user = userInfo[msg.sender];
uint256 _amount = user.totalInvestedETH;
require(_amount > 0 , "You have no investment.");
user.debt = 0;
user.totalInvestedETH = 0;
user.total = 0;
(bool success, ) = msg.sender.call{value: _amount}("");
require(success, "Transfer failed.");
}
/// @dev Allows to claim tokens for the specific user.
/// @param _user Token receiver.
function claimFor(address _user) external {
proccessClaim(_user);
}
/// @dev Allows to claim tokens for themselves.
function claim() external {
proccessClaim(msg.sender);
}
/// @dev Proccess the claim.
/// @param _receiver Token receiver.
function proccessClaim(
address _receiver
) internal nonReentrant{
require(block.timestamp > timestamps.endTimestamp, "The IDO pool has not ended.");
require(totalInvestedETH >= finInfo.softCap, "The IDO pool did not reach soft cap.");
UserInfo storage user = userInfo[_receiver];
uint256 _amount = user.debt;
require(_amount > 0 , "You do not have debt tokens.");
user.debt = 0;
distributedTokens = distributedTokens.add(_amount);
rewardToken.safeTransfer(_receiver, _amount);
emit TokensWithdrawn(_receiver,_amount);
}
// /**
// * @dev Debug version of withdrawETH that logs all parameters without actual external calls
// * Records exact parameters that would be passed to addLiquidityETH
// */
// function withdrawETHDebug() external payable onlyOwner {
// // Check prerequisites
// require(block.timestamp > timestamps.endTimestamp, "The IDO pool has not ended.");
// require(totalInvestedETH >= finInfo.softCap, "The IDO pool did not reach soft cap.");
// require(!distributed, "Already distributed.");
// // Record initial state
// emit DebugParams(
// "Initial State",
// address(this).balance, // Contract ETH balance
// rewardToken.balanceOf(address(this)), // Contract token balance
// address(0),
// address(0)
// );
// // Record address information
// emit DebugParams(
// "Contract Addresses",
// 0,
// 0,
// dexInfo.router, // Router address
// dexInfo.factory // Factory address
// );
// emit DebugParams(
// "Token Addresses",
// 0,
// 0,
// dexInfo.weth, // WETH address
// address(rewardToken) // Reward token address
// );
// emit DebugParams(
// "Control Addresses",
// 0,
// 0,
// owner(), // Contract owner
// msg.sender // Function caller
// );
// // Record timestamps
// emit DebugParams(
// "Timestamps",
// timestamps.startTimestamp, // Start time
// timestamps.endTimestamp, // End time
// address(0),
// address(0)
// );
// emit DebugParams(
// "More Timestamps",
// timestamps.unlockTimestamp, // Unlock time
// block.timestamp, // Current time
// address(0),
// address(0)
// );
// // Record financial parameters
// emit DebugParams(
// "Financial Info",
// finInfo.tokenPrice, // Token price in wei
// finInfo.listingPrice, // Listing price in wei
// address(0),
// address(0)
// );
// emit DebugParams(
// "Cap Info",
// finInfo.softCap, // Soft cap
// finInfo.hardCap, // Hard cap
// address(0),
// address(0)
// );
// emit DebugParams(
// "LP Rate",
// finInfo.lpInterestRate, // LP interest rate percentage
// totalInvestedETH, // Total invested ETH
// address(0),
// address(0)
// );
// // Calculate ETH allocation
// uint256 balance = address(this).balance;
// // Liquidity-related logic
// if (finInfo.lpInterestRate > 0 && finInfo.listingPrice > 0) {
// // Subtract msg.value (for locker fee)
// balance -= msg.value;
// // Calculate ETH for LP and ETH to withdraw
// uint256 ethForLP = (balance * finInfo.lpInterestRate) / 100;
// uint256 ethWithdraw = balance - ethForLP;
// // Calculate token amount needed for LP
// uint256 tokenAmount = getTokenAmount(ethForLP, finInfo.listingPrice);
// // Record calculated values
// emit DebugParams(
// "LP Calculation",
// ethForLP, // ETH for liquidity
// ethWithdraw, // ETH to withdraw
// address(0),
// address(0)
// );
// emit DebugParams(
// "Token Calculation",
// tokenAmount, // Token amount for LP
// msg.value, // Fee amount
// address(0),
// address(0)
// );
// // Check token allowance before approval
// uint256 allowanceBefore = rewardToken.allowance(address(this), dexInfo.router);
// emit DebugParams(
// "Allowance Before",
// allowanceBefore, // Current allowance
// 0,
// dexInfo.router, // Router address
// address(0)
// );
// distributed = true;
// // Record expected parameters for addLiquidityETH
// emit AddLiquidityETHParams(
// address(rewardToken), // Token address
// tokenAmount, // Token amount
// ethForLP, // ETH amount
// 0, // Minimum token amount (0 = no slippage protection)
// 0, // Minimum ETH amount (0 = no slippage protection)
// address(this), // LP token recipient
// block.timestamp + 360 // Deadline (6 minutes)
// );
// // Check if LP locking is needed
// bool needsLock = timestamps.unlockTimestamp > block.timestamp;
// emit DebugParams(
// "LP Lock Status",
// needsLock ? 1 : 0, // Whether locking is needed
// timestamps.unlockTimestamp, // Unlock timestamp
// address(0),
// address(0)
// );
// // Try to get pair address if it exists
// try IUniswapV2Factory(dexInfo.factory).getPair(address(rewardToken), dexInfo.weth) returns (address pair) {
// emit DebugParams(
// "Existing Pair",
// pair != address(0) ? 1 : 0, // Whether pair exists
// 0,
// pair, // Pair address
// address(0)
// );
// } catch {
// emit DebugParams(
// "Pair Check Failed",
// 0,
// 0,
// address(0),
// address(0)
// );
// }
// // Simulate LP token handling with mock liquidity
// uint256 mockLiquidity = 1000; // Example value
// if (needsLock) {
// // Record locker parameters
// emit TokenLockerParams(
// address(0), // LP token address (unknown yet)
// "LP Token Locker", // Locker name
// mockLiquidity, // LP amount (mock)
// msg.sender, // Owner
// timestamps.unlockTimestamp, // Unlock time
// msg.value // Fee amount
// );
// // Record ETH transfer parameters
// emit ETHTransferParams(
// msg.sender, // Recipient
// ethWithdraw, // Amount
// true // Is lock fee
// );
// } else {
// // Record LP token transfer (without locking)
// emit DebugParams(
// "LP Transfer",
// mockLiquidity, // LP amount (mock)
// 0,
// msg.sender, // Recipient
// address(0)
// );
// // Record ETH transfer parameters
// emit ETHTransferParams(
// msg.sender, // Recipient
// ethWithdraw + msg.value, // Amount (including msg.value)
// false // Not a lock fee
// );
// }
// } else {
// // If no liquidity addition, record direct ETH transfer
// emit ETHTransferParams(
// msg.sender, // Recipient
// balance, // Full balance
// false // Not a lock fee
// );
// }
// // Record gas information
// emit DebugParams(
// "Gas Info",
// gasleft(), // Remaining gas
// block.gaslimit, // Block gas limit
// address(0),
// address(0)
// );
// }
function withdrawETH() external payable onlyOwner {
require(block.timestamp > timestamps.endTimestamp, "The IDO pool has not ended.");
require(totalInvestedETH >= finInfo.softCap, "The IDO pool did not reach soft cap.");
require(!distributed, "Already distributed.");
// This forwards all available gas. Be sure to check the return value!
uint256 balance = address(this).balance;
if ( finInfo.lpInterestRate > 0 && finInfo.listingPrice > 0 ) {
// if TokenLockerFactory has fee we should provide there fee by msg.value and sub it from balance for correct execution
balance -= msg.value;
uint256 ethForLP = (balance * finInfo.lpInterestRate)/100;
uint256 ethWithdraw = balance - ethForLP;
uint256 tokenAmount = getTokenAmount(ethForLP, finInfo.listingPrice);
// Add Liquidity ETH
IUniswapV2Router02 uniswapRouter = IUniswapV2Router02(dexInfo.router);
rewardToken.approve(address(uniswapRouter), tokenAmount);
// (,, uint liquidity) = uniswapRouter.addLiquidityETH{value: ethForLP}(
// address(rewardToken),
// tokenAmount,
// 0, // slippage is unavoidable
// 0, // slippage is unavoidable
// address(this),
// block.timestamp + 360
// );
uint256 liquidity = 0;
emit AddLiquidityETHParams(
address(rewardToken), // Token address
tokenAmount, // Token amount
ethForLP, // ETH amount
0, // Minimum token amount (0 = no slippage protection)
0, // Minimum ETH amount (0 = no slippage protection)
address(this), // LP token recipient
block.timestamp + 360 // Deadline (6 minutes)
);
// Lock LP Tokens
(address lpTokenAddress) = IUniswapV2Factory(dexInfo.factory).getPair(address(rewardToken), dexInfo.weth);
ERC20 lpToken = ERC20(lpTokenAddress);
if (timestamps.unlockTimestamp > block.timestamp) {
lpToken.approve(address(lockerFactory), liquidity);
lockerFactory.createLocker{value: msg.value}(
lpToken,
string.concat(lpToken.symbol(), " tokens locker"),
liquidity, msg.sender, timestamps.unlockTimestamp
);
} else {
lpToken.transfer(msg.sender, liquidity);
// return msg.value along with eth to output if someone sent it wrong
ethWithdraw += msg.value;
}
// Withdraw rest ETH
(bool success, ) = msg.sender.call{value: ethWithdraw}("");
require(success, "Transfer failed.");
} else {
(bool success, ) = msg.sender.call{value: balance}("");
require(success, "Transfer failed.");
}
distributed = true;
}
function withdrawNotSoldTokens() external onlyOwner {
require(distributed, "Withdraw allowed after distributed.");
uint256 balance = getNotSoldToken();
require(balance > 0, "The IDO pool has not unsold tokens.");
rewardToken.safeTransfer(msg.sender, balance);
}
function getNotSoldToken() public view returns(uint256){
uint256 balance = rewardToken.balanceOf(address(this));
return balance.add(distributedTokens).sub(tokensForDistribution);
}
function refundTokens() external onlyOwner {
require(block.timestamp > timestamps.endTimestamp, "The IDO pool has not ended.");
require(totalInvestedETH < finInfo.softCap, "The IDO pool has reach soft cap.");
uint256 balance = rewardToken.balanceOf(address(this));
require(balance > 0, "The IDO pool has not refund tokens.");
rewardToken.safeTransfer(msg.sender, balance);
}
function getTokenAmount(uint256 ethAmount, uint256 oneTokenInWei)
internal
view
returns (uint256)
{
return (ethAmount / oneTokenInWei) * 10**decimals;
}
/**
* @notice It allows the owner to recover wrong tokens sent to the contract
* @param _tokenAddress: the address of the token to withdraw with the exception of rewardToken
* @param _tokenAmount: the number of token amount to withdraw
* @dev Only callable by owner.
*/
function recoverWrongTokens(address _tokenAddress, uint256 _tokenAmount) external onlyOwner {
require(_tokenAddress != address(rewardToken));
ERC20(_tokenAddress).safeTransfer(address(msg.sender), _tokenAmount);
}
}
contracts/factory/IUniswapV2Factory.sol
pragma solidity >=0.5.0;
interface IUniswapV2Factory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
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(uint) external view returns (address pair);
function allPairsLength() external view returns (uint);
function createPair(address tokenA, address tokenB) external returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
}
contracts/factory/IUniswapV2Router01.sol
pragma solidity >=0.6.2;
interface IUniswapV2Router01 {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidity(
address tokenA,
address tokenB,
uint amountADesired,
uint amountBDesired,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB, uint liquidity);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
function removeLiquidity(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB);
function removeLiquidityETH(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountToken, uint amountETH);
function removeLiquidityWithPermit(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountA, uint amountB);
function removeLiquidityETHWithPermit(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountToken, uint amountETH);
function swapExactTokensForTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapTokensForExactTokens(
uint amountOut,
uint amountInMax,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}
contracts/factory/IUniswapV2Router02.sol
pragma solidity >=0.6.2;
import './IUniswapV2Router01.sol';
interface IUniswapV2Router02 is IUniswapV2Router01 {
function removeLiquidityETHSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountETH);
function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountETH);
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external payable;
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
}
contracts/factory/TokenLocker.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
contract TokenLocker is Ownable {
using SafeMath for uint256;
using SafeERC20 for ERC20;
ERC20 public token;
address public withdrawer;
uint256 public withdrawTime;
string public name;
event withdrawTokenEvent(uint256 timestamp, uint256 amount);
constructor(
ERC20 _token,
string memory _name,
address _withdrawer,
uint256 _withdrawTime
){
require(_withdrawTime > block.timestamp, "withdraw time should be more than now");
token = _token;
name = _name;
withdrawer = _withdrawer;
withdrawTime = _withdrawTime;
}
function _processWithdraw(uint256 amount) internal {
require(msg.sender == withdrawer, "You are not withdrawer");
require(block.timestamp > withdrawTime, "Not time yet");
token.safeTransfer(msg.sender, amount);
emit withdrawTokenEvent(block.timestamp, amount);
}
function withdrawToken(uint256 amount) public {
require(amount <= token.balanceOf(address(this)), "Withdraw amount exceeds balance");
_processWithdraw(amount);
}
function withdrawTokenAll() public {
uint256 amount = token.balanceOf(address(this));
_processWithdraw(amount);
}
function tokenRemaining() public view returns(uint256){
return token.balanceOf(address(this));
}
}
contracts/factory/TokenLockerFactory.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "./TokenLocker.sol";
contract TokenLockerFactory is Ownable {
using SafeMath for uint256;
using SafeERC20 for ERC20;
uint256 public lockerCount = 0;
uint256 public fee = 0;
struct lockerInfo {
uint256 lockerId;
address tokenAddress;
address creator;
uint256 ramaining;
address withdrawer;
uint256 withdrawTime;
}
address[] public lockerAddresses;
mapping(address => address[]) public creatorLockers;
mapping(address => address[]) public tokenLockers;
event LockerCreated(uint256 lockerId, address indexed lockerAddress, address tokenAddress);
event FeeUpdated(uint256 oldFee, uint256 newFee);
constructor(){}
function getLockerAddresses() public view returns (address[] memory) {
return lockerAddresses;
}
function createLocker(
ERC20 _tokenAddress,
string memory _name,
uint256 _lockAmount,
address _withdrawer,
uint256 _withdrawTime
) payable public returns(address){
require(msg.value == fee, 'Fee amount is required');
require(_lockAmount > 0, 'Lock amount must be greater than 0');
require(_withdrawer != address(0), 'Withdrawer cannot be zero address');
TokenLocker tokenLocker = new TokenLocker(_tokenAddress, _name, _withdrawer, _withdrawTime);
tokenLocker.transferOwnership(msg.sender);
_tokenAddress.safeTransferFrom(
msg.sender,
address(tokenLocker),
_lockAmount
);
lockerAddresses.push(address(tokenLocker));
creatorLockers[msg.sender].push(address(tokenLocker));
tokenLockers[address(_tokenAddress)].push(address(tokenLocker));
emit LockerCreated(lockerCount, address(tokenLocker), address(_tokenAddress));
lockerCount++;
return address(tokenLocker);
}
function withdrawFee() public onlyOwner{
(bool success, ) = msg.sender.call{value: address(this).balance}("");
require(success, "Transfer failed.");
}
function setFee(uint256 amount) public onlyOwner{
uint256 oldFee = fee;
fee = amount;
emit FeeUpdated(oldFee, amount);
}
function getLockersByCreator(address creator) public view returns (address[] memory) {
return creatorLockers[creator];
}
function getLockersByToken(address tokenAddress) public view returns (address[] memory) {
return tokenLockers[tokenAddress];
}
}
Compiler Settings
{"viaIR":true,"outputSelection":{"*":{"*":["abi","evm.bytecode","evm.deployedBytecode","evm.methodIdentifiers","metadata"],"":["ast"]}},"optimizer":{"runs":100,"enabled":true},"metadata":{"bytecodeHash":"none"},"libraries":{}}
Contract ABI
[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"_feeToken","internalType":"contract ERC20Burnable"},{"type":"uint256","name":"_feeAmount","internalType":"uint256"},{"type":"uint256","name":"_burnPercent","internalType":"uint256"}]},{"type":"event","name":"BurnPercentUpdated","inputs":[{"type":"uint256","name":"newBurnPercent","internalType":"uint256","indexed":false},{"type":"uint256","name":"divider","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"FeeAmountUpdated","inputs":[{"type":"uint256","name":"newFeeAmount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"FeeWalletUpdated","inputs":[{"type":"address","name":"newFeeWallet","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"IDOCreated","inputs":[{"type":"address","name":"owner","internalType":"address","indexed":true},{"type":"address","name":"idoPool","internalType":"address","indexed":false},{"type":"address","name":"rewardToken","internalType":"address","indexed":true},{"type":"string","name":"tokenURI","internalType":"string","indexed":false}],"anonymous":false},{"type":"event","name":"IDOCreatedByHelper","inputs":[{"type":"address","name":"owner","internalType":"address","indexed":true},{"type":"address","name":"idoPool","internalType":"address","indexed":false},{"type":"address","name":"rewardToken","internalType":"address","indexed":true},{"type":"string","name":"tokenURI","internalType":"string","indexed":false},{"type":"uint256","name":"idoTokenAmount","internalType":"uint256","indexed":false},{"type":"uint256","name":"lpTokenAmount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"IDOPoolInitialized","inputs":[{"type":"address","name":"idoPool","internalType":"address","indexed":true},{"type":"address","name":"rewardToken","internalType":"address","indexed":true},{"type":"tuple","name":"finInfo","internalType":"struct IDOPool.FinInfo","indexed":false,"components":[{"type":"uint256","name":"tokenPrice","internalType":"uint256"},{"type":"uint256","name":"softCap","internalType":"uint256"},{"type":"uint256","name":"hardCap","internalType":"uint256"},{"type":"uint256","name":"minEthPayment","internalType":"uint256"},{"type":"uint256","name":"maxEthPayment","internalType":"uint256"},{"type":"uint256","name":"listingPrice","internalType":"uint256"},{"type":"uint256","name":"lpInterestRate","internalType":"uint256"}]},{"type":"tuple","name":"timestamps","internalType":"struct IDOPool.Timestamps","indexed":false,"components":[{"type":"uint256","name":"startTimestamp","internalType":"uint256"},{"type":"uint256","name":"endTimestamp","internalType":"uint256"},{"type":"uint256","name":"unlockTimestamp","internalType":"uint256"}]},{"type":"tuple","name":"dexInfo","internalType":"struct IDOPool.DEXInfo","indexed":false,"components":[{"type":"address","name":"router","internalType":"address"},{"type":"address","name":"factory","internalType":"address"},{"type":"address","name":"weth","internalType":"address"}]},{"type":"address","name":"lockerFactory","internalType":"address","indexed":false},{"type":"string","name":"metadataURL","internalType":"string","indexed":false}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"TokenFeeUpdated","inputs":[{"type":"address","name":"newFeeToken","internalType":"address","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"burnPercent","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"address","name":"idoPoolAddress","internalType":"address"}],"name":"createIDO","inputs":[{"type":"address","name":"_rewardToken","internalType":"contract ERC20"},{"type":"tuple","name":"_finInfo","internalType":"struct IDOPool.FinInfo","components":[{"type":"uint256","name":"tokenPrice","internalType":"uint256"},{"type":"uint256","name":"softCap","internalType":"uint256"},{"type":"uint256","name":"hardCap","internalType":"uint256"},{"type":"uint256","name":"minEthPayment","internalType":"uint256"},{"type":"uint256","name":"maxEthPayment","internalType":"uint256"},{"type":"uint256","name":"listingPrice","internalType":"uint256"},{"type":"uint256","name":"lpInterestRate","internalType":"uint256"}]},{"type":"tuple","name":"_timestamps","internalType":"struct IDOPool.Timestamps","components":[{"type":"uint256","name":"startTimestamp","internalType":"uint256"},{"type":"uint256","name":"endTimestamp","internalType":"uint256"},{"type":"uint256","name":"unlockTimestamp","internalType":"uint256"}]},{"type":"tuple","name":"_dexInfo","internalType":"struct IDOPool.DEXInfo","components":[{"type":"address","name":"router","internalType":"address"},{"type":"address","name":"factory","internalType":"address"},{"type":"address","name":"weth","internalType":"address"}]},{"type":"address","name":"_lockerFactoryAddress","internalType":"address"},{"type":"string","name":"_metadataURL","internalType":"string"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"address","name":"idoPoolAddress","internalType":"address"}],"name":"createIDOByHelper","inputs":[{"type":"address","name":"_rewardToken","internalType":"contract ERC20"},{"type":"tuple","name":"_finInfo","internalType":"struct IDOPool.FinInfo","components":[{"type":"uint256","name":"tokenPrice","internalType":"uint256"},{"type":"uint256","name":"softCap","internalType":"uint256"},{"type":"uint256","name":"hardCap","internalType":"uint256"},{"type":"uint256","name":"minEthPayment","internalType":"uint256"},{"type":"uint256","name":"maxEthPayment","internalType":"uint256"},{"type":"uint256","name":"listingPrice","internalType":"uint256"},{"type":"uint256","name":"lpInterestRate","internalType":"uint256"}]},{"type":"tuple","name":"_timestamps","internalType":"struct IDOPool.Timestamps","components":[{"type":"uint256","name":"startTimestamp","internalType":"uint256"},{"type":"uint256","name":"endTimestamp","internalType":"uint256"},{"type":"uint256","name":"unlockTimestamp","internalType":"uint256"}]},{"type":"tuple","name":"_dexInfo","internalType":"struct IDOPool.DEXInfo","components":[{"type":"address","name":"router","internalType":"address"},{"type":"address","name":"factory","internalType":"address"},{"type":"address","name":"weth","internalType":"address"}]},{"type":"address","name":"_lockerFactoryAddress","internalType":"address"},{"type":"string","name":"_metadataURL","internalType":"string"},{"type":"uint256","name":"idoTokenAmount","internalType":"uint256"},{"type":"uint256","name":"lpTokenAmount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"divider","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"feeAmount","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract ERC20Burnable"}],"name":"feeToken","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"feeWallet","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address[]","name":"","internalType":"address[]"}],"name":"getIdoPools","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"idoPools","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setBurnPercent","inputs":[{"type":"uint256","name":"_newBurnPercent","internalType":"uint256"},{"type":"uint256","name":"_newDivider","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setFeeAmount","inputs":[{"type":"uint256","name":"_newFeeAmount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setFeeToken","inputs":[{"type":"address","name":"_newFeeToken","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setFeeWallet","inputs":[{"type":"address","name":"_newFeeWallet","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]}]
Contract Creation Code
0x6080346100be57601f61572e38819003918201601f19168301916001600160401b038311848410176100c3578084926060946040528339810103126100be5780516001600160a01b0391828216918290036100be57604060208201519101519160005460018060a01b0319903382821617600055604051953391167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a36001541617600155600355600455606460055561565490816100da8239f35b600080fd5b634e487b7160e01b600052604160045260246000fdfe608060405260043610156200001357600080fd5b60003560e01c806301202f41146200013757806303807ee5146200013157806315cce224146200012b57806337491a911462000125578063378efa37146200011f578063647846a5146200011957806369e1540414620001135780636a1860e2146200010d5780636b39268014620001075780637104c9fd1462000101578063715018a614620000fb5780638da5cb5b14620000f55780638dc1299114620000ef57806390d49b9d14620000e9578063f25f4b5614620000e35763f2fde38b14620000dd57600080fd5b62000c87565b62000c5c565b62000be1565b62000b1b565b62000af0565b62000a8d565b62000a2f565b620009d2565b6200091e565b620008fe565b620008d3565b620008b3565b6200064e565b62000570565b62000550565b62000356565b6001600160a01b038116036200014f57565b600080fd5b634e487b7160e01b600052604160045260246000fd5b606081019081106001600160401b038211176200018657604052565b62000154565b6001600160401b0381116200018657604052565b60a081019081106001600160401b038211176200018657604052565b604081019081106001600160401b038211176200018657604052565b90601f801991011681019081106001600160401b038211176200018657604052565b60e09060231901126200014f576040519060e082018281106001600160401b03821117620001865760405281602435815260443560208201526064356040820152608435606082015260a435608082015260c43560a082015260c060e435910152565b6060906101031901126200014f57604051906200027a826200016a565b610104358252610124356020830152610144356040830152565b6060906101631901126200014f5760405190620002b1826200016a565b8161016435620002c1816200013d565b815261018435620002d2816200013d565b602082015260406101a43591620002e9836200013d565b0152565b6001600160401b0381116200018657601f01601f191660200190565b81601f820112156200014f578035906200032382620002ed565b92620003336040519485620001d8565b828452602083830101116200014f57816000926020809301838601378301015290565b346200014f576102403660031901126200014f5760043562000378816200013d565b6200038336620001fa565b6200038e366200025d565b906200039a3662000294565b926101c43591620003ab836200013d565b6001600160401b03946101e4358681116200014f57620003d090369060040162000309565b92610204359261022435976040519061210e808301918383109083111762000186578789878c878988976200040b976200142c8a3962000e42565b03906000f09687156200053e577f6006912f3f9fa856c9c91fc76c0608abd71c7b44e038dd7598f1117bd4c6aa83916200045d8760018060a01b03809b169a8b9616998a976040519586958662001342565b0390a36200046c858262000f52565b94843b156200014f5760405163f2fde38b60e01b815233600482015291600083602481838a5af180156200053e576200051c977fbb1e34963a7cf74028f70419838711c854e9716294c07397f076ff3ec10e04bb94620004d69262000520575b5087338862001000565b620004e18662000f60565b620004f560405192839233968985620013cd565b0390a3620005026200121b565b6040516001600160a01b0390911681529081906020820190565b0390f35b806200053062000537926200018c565b8062000544565b38620004cc565b62000eda565b60009103126200014f57565b346200014f5760003660031901126200014f576020600454604051908152f35b346200014f5760203660031901126200014f5760043562000591816200013d565b6000546001600160a01b0390620005ac908216331462000d2c565b63ffffffff823b16156200060957600180546001600160a01b0319169183169190911790556040516001600160a01b0390911681527f9e892f555b0a5cac6c8cc33c82ebb9308207bd16dfdca9d0289b96d7e4186c8a90602090a1005b60405162461bcd60e51b815260206004820152601a60248201527f4e65772061646472657373206973206e6f74206120746f6b656e0000000000006044820152606490fd5b346200014f576102003660031901126200014f5760043562000670816200013d565b6200067b36620001fa565b62000686366200025d565b91620006923662000294565b906101c43593620006a3856200013d565b6001600160401b03906101e4358281116200014f57620006c890369060040162000309565b9160409485519761210e91828a01938a851090851117620001865789948988620006fa9689966200353a8a3962000e42565b0360009586f09182156200053e57835163313ce56760e01b81526001600160a01b039182169390602081600481885afa9081156200053e5788916200087e575b50858701966200074f82895183519062001402565b9760c0820151908115158062000870575b6200082e575b505050501693843b156200082a57835163f2fde38b60e01b8152336004820152958660248183895af19081156200053e576200051c96620007b19262000813575b5085338562001000565b620007bc8462000f60565b7ff71c11ab5bd622b01d634c5c9e59846d77ee252871f11645b7b8376ddd4dd3e2835180620007ee3394888362000fdc565b0390a3620007fb6200121b565b516001600160a01b0390911681529081906020820190565b806200053062000823926200018c565b38620007a7565b8580fd5b9160a0620008546200084d62000865979c96946200085e965162000f17565b6064900490565b9101519062001402565b9062000f52565b943880808062000766565b5060a0830151151562000760565b620008a4915060203d8111620008ab575b6200089b8183620001d8565b81019062000ee6565b386200073a565b503d6200088f565b346200014f5760003660031901126200014f576020600554604051908152f35b346200014f5760003660031901126200014f576001546040516001600160a01b039091168152602090f35b346200014f5760003660031901126200014f576020600354604051908152f35b346200014f57600080600319360112620009cf57604051809160065490818352602080930180926006835284832090835b818110620009b1575050508462000968910385620001d8565b60405193838594850191818652518092526040850193925b8281106200099057505050500390f35b83516001600160a01b03168552869550938101939281019260010162000980565b82546001600160a01b0316845292860192600192830192016200094f565b80fd5b346200014f5760203660031901126200014f577fbb128cd9921d003aff00ed910fe24b1655b2bf1f4a2090cc3523f61bdc172316602060043562000a2260018060a01b0360005416331462000d2c565b80600355604051908152a1005b346200014f5760203660031901126200014f576004356006548110156200014f5760066000527ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f01546040516001600160a01b039091168152602090f35b346200014f57600080600319360112620009cf57805481906001600160a01b0381169062000abd33831462000d2c565b6001600160a01b03191682557f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b346200014f5760003660031901126200014f576000546040516001600160a01b039091168152602090f35b346200014f5760403660031901126200014f5760043560243562000b4b60018060a01b0360005416331462000d2c565b80821162000b8d57816040917fb62d69c6ddf4f4bd443dca17ea7405d8018efb872e82e77bb8ef13b5be2f2e9c936004558060055582519182526020820152a1005b60405162461bcd60e51b815260206004820152602660248201527f4275726e2070657263656e74206d757374206265206c657373207468616e206460448201526534bb34b232b960d11b6064820152608490fd5b346200014f5760203660031901126200014f577f29acee77dafcfa0143d74a7ea236018f3a6e1fa71e27fc59bbfbc6b8ca8edccd602060043562000c25816200013d565b6000546001600160a01b03919062000c41908316331462000d2c565b168060018060a01b03196002541617600255604051908152a1005b346200014f5760003660031901126200014f576002546040516001600160a01b039091168152602090f35b346200014f5760203660031901126200014f5760043562000ca8816200013d565b6000546001600160a01b039062000cc3908216331462000d2c565b81161562000cd85762000cd69062000d78565b005b60405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608490fd5b1562000d3457565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b600080546001600160a01b039283166001600160a01b03198216811783559216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a3565b60c08091805184526020810151602085015260408101516040850152606081015160608501526080810151608085015260a081015160a08501520151910152565b919082519283825260005b84811062000e2d575050826000602080949584010152601f8019910116010190565b60208183018101518483018201520162000e0b565b9362000e8e62000ebd929462000e6f62000ed799989560018060a01b038098168952602089019062000dbf565b8051610100880152602081015161012088015260400151610140870152565b80516001600160a01b0390811661016087015260208201518116610180870152604090910151166101a0850152565b166101c082015261020090816101e0820152019062000e00565b90565b6040513d6000823e3d90fd5b908160209103126200014f575160ff811681036200014f5790565b634e487b7160e01b600052601160045260246000fd5b8181029291811591840414171562000f2b57565b62000f01565b811562000f3c570490565b634e487b7160e01b600052601260045260246000fd5b9190820180921162000f2b57565b600654600160401b8110156200018657600181018060065581101562000fc65760066000527ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f0180546001600160a01b0319166001600160a01b03909216919091179055565b634e487b7160e01b600052603260045260246000fd5b6001600160a01b03909116815260406020820181905262000ed79291019062000e00565b6040516323b872dd60e01b602082019081526001600160a01b0393841660248301529383166044820152606480820195909552938452620010ab939260009283926200104c86620001a0565b169082604051956200105e87620001bc565b602087527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564602088015262001096843b151562001151565b51925af1620010a46200119e565b90620011d3565b805180620010b7575050565b81602080620010cf93620010d59501019101620010d7565b620010f1565b565b908160209103126200014f575180151581036200014f5790565b15620010f957565b60405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608490fd5b156200115957565b60405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b3d15620011ce573d90620011b282620002ed565b91620011c26040519384620001d8565b82523d6000602084013e565b606090565b90919015620011e0575090565b815115620011f15750805190602001fd5b60405162461bcd60e51b8152602060048201529081906200121790602483019062000e00565b0390fd5b60035480620012275750565b600454156200130257506003546200129b620012546200124a6004548462000f17565b6005549062000f31565b60015490929062001275906001600160a01b03165b6001600160a01b031690565b600254909190620012929085906001600160a01b03169262001334565b91339062001000565b600154620012b2906001600160a01b031662001269565b803b156200014f5760405163079cc67960e41b815233600482015260248101929092526000908290604490829084905af180156200053e57620012f25750565b8062000530620010d5926200018c565b600154620010d591906200131f906001600160a01b031662001269565b6002546001600160a01b031690339062001000565b9190820391821162000f2b57565b926200137c62000ed79695936200135e86620013ab9562000dbf565b805160e0870152602081015161010087015260400151610120860152565b80516001600160a01b039081166101408601526020820151811661016086015260409091015116610180840152565b6001600160a01b03166101a08201526101e06101c08201819052019062000e00565b6001600160a01b03909116815260806020820181905292949392606092620013f89183019062000e00565b9460408201520152565b60ff91620014109162000f31565b911690604d821162000f2b5762000ed791600a0a9062000f1756fe608060405234620005e7576200210e80380380916200002082608062000608565b6080396102008112620005e7576080516001600160a01b0381168103620005e75760e0601f19830112620005e75760405160e081016001600160401b03811182821017620004a357604090815260a08051835260c08051602085015260e05192840192909252610100516060808501919091526101205160808501526101405191840191909152610160519183019190915260ff19840112620005e75760405190620000cc82620005ec565b6101805182526101a05160208301526101c0516040830152606061015f19850112620005e757604051926200010184620005ec565b6200010e6101e06200062c565b84526200011d6102006200062c565b60208501526200012f6102206200062c565b6040850152620001416102406200062c565b610260519091906001600160401b038111620005e75760808701609f82011215620005e7576080810151906001600160401b038211620004a3576040519762000195601f8401601f19166020018a62000608565b82895260800160a08284010111620005e75760005b828110620005ce57505060206000918801015260206000543360018060a01b0319821617600055600460405180948193339060018060a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3600180556016805460ff19169055600280546001600160a01b0319166001600160a01b0392909216918217905563313ce56760e01b82525afa908115620005c25760009162000577575b5060ff16600355601280546001600160a01b0319166001600160a01b03909216919091179055805160055560208082015160065560408201516007556060820151600855608082015160095560a0820151600a5560c09190910151600b55815190820151111562000517576020810151421015620004b9578051600c55602080820151600d55604091820151600e558251600f80546001600160a01b039283166001600160a01b031991821617909155918401516010805491831691841691909117905592909101516011805491909316911617905580516001600160401b038111620004a357600454600181811c9116801562000498575b60208210146200048257601f811162000418575b50602091601f8211600114620003ae57918192600092620003a2575b50508160011b916000199060031b1c1916176004555b604051611acc9081620006428239f35b0151905038806200037c565b601f19821692600460005260206000209160005b858110620003ff57508360019510620003e5575b505050811b0160045562000392565b015160001960f88460031b161c19169055388080620003d6565b91926020600181928685015181550194019201620003c2565b60046000527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b601f830160051c8101916020841062000477575b601f0160051c01905b8181106200046a575062000360565b600081556001016200045b565b909150819062000452565b634e487b7160e01b600052602260045260246000fd5b90607f16906200034c565b634e487b7160e01b600052604160045260246000fd5b60405162461bcd60e51b815260206004820152603060248201527f46696e6973682074696d657374616d70206d757374206265206d6f726520746860448201526f616e2063757272656e7420626c6f636b60801b6064820152608490fd5b60405162461bcd60e51b815260206004820152603260248201527f53746172742074696d657374616d70206d757374206265206c6573732074686160448201527106e2066696e6973682074696d657374616d760741b6064820152608490fd5b6020813d602011620005b9575b81620005936020938362000608565b81010312620005b557519060ff82168203620005b2575060ff62000253565b80fd5b5080fd5b3d915062000584565b6040513d6000823e3d90fd5b80602080928460800101015182828c01015201620001aa565b600080fd5b606081019081106001600160401b03821117620004a357604052565b601f909101601f19168101906001600160401b03821190821017620004a357604052565b51906001600160a01b0382168203620005e75756fe6080604052600436101561001257600080fd5b60003560e01c806312d3675e146101a75780631959a002146101a25780631b9265b81461019d5780632a123b16146101985780632dcc8c6614610193578063313ce5671461018e5780633f138d4b14610189578063491447a8146101845780634b1a4c0c1461017f5780634e71d92d1461017a578063586360ce14610175578063590e1ae31461017057806362bea93f1461016b5780637100750914610166578063715018a614610161578063747daec51461015c5780638da5cb5b14610157578063c6a0e27d14610152578063d8d2a56d1461014d578063ddeae03314610148578063e086e5ec14610143578063f2fde38b1461013e578063f7c618c114610139578063f84b903e146101345763fd46a1711461012f57600080fd5b6111d8565b6111b5565b61118c565b6110f2565b610c81565b610ba8565b610b6b565b610a6e565b610a45565b6109d2565b610957565b610889565b610866565b6107bb565b61079d565b610645565b610627565b6105f5565b6105a0565b610582565b6104a6565b61038e565b610270565b61020e565b346101f85760003660031901126101f85760e060055460065460075460085460095490600a5492600b5494604051968752602087015260408601526060850152608084015260a083015260c0820152f35b600080fd5b6001600160a01b038116036101f857565b346101f85760203660031901126101f85760043561022b816101fd565b60018060a01b031660005260176020526040600020805461026c60026001840154930154604051938493846040919493926060820195825260208201520152565b0390f35b60003660031901126101f85761028a600c544210156113c2565b610297600d5442106113fc565b6102a5600854341015611430565b6009546102b481341115611473565b601354906102cf6102c53484611519565b60075410156114b6565b336000908152601760205260409020906102f960028301916102f2348454611519565b1115611473565b61031861031361030b60055434611a89565b943490611519565b601355565b61032c61032784601454611519565b601455565b610337348254611519565b905560018101610348838254611519565b9055610355828254611519565b905560408051348152602081019290925233917fb55d4ca2fc644ca3f8cdc9c907826e24acd68d2b2d4d73f48b8f2378dbaedf5d9190a2005b346101f85760003660031901126101f8576012546040516001600160a01b039091168152602090f35b90600182811c921680156103e7575b60208310146103d157565b634e487b7160e01b600052602260045260246000fd5b91607f16916103c6565b634e487b7160e01b600052604160045260246000fd5b6040810190811067ffffffffffffffff82111761042357604052565b6103f1565b90601f8019910116810190811067ffffffffffffffff82111761042357604052565b60005b83811061045d5750506000910152565b818101518382015260200161044d565b906020916104868151809281855285808601910161044a565b601f01601f1916010190565b9060206104a392818152019061046d565b90565b346101f85760008060031936011261057f57604051816004546104c8816103b7565b8084529060019081811690811561055757506001146104fe575b61026c846104f281880382610428565b60405191829182610492565b60048352602094507f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b5b828410610544575050508161026c936104f292820101936104e2565b8054858501870152928501928101610528565b61026c96506104f29450602092508593915060ff191682840152151560051b820101936104e2565b80fd5b346101f85760003660031901126101f8576020600354604051908152f35b346101f85760403660031901126101f8576004356105bd816101fd565b6000546001600160a01b03906105d690821633146111f6565b806002541691169081146101f8576105f390602435903390611684565b005b346101f85760003660031901126101f857600c54600d54600e5460408051938452602084019290925290820152606090f35b346101f85760003660031901126101f8576020601454604051908152f35b346101f85760008060031936011261057f57600260015414610758576002600155610673600d544211611526565b610683601354600654111561162c565b3381526017602052604081208054908115610713578290556106af6106aa82601554611519565b601555565b6002546106d990829033906106d4906001600160a01b03165b6001600160a01b031690565b611684565b60405190815233907f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b90602090a261071060018055565b80f35b60405162461bcd60e51b815260206004820152601c60248201527f596f7520646f206e6f742068617665206465627420746f6b656e732e000000006044820152606490fd5b60405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606490fd5b346101f85760003660031901126101f8576020601554604051908152f35b346101f85760008060031936011261057f576107da600d544211611526565b6107e960135460065411611572565b338152601760205260408120600281018054801561082757838080939281600187828097816107109b55550155335af16108216115bd565b506115ed565b60405162461bcd60e51b81526020600482015260176024820152762cb7ba903430bb329037379034b73b32b9ba36b2b73a1760491b6044820152606490fd5b346101f85760003660031901126101f85760206108816119bc565b604051908152f35b346101f85760008060031936011261057f576108af60018060a01b0382541633146111f6565b6108bc600d544211611526565b6108cb60135460065411611572565b6002546108e0906001600160a01b03166106c8565b6040516370a0823160e01b815230600482015290602082602481845afa90811561095257610710928492610922575b5061091b821515611a31565b3390611684565b61094491925060203d811161094b575b61093c8183610428565b8101906119ad565b903861090f565b503d610932565b6118ae565b346101f85760008060031936011261057f57805481906001600160a01b038116906109833383146111f6565b6001600160a01b03191682557f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b67ffffffffffffffff811161042357601f01601f191660200190565b346101f85760203660031901126101f85760043567ffffffffffffffff81116101f857366023820112156101f8578060040135610a0e816109b6565b90610a1c6040519283610428565b80825236602482850101116101f85760208160009260246105f3960183860137830101526112dc565b346101f85760003660031901126101f8576000546040516001600160a01b039091168152602090f35b346101f85760008060031936011261057f57610a9460018060a01b0382541633146111f6565b60ff6016541615610b1a57610aa76119bc565b8015610ac957600254610710919033906106d4906001600160a01b03166106c8565b60405162461bcd60e51b815260206004820152602360248201527f5468652049444f20706f6f6c20686173206e6f7420756e736f6c6420746f6b6560448201526237399760e91b6064820152608490fd5b60405162461bcd60e51b815260206004820152602360248201527f576974686472617720616c6c6f7765642061667465722064697374726962757460448201526232b21760e91b6064820152608490fd5b346101f85760003660031901126101f857606060018060a01b0380600f541690806010541690601154169060405192835260208301526040820152f35b346101f85760203660031901126101f857600435610bc5816101fd565b600260015414610758576002600155610be1600d544211611526565b610bf1601354600654111561162c565b6001600160a01b03811660008181526017602052604090208054919291801561071357610c65817f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b946000610c759555610c506106aa83601554611519565b6002546106d4906001600160a01b03166106c8565b6040519081529081906020820190565b0390a26105f360018055565b60008060031936011261057f5780546001600160a01b0390610ca690821633146111f6565b610cb3600d544211611526565b610cc3601354600654111561162c565b610cde610cd9610cd560165460ff1690565b1590565b61184b565b4782600b541515806110e7575b156110ce5750610cfc90349061188e565b610d1c610d15610d0e600b548461189b565b6064900490565b809261188e565b90610d29600a5482611a89565b600f54909390610d41906001600160a01b03166106c8565b600254610d56906001600160a01b03166106c8565b916040958651809563095ea7b360e01b958683526020978891818d81610d98898b60049d168d840160209093929193604081019460018060a01b031681520152565b03925af1801561095257610e859388937f2a096ad1a828607e4bf163c7562faf2a343c083c6549b4e442ae24a6518a5cf4926110b1575b50600254610de5906001600160a01b03166106c8565b92610e35610df242611505565b8d516001600160a01b03871681526020810194909452604084019290925260006060840181905260808401523060a084015260c0830191909152819060e0820190565b0390a1601054610e4f906106c8906001600160a01b031681565b6011548a5163e6a4390560e01b81526001600160a01b039384168882019081529390911660208401529384928391829160400190565b03915afa908115610952578891611094575b5016918642600e541160001461101d5750601254610eec918591610ec3906001600160a01b03166106c8565b88519182526001600160a01b031684820190815260006020820152909283918291604090910190565b03818a875af1801561095257610ff0575b50601254610f13906001600160a01b03166106c8565b85516395d89b4160e01b81529287848481845afa938415610952578594610f41918a91610fce575b5061192e565b90610f63600e5498519889958694859462fcf6eb60e21b865233928601611973565b039134905af19283156109525784809381938293610f8e97610fa0575b50505b335af16108216115bd565b610710600160ff196016541617601655565b81610fbf92903d10610fc7575b610fb78183610428565b8101906118ba565b503880610f80565b503d610fad565b610fea91503d808c833e610fe28183610428565b8101906118cf565b38610f3b565b61100f90843d8611611016575b6110078183610428565b810190611790565b5038610efd565b503d610ffd565b955163a9059cbb60e01b81523392810192835260006020840152959394938593879384900360400192508391905af19182156109525784611071819493829493610f8e978495611076575b50503490611519565b610f83565b8161108c92903d10611016576110078183610428565b503880611068565b6110ab9150853d8711610fc757610fb78183610428565b38610e97565b6110c790853d8711611016576110078183610428565b5038610dcf565b6110e2925080808093335af16108216115bd565b610f8e565b50600a541515610ceb565b346101f85760203660031901126101f85760043561110f816101fd565b6000546001600160a01b039061112890821633146111f6565b811615611138576105f390611241565b60405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608490fd5b346101f85760003660031901126101f8576002546040516001600160a01b039091168152602090f35b346101f85760003660031901126101f857602060ff601654166040519015158152f35b346101f85760003660031901126101f8576020601354604051908152f35b156111fd57565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b600080546001600160a01b039283166001600160a01b03198216811783559216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a3565b601f8111611294575050565b6000906004825260208220906020601f850160051c830194106112d2575b601f0160051c01915b8281106112c757505050565b8181556001016112bb565b90925082906112b2565b90815167ffffffffffffffff811161042357611302816112fd6004546103b7565b611288565b602080601f831160011461133e5750819293600092611333575b50508160011b916000199060031b1c191617600455565b01519050388061131c565b6004600052601f198316949091907f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b926000905b8782106113aa575050836001959610611391575b505050811b01600455565b015160001960f88460031b161c19169055388080611386565b80600185968294968601518155019501930190611372565b156113c957565b60405162461bcd60e51b815260206004820152600b60248201526a139bdd081cdd185c9d195960aa1b6044820152606490fd5b1561140357565b60405162461bcd60e51b8152602060048201526005602482015264115b99195960da1b6044820152606490fd5b1561143757565b60405162461bcd60e51b815260206004820152601460248201527313195cdcc81d1a195b881b5a5b88185b5bdd5b9d60621b6044820152606490fd5b1561147a57565b60405162461bcd60e51b8152602060048201526014602482015273135bdc99481d1a195b881b585e08185b5bdd5b9d60621b6044820152606490fd5b156114bd57565b60405162461bcd60e51b815260206004820152600a60248201526913dd995c999a5b1b195960b21b6044820152606490fd5b634e487b7160e01b600052601160045260246000fd5b90610168820180921161151457565b6114ef565b9190820180921161151457565b1561152d57565b60405162461bcd60e51b815260206004820152601b60248201527f5468652049444f20706f6f6c20686173206e6f7420656e6465642e00000000006044820152606490fd5b1561157957565b606460405162461bcd60e51b815260206004820152602060248201527f5468652049444f20706f6f6c2068617320726561636820736f6674206361702e6044820152fd5b3d156115e8573d906115ce826109b6565b916115dc6040519384610428565b82523d6000602084013e565b606090565b156115f457565b60405162461bcd60e51b815260206004820152601060248201526f2a3930b739b332b9103330b4b632b21760811b6044820152606490fd5b1561163357565b60405162461bcd60e51b8152602060048201526024808201527f5468652049444f20706f6f6c20646964206e6f7420726561636820736f66742060448201526331b0b81760e11b6064820152608490fd5b60405163a9059cbb60e01b60208083019182526001600160a01b039490941660248301526044808301959095529381529192906116c2606484610428565b60018060a01b031690604051926116d884610407565b8484527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656485850152823b1561174b57611724939260009283809351925af161171e6115bd565b90611807565b8051908161173157505050565b8261174993611744938301019101611790565b6117a8565b565b60405162461bcd60e51b815260048101869052601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b908160209103126101f8575180151581036101f85790565b156117af57565b60405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608490fd5b90919015611813575090565b8151156118235750805190602001fd5b60405162461bcd60e51b81526020600482015290819061184790602483019061046d565b0390fd5b1561185257565b60405162461bcd60e51b815260206004820152601460248201527320b63932b0b23c903234b9ba3934b13aba32b21760611b6044820152606490fd5b9190820391821161151457565b8181029291811591840414171561151457565b6040513d6000823e3d90fd5b908160209103126101f857516104a3816101fd565b6020818303126101f85780519067ffffffffffffffff82116101f8570181601f820112156101f8578051611902816109b6565b926119106040519485610428565b818452602082840101116101f8576104a3916020808501910161044a565b90611749602e6040518461194c82965180926020808601910161044a565b81016d103a37b5b2b739903637b1b5b2b960911b602082015203600e810185520183610428565b9061199b6080939695949660018060a01b03809316845260a0602085015260a084019061046d565b95600060408401521660608201520152565b908160209103126101f8575190565b6002546040516370a0823160e01b815230600482015290602090829060249082906001600160a01b03165afa90811561095257600091611a13575b5060155481018091116115145760145481039081116115145790565b611a2b915060203d811161094b5761093c8183610428565b386119f7565b15611a3857565b60405162461bcd60e51b815260206004820152602360248201527f5468652049444f20706f6f6c20686173206e6f7420726566756e6420746f6b6560448201526237399760e91b6064820152608490fd5b8115611aa95760035491604d8311611514576104a392600a0a910461189b565b634e487b7160e01b600052601260045260246000fdfea164736f6c6343000812000a608060405234620005e7576200210e80380380916200002082608062000608565b6080396102008112620005e7576080516001600160a01b0381168103620005e75760e0601f19830112620005e75760405160e081016001600160401b03811182821017620004a357604090815260a08051835260c08051602085015260e05192840192909252610100516060808501919091526101205160808501526101405191840191909152610160519183019190915260ff19840112620005e75760405190620000cc82620005ec565b6101805182526101a05160208301526101c0516040830152606061015f19850112620005e757604051926200010184620005ec565b6200010e6101e06200062c565b84526200011d6102006200062c565b60208501526200012f6102206200062c565b6040850152620001416102406200062c565b610260519091906001600160401b038111620005e75760808701609f82011215620005e7576080810151906001600160401b038211620004a3576040519762000195601f8401601f19166020018a62000608565b82895260800160a08284010111620005e75760005b828110620005ce57505060206000918801015260206000543360018060a01b0319821617600055600460405180948193339060018060a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3600180556016805460ff19169055600280546001600160a01b0319166001600160a01b0392909216918217905563313ce56760e01b82525afa908115620005c25760009162000577575b5060ff16600355601280546001600160a01b0319166001600160a01b03909216919091179055805160055560208082015160065560408201516007556060820151600855608082015160095560a0820151600a5560c09190910151600b55815190820151111562000517576020810151421015620004b9578051600c55602080820151600d55604091820151600e558251600f80546001600160a01b039283166001600160a01b031991821617909155918401516010805491831691841691909117905592909101516011805491909316911617905580516001600160401b038111620004a357600454600181811c9116801562000498575b60208210146200048257601f811162000418575b50602091601f8211600114620003ae57918192600092620003a2575b50508160011b916000199060031b1c1916176004555b604051611acc9081620006428239f35b0151905038806200037c565b601f19821692600460005260206000209160005b858110620003ff57508360019510620003e5575b505050811b0160045562000392565b015160001960f88460031b161c19169055388080620003d6565b91926020600181928685015181550194019201620003c2565b60046000527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b601f830160051c8101916020841062000477575b601f0160051c01905b8181106200046a575062000360565b600081556001016200045b565b909150819062000452565b634e487b7160e01b600052602260045260246000fd5b90607f16906200034c565b634e487b7160e01b600052604160045260246000fd5b60405162461bcd60e51b815260206004820152603060248201527f46696e6973682074696d657374616d70206d757374206265206d6f726520746860448201526f616e2063757272656e7420626c6f636b60801b6064820152608490fd5b60405162461bcd60e51b815260206004820152603260248201527f53746172742074696d657374616d70206d757374206265206c6573732074686160448201527106e2066696e6973682074696d657374616d760741b6064820152608490fd5b6020813d602011620005b9575b81620005936020938362000608565b81010312620005b557519060ff82168203620005b2575060ff62000253565b80fd5b5080fd5b3d915062000584565b6040513d6000823e3d90fd5b80602080928460800101015182828c01015201620001aa565b600080fd5b606081019081106001600160401b03821117620004a357604052565b601f909101601f19168101906001600160401b03821190821017620004a357604052565b51906001600160a01b0382168203620005e75756fe6080604052600436101561001257600080fd5b60003560e01c806312d3675e146101a75780631959a002146101a25780631b9265b81461019d5780632a123b16146101985780632dcc8c6614610193578063313ce5671461018e5780633f138d4b14610189578063491447a8146101845780634b1a4c0c1461017f5780634e71d92d1461017a578063586360ce14610175578063590e1ae31461017057806362bea93f1461016b5780637100750914610166578063715018a614610161578063747daec51461015c5780638da5cb5b14610157578063c6a0e27d14610152578063d8d2a56d1461014d578063ddeae03314610148578063e086e5ec14610143578063f2fde38b1461013e578063f7c618c114610139578063f84b903e146101345763fd46a1711461012f57600080fd5b6111d8565b6111b5565b61118c565b6110f2565b610c81565b610ba8565b610b6b565b610a6e565b610a45565b6109d2565b610957565b610889565b610866565b6107bb565b61079d565b610645565b610627565b6105f5565b6105a0565b610582565b6104a6565b61038e565b610270565b61020e565b346101f85760003660031901126101f85760e060055460065460075460085460095490600a5492600b5494604051968752602087015260408601526060850152608084015260a083015260c0820152f35b600080fd5b6001600160a01b038116036101f857565b346101f85760203660031901126101f85760043561022b816101fd565b60018060a01b031660005260176020526040600020805461026c60026001840154930154604051938493846040919493926060820195825260208201520152565b0390f35b60003660031901126101f85761028a600c544210156113c2565b610297600d5442106113fc565b6102a5600854341015611430565b6009546102b481341115611473565b601354906102cf6102c53484611519565b60075410156114b6565b336000908152601760205260409020906102f960028301916102f2348454611519565b1115611473565b61031861031361030b60055434611a89565b943490611519565b601355565b61032c61032784601454611519565b601455565b610337348254611519565b905560018101610348838254611519565b9055610355828254611519565b905560408051348152602081019290925233917fb55d4ca2fc644ca3f8cdc9c907826e24acd68d2b2d4d73f48b8f2378dbaedf5d9190a2005b346101f85760003660031901126101f8576012546040516001600160a01b039091168152602090f35b90600182811c921680156103e7575b60208310146103d157565b634e487b7160e01b600052602260045260246000fd5b91607f16916103c6565b634e487b7160e01b600052604160045260246000fd5b6040810190811067ffffffffffffffff82111761042357604052565b6103f1565b90601f8019910116810190811067ffffffffffffffff82111761042357604052565b60005b83811061045d5750506000910152565b818101518382015260200161044d565b906020916104868151809281855285808601910161044a565b601f01601f1916010190565b9060206104a392818152019061046d565b90565b346101f85760008060031936011261057f57604051816004546104c8816103b7565b8084529060019081811690811561055757506001146104fe575b61026c846104f281880382610428565b60405191829182610492565b60048352602094507f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b5b828410610544575050508161026c936104f292820101936104e2565b8054858501870152928501928101610528565b61026c96506104f29450602092508593915060ff191682840152151560051b820101936104e2565b80fd5b346101f85760003660031901126101f8576020600354604051908152f35b346101f85760403660031901126101f8576004356105bd816101fd565b6000546001600160a01b03906105d690821633146111f6565b806002541691169081146101f8576105f390602435903390611684565b005b346101f85760003660031901126101f857600c54600d54600e5460408051938452602084019290925290820152606090f35b346101f85760003660031901126101f8576020601454604051908152f35b346101f85760008060031936011261057f57600260015414610758576002600155610673600d544211611526565b610683601354600654111561162c565b3381526017602052604081208054908115610713578290556106af6106aa82601554611519565b601555565b6002546106d990829033906106d4906001600160a01b03165b6001600160a01b031690565b611684565b60405190815233907f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b90602090a261071060018055565b80f35b60405162461bcd60e51b815260206004820152601c60248201527f596f7520646f206e6f742068617665206465627420746f6b656e732e000000006044820152606490fd5b60405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606490fd5b346101f85760003660031901126101f8576020601554604051908152f35b346101f85760008060031936011261057f576107da600d544211611526565b6107e960135460065411611572565b338152601760205260408120600281018054801561082757838080939281600187828097816107109b55550155335af16108216115bd565b506115ed565b60405162461bcd60e51b81526020600482015260176024820152762cb7ba903430bb329037379034b73b32b9ba36b2b73a1760491b6044820152606490fd5b346101f85760003660031901126101f85760206108816119bc565b604051908152f35b346101f85760008060031936011261057f576108af60018060a01b0382541633146111f6565b6108bc600d544211611526565b6108cb60135460065411611572565b6002546108e0906001600160a01b03166106c8565b6040516370a0823160e01b815230600482015290602082602481845afa90811561095257610710928492610922575b5061091b821515611a31565b3390611684565b61094491925060203d811161094b575b61093c8183610428565b8101906119ad565b903861090f565b503d610932565b6118ae565b346101f85760008060031936011261057f57805481906001600160a01b038116906109833383146111f6565b6001600160a01b03191682557f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b67ffffffffffffffff811161042357601f01601f191660200190565b346101f85760203660031901126101f85760043567ffffffffffffffff81116101f857366023820112156101f8578060040135610a0e816109b6565b90610a1c6040519283610428565b80825236602482850101116101f85760208160009260246105f3960183860137830101526112dc565b346101f85760003660031901126101f8576000546040516001600160a01b039091168152602090f35b346101f85760008060031936011261057f57610a9460018060a01b0382541633146111f6565b60ff6016541615610b1a57610aa76119bc565b8015610ac957600254610710919033906106d4906001600160a01b03166106c8565b60405162461bcd60e51b815260206004820152602360248201527f5468652049444f20706f6f6c20686173206e6f7420756e736f6c6420746f6b6560448201526237399760e91b6064820152608490fd5b60405162461bcd60e51b815260206004820152602360248201527f576974686472617720616c6c6f7765642061667465722064697374726962757460448201526232b21760e91b6064820152608490fd5b346101f85760003660031901126101f857606060018060a01b0380600f541690806010541690601154169060405192835260208301526040820152f35b346101f85760203660031901126101f857600435610bc5816101fd565b600260015414610758576002600155610be1600d544211611526565b610bf1601354600654111561162c565b6001600160a01b03811660008181526017602052604090208054919291801561071357610c65817f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b946000610c759555610c506106aa83601554611519565b6002546106d4906001600160a01b03166106c8565b6040519081529081906020820190565b0390a26105f360018055565b60008060031936011261057f5780546001600160a01b0390610ca690821633146111f6565b610cb3600d544211611526565b610cc3601354600654111561162c565b610cde610cd9610cd560165460ff1690565b1590565b61184b565b4782600b541515806110e7575b156110ce5750610cfc90349061188e565b610d1c610d15610d0e600b548461189b565b6064900490565b809261188e565b90610d29600a5482611a89565b600f54909390610d41906001600160a01b03166106c8565b600254610d56906001600160a01b03166106c8565b916040958651809563095ea7b360e01b958683526020978891818d81610d98898b60049d168d840160209093929193604081019460018060a01b031681520152565b03925af1801561095257610e859388937f2a096ad1a828607e4bf163c7562faf2a343c083c6549b4e442ae24a6518a5cf4926110b1575b50600254610de5906001600160a01b03166106c8565b92610e35610df242611505565b8d516001600160a01b03871681526020810194909452604084019290925260006060840181905260808401523060a084015260c0830191909152819060e0820190565b0390a1601054610e4f906106c8906001600160a01b031681565b6011548a5163e6a4390560e01b81526001600160a01b039384168882019081529390911660208401529384928391829160400190565b03915afa908115610952578891611094575b5016918642600e541160001461101d5750601254610eec918591610ec3906001600160a01b03166106c8565b88519182526001600160a01b031684820190815260006020820152909283918291604090910190565b03818a875af1801561095257610ff0575b50601254610f13906001600160a01b03166106c8565b85516395d89b4160e01b81529287848481845afa938415610952578594610f41918a91610fce575b5061192e565b90610f63600e5498519889958694859462fcf6eb60e21b865233928601611973565b039134905af19283156109525784809381938293610f8e97610fa0575b50505b335af16108216115bd565b610710600160ff196016541617601655565b81610fbf92903d10610fc7575b610fb78183610428565b8101906118ba565b503880610f80565b503d610fad565b610fea91503d808c833e610fe28183610428565b8101906118cf565b38610f3b565b61100f90843d8611611016575b6110078183610428565b810190611790565b5038610efd565b503d610ffd565b955163a9059cbb60e01b81523392810192835260006020840152959394938593879384900360400192508391905af19182156109525784611071819493829493610f8e978495611076575b50503490611519565b610f83565b8161108c92903d10611016576110078183610428565b503880611068565b6110ab9150853d8711610fc757610fb78183610428565b38610e97565b6110c790853d8711611016576110078183610428565b5038610dcf565b6110e2925080808093335af16108216115bd565b610f8e565b50600a541515610ceb565b346101f85760203660031901126101f85760043561110f816101fd565b6000546001600160a01b039061112890821633146111f6565b811615611138576105f390611241565b60405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608490fd5b346101f85760003660031901126101f8576002546040516001600160a01b039091168152602090f35b346101f85760003660031901126101f857602060ff601654166040519015158152f35b346101f85760003660031901126101f8576020601354604051908152f35b156111fd57565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b600080546001600160a01b039283166001600160a01b03198216811783559216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a3565b601f8111611294575050565b6000906004825260208220906020601f850160051c830194106112d2575b601f0160051c01915b8281106112c757505050565b8181556001016112bb565b90925082906112b2565b90815167ffffffffffffffff811161042357611302816112fd6004546103b7565b611288565b602080601f831160011461133e5750819293600092611333575b50508160011b916000199060031b1c191617600455565b01519050388061131c565b6004600052601f198316949091907f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b926000905b8782106113aa575050836001959610611391575b505050811b01600455565b015160001960f88460031b161c19169055388080611386565b80600185968294968601518155019501930190611372565b156113c957565b60405162461bcd60e51b815260206004820152600b60248201526a139bdd081cdd185c9d195960aa1b6044820152606490fd5b1561140357565b60405162461bcd60e51b8152602060048201526005602482015264115b99195960da1b6044820152606490fd5b1561143757565b60405162461bcd60e51b815260206004820152601460248201527313195cdcc81d1a195b881b5a5b88185b5bdd5b9d60621b6044820152606490fd5b1561147a57565b60405162461bcd60e51b8152602060048201526014602482015273135bdc99481d1a195b881b585e08185b5bdd5b9d60621b6044820152606490fd5b156114bd57565b60405162461bcd60e51b815260206004820152600a60248201526913dd995c999a5b1b195960b21b6044820152606490fd5b634e487b7160e01b600052601160045260246000fd5b90610168820180921161151457565b6114ef565b9190820180921161151457565b1561152d57565b60405162461bcd60e51b815260206004820152601b60248201527f5468652049444f20706f6f6c20686173206e6f7420656e6465642e00000000006044820152606490fd5b1561157957565b606460405162461bcd60e51b815260206004820152602060248201527f5468652049444f20706f6f6c2068617320726561636820736f6674206361702e6044820152fd5b3d156115e8573d906115ce826109b6565b916115dc6040519384610428565b82523d6000602084013e565b606090565b156115f457565b60405162461bcd60e51b815260206004820152601060248201526f2a3930b739b332b9103330b4b632b21760811b6044820152606490fd5b1561163357565b60405162461bcd60e51b8152602060048201526024808201527f5468652049444f20706f6f6c20646964206e6f7420726561636820736f66742060448201526331b0b81760e11b6064820152608490fd5b60405163a9059cbb60e01b60208083019182526001600160a01b039490941660248301526044808301959095529381529192906116c2606484610428565b60018060a01b031690604051926116d884610407565b8484527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656485850152823b1561174b57611724939260009283809351925af161171e6115bd565b90611807565b8051908161173157505050565b8261174993611744938301019101611790565b6117a8565b565b60405162461bcd60e51b815260048101869052601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b908160209103126101f8575180151581036101f85790565b156117af57565b60405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608490fd5b90919015611813575090565b8151156118235750805190602001fd5b60405162461bcd60e51b81526020600482015290819061184790602483019061046d565b0390fd5b1561185257565b60405162461bcd60e51b815260206004820152601460248201527320b63932b0b23c903234b9ba3934b13aba32b21760611b6044820152606490fd5b9190820391821161151457565b8181029291811591840414171561151457565b6040513d6000823e3d90fd5b908160209103126101f857516104a3816101fd565b6020818303126101f85780519067ffffffffffffffff82116101f8570181601f820112156101f8578051611902816109b6565b926119106040519485610428565b818452602082840101116101f8576104a3916020808501910161044a565b90611749602e6040518461194c82965180926020808601910161044a565b81016d103a37b5b2b739903637b1b5b2b960911b602082015203600e810185520183610428565b9061199b6080939695949660018060a01b03809316845260a0602085015260a084019061046d565b95600060408401521660608201520152565b908160209103126101f8575190565b6002546040516370a0823160e01b815230600482015290602090829060249082906001600160a01b03165afa90811561095257600091611a13575b5060155481018091116115145760145481039081116115145790565b611a2b915060203d811161094b5761093c8183610428565b386119f7565b15611a3857565b60405162461bcd60e51b815260206004820152602360248201527f5468652049444f20706f6f6c20686173206e6f7420726566756e6420746f6b6560448201526237399760e91b6064820152608490fd5b8115611aa95760035491604d8311611514576104a392600a0a910461189b565b634e487b7160e01b600052601260045260246000fdfea164736f6c6343000812000aa164736f6c6343000812000a000000000000000000000000abccefb00528c9c792ac7c46997f0f6ee5dcdddd0000000000000000000000000000000000000000000000008ac7230489e800000000000000000000000000000000000000000000000000000000000000000064
Deployed ByteCode
0x608060405260043610156200001357600080fd5b60003560e01c806301202f41146200013757806303807ee5146200013157806315cce224146200012b57806337491a911462000125578063378efa37146200011f578063647846a5146200011957806369e1540414620001135780636a1860e2146200010d5780636b39268014620001075780637104c9fd1462000101578063715018a614620000fb5780638da5cb5b14620000f55780638dc1299114620000ef57806390d49b9d14620000e9578063f25f4b5614620000e35763f2fde38b14620000dd57600080fd5b62000c87565b62000c5c565b62000be1565b62000b1b565b62000af0565b62000a8d565b62000a2f565b620009d2565b6200091e565b620008fe565b620008d3565b620008b3565b6200064e565b62000570565b62000550565b62000356565b6001600160a01b038116036200014f57565b600080fd5b634e487b7160e01b600052604160045260246000fd5b606081019081106001600160401b038211176200018657604052565b62000154565b6001600160401b0381116200018657604052565b60a081019081106001600160401b038211176200018657604052565b604081019081106001600160401b038211176200018657604052565b90601f801991011681019081106001600160401b038211176200018657604052565b60e09060231901126200014f576040519060e082018281106001600160401b03821117620001865760405281602435815260443560208201526064356040820152608435606082015260a435608082015260c43560a082015260c060e435910152565b6060906101031901126200014f57604051906200027a826200016a565b610104358252610124356020830152610144356040830152565b6060906101631901126200014f5760405190620002b1826200016a565b8161016435620002c1816200013d565b815261018435620002d2816200013d565b602082015260406101a43591620002e9836200013d565b0152565b6001600160401b0381116200018657601f01601f191660200190565b81601f820112156200014f578035906200032382620002ed565b92620003336040519485620001d8565b828452602083830101116200014f57816000926020809301838601378301015290565b346200014f576102403660031901126200014f5760043562000378816200013d565b6200038336620001fa565b6200038e366200025d565b906200039a3662000294565b926101c43591620003ab836200013d565b6001600160401b03946101e4358681116200014f57620003d090369060040162000309565b92610204359261022435976040519061210e808301918383109083111762000186578789878c878988976200040b976200142c8a3962000e42565b03906000f09687156200053e577f6006912f3f9fa856c9c91fc76c0608abd71c7b44e038dd7598f1117bd4c6aa83916200045d8760018060a01b03809b169a8b9616998a976040519586958662001342565b0390a36200046c858262000f52565b94843b156200014f5760405163f2fde38b60e01b815233600482015291600083602481838a5af180156200053e576200051c977fbb1e34963a7cf74028f70419838711c854e9716294c07397f076ff3ec10e04bb94620004d69262000520575b5087338862001000565b620004e18662000f60565b620004f560405192839233968985620013cd565b0390a3620005026200121b565b6040516001600160a01b0390911681529081906020820190565b0390f35b806200053062000537926200018c565b8062000544565b38620004cc565b62000eda565b60009103126200014f57565b346200014f5760003660031901126200014f576020600454604051908152f35b346200014f5760203660031901126200014f5760043562000591816200013d565b6000546001600160a01b0390620005ac908216331462000d2c565b63ffffffff823b16156200060957600180546001600160a01b0319169183169190911790556040516001600160a01b0390911681527f9e892f555b0a5cac6c8cc33c82ebb9308207bd16dfdca9d0289b96d7e4186c8a90602090a1005b60405162461bcd60e51b815260206004820152601a60248201527f4e65772061646472657373206973206e6f74206120746f6b656e0000000000006044820152606490fd5b346200014f576102003660031901126200014f5760043562000670816200013d565b6200067b36620001fa565b62000686366200025d565b91620006923662000294565b906101c43593620006a3856200013d565b6001600160401b03906101e4358281116200014f57620006c890369060040162000309565b9160409485519761210e91828a01938a851090851117620001865789948988620006fa9689966200353a8a3962000e42565b0360009586f09182156200053e57835163313ce56760e01b81526001600160a01b039182169390602081600481885afa9081156200053e5788916200087e575b50858701966200074f82895183519062001402565b9760c0820151908115158062000870575b6200082e575b505050501693843b156200082a57835163f2fde38b60e01b8152336004820152958660248183895af19081156200053e576200051c96620007b19262000813575b5085338562001000565b620007bc8462000f60565b7ff71c11ab5bd622b01d634c5c9e59846d77ee252871f11645b7b8376ddd4dd3e2835180620007ee3394888362000fdc565b0390a3620007fb6200121b565b516001600160a01b0390911681529081906020820190565b806200053062000823926200018c565b38620007a7565b8580fd5b9160a0620008546200084d62000865979c96946200085e965162000f17565b6064900490565b9101519062001402565b9062000f52565b943880808062000766565b5060a0830151151562000760565b620008a4915060203d8111620008ab575b6200089b8183620001d8565b81019062000ee6565b386200073a565b503d6200088f565b346200014f5760003660031901126200014f576020600554604051908152f35b346200014f5760003660031901126200014f576001546040516001600160a01b039091168152602090f35b346200014f5760003660031901126200014f576020600354604051908152f35b346200014f57600080600319360112620009cf57604051809160065490818352602080930180926006835284832090835b818110620009b1575050508462000968910385620001d8565b60405193838594850191818652518092526040850193925b8281106200099057505050500390f35b83516001600160a01b03168552869550938101939281019260010162000980565b82546001600160a01b0316845292860192600192830192016200094f565b80fd5b346200014f5760203660031901126200014f577fbb128cd9921d003aff00ed910fe24b1655b2bf1f4a2090cc3523f61bdc172316602060043562000a2260018060a01b0360005416331462000d2c565b80600355604051908152a1005b346200014f5760203660031901126200014f576004356006548110156200014f5760066000527ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f01546040516001600160a01b039091168152602090f35b346200014f57600080600319360112620009cf57805481906001600160a01b0381169062000abd33831462000d2c565b6001600160a01b03191682557f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b346200014f5760003660031901126200014f576000546040516001600160a01b039091168152602090f35b346200014f5760403660031901126200014f5760043560243562000b4b60018060a01b0360005416331462000d2c565b80821162000b8d57816040917fb62d69c6ddf4f4bd443dca17ea7405d8018efb872e82e77bb8ef13b5be2f2e9c936004558060055582519182526020820152a1005b60405162461bcd60e51b815260206004820152602660248201527f4275726e2070657263656e74206d757374206265206c657373207468616e206460448201526534bb34b232b960d11b6064820152608490fd5b346200014f5760203660031901126200014f577f29acee77dafcfa0143d74a7ea236018f3a6e1fa71e27fc59bbfbc6b8ca8edccd602060043562000c25816200013d565b6000546001600160a01b03919062000c41908316331462000d2c565b168060018060a01b03196002541617600255604051908152a1005b346200014f5760003660031901126200014f576002546040516001600160a01b039091168152602090f35b346200014f5760203660031901126200014f5760043562000ca8816200013d565b6000546001600160a01b039062000cc3908216331462000d2c565b81161562000cd85762000cd69062000d78565b005b60405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608490fd5b1562000d3457565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b600080546001600160a01b039283166001600160a01b03198216811783559216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a3565b60c08091805184526020810151602085015260408101516040850152606081015160608501526080810151608085015260a081015160a08501520151910152565b919082519283825260005b84811062000e2d575050826000602080949584010152601f8019910116010190565b60208183018101518483018201520162000e0b565b9362000e8e62000ebd929462000e6f62000ed799989560018060a01b038098168952602089019062000dbf565b8051610100880152602081015161012088015260400151610140870152565b80516001600160a01b0390811661016087015260208201518116610180870152604090910151166101a0850152565b166101c082015261020090816101e0820152019062000e00565b90565b6040513d6000823e3d90fd5b908160209103126200014f575160ff811681036200014f5790565b634e487b7160e01b600052601160045260246000fd5b8181029291811591840414171562000f2b57565b62000f01565b811562000f3c570490565b634e487b7160e01b600052601260045260246000fd5b9190820180921162000f2b57565b600654600160401b8110156200018657600181018060065581101562000fc65760066000527ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f0180546001600160a01b0319166001600160a01b03909216919091179055565b634e487b7160e01b600052603260045260246000fd5b6001600160a01b03909116815260406020820181905262000ed79291019062000e00565b6040516323b872dd60e01b602082019081526001600160a01b0393841660248301529383166044820152606480820195909552938452620010ab939260009283926200104c86620001a0565b169082604051956200105e87620001bc565b602087527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564602088015262001096843b151562001151565b51925af1620010a46200119e565b90620011d3565b805180620010b7575050565b81602080620010cf93620010d59501019101620010d7565b620010f1565b565b908160209103126200014f575180151581036200014f5790565b15620010f957565b60405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608490fd5b156200115957565b60405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b3d15620011ce573d90620011b282620002ed565b91620011c26040519384620001d8565b82523d6000602084013e565b606090565b90919015620011e0575090565b815115620011f15750805190602001fd5b60405162461bcd60e51b8152602060048201529081906200121790602483019062000e00565b0390fd5b60035480620012275750565b600454156200130257506003546200129b620012546200124a6004548462000f17565b6005549062000f31565b60015490929062001275906001600160a01b03165b6001600160a01b031690565b600254909190620012929085906001600160a01b03169262001334565b91339062001000565b600154620012b2906001600160a01b031662001269565b803b156200014f5760405163079cc67960e41b815233600482015260248101929092526000908290604490829084905af180156200053e57620012f25750565b8062000530620010d5926200018c565b600154620010d591906200131f906001600160a01b031662001269565b6002546001600160a01b031690339062001000565b9190820391821162000f2b57565b926200137c62000ed79695936200135e86620013ab9562000dbf565b805160e0870152602081015161010087015260400151610120860152565b80516001600160a01b039081166101408601526020820151811661016086015260409091015116610180840152565b6001600160a01b03166101a08201526101e06101c08201819052019062000e00565b6001600160a01b03909116815260806020820181905292949392606092620013f89183019062000e00565b9460408201520152565b60ff91620014109162000f31565b911690604d821162000f2b5762000ed791600a0a9062000f1756fe608060405234620005e7576200210e80380380916200002082608062000608565b6080396102008112620005e7576080516001600160a01b0381168103620005e75760e0601f19830112620005e75760405160e081016001600160401b03811182821017620004a357604090815260a08051835260c08051602085015260e05192840192909252610100516060808501919091526101205160808501526101405191840191909152610160519183019190915260ff19840112620005e75760405190620000cc82620005ec565b6101805182526101a05160208301526101c0516040830152606061015f19850112620005e757604051926200010184620005ec565b6200010e6101e06200062c565b84526200011d6102006200062c565b60208501526200012f6102206200062c565b6040850152620001416102406200062c565b610260519091906001600160401b038111620005e75760808701609f82011215620005e7576080810151906001600160401b038211620004a3576040519762000195601f8401601f19166020018a62000608565b82895260800160a08284010111620005e75760005b828110620005ce57505060206000918801015260206000543360018060a01b0319821617600055600460405180948193339060018060a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3600180556016805460ff19169055600280546001600160a01b0319166001600160a01b0392909216918217905563313ce56760e01b82525afa908115620005c25760009162000577575b5060ff16600355601280546001600160a01b0319166001600160a01b03909216919091179055805160055560208082015160065560408201516007556060820151600855608082015160095560a0820151600a5560c09190910151600b55815190820151111562000517576020810151421015620004b9578051600c55602080820151600d55604091820151600e558251600f80546001600160a01b039283166001600160a01b031991821617909155918401516010805491831691841691909117905592909101516011805491909316911617905580516001600160401b038111620004a357600454600181811c9116801562000498575b60208210146200048257601f811162000418575b50602091601f8211600114620003ae57918192600092620003a2575b50508160011b916000199060031b1c1916176004555b604051611acc9081620006428239f35b0151905038806200037c565b601f19821692600460005260206000209160005b858110620003ff57508360019510620003e5575b505050811b0160045562000392565b015160001960f88460031b161c19169055388080620003d6565b91926020600181928685015181550194019201620003c2565b60046000527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b601f830160051c8101916020841062000477575b601f0160051c01905b8181106200046a575062000360565b600081556001016200045b565b909150819062000452565b634e487b7160e01b600052602260045260246000fd5b90607f16906200034c565b634e487b7160e01b600052604160045260246000fd5b60405162461bcd60e51b815260206004820152603060248201527f46696e6973682074696d657374616d70206d757374206265206d6f726520746860448201526f616e2063757272656e7420626c6f636b60801b6064820152608490fd5b60405162461bcd60e51b815260206004820152603260248201527f53746172742074696d657374616d70206d757374206265206c6573732074686160448201527106e2066696e6973682074696d657374616d760741b6064820152608490fd5b6020813d602011620005b9575b81620005936020938362000608565b81010312620005b557519060ff82168203620005b2575060ff62000253565b80fd5b5080fd5b3d915062000584565b6040513d6000823e3d90fd5b80602080928460800101015182828c01015201620001aa565b600080fd5b606081019081106001600160401b03821117620004a357604052565b601f909101601f19168101906001600160401b03821190821017620004a357604052565b51906001600160a01b0382168203620005e75756fe6080604052600436101561001257600080fd5b60003560e01c806312d3675e146101a75780631959a002146101a25780631b9265b81461019d5780632a123b16146101985780632dcc8c6614610193578063313ce5671461018e5780633f138d4b14610189578063491447a8146101845780634b1a4c0c1461017f5780634e71d92d1461017a578063586360ce14610175578063590e1ae31461017057806362bea93f1461016b5780637100750914610166578063715018a614610161578063747daec51461015c5780638da5cb5b14610157578063c6a0e27d14610152578063d8d2a56d1461014d578063ddeae03314610148578063e086e5ec14610143578063f2fde38b1461013e578063f7c618c114610139578063f84b903e146101345763fd46a1711461012f57600080fd5b6111d8565b6111b5565b61118c565b6110f2565b610c81565b610ba8565b610b6b565b610a6e565b610a45565b6109d2565b610957565b610889565b610866565b6107bb565b61079d565b610645565b610627565b6105f5565b6105a0565b610582565b6104a6565b61038e565b610270565b61020e565b346101f85760003660031901126101f85760e060055460065460075460085460095490600a5492600b5494604051968752602087015260408601526060850152608084015260a083015260c0820152f35b600080fd5b6001600160a01b038116036101f857565b346101f85760203660031901126101f85760043561022b816101fd565b60018060a01b031660005260176020526040600020805461026c60026001840154930154604051938493846040919493926060820195825260208201520152565b0390f35b60003660031901126101f85761028a600c544210156113c2565b610297600d5442106113fc565b6102a5600854341015611430565b6009546102b481341115611473565b601354906102cf6102c53484611519565b60075410156114b6565b336000908152601760205260409020906102f960028301916102f2348454611519565b1115611473565b61031861031361030b60055434611a89565b943490611519565b601355565b61032c61032784601454611519565b601455565b610337348254611519565b905560018101610348838254611519565b9055610355828254611519565b905560408051348152602081019290925233917fb55d4ca2fc644ca3f8cdc9c907826e24acd68d2b2d4d73f48b8f2378dbaedf5d9190a2005b346101f85760003660031901126101f8576012546040516001600160a01b039091168152602090f35b90600182811c921680156103e7575b60208310146103d157565b634e487b7160e01b600052602260045260246000fd5b91607f16916103c6565b634e487b7160e01b600052604160045260246000fd5b6040810190811067ffffffffffffffff82111761042357604052565b6103f1565b90601f8019910116810190811067ffffffffffffffff82111761042357604052565b60005b83811061045d5750506000910152565b818101518382015260200161044d565b906020916104868151809281855285808601910161044a565b601f01601f1916010190565b9060206104a392818152019061046d565b90565b346101f85760008060031936011261057f57604051816004546104c8816103b7565b8084529060019081811690811561055757506001146104fe575b61026c846104f281880382610428565b60405191829182610492565b60048352602094507f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b5b828410610544575050508161026c936104f292820101936104e2565b8054858501870152928501928101610528565b61026c96506104f29450602092508593915060ff191682840152151560051b820101936104e2565b80fd5b346101f85760003660031901126101f8576020600354604051908152f35b346101f85760403660031901126101f8576004356105bd816101fd565b6000546001600160a01b03906105d690821633146111f6565b806002541691169081146101f8576105f390602435903390611684565b005b346101f85760003660031901126101f857600c54600d54600e5460408051938452602084019290925290820152606090f35b346101f85760003660031901126101f8576020601454604051908152f35b346101f85760008060031936011261057f57600260015414610758576002600155610673600d544211611526565b610683601354600654111561162c565b3381526017602052604081208054908115610713578290556106af6106aa82601554611519565b601555565b6002546106d990829033906106d4906001600160a01b03165b6001600160a01b031690565b611684565b60405190815233907f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b90602090a261071060018055565b80f35b60405162461bcd60e51b815260206004820152601c60248201527f596f7520646f206e6f742068617665206465627420746f6b656e732e000000006044820152606490fd5b60405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606490fd5b346101f85760003660031901126101f8576020601554604051908152f35b346101f85760008060031936011261057f576107da600d544211611526565b6107e960135460065411611572565b338152601760205260408120600281018054801561082757838080939281600187828097816107109b55550155335af16108216115bd565b506115ed565b60405162461bcd60e51b81526020600482015260176024820152762cb7ba903430bb329037379034b73b32b9ba36b2b73a1760491b6044820152606490fd5b346101f85760003660031901126101f85760206108816119bc565b604051908152f35b346101f85760008060031936011261057f576108af60018060a01b0382541633146111f6565b6108bc600d544211611526565b6108cb60135460065411611572565b6002546108e0906001600160a01b03166106c8565b6040516370a0823160e01b815230600482015290602082602481845afa90811561095257610710928492610922575b5061091b821515611a31565b3390611684565b61094491925060203d811161094b575b61093c8183610428565b8101906119ad565b903861090f565b503d610932565b6118ae565b346101f85760008060031936011261057f57805481906001600160a01b038116906109833383146111f6565b6001600160a01b03191682557f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b67ffffffffffffffff811161042357601f01601f191660200190565b346101f85760203660031901126101f85760043567ffffffffffffffff81116101f857366023820112156101f8578060040135610a0e816109b6565b90610a1c6040519283610428565b80825236602482850101116101f85760208160009260246105f3960183860137830101526112dc565b346101f85760003660031901126101f8576000546040516001600160a01b039091168152602090f35b346101f85760008060031936011261057f57610a9460018060a01b0382541633146111f6565b60ff6016541615610b1a57610aa76119bc565b8015610ac957600254610710919033906106d4906001600160a01b03166106c8565b60405162461bcd60e51b815260206004820152602360248201527f5468652049444f20706f6f6c20686173206e6f7420756e736f6c6420746f6b6560448201526237399760e91b6064820152608490fd5b60405162461bcd60e51b815260206004820152602360248201527f576974686472617720616c6c6f7765642061667465722064697374726962757460448201526232b21760e91b6064820152608490fd5b346101f85760003660031901126101f857606060018060a01b0380600f541690806010541690601154169060405192835260208301526040820152f35b346101f85760203660031901126101f857600435610bc5816101fd565b600260015414610758576002600155610be1600d544211611526565b610bf1601354600654111561162c565b6001600160a01b03811660008181526017602052604090208054919291801561071357610c65817f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b946000610c759555610c506106aa83601554611519565b6002546106d4906001600160a01b03166106c8565b6040519081529081906020820190565b0390a26105f360018055565b60008060031936011261057f5780546001600160a01b0390610ca690821633146111f6565b610cb3600d544211611526565b610cc3601354600654111561162c565b610cde610cd9610cd560165460ff1690565b1590565b61184b565b4782600b541515806110e7575b156110ce5750610cfc90349061188e565b610d1c610d15610d0e600b548461189b565b6064900490565b809261188e565b90610d29600a5482611a89565b600f54909390610d41906001600160a01b03166106c8565b600254610d56906001600160a01b03166106c8565b916040958651809563095ea7b360e01b958683526020978891818d81610d98898b60049d168d840160209093929193604081019460018060a01b031681520152565b03925af1801561095257610e859388937f2a096ad1a828607e4bf163c7562faf2a343c083c6549b4e442ae24a6518a5cf4926110b1575b50600254610de5906001600160a01b03166106c8565b92610e35610df242611505565b8d516001600160a01b03871681526020810194909452604084019290925260006060840181905260808401523060a084015260c0830191909152819060e0820190565b0390a1601054610e4f906106c8906001600160a01b031681565b6011548a5163e6a4390560e01b81526001600160a01b039384168882019081529390911660208401529384928391829160400190565b03915afa908115610952578891611094575b5016918642600e541160001461101d5750601254610eec918591610ec3906001600160a01b03166106c8565b88519182526001600160a01b031684820190815260006020820152909283918291604090910190565b03818a875af1801561095257610ff0575b50601254610f13906001600160a01b03166106c8565b85516395d89b4160e01b81529287848481845afa938415610952578594610f41918a91610fce575b5061192e565b90610f63600e5498519889958694859462fcf6eb60e21b865233928601611973565b039134905af19283156109525784809381938293610f8e97610fa0575b50505b335af16108216115bd565b610710600160ff196016541617601655565b81610fbf92903d10610fc7575b610fb78183610428565b8101906118ba565b503880610f80565b503d610fad565b610fea91503d808c833e610fe28183610428565b8101906118cf565b38610f3b565b61100f90843d8611611016575b6110078183610428565b810190611790565b5038610efd565b503d610ffd565b955163a9059cbb60e01b81523392810192835260006020840152959394938593879384900360400192508391905af19182156109525784611071819493829493610f8e978495611076575b50503490611519565b610f83565b8161108c92903d10611016576110078183610428565b503880611068565b6110ab9150853d8711610fc757610fb78183610428565b38610e97565b6110c790853d8711611016576110078183610428565b5038610dcf565b6110e2925080808093335af16108216115bd565b610f8e565b50600a541515610ceb565b346101f85760203660031901126101f85760043561110f816101fd565b6000546001600160a01b039061112890821633146111f6565b811615611138576105f390611241565b60405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608490fd5b346101f85760003660031901126101f8576002546040516001600160a01b039091168152602090f35b346101f85760003660031901126101f857602060ff601654166040519015158152f35b346101f85760003660031901126101f8576020601354604051908152f35b156111fd57565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b600080546001600160a01b039283166001600160a01b03198216811783559216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a3565b601f8111611294575050565b6000906004825260208220906020601f850160051c830194106112d2575b601f0160051c01915b8281106112c757505050565b8181556001016112bb565b90925082906112b2565b90815167ffffffffffffffff811161042357611302816112fd6004546103b7565b611288565b602080601f831160011461133e5750819293600092611333575b50508160011b916000199060031b1c191617600455565b01519050388061131c565b6004600052601f198316949091907f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b926000905b8782106113aa575050836001959610611391575b505050811b01600455565b015160001960f88460031b161c19169055388080611386565b80600185968294968601518155019501930190611372565b156113c957565b60405162461bcd60e51b815260206004820152600b60248201526a139bdd081cdd185c9d195960aa1b6044820152606490fd5b1561140357565b60405162461bcd60e51b8152602060048201526005602482015264115b99195960da1b6044820152606490fd5b1561143757565b60405162461bcd60e51b815260206004820152601460248201527313195cdcc81d1a195b881b5a5b88185b5bdd5b9d60621b6044820152606490fd5b1561147a57565b60405162461bcd60e51b8152602060048201526014602482015273135bdc99481d1a195b881b585e08185b5bdd5b9d60621b6044820152606490fd5b156114bd57565b60405162461bcd60e51b815260206004820152600a60248201526913dd995c999a5b1b195960b21b6044820152606490fd5b634e487b7160e01b600052601160045260246000fd5b90610168820180921161151457565b6114ef565b9190820180921161151457565b1561152d57565b60405162461bcd60e51b815260206004820152601b60248201527f5468652049444f20706f6f6c20686173206e6f7420656e6465642e00000000006044820152606490fd5b1561157957565b606460405162461bcd60e51b815260206004820152602060248201527f5468652049444f20706f6f6c2068617320726561636820736f6674206361702e6044820152fd5b3d156115e8573d906115ce826109b6565b916115dc6040519384610428565b82523d6000602084013e565b606090565b156115f457565b60405162461bcd60e51b815260206004820152601060248201526f2a3930b739b332b9103330b4b632b21760811b6044820152606490fd5b1561163357565b60405162461bcd60e51b8152602060048201526024808201527f5468652049444f20706f6f6c20646964206e6f7420726561636820736f66742060448201526331b0b81760e11b6064820152608490fd5b60405163a9059cbb60e01b60208083019182526001600160a01b039490941660248301526044808301959095529381529192906116c2606484610428565b60018060a01b031690604051926116d884610407565b8484527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656485850152823b1561174b57611724939260009283809351925af161171e6115bd565b90611807565b8051908161173157505050565b8261174993611744938301019101611790565b6117a8565b565b60405162461bcd60e51b815260048101869052601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b908160209103126101f8575180151581036101f85790565b156117af57565b60405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608490fd5b90919015611813575090565b8151156118235750805190602001fd5b60405162461bcd60e51b81526020600482015290819061184790602483019061046d565b0390fd5b1561185257565b60405162461bcd60e51b815260206004820152601460248201527320b63932b0b23c903234b9ba3934b13aba32b21760611b6044820152606490fd5b9190820391821161151457565b8181029291811591840414171561151457565b6040513d6000823e3d90fd5b908160209103126101f857516104a3816101fd565b6020818303126101f85780519067ffffffffffffffff82116101f8570181601f820112156101f8578051611902816109b6565b926119106040519485610428565b818452602082840101116101f8576104a3916020808501910161044a565b90611749602e6040518461194c82965180926020808601910161044a565b81016d103a37b5b2b739903637b1b5b2b960911b602082015203600e810185520183610428565b9061199b6080939695949660018060a01b03809316845260a0602085015260a084019061046d565b95600060408401521660608201520152565b908160209103126101f8575190565b6002546040516370a0823160e01b815230600482015290602090829060249082906001600160a01b03165afa90811561095257600091611a13575b5060155481018091116115145760145481039081116115145790565b611a2b915060203d811161094b5761093c8183610428565b386119f7565b15611a3857565b60405162461bcd60e51b815260206004820152602360248201527f5468652049444f20706f6f6c20686173206e6f7420726566756e6420746f6b6560448201526237399760e91b6064820152608490fd5b8115611aa95760035491604d8311611514576104a392600a0a910461189b565b634e487b7160e01b600052601260045260246000fdfea164736f6c6343000812000a608060405234620005e7576200210e80380380916200002082608062000608565b6080396102008112620005e7576080516001600160a01b0381168103620005e75760e0601f19830112620005e75760405160e081016001600160401b03811182821017620004a357604090815260a08051835260c08051602085015260e05192840192909252610100516060808501919091526101205160808501526101405191840191909152610160519183019190915260ff19840112620005e75760405190620000cc82620005ec565b6101805182526101a05160208301526101c0516040830152606061015f19850112620005e757604051926200010184620005ec565b6200010e6101e06200062c565b84526200011d6102006200062c565b60208501526200012f6102206200062c565b6040850152620001416102406200062c565b610260519091906001600160401b038111620005e75760808701609f82011215620005e7576080810151906001600160401b038211620004a3576040519762000195601f8401601f19166020018a62000608565b82895260800160a08284010111620005e75760005b828110620005ce57505060206000918801015260206000543360018060a01b0319821617600055600460405180948193339060018060a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3600180556016805460ff19169055600280546001600160a01b0319166001600160a01b0392909216918217905563313ce56760e01b82525afa908115620005c25760009162000577575b5060ff16600355601280546001600160a01b0319166001600160a01b03909216919091179055805160055560208082015160065560408201516007556060820151600855608082015160095560a0820151600a5560c09190910151600b55815190820151111562000517576020810151421015620004b9578051600c55602080820151600d55604091820151600e558251600f80546001600160a01b039283166001600160a01b031991821617909155918401516010805491831691841691909117905592909101516011805491909316911617905580516001600160401b038111620004a357600454600181811c9116801562000498575b60208210146200048257601f811162000418575b50602091601f8211600114620003ae57918192600092620003a2575b50508160011b916000199060031b1c1916176004555b604051611acc9081620006428239f35b0151905038806200037c565b601f19821692600460005260206000209160005b858110620003ff57508360019510620003e5575b505050811b0160045562000392565b015160001960f88460031b161c19169055388080620003d6565b91926020600181928685015181550194019201620003c2565b60046000527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b601f830160051c8101916020841062000477575b601f0160051c01905b8181106200046a575062000360565b600081556001016200045b565b909150819062000452565b634e487b7160e01b600052602260045260246000fd5b90607f16906200034c565b634e487b7160e01b600052604160045260246000fd5b60405162461bcd60e51b815260206004820152603060248201527f46696e6973682074696d657374616d70206d757374206265206d6f726520746860448201526f616e2063757272656e7420626c6f636b60801b6064820152608490fd5b60405162461bcd60e51b815260206004820152603260248201527f53746172742074696d657374616d70206d757374206265206c6573732074686160448201527106e2066696e6973682074696d657374616d760741b6064820152608490fd5b6020813d602011620005b9575b81620005936020938362000608565b81010312620005b557519060ff82168203620005b2575060ff62000253565b80fd5b5080fd5b3d915062000584565b6040513d6000823e3d90fd5b80602080928460800101015182828c01015201620001aa565b600080fd5b606081019081106001600160401b03821117620004a357604052565b601f909101601f19168101906001600160401b03821190821017620004a357604052565b51906001600160a01b0382168203620005e75756fe6080604052600436101561001257600080fd5b60003560e01c806312d3675e146101a75780631959a002146101a25780631b9265b81461019d5780632a123b16146101985780632dcc8c6614610193578063313ce5671461018e5780633f138d4b14610189578063491447a8146101845780634b1a4c0c1461017f5780634e71d92d1461017a578063586360ce14610175578063590e1ae31461017057806362bea93f1461016b5780637100750914610166578063715018a614610161578063747daec51461015c5780638da5cb5b14610157578063c6a0e27d14610152578063d8d2a56d1461014d578063ddeae03314610148578063e086e5ec14610143578063f2fde38b1461013e578063f7c618c114610139578063f84b903e146101345763fd46a1711461012f57600080fd5b6111d8565b6111b5565b61118c565b6110f2565b610c81565b610ba8565b610b6b565b610a6e565b610a45565b6109d2565b610957565b610889565b610866565b6107bb565b61079d565b610645565b610627565b6105f5565b6105a0565b610582565b6104a6565b61038e565b610270565b61020e565b346101f85760003660031901126101f85760e060055460065460075460085460095490600a5492600b5494604051968752602087015260408601526060850152608084015260a083015260c0820152f35b600080fd5b6001600160a01b038116036101f857565b346101f85760203660031901126101f85760043561022b816101fd565b60018060a01b031660005260176020526040600020805461026c60026001840154930154604051938493846040919493926060820195825260208201520152565b0390f35b60003660031901126101f85761028a600c544210156113c2565b610297600d5442106113fc565b6102a5600854341015611430565b6009546102b481341115611473565b601354906102cf6102c53484611519565b60075410156114b6565b336000908152601760205260409020906102f960028301916102f2348454611519565b1115611473565b61031861031361030b60055434611a89565b943490611519565b601355565b61032c61032784601454611519565b601455565b610337348254611519565b905560018101610348838254611519565b9055610355828254611519565b905560408051348152602081019290925233917fb55d4ca2fc644ca3f8cdc9c907826e24acd68d2b2d4d73f48b8f2378dbaedf5d9190a2005b346101f85760003660031901126101f8576012546040516001600160a01b039091168152602090f35b90600182811c921680156103e7575b60208310146103d157565b634e487b7160e01b600052602260045260246000fd5b91607f16916103c6565b634e487b7160e01b600052604160045260246000fd5b6040810190811067ffffffffffffffff82111761042357604052565b6103f1565b90601f8019910116810190811067ffffffffffffffff82111761042357604052565b60005b83811061045d5750506000910152565b818101518382015260200161044d565b906020916104868151809281855285808601910161044a565b601f01601f1916010190565b9060206104a392818152019061046d565b90565b346101f85760008060031936011261057f57604051816004546104c8816103b7565b8084529060019081811690811561055757506001146104fe575b61026c846104f281880382610428565b60405191829182610492565b60048352602094507f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b5b828410610544575050508161026c936104f292820101936104e2565b8054858501870152928501928101610528565b61026c96506104f29450602092508593915060ff191682840152151560051b820101936104e2565b80fd5b346101f85760003660031901126101f8576020600354604051908152f35b346101f85760403660031901126101f8576004356105bd816101fd565b6000546001600160a01b03906105d690821633146111f6565b806002541691169081146101f8576105f390602435903390611684565b005b346101f85760003660031901126101f857600c54600d54600e5460408051938452602084019290925290820152606090f35b346101f85760003660031901126101f8576020601454604051908152f35b346101f85760008060031936011261057f57600260015414610758576002600155610673600d544211611526565b610683601354600654111561162c565b3381526017602052604081208054908115610713578290556106af6106aa82601554611519565b601555565b6002546106d990829033906106d4906001600160a01b03165b6001600160a01b031690565b611684565b60405190815233907f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b90602090a261071060018055565b80f35b60405162461bcd60e51b815260206004820152601c60248201527f596f7520646f206e6f742068617665206465627420746f6b656e732e000000006044820152606490fd5b60405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606490fd5b346101f85760003660031901126101f8576020601554604051908152f35b346101f85760008060031936011261057f576107da600d544211611526565b6107e960135460065411611572565b338152601760205260408120600281018054801561082757838080939281600187828097816107109b55550155335af16108216115bd565b506115ed565b60405162461bcd60e51b81526020600482015260176024820152762cb7ba903430bb329037379034b73b32b9ba36b2b73a1760491b6044820152606490fd5b346101f85760003660031901126101f85760206108816119bc565b604051908152f35b346101f85760008060031936011261057f576108af60018060a01b0382541633146111f6565b6108bc600d544211611526565b6108cb60135460065411611572565b6002546108e0906001600160a01b03166106c8565b6040516370a0823160e01b815230600482015290602082602481845afa90811561095257610710928492610922575b5061091b821515611a31565b3390611684565b61094491925060203d811161094b575b61093c8183610428565b8101906119ad565b903861090f565b503d610932565b6118ae565b346101f85760008060031936011261057f57805481906001600160a01b038116906109833383146111f6565b6001600160a01b03191682557f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b67ffffffffffffffff811161042357601f01601f191660200190565b346101f85760203660031901126101f85760043567ffffffffffffffff81116101f857366023820112156101f8578060040135610a0e816109b6565b90610a1c6040519283610428565b80825236602482850101116101f85760208160009260246105f3960183860137830101526112dc565b346101f85760003660031901126101f8576000546040516001600160a01b039091168152602090f35b346101f85760008060031936011261057f57610a9460018060a01b0382541633146111f6565b60ff6016541615610b1a57610aa76119bc565b8015610ac957600254610710919033906106d4906001600160a01b03166106c8565b60405162461bcd60e51b815260206004820152602360248201527f5468652049444f20706f6f6c20686173206e6f7420756e736f6c6420746f6b6560448201526237399760e91b6064820152608490fd5b60405162461bcd60e51b815260206004820152602360248201527f576974686472617720616c6c6f7765642061667465722064697374726962757460448201526232b21760e91b6064820152608490fd5b346101f85760003660031901126101f857606060018060a01b0380600f541690806010541690601154169060405192835260208301526040820152f35b346101f85760203660031901126101f857600435610bc5816101fd565b600260015414610758576002600155610be1600d544211611526565b610bf1601354600654111561162c565b6001600160a01b03811660008181526017602052604090208054919291801561071357610c65817f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b946000610c759555610c506106aa83601554611519565b6002546106d4906001600160a01b03166106c8565b6040519081529081906020820190565b0390a26105f360018055565b60008060031936011261057f5780546001600160a01b0390610ca690821633146111f6565b610cb3600d544211611526565b610cc3601354600654111561162c565b610cde610cd9610cd560165460ff1690565b1590565b61184b565b4782600b541515806110e7575b156110ce5750610cfc90349061188e565b610d1c610d15610d0e600b548461189b565b6064900490565b809261188e565b90610d29600a5482611a89565b600f54909390610d41906001600160a01b03166106c8565b600254610d56906001600160a01b03166106c8565b916040958651809563095ea7b360e01b958683526020978891818d81610d98898b60049d168d840160209093929193604081019460018060a01b031681520152565b03925af1801561095257610e859388937f2a096ad1a828607e4bf163c7562faf2a343c083c6549b4e442ae24a6518a5cf4926110b1575b50600254610de5906001600160a01b03166106c8565b92610e35610df242611505565b8d516001600160a01b03871681526020810194909452604084019290925260006060840181905260808401523060a084015260c0830191909152819060e0820190565b0390a1601054610e4f906106c8906001600160a01b031681565b6011548a5163e6a4390560e01b81526001600160a01b039384168882019081529390911660208401529384928391829160400190565b03915afa908115610952578891611094575b5016918642600e541160001461101d5750601254610eec918591610ec3906001600160a01b03166106c8565b88519182526001600160a01b031684820190815260006020820152909283918291604090910190565b03818a875af1801561095257610ff0575b50601254610f13906001600160a01b03166106c8565b85516395d89b4160e01b81529287848481845afa938415610952578594610f41918a91610fce575b5061192e565b90610f63600e5498519889958694859462fcf6eb60e21b865233928601611973565b039134905af19283156109525784809381938293610f8e97610fa0575b50505b335af16108216115bd565b610710600160ff196016541617601655565b81610fbf92903d10610fc7575b610fb78183610428565b8101906118ba565b503880610f80565b503d610fad565b610fea91503d808c833e610fe28183610428565b8101906118cf565b38610f3b565b61100f90843d8611611016575b6110078183610428565b810190611790565b5038610efd565b503d610ffd565b955163a9059cbb60e01b81523392810192835260006020840152959394938593879384900360400192508391905af19182156109525784611071819493829493610f8e978495611076575b50503490611519565b610f83565b8161108c92903d10611016576110078183610428565b503880611068565b6110ab9150853d8711610fc757610fb78183610428565b38610e97565b6110c790853d8711611016576110078183610428565b5038610dcf565b6110e2925080808093335af16108216115bd565b610f8e565b50600a541515610ceb565b346101f85760203660031901126101f85760043561110f816101fd565b6000546001600160a01b039061112890821633146111f6565b811615611138576105f390611241565b60405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608490fd5b346101f85760003660031901126101f8576002546040516001600160a01b039091168152602090f35b346101f85760003660031901126101f857602060ff601654166040519015158152f35b346101f85760003660031901126101f8576020601354604051908152f35b156111fd57565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b600080546001600160a01b039283166001600160a01b03198216811783559216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a3565b601f8111611294575050565b6000906004825260208220906020601f850160051c830194106112d2575b601f0160051c01915b8281106112c757505050565b8181556001016112bb565b90925082906112b2565b90815167ffffffffffffffff811161042357611302816112fd6004546103b7565b611288565b602080601f831160011461133e5750819293600092611333575b50508160011b916000199060031b1c191617600455565b01519050388061131c565b6004600052601f198316949091907f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b926000905b8782106113aa575050836001959610611391575b505050811b01600455565b015160001960f88460031b161c19169055388080611386565b80600185968294968601518155019501930190611372565b156113c957565b60405162461bcd60e51b815260206004820152600b60248201526a139bdd081cdd185c9d195960aa1b6044820152606490fd5b1561140357565b60405162461bcd60e51b8152602060048201526005602482015264115b99195960da1b6044820152606490fd5b1561143757565b60405162461bcd60e51b815260206004820152601460248201527313195cdcc81d1a195b881b5a5b88185b5bdd5b9d60621b6044820152606490fd5b1561147a57565b60405162461bcd60e51b8152602060048201526014602482015273135bdc99481d1a195b881b585e08185b5bdd5b9d60621b6044820152606490fd5b156114bd57565b60405162461bcd60e51b815260206004820152600a60248201526913dd995c999a5b1b195960b21b6044820152606490fd5b634e487b7160e01b600052601160045260246000fd5b90610168820180921161151457565b6114ef565b9190820180921161151457565b1561152d57565b60405162461bcd60e51b815260206004820152601b60248201527f5468652049444f20706f6f6c20686173206e6f7420656e6465642e00000000006044820152606490fd5b1561157957565b606460405162461bcd60e51b815260206004820152602060248201527f5468652049444f20706f6f6c2068617320726561636820736f6674206361702e6044820152fd5b3d156115e8573d906115ce826109b6565b916115dc6040519384610428565b82523d6000602084013e565b606090565b156115f457565b60405162461bcd60e51b815260206004820152601060248201526f2a3930b739b332b9103330b4b632b21760811b6044820152606490fd5b1561163357565b60405162461bcd60e51b8152602060048201526024808201527f5468652049444f20706f6f6c20646964206e6f7420726561636820736f66742060448201526331b0b81760e11b6064820152608490fd5b60405163a9059cbb60e01b60208083019182526001600160a01b039490941660248301526044808301959095529381529192906116c2606484610428565b60018060a01b031690604051926116d884610407565b8484527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656485850152823b1561174b57611724939260009283809351925af161171e6115bd565b90611807565b8051908161173157505050565b8261174993611744938301019101611790565b6117a8565b565b60405162461bcd60e51b815260048101869052601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b908160209103126101f8575180151581036101f85790565b156117af57565b60405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608490fd5b90919015611813575090565b8151156118235750805190602001fd5b60405162461bcd60e51b81526020600482015290819061184790602483019061046d565b0390fd5b1561185257565b60405162461bcd60e51b815260206004820152601460248201527320b63932b0b23c903234b9ba3934b13aba32b21760611b6044820152606490fd5b9190820391821161151457565b8181029291811591840414171561151457565b6040513d6000823e3d90fd5b908160209103126101f857516104a3816101fd565b6020818303126101f85780519067ffffffffffffffff82116101f8570181601f820112156101f8578051611902816109b6565b926119106040519485610428565b818452602082840101116101f8576104a3916020808501910161044a565b90611749602e6040518461194c82965180926020808601910161044a565b81016d103a37b5b2b739903637b1b5b2b960911b602082015203600e810185520183610428565b9061199b6080939695949660018060a01b03809316845260a0602085015260a084019061046d565b95600060408401521660608201520152565b908160209103126101f8575190565b6002546040516370a0823160e01b815230600482015290602090829060249082906001600160a01b03165afa90811561095257600091611a13575b5060155481018091116115145760145481039081116115145790565b611a2b915060203d811161094b5761093c8183610428565b386119f7565b15611a3857565b60405162461bcd60e51b815260206004820152602360248201527f5468652049444f20706f6f6c20686173206e6f7420726566756e6420746f6b6560448201526237399760e91b6064820152608490fd5b8115611aa95760035491604d8311611514576104a392600a0a910461189b565b634e487b7160e01b600052601260045260246000fdfea164736f6c6343000812000aa164736f6c6343000812000a