Contract Address Details
contract

0x94b8b6e9Ee07132363410091B221873e27Bd4777

Contract Name
PresaleGenerator01
Creator
0x60e2e1–b2099a at 0x3df94e–94c78d
Balance
0 xDAI ( )
Tokens
Fetching tokens...
Transactions
Transfers
Gas Used
Last Balance Update
18754679
Contract name:
PresaleGenerator01




Optimization enabled
true
Compiler version
v0.6.12+commit.27d51765




Optimization runs
200
EVM Version
default




Verified at
2021-02-11 11:23:20.990865Z

Contract source code

// SPDX-License-Identifier: MIT
// MIT LICENSE FOR ALL OPEN ZEPPLIN CONTRACTS
// SPDX-License-Identifier: UNLICENSED
// ALL RIGHTS RESERVED FOR ALL UNICRYPT PRESALE CONTRACTS
// File: contracts\TransferHelper.sol
pragma solidity 0.6.12;
/**
helper methods for interacting with ERC20 tokens that do not consistently return true/false
with the addition of a transfer function to send eth or an erc20 token
*/
library TransferHelper {
function safeApprove(address token, address to, uint value) internal {
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x095ea7b3, to, value));
require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: APPROVE_FAILED');
}
function safeTransfer(address token, address to, uint value) internal {
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value));
require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FAILED');
}
function safeTransferFrom(address token, address from, address to, uint value) internal {
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value));
require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FROM_FAILED');
}
// sends ETH or an erc20 token
function safeTransferBaseToken(address token, address payable to, uint value, bool isERC20) internal {
if (!isERC20) {
to.transfer(value);
} else {
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value));
require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FAILED');
}
}
}
// File: contracts\EnumerableSet.sol
// From https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/EnumerableSet.sol
// Subject to the MIT license.
pragma solidity >=0.6.0 <0.8.0;
/**
* @dev Library for managing
* https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
* types.
*
* Sets have the following properties:
*
* - Elements are added, removed, and checked for existence in constant time
* (O(1)).
* - Elements are enumerated in O(n). No guarantees are made on the ordering.
*
* ```
* contract Example {
* // Add the library methods
* using EnumerableSet for EnumerableSet.AddressSet;
*
* // Declare a set state variable
* EnumerableSet.AddressSet private mySet;
* }
* ```
*
* As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
* and `uint256` (`UintSet`) are supported.
*/
library EnumerableSet {
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Set type with
// bytes32 values.
// The Set implementation uses private functions, and user-facing
// implementations (such as AddressSet) are just wrappers around the
// underlying Set.
// This means that we can only create new EnumerableSets for types that fit
// in bytes32.
struct Set {
// Storage of set values
bytes32[] _values;
// Position of the value in the `values` array, plus 1 because index 0
// means a value is not in the set.
mapping (bytes32 => uint256) _indexes;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function _add(Set storage set, bytes32 value) private returns (bool) {
if (!_contains(set, value)) {
set._values.push(value);
// The value is stored at length-1, but we add 1 to all indexes
// and use 0 as a sentinel value
set._indexes[value] = set._values.length;
return true;
} else {
return false;
}
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function _remove(Set storage set, bytes32 value) private returns (bool) {
// We read and store the value's index to prevent multiple reads from the same storage slot
uint256 valueIndex = set._indexes[value];
if (valueIndex != 0) { // Equivalent to contains(set, value)
// To delete an element from the _values array in O(1), we swap the element to delete with the last one in
// the array, and then remove the last element (sometimes called as 'swap and pop').
// This modifies the order of the array, as noted in {at}.
uint256 toDeleteIndex = valueIndex - 1;
uint256 lastIndex = set._values.length - 1;
// When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs
// so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.
bytes32 lastvalue = set._values[lastIndex];
// Move the last value to the index where the value to delete is
set._values[toDeleteIndex] = lastvalue;
// Update the index for the moved value
set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based
// Delete the slot where the moved value was stored
set._values.pop();
// Delete the index for the deleted slot
delete set._indexes[value];
return true;
} else {
return false;
}
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function _contains(Set storage set, bytes32 value) private view returns (bool) {
return set._indexes[value] != 0;
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function _length(Set storage set) private view returns (uint256) {
return set._values.length;
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function _at(Set storage set, uint256 index) private view returns (bytes32) {
require(set._values.length > index, "EnumerableSet: index out of bounds");
return set._values[index];
}
// Bytes32Set
struct Bytes32Set {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
return _add(set._inner, value);
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
return _remove(set._inner, value);
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
return _contains(set._inner, value);
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(Bytes32Set storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
return _at(set._inner, index);
}
// AddressSet
struct AddressSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(AddressSet storage set, address value) internal returns (bool) {
return _add(set._inner, bytes32(uint256(value)));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(AddressSet storage set, address value) internal returns (bool) {
return _remove(set._inner, bytes32(uint256(value)));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(AddressSet storage set, address value) internal view returns (bool) {
return _contains(set._inner, bytes32(uint256(value)));
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(AddressSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(AddressSet storage set, uint256 index) internal view returns (address) {
return address(uint256(_at(set._inner, index)));
}
// UintSet
struct UintSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(UintSet storage set, uint256 value) internal returns (bool) {
return _add(set._inner, bytes32(value));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(UintSet storage set, uint256 value) internal returns (bool) {
return _remove(set._inner, bytes32(value));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(UintSet storage set, uint256 value) internal view returns (bool) {
return _contains(set._inner, bytes32(value));
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function length(UintSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(UintSet storage set, uint256 index) internal view returns (uint256) {
return uint256(_at(set._inner, index));
}
}
// File: contracts\SafeMath.sol
// From https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/math/SafeMath.sol
// Subject to the MIT license.
pragma solidity >=0.6.0 <0.8.0;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @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) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @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 sub(a, b, "SafeMath: subtraction overflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @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) {
// 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 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts 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) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts 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) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts 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 mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message 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, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
// File: contracts\ReentrancyGuard.sol
// From https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/ReentrancyGuard.sol
// Subject to the MIT license.
pragma solidity >=0.6.0 <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 () internal {
_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;
}
}
// File: contracts\IERC20.sol
pragma solidity >=0.5.0;
interface IERC20 {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function decimals() external view returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
}
// File: contracts\Presale01.sol
// Forked from Ethereum mainnet for Honeyswap on xDai with no code changes
// WETH = WXDAI
// ETH = XDAI
// Presale contract. Version 1
/**
Allows a decentralised presale to take place, and on success creates a uniswap pair and locks liquidity on Unicrypt.
B_TOKEN, or base token, is the token the presale attempts to raise. (Usally ETH).
S_TOKEN, or sale token, is the token being sold, which investors buy with the base token.
If the base currency is set to the WETH9 address, the presale is in ETH.
Otherwise it is for an ERC20 token - such as DAI, USDC, WBTC etc.
For the Base token - It is advised to only use tokens such as ETH (WETH), DAI, USDC or tokens that have no rebasing, or complex fee on transfers. 1 token should ideally always be 1 token.
Token withdrawls are done on a percent of total contribution basis (opposed to via a hardcoded 'amount'). This allows
fee on transfer, rebasing, or any magically changing balances to still work for the Sale token.
*/
pragma solidity 0.6.12;
interface IUniswapV2Factory {
function getPair(address tokenA, address tokenB) external view returns (address pair);
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IPresaleLockForwarder {
function lockLiquidity (IERC20 _baseToken, IERC20 _saleToken, uint256 _baseAmount, uint256 _saleAmount, uint256 _unlock_date, address payable _withdrawer) external;
function uniswapPairIsInitialised (address _token0, address _token1) external view returns (bool);
}
interface IWETH {
function deposit() external payable;
function transfer(address to, uint value) external returns (bool);
function withdraw(uint) external;
}
interface IPresaleSettings {
function getMaxPresaleLength () external view returns (uint256);
function getRound1Length () external view returns (uint256);
function userHoldsSufficientRound1Token (address _user) external view returns (bool);
function referrerIsValid(address _referrer) external view returns (bool);
function getBaseFee () external view returns (uint256);
function getTokenFee () external view returns (uint256);
function getEthAddress () external view returns (address payable);
function getTokenAddress () external view returns (address payable);
function getReferralFee () external view returns (uint256);
function getEthCreationFee () external view returns (uint256);
}
contract Presale01 is ReentrancyGuard {
using SafeMath for uint256;
using EnumerableSet for EnumerableSet.AddressSet;
/// @notice Presale Contract Version, used to choose the correct ABI to decode the contract
uint256 public CONTRACT_VERSION = 1;
struct PresaleInfo {
address payable PRESALE_OWNER;
IERC20 S_TOKEN; // sale token
IERC20 B_TOKEN; // base token // usually WETH (ETH)
uint256 TOKEN_PRICE; // 1 base token = ? s_tokens, fixed price
uint256 MAX_SPEND_PER_BUYER; // maximum base token BUY amount per account
uint256 AMOUNT; // the amount of presale tokens up for presale
uint256 HARDCAP;
uint256 SOFTCAP;
uint256 LIQUIDITY_PERCENT; // divided by 1000
uint256 LISTING_RATE; // fixed rate at which the token will list on uniswap
uint256 START_BLOCK;
uint256 END_BLOCK;
uint256 LOCK_PERIOD; // unix timestamp -> e.g. 2 weeks
bool PRESALE_IN_ETH; // if this flag is true the presale is raising ETH, otherwise an ERC20 token such as DAI
}
struct PresaleFeeInfo {
uint256 UNICRYPT_BASE_FEE; // divided by 1000
uint256 UNICRYPT_TOKEN_FEE; // divided by 1000
uint256 REFERRAL_FEE; // divided by 1000
address payable BASE_FEE_ADDRESS;
address payable TOKEN_FEE_ADDRESS;
address payable REFERRAL_FEE_ADDRESS; // if this is not address(0), there is a valid referral
}
struct PresaleStatus {
bool WHITELIST_ONLY; // if set to true only whitelisted members may participate
bool LP_GENERATION_COMPLETE; // final flag required to end a presale and enable withdrawls
bool FORCE_FAILED; // set this flag to force fail the presale
uint256 TOTAL_BASE_COLLECTED; // total base currency raised (usually ETH)
uint256 TOTAL_TOKENS_SOLD; // total presale tokens sold
uint256 TOTAL_TOKENS_WITHDRAWN; // total tokens withdrawn post successful presale
uint256 TOTAL_BASE_WITHDRAWN; // total base tokens withdrawn on presale failure
uint256 ROUND1_LENGTH; // in blocks
uint256 NUM_BUYERS; // number of unique participants
}
struct BuyerInfo {
uint256 baseDeposited; // total base token (usually ETH) deposited by user, can be withdrawn on presale failure
uint256 tokensOwed; // num presale tokens a user is owed, can be withdrawn on presale success
}
PresaleInfo public PRESALE_INFO;
PresaleFeeInfo public PRESALE_FEE_INFO;
PresaleStatus public STATUS;
address public PRESALE_GENERATOR;
IPresaleLockForwarder public PRESALE_LOCK_FORWARDER;
IPresaleSettings public PRESALE_SETTINGS;
address UNICRYPT_DEV_ADDRESS;
IUniswapV2Factory public UNI_FACTORY;
IWETH public WETH;
mapping(address => BuyerInfo) public BUYERS;
EnumerableSet.AddressSet private WHITELIST;
constructor(address _presaleGenerator) public {
PRESALE_GENERATOR = _presaleGenerator;
UNI_FACTORY = IUniswapV2Factory(0xA818b4F111Ccac7AA31D0BCc0806d64F2E0737D7);
WETH = IWETH(0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d);
PRESALE_SETTINGS = IPresaleSettings(0x687F8AE35581D5729253542524be3eD9445ee607);
PRESALE_LOCK_FORWARDER = IPresaleLockForwarder(0x8a5e208C1cA217Db8Ee64e8d390CF1f25De35A4e);
UNICRYPT_DEV_ADDRESS = 0x60e2E1b2a317EdfC870b6Fc6886F69083FB2099a;
}
function init1 (
address payable _presaleOwner,
uint256 _amount,
uint256 _tokenPrice,
uint256 _maxEthPerBuyer,
uint256 _hardcap,
uint256 _softcap,
uint256 _liquidityPercent,
uint256 _listingRate,
uint256 _startblock,
uint256 _endblock,
uint256 _lockPeriod
) external {
require(msg.sender == PRESALE_GENERATOR, 'FORBIDDEN');
PRESALE_INFO.PRESALE_OWNER = _presaleOwner;
PRESALE_INFO.AMOUNT = _amount;
PRESALE_INFO.TOKEN_PRICE = _tokenPrice;
PRESALE_INFO.MAX_SPEND_PER_BUYER = _maxEthPerBuyer;
PRESALE_INFO.HARDCAP = _hardcap;
PRESALE_INFO.SOFTCAP = _softcap;
PRESALE_INFO.LIQUIDITY_PERCENT = _liquidityPercent;
PRESALE_INFO.LISTING_RATE = _listingRate;
PRESALE_INFO.START_BLOCK = _startblock;
PRESALE_INFO.END_BLOCK = _endblock;
PRESALE_INFO.LOCK_PERIOD = _lockPeriod;
}
function init2 (
IERC20 _baseToken,
IERC20 _presaleToken,
uint256 _unicryptBaseFee,
uint256 _unicryptTokenFee,
uint256 _referralFee,
address payable _baseFeeAddress,
address payable _tokenFeeAddress,
address payable _referralAddress
) external {
require(msg.sender == PRESALE_GENERATOR, 'FORBIDDEN');
// require(!PRESALE_LOCK_FORWARDER.uniswapPairIsInitialised(address(_presaleToken), address(_baseToken)), 'PAIR INITIALISED');
PRESALE_INFO.PRESALE_IN_ETH = address(_baseToken) == address(WETH);
PRESALE_INFO.S_TOKEN = _presaleToken;
PRESALE_INFO.B_TOKEN = _baseToken;
PRESALE_FEE_INFO.UNICRYPT_BASE_FEE = _unicryptBaseFee;
PRESALE_FEE_INFO.UNICRYPT_TOKEN_FEE = _unicryptTokenFee;
PRESALE_FEE_INFO.REFERRAL_FEE = _referralFee;
PRESALE_FEE_INFO.BASE_FEE_ADDRESS = _baseFeeAddress;
PRESALE_FEE_INFO.TOKEN_FEE_ADDRESS = _tokenFeeAddress;
PRESALE_FEE_INFO.REFERRAL_FEE_ADDRESS = _referralAddress;
STATUS.ROUND1_LENGTH = PRESALE_SETTINGS.getRound1Length();
}
modifier onlyPresaleOwner() {
require(PRESALE_INFO.PRESALE_OWNER == msg.sender, "NOT PRESALE OWNER");
_;
}
function presaleStatus () public view returns (uint256) {
if (STATUS.FORCE_FAILED) {
return 3; // FAILED - force fail
}
if ((block.number > PRESALE_INFO.END_BLOCK) && (STATUS.TOTAL_BASE_COLLECTED < PRESALE_INFO.SOFTCAP)) {
return 3; // FAILED - softcap not met by end block
}
if (STATUS.TOTAL_BASE_COLLECTED >= PRESALE_INFO.HARDCAP) {
return 2; // SUCCESS - hardcap met
}
if ((block.number > PRESALE_INFO.END_BLOCK) && (STATUS.TOTAL_BASE_COLLECTED >= PRESALE_INFO.SOFTCAP)) {
return 2; // SUCCESS - endblock and soft cap reached
}
if ((block.number >= PRESALE_INFO.START_BLOCK) && (block.number <= PRESALE_INFO.END_BLOCK)) {
return 1; // ACTIVE - deposits enabled
}
return 0; // QUED - awaiting start block
}
// accepts msg.value for eth or _amount for ERC20 tokens
function userDeposit (uint256 _amount) external payable nonReentrant {
require(presaleStatus() == 1, 'NOT ACTIVE'); // ACTIVE
if (STATUS.WHITELIST_ONLY) {
require(WHITELIST.contains(msg.sender), 'NOT WHITELISTED');
}
// Presale Round 1 - require participant to hold a certain token and balance
if (block.number < PRESALE_INFO.START_BLOCK + STATUS.ROUND1_LENGTH) { // 276 blocks = 1 hour
require(PRESALE_SETTINGS.userHoldsSufficientRound1Token(msg.sender), 'INSUFFICENT ROUND 1 TOKEN BALANCE');
}
BuyerInfo storage buyer = BUYERS[msg.sender];
uint256 amount_in = PRESALE_INFO.PRESALE_IN_ETH ? msg.value : _amount;
uint256 allowance = PRESALE_INFO.MAX_SPEND_PER_BUYER.sub(buyer.baseDeposited);
uint256 remaining = PRESALE_INFO.HARDCAP - STATUS.TOTAL_BASE_COLLECTED;
allowance = allowance > remaining ? remaining : allowance;
if (amount_in > allowance) {
amount_in = allowance;
}
uint256 tokensSold = amount_in.mul(PRESALE_INFO.TOKEN_PRICE).div(10 ** uint256(PRESALE_INFO.B_TOKEN.decimals()));
require(tokensSold > 0, 'ZERO TOKENS');
if (buyer.baseDeposited == 0) {
STATUS.NUM_BUYERS++;
}
buyer.baseDeposited = buyer.baseDeposited.add(amount_in);
buyer.tokensOwed = buyer.tokensOwed.add(tokensSold);
STATUS.TOTAL_BASE_COLLECTED = STATUS.TOTAL_BASE_COLLECTED.add(amount_in);
STATUS.TOTAL_TOKENS_SOLD = STATUS.TOTAL_TOKENS_SOLD.add(tokensSold);
// return unused ETH
if (PRESALE_INFO.PRESALE_IN_ETH && amount_in < msg.value) {
msg.sender.transfer(msg.value.sub(amount_in));
}
// deduct non ETH token from user
if (!PRESALE_INFO.PRESALE_IN_ETH) {
TransferHelper.safeTransferFrom(address(PRESALE_INFO.B_TOKEN), msg.sender, address(this), amount_in);
}
}
// withdraw presale tokens
// percentile withdrawls allows fee on transfer or rebasing tokens to still work
function userWithdrawTokens () external nonReentrant {
require(STATUS.LP_GENERATION_COMPLETE, 'AWAITING LP GENERATION');
BuyerInfo storage buyer = BUYERS[msg.sender];
uint256 tokensRemainingDenominator = STATUS.TOTAL_TOKENS_SOLD.sub(STATUS.TOTAL_TOKENS_WITHDRAWN);
uint256 tokensOwed = PRESALE_INFO.S_TOKEN.balanceOf(address(this)).mul(buyer.tokensOwed).div(tokensRemainingDenominator);
require(tokensOwed > 0, 'NOTHING TO WITHDRAW');
STATUS.TOTAL_TOKENS_WITHDRAWN = STATUS.TOTAL_TOKENS_WITHDRAWN.add(buyer.tokensOwed);
buyer.tokensOwed = 0;
TransferHelper.safeTransfer(address(PRESALE_INFO.S_TOKEN), msg.sender, tokensOwed);
}
// on presale failure
// percentile withdrawls allows fee on transfer or rebasing tokens to still work
function userWithdrawBaseTokens () external nonReentrant {
require(presaleStatus() == 3, 'NOT FAILED'); // FAILED
BuyerInfo storage buyer = BUYERS[msg.sender];
uint256 baseRemainingDenominator = STATUS.TOTAL_BASE_COLLECTED.sub(STATUS.TOTAL_BASE_WITHDRAWN);
uint256 remainingBaseBalance = PRESALE_INFO.PRESALE_IN_ETH ? address(this).balance : PRESALE_INFO.B_TOKEN.balanceOf(address(this));
uint256 tokensOwed = remainingBaseBalance.mul(buyer.baseDeposited).div(baseRemainingDenominator);
require(tokensOwed > 0, 'NOTHING TO WITHDRAW');
STATUS.TOTAL_BASE_WITHDRAWN = STATUS.TOTAL_BASE_WITHDRAWN.add(buyer.baseDeposited);
buyer.baseDeposited = 0;
TransferHelper.safeTransferBaseToken(address(PRESALE_INFO.B_TOKEN), msg.sender, tokensOwed, !PRESALE_INFO.PRESALE_IN_ETH);
}
// on presale failure
// allows the owner to withdraw the tokens they sent for presale & initial liquidity
function ownerWithdrawTokens () external onlyPresaleOwner {
require(presaleStatus() == 3); // FAILED
TransferHelper.safeTransfer(address(PRESALE_INFO.S_TOKEN), PRESALE_INFO.PRESALE_OWNER, PRESALE_INFO.S_TOKEN.balanceOf(address(this)));
}
// Can be called at any stage before or during the presale to cancel it before it ends.
// If the pair already exists on uniswap and it contains the presale token as liquidity
// the final stage of the presale 'addLiquidity()' will fail. This function
// allows anyone to end the presale prematurely to release funds in such a case.
function forceFailIfPairExists () external {
require(!STATUS.LP_GENERATION_COMPLETE && !STATUS.FORCE_FAILED);
if (PRESALE_LOCK_FORWARDER.uniswapPairIsInitialised(address(PRESALE_INFO.S_TOKEN), address(PRESALE_INFO.B_TOKEN))) {
STATUS.FORCE_FAILED = true;
}
}
// if something goes wrong in LP generation
function forceFailByUnicrypt () external {
require(msg.sender == UNICRYPT_DEV_ADDRESS);
STATUS.FORCE_FAILED = true;
}
// on presale success, this is the final step to end the presale, lock liquidity and enable withdrawls of the sale token.
// This function does not use percentile distribution. Rebasing mechanisms, fee on transfers, or any deflationary logic
// are not taken into account at this stage to ensure stated liquidity is locked and the pool is initialised according to
// the presale parameters and fixed prices.
function addLiquidity() external nonReentrant {
require(!STATUS.LP_GENERATION_COMPLETE, 'GENERATION COMPLETE');
require(presaleStatus() == 2, 'NOT SUCCESS'); // SUCCESS
// Fail the presale if the pair exists and contains presale token liquidity
if (PRESALE_LOCK_FORWARDER.uniswapPairIsInitialised(address(PRESALE_INFO.S_TOKEN), address(PRESALE_INFO.B_TOKEN))) {
STATUS.FORCE_FAILED = true;
return;
}
uint256 unicryptBaseFee = STATUS.TOTAL_BASE_COLLECTED.mul(PRESALE_FEE_INFO.UNICRYPT_BASE_FEE).div(1000);
// base token liquidity
uint256 baseLiquidity = STATUS.TOTAL_BASE_COLLECTED.sub(unicryptBaseFee).mul(PRESALE_INFO.LIQUIDITY_PERCENT).div(1000);
if (PRESALE_INFO.PRESALE_IN_ETH) {
WETH.deposit{value : baseLiquidity}();
}
TransferHelper.safeApprove(address(PRESALE_INFO.B_TOKEN), address(PRESALE_LOCK_FORWARDER), baseLiquidity);
// sale token liquidity
uint256 tokenLiquidity = baseLiquidity.mul(PRESALE_INFO.LISTING_RATE).div(10 ** uint256(PRESALE_INFO.B_TOKEN.decimals()));
TransferHelper.safeApprove(address(PRESALE_INFO.S_TOKEN), address(PRESALE_LOCK_FORWARDER), tokenLiquidity);
PRESALE_LOCK_FORWARDER.lockLiquidity(PRESALE_INFO.B_TOKEN, PRESALE_INFO.S_TOKEN, baseLiquidity, tokenLiquidity, block.timestamp + PRESALE_INFO.LOCK_PERIOD, PRESALE_INFO.PRESALE_OWNER);
// transfer fees
uint256 unicryptTokenFee = STATUS.TOTAL_TOKENS_SOLD.mul(PRESALE_FEE_INFO.UNICRYPT_TOKEN_FEE).div(1000);
// referrals are checked for validity in the presale generator
if (PRESALE_FEE_INFO.REFERRAL_FEE_ADDRESS != address(0)) {
// Base token fee
uint256 referralBaseFee = unicryptBaseFee.mul(PRESALE_FEE_INFO.REFERRAL_FEE).div(1000);
TransferHelper.safeTransferBaseToken(address(PRESALE_INFO.B_TOKEN), PRESALE_FEE_INFO.REFERRAL_FEE_ADDRESS, referralBaseFee, !PRESALE_INFO.PRESALE_IN_ETH);
unicryptBaseFee = unicryptBaseFee.sub(referralBaseFee);
// Token fee
uint256 referralTokenFee = unicryptTokenFee.mul(PRESALE_FEE_INFO.REFERRAL_FEE).div(1000);
TransferHelper.safeTransfer(address(PRESALE_INFO.S_TOKEN), PRESALE_FEE_INFO.REFERRAL_FEE_ADDRESS, referralTokenFee);
unicryptTokenFee = unicryptTokenFee.sub(referralTokenFee);
}
TransferHelper.safeTransferBaseToken(address(PRESALE_INFO.B_TOKEN), PRESALE_FEE_INFO.BASE_FEE_ADDRESS, unicryptBaseFee, !PRESALE_INFO.PRESALE_IN_ETH);
TransferHelper.safeTransfer(address(PRESALE_INFO.S_TOKEN), PRESALE_FEE_INFO.TOKEN_FEE_ADDRESS, unicryptTokenFee);
// burn unsold tokens
uint256 remainingSBalance = PRESALE_INFO.S_TOKEN.balanceOf(address(this));
if (remainingSBalance > STATUS.TOTAL_TOKENS_SOLD) {
uint256 burnAmount = remainingSBalance.sub(STATUS.TOTAL_TOKENS_SOLD);
TransferHelper.safeTransfer(address(PRESALE_INFO.S_TOKEN), 0x000000000000000000000000000000000000dEaD, burnAmount);
}
// send remaining base tokens to presale owner
uint256 remainingBaseBalance = PRESALE_INFO.PRESALE_IN_ETH ? address(this).balance : PRESALE_INFO.B_TOKEN.balanceOf(address(this));
TransferHelper.safeTransferBaseToken(address(PRESALE_INFO.B_TOKEN), PRESALE_INFO.PRESALE_OWNER, remainingBaseBalance, !PRESALE_INFO.PRESALE_IN_ETH);
STATUS.LP_GENERATION_COMPLETE = true;
}
function updateMaxSpendLimit(uint256 _maxSpend) external onlyPresaleOwner {
PRESALE_INFO.MAX_SPEND_PER_BUYER = _maxSpend;
}
// postpone or bring a presale forward, this will only work when a presale is inactive.
// i.e. current start block > block.number
function updateBlocks(uint256 _startBlock, uint256 _endBlock) external onlyPresaleOwner {
require(PRESALE_INFO.START_BLOCK > block.number);
require(_endBlock.sub(_startBlock) <= PRESALE_SETTINGS.getMaxPresaleLength());
PRESALE_INFO.START_BLOCK = _startBlock;
PRESALE_INFO.END_BLOCK = _endBlock;
}
// editable at any stage of the presale
function setWhitelistFlag(bool _flag) external onlyPresaleOwner {
STATUS.WHITELIST_ONLY = _flag;
}
// editable at any stage of the presale
function editWhitelist(address[] memory _users, bool _add) external onlyPresaleOwner {
if (_add) {
for (uint i = 0; i < _users.length; i++) {
WHITELIST.add(_users[i]);
}
} else {
for (uint i = 0; i < _users.length; i++) {
WHITELIST.remove(_users[i]);
}
}
}
// whitelist getters
function getWhitelistedUsersLength () external view returns (uint256) {
return WHITELIST.length();
}
function getWhitelistedUserAtIndex (uint256 _index) external view returns (address) {
return WHITELIST.at(_index);
}
function getUserWhitelistStatus (address _user) external view returns (bool) {
return WHITELIST.contains(_user);
}
}
// File: contracts\Context.sol
// From https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/GSN/Context.sol
// Subject to the MIT license.
pragma solidity >=0.6.0 <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 GSN 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 payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
// File: contracts\Ownable.sol
// From https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol
// Subject to the MIT license.
pragma solidity >=0.6.0 <0.8.0;
/**
* @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 () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view 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 {
emit OwnershipTransferred(_owner, address(0));
_owner = 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");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
// File: contracts\PresaleHelper.sol
pragma solidity 0.6.12;
// A simple library for initial presale parameter calculations
library PresaleHelper {
using SafeMath for uint256;
function calculateAmountRequired (uint256 _amount, uint256 _tokenPrice, uint256 _listingRate, uint256 _liquidityPercent, uint256 _tokenFee) public pure returns (uint256) {
uint256 listingRatePercent = _listingRate.mul(1000).div(_tokenPrice);
uint256 unicryptTokenFee = _amount.mul(_tokenFee).div(1000);
uint256 amountMinusFee = _amount.sub(unicryptTokenFee);
uint256 liquidityRequired = amountMinusFee.mul(_liquidityPercent).mul(listingRatePercent).div(1000000);
uint256 tokensRequiredForPresale = _amount.add(liquidityRequired).add(unicryptTokenFee);
return tokensRequiredForPresale;
}
}
// File: contracts\PresaleGenerator01.sol
// Forked from Ethereum mainnet for Honeyswap on xDai with no code changes
// WETH = WXDAI
// ETH = XDAI
// This contract generates Presale01 contracts and registers them in the PresaleFactory.
// Ideally you should not interact with this contract directly, and use the Unicrypt presale app instead so warnings can be shown where necessary.
pragma solidity 0.6.12;
interface IPresaleFactory {
function registerPresale (address _presaleAddress) external;
function presaleIsRegistered(address _presaleAddress) external view returns (bool);
}
interface IUniswapV2Locker {
function lockLPToken (address _lpToken, uint256 _amount, uint256 _unlock_date, address payable _referral, bool _fee_in_eth, address payable _withdrawer) external payable;
}
contract PresaleGenerator01 is Ownable {
using SafeMath for uint256;
IPresaleFactory public PRESALE_FACTORY;
IPresaleSettings public PRESALE_SETTINGS;
struct PresaleParams {
uint256 amount;
uint256 tokenPrice;
uint256 maxSpendPerBuyer;
uint256 hardcap;
uint256 softcap;
uint256 liquidityPercent;
uint256 listingRate; // sale token listing price on uniswap
uint256 startblock;
uint256 endblock;
uint256 lockPeriod;
}
constructor() public {
PRESALE_FACTORY = IPresaleFactory(0x2f4eb47A1b1F4488C71fc10e39a4aa56AF33Dd49);
PRESALE_SETTINGS = IPresaleSettings(0x687F8AE35581D5729253542524be3eD9445ee607);
}
/**
* @notice Creates a new Presale contract and registers it in the PresaleFactory.sol.
*/
function createPresale (
address payable _presaleOwner,
IERC20 _presaleToken,
IERC20 _baseToken,
address payable _referralAddress,
uint256[10] memory uint_params
) public payable {
PresaleParams memory params;
params.amount = uint_params[0];
params.tokenPrice = uint_params[1];
params.maxSpendPerBuyer = uint_params[2];
params.hardcap = uint_params[3];
params.softcap = uint_params[4];
params.liquidityPercent = uint_params[5];
params.listingRate = uint_params[6];
params.startblock = uint_params[7];
params.endblock = uint_params[8];
params.lockPeriod = uint_params[9];
if (params.lockPeriod < 4 weeks) {
params.lockPeriod = 4 weeks;
}
// Charge ETH fee for contract creation
require(msg.value == PRESALE_SETTINGS.getEthCreationFee(), 'FEE NOT MET');
PRESALE_SETTINGS.getEthAddress().transfer(PRESALE_SETTINGS.getEthCreationFee());
if (_referralAddress != address(0)) {
require(PRESALE_SETTINGS.referrerIsValid(_referralAddress), 'INVALID REFERRAL');
}
require(params.amount >= 10000, 'MIN DIVIS'); // minimum divisibility
require(params.endblock.sub(params.startblock) <= PRESALE_SETTINGS.getMaxPresaleLength());
require(params.tokenPrice.mul(params.hardcap) > 0, 'INVALID PARAMS'); // ensure no overflow for future calculations
require(params.liquidityPercent >= 300 && params.liquidityPercent <= 1000, 'MIN LIQUIDITY'); // 30% minimum liquidity lock
uint256 tokensRequiredForPresale = PresaleHelper.calculateAmountRequired(params.amount, params.tokenPrice, params.listingRate, params.liquidityPercent, PRESALE_SETTINGS.getTokenFee());
Presale01 newPresale = new Presale01(address(this));
TransferHelper.safeTransferFrom(address(_presaleToken), address(msg.sender), address(newPresale), tokensRequiredForPresale);
newPresale.init1(_presaleOwner, params.amount, params.tokenPrice, params.maxSpendPerBuyer, params.hardcap, params.softcap,
params.liquidityPercent, params.listingRate, params.startblock, params.endblock, params.lockPeriod);
newPresale.init2(_baseToken, _presaleToken, PRESALE_SETTINGS.getBaseFee(), PRESALE_SETTINGS.getTokenFee(), PRESALE_SETTINGS.getReferralFee(), PRESALE_SETTINGS.getEthAddress(), PRESALE_SETTINGS.getTokenAddress(), _referralAddress);
PRESALE_FACTORY.registerPresale(address(newPresale));
}
}

Contract ABI

[{"type":"constructor","stateMutability":"nonpayable","inputs":[]},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IPresaleFactory"}],"name":"PRESALE_FACTORY","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IPresaleSettings"}],"name":"PRESALE_SETTINGS","inputs":[]},{"type":"function","stateMutability":"payable","outputs":[],"name":"createPresale","inputs":[{"type":"address","name":"_presaleOwner","internalType":"address payable"},{"type":"address","name":"_presaleToken","internalType":"contract IERC20"},{"type":"address","name":"_baseToken","internalType":"contract IERC20"},{"type":"address","name":"_referralAddress","internalType":"address payable"},{"type":"uint256[10]","name":"uint_params","internalType":"uint256[10]"}]},{"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":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]}]
            

Deployed ByteCode

0x6080604052600436106100555760003560e01c80630bbebba41461005a5780634d8f18241461008b578063715018a6146101075780638da5cb5b1461011c578063cd608cbb14610131578063f2fde38b14610146575b600080fd5b34801561006657600080fd5b5061006f610179565b604080516001600160a01b039092168252519081900360200190f35b61010560048036036101c08110156100a257600080fd5b6040805161014081810183526001600160a01b0385358116956020810135821695948101358216946060820135909216939181019290916101c08301916080840190600a9083908390808284376000920191909152509194506101889350505050565b005b34801561011357600080fd5b50610105610bf4565b34801561012857600080fd5b5061006f610ca8565b34801561013d57600080fd5b5061006f610cb7565b34801561015257600080fd5b506101056004803603602081101561016957600080fd5b50356001600160a01b0316610cc6565b6002546001600160a01b031681565b61019061106c565b815181526020808301519082015260408083015190820152606080830151908201526080808301519082015260a0808301519082015260c0808301519082015260e080830151908201526101008083015190820152610120808301519082018190526224ea001115610207576224ea006101208201525b600260009054906101000a90046001600160a01b03166001600160a01b031663e38ef7a36040518163ffffffff1660e01b815260040160206040518083038186803b15801561025557600080fd5b505afa158015610269573d6000803e3d6000fd5b505050506040513d602081101561027f57600080fd5b505134146102c2576040805162461bcd60e51b815260206004820152600b60248201526a119151481393d50813515560aa1b604482015290519081900360640190fd5b600260009054906101000a90046001600160a01b03166001600160a01b031663247851726040518163ffffffff1660e01b815260040160206040518083038186803b15801561031057600080fd5b505afa158015610324573d6000803e3d6000fd5b505050506040513d602081101561033a57600080fd5b50516002546040805163e38ef7a360e01b815290516001600160a01b03938416936108fc93169163e38ef7a3916004808301926020929190829003018186803b15801561038657600080fd5b505afa15801561039a573d6000803e3d6000fd5b505050506040513d60208110156103b057600080fd5b50516040518115909202916000818181858888f193505050501580156103da573d6000803e3d6000fd5b506001600160a01b038316156104a757600254604080516305cb8a6560e11b81526001600160a01b03868116600483015291519190921691630b9714ca916024808301926020929190829003018186803b15801561043757600080fd5b505afa15801561044b573d6000803e3d6000fd5b505050506040513d602081101561046157600080fd5b50516104a7576040805162461bcd60e51b815260206004820152601060248201526f1253959053125108149151915494905360821b604482015290519081900360640190fd5b805161271011156104eb576040805162461bcd60e51b81526020600482015260096024820152684d494e20444956495360b81b604482015290519081900360640190fd5b600260009054906101000a90046001600160a01b03166001600160a01b031663120ac7e66040518163ffffffff1660e01b815260040160206040518083038186803b15801561053957600080fd5b505afa15801561054d573d6000803e3d6000fd5b505050506040513d602081101561056357600080fd5b505160e082015161010083015161057991610dd0565b111561058457600080fd5b60006105a182606001518360200151610e1b90919063ffffffff16565b116105e4576040805162461bcd60e51b815260206004820152600e60248201526d494e56414c494420504152414d5360901b604482015290519081900360640190fd5b61012c8160a001511015801561060057506103e88160a0015111155b610641576040805162461bcd60e51b815260206004820152600d60248201526c4d494e204c495155494449545960981b604482015290519081900360640190fd5b60007369ce12390f197dfe0b2f1733aa515107f7cc648f631185168a836000015184602001518560c001518660a00151600260009054906101000a90046001600160a01b03166001600160a01b031663355468506040518163ffffffff1660e01b815260040160206040518083038186803b1580156106bf57600080fd5b505afa1580156106d3573d6000803e3d6000fd5b505050506040513d60208110156106e957600080fd5b5051604080516001600160e01b031960e089901b168152600481019690965260248601949094526044850192909252606484015260848301525160a4808301926020929190829003018186803b15801561074257600080fd5b505af4158015610756573d6000803e3d6000fd5b505050506040513d602081101561076c57600080fd5b50516040519091506000903090610782906110bf565b6001600160a01b03909116815260405190819003602001906000f0801580156107af573d6000803e3d6000fd5b5090506107be87338385610e74565b806001600160a01b031663b93ac79289856000015186602001518760400151886060015189608001518a60a001518b60c001518c60e001518d61010001518e61012001516040518c63ffffffff1660e01b8152600401808c6001600160a01b031681526020018b81526020018a81526020018981526020018881526020018781526020018681526020018581526020018481526020018381526020018281526020019b505050505050505050505050600060405180830381600087803b15801561088757600080fd5b505af115801561089b573d6000803e3d6000fd5b50505050806001600160a01b03166346ed62c98789600260009054906101000a90046001600160a01b03166001600160a01b03166315e812ad6040518163ffffffff1660e01b815260040160206040518083038186803b1580156108fe57600080fd5b505afa158015610912573d6000803e3d6000fd5b505050506040513d602081101561092857600080fd5b505160025460408051630355468560e41b815290516001600160a01b0390921691633554685091600480820192602092909190829003018186803b15801561096f57600080fd5b505afa158015610983573d6000803e3d6000fd5b505050506040513d602081101561099957600080fd5b50516002546040805163f6c0812f60e01b815290516001600160a01b039092169163f6c0812f91600480820192602092909190829003018186803b1580156109e057600080fd5b505afa1580156109f4573d6000803e3d6000fd5b505050506040513d6020811015610a0a57600080fd5b50516002546040805163123c28b960e11b815290516001600160a01b0390921691632478517291600480820192602092909190829003018186803b158015610a5157600080fd5b505afa158015610a65573d6000803e3d6000fd5b505050506040513d6020811015610a7b57600080fd5b50516002546040805163021fd35d60e31b815290516001600160a01b03909216916310fe9ae891600480820192602092909190829003018186803b158015610ac257600080fd5b505afa158015610ad6573d6000803e3d6000fd5b505050506040513d6020811015610aec57600080fd5b5051604080516001600160e01b031960e08b901b1681526001600160a01b0398891660048201529688166024880152604487019590955260648601939093526084850191909152841660a4840152831660c483015291891660e4820152905161010480830192600092919082900301818387803b158015610b6c57600080fd5b505af1158015610b80573d6000803e3d6000fd5b5050600154604080516311c065b760e01b81526001600160a01b03868116600483015291519190921693506311c065b79250602480830192600092919082900301818387803b158015610bd257600080fd5b505af1158015610be6573d6000803e3d6000fd5b505050505050505050505050565b610bfc610fd1565b6000546001600160a01b03908116911614610c5e576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031690565b6001546001600160a01b031681565b610cce610fd1565b6000546001600160a01b03908116911614610d30576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b038116610d755760405162461bcd60e51b81526004018080602001828103825260268152602001806139c46026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000610e1283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610fd5565b90505b92915050565b600082610e2a57506000610e15565b82820282848281610e3757fe5b0414610e125760405162461bcd60e51b81526004018080602001828103825260218152602001806139ea6021913960400191505060405180910390fd5b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180516001600160e01b03166323b872dd60e01b17815292518251600094606094938a169392918291908083835b60208310610ef95780518252601f199092019160209182019101610eda565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114610f5b576040519150601f19603f3d011682016040523d82523d6000602084013e610f60565b606091505b5091509150818015610f8e575080511580610f8e5750808060200190516020811015610f8b57600080fd5b50515b610fc95760405162461bcd60e51b8152600401808060200182810382526024815260200180613a0b6024913960400191505060405180910390fd5b505050505050565b3390565b600081848411156110645760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611029578181015183820152602001611011565b50505050905090810190601f1680156110565780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b604051806101400160405280600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b6128f7806110cd8339019056fe60806040526001805534801561001457600080fd5b506040516128f73803806128f78339818101604052602081101561003757600080fd5b50516001600055601d80546001600160a01b039092166001600160a01b031992831617905560218054821673a818b4f111ccac7aa31d0bcc0806d64f2e0737d717905560228054821673e91d153e0b41518a2ce8dd3d7944fa863463a97d179055601f8054821673687f8ae35581d5729253542524be3ed9445ee607179055601e80548216738a5e208c1ca217db8ee64e8d390cf1f25de35a4e179055602080549091167360e2e1b2a317edfc870b6fc6886f69083fb2099a1790556127f5806101026000396000f3fe60806040526004361061019c5760003560e01c8063927ac44d116100ec578063c39e7dbb1161008a578063e8078d9411610064578063e8078d94146106da578063e86e6340146106ef578063f868e76614610704578063fe8121de146107215761019c565b8063c39e7dbb14610652578063c870279e14610667578063e33865b31461067c5761019c565b8063acfb2355116100c6578063acfb23551461056e578063ad5c464814610583578063b93ac79214610598578063b9863a441461060b5761019c565b8063927ac44d14610454578063a5d0de8c14610506578063a94e7e80146105595761019c565b806346ed62c911610159578063760fe56e11610133578063760fe56e146103d05780637bfc66001461040057806389fc0056146104155780638c301df81461042a5761019c565b806346ed62c9146103405780634bb18e3f146103a657806373c30b6c146103bb5761019c565b80630bbebba4146101a157806310c55f2b146101d257806324ef1bc71461021e57806338b903331461024a5780633f74aa38146102715780634200e4fc14610314575b600080fd5b3480156101ad57600080fd5b506101b6610736565b604080516001600160a01b039092168252519081900360200190f35b3480156101de57600080fd5b50610205600480360360208110156101f557600080fd5b50356001600160a01b0316610745565b6040805192835260208301919091528051918290030190f35b34801561022a57600080fd5b506102486004803603602081101561024157600080fd5b503561075e565b005b34801561025657600080fd5b5061025f6107b6565b60408051918252519081900360200190f35b34801561027d57600080fd5b506102866107bc565b604051808f6001600160a01b031681526020018e6001600160a01b031681526020018d6001600160a01b031681526020018c81526020018b81526020018a815260200189815260200188815260200187815260200186815260200185815260200184815260200183815260200182151581526020019e50505050505050505050505050505060405180910390f35b34801561032057600080fd5b506102486004803603602081101561033757600080fd5b50351515610800565b34801561034c57600080fd5b50610248600480360361010081101561036457600080fd5b506001600160a01b038135811691602081013582169160408201359160608101359160808201359160a081013582169160c082013581169160e0013516610866565b3480156103b257600080fd5b5061025f6109a1565b3480156103c757600080fd5b506102486109b3565b3480156103dc57600080fd5b50610248600480360360408110156103f357600080fd5b50803590602001356109dd565b34801561040c57600080fd5b506101b6610ad8565b34801561042157600080fd5b506101b6610ae7565b34801561043657600080fd5b506101b66004803603602081101561044d57600080fd5b5035610af6565b34801561046057600080fd5b506102486004803603604081101561047757600080fd5b81019060208101813564010000000081111561049257600080fd5b8201836020820111156104a457600080fd5b803590602001918460208302840111640100000000831117156104c657600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295505050503515159050610b09565b34801561051257600080fd5b5061051b610be6565b604080519687526020870195909552858501939093526001600160a01b039182166060860152811660808501521660a0830152519081900360c00190f35b34801561056557600080fd5b50610248610c0c565b34801561057a57600080fd5b5061025f610cfc565b34801561058f57600080fd5b506101b6610d95565b3480156105a457600080fd5b5061024860048036036101608110156105bc57600080fd5b506001600160a01b038135169060208101359060408101359060608101359060808101359060a08101359060c08101359060e08101359061010081013590610120810135906101400135610da4565b34801561061757600080fd5b5061063e6004803603602081101561062e57600080fd5b50356001600160a01b0316610e3c565b604080519115158252519081900360200190f35b34801561065e57600080fd5b50610248610e49565b34801561067357600080fd5b506101b6611040565b34801561068857600080fd5b5061069161104f565b604080519915158a5297151560208a0152951515888801526060880194909452608087019290925260a086015260c085015260e084015261010083015251908190036101200190f35b3480156106e657600080fd5b50610248611088565b3480156106fb57600080fd5b506102486116d6565b6102486004803603602081101561071a57600080fd5b50356117a1565b34801561072d57600080fd5b50610248611b4b565b601f546001600160a01b031681565b6023602052600090815260409020805460019091015482565b6002546001600160a01b031633146107b1576040805162461bcd60e51b81526020600482015260116024820152702727aa10282922a9a0a6229027aba722a960791b604482015290519081900360640190fd5b600655565b60015481565b600254600354600454600554600654600754600854600954600a54600b54600c54600d54600e54600f546001600160a01b039d8e169d9c8d169c909b169a60ff168e565b6002546001600160a01b03163314610853576040805162461bcd60e51b81526020600482015260116024820152702727aa10282922a9a0a6229027aba722a960791b604482015290519081900360640190fd5b6016805460ff1916911515919091179055565b601d546001600160a01b031633146108b1576040805162461bcd60e51b81526020600482015260096024820152682327a92124a22222a760b91b604482015290519081900360640190fd5b602254600f805460ff19166001600160a01b038b8116938116841491909117909155600380548a83166001600160a01b03199182161790915560048054821690931783556010899055601188905560128790556013805487841690831617905560148054868416908316179055601580548584169216919091179055601f5460408051635564890b60e11b81529051919092169263aac9121692808201926020929091829003018186803b15801561096857600080fd5b505afa15801561097c573d6000803e3d6000fd5b505050506040513d602081101561099257600080fd5b5051601b555050505050505050565b60006109ad6024611d28565b90505b90565b6020546001600160a01b031633146109ca57600080fd5b6016805462ff0000191662010000179055565b6002546001600160a01b03163314610a30576040805162461bcd60e51b81526020600482015260116024820152702727aa10282922a9a0a6229027aba722a960791b604482015290519081900360640190fd5b600c544310610a3e57600080fd5b601f60009054906101000a90046001600160a01b03166001600160a01b031663120ac7e66040518163ffffffff1660e01b815260040160206040518083038186803b158015610a8c57600080fd5b505afa158015610aa0573d6000803e3d6000fd5b505050506040513d6020811015610ab657600080fd5b5051610ac28284611d33565b1115610acd57600080fd5b600c91909155600d55565b601e546001600160a01b031681565b6021546001600160a01b031681565b6000610b03602483611d7c565b92915050565b6002546001600160a01b03163314610b5c576040805162461bcd60e51b81526020600482015260116024820152702727aa10282922a9a0a6229027aba722a960791b604482015290519081900360640190fd5b8015610ba45760005b8251811015610b9e57610b95838281518110610b7d57fe5b60200260200101516024611d8890919063ffffffff16565b50600101610b65565b50610be2565b60005b8251811015610be057610bd7838281518110610bbf57fe5b60200260200101516024611d9d90919063ffffffff16565b50600101610ba7565b505b5050565b6010546011546012546013546014546015546001600160a01b0392831692918216911686565b6002546001600160a01b03163314610c5f576040805162461bcd60e51b81526020600482015260116024820152702727aa10282922a9a0a6229027aba722a960791b604482015290519081900360640190fd5b610c67610cfc565b600314610c7357600080fd5b600354600254604080516370a0823160e01b81523060048201529051610cfa936001600160a01b0390811693169183916370a0823191602480820192602092909190829003018186803b158015610cc957600080fd5b505afa158015610cdd573d6000803e3d6000fd5b505050506040513d6020811015610cf357600080fd5b5051611db2565b565b60165460009062010000900460ff1615610d18575060036109b0565b600d5443118015610d2c5750600954601754105b15610d39575060036109b0565b60085460175410610d4c575060026109b0565b600d5443118015610d61575060095460175410155b15610d6e575060026109b0565b600c544310801590610d825750600d544311155b15610d8f575060016109b0565b50600090565b6022546001600160a01b031681565b601d546001600160a01b03163314610def576040805162461bcd60e51b81526020600482015260096024820152682327a92124a22222a760b91b604482015290519081900360640190fd5b600280546001600160a01b0319166001600160a01b039c909c169b909b17909a55600798909855600596909655600694909455600892909255600955600a55600b55600c55600d55600e55565b6000610b03602483611f1c565b60026000541415610e8f576040805162461bcd60e51b815260206004820152601f602482015260008051602061275b833981519152604482015290519081900360640190fd5b6002600055610e9c610cfc565b600314610edd576040805162461bcd60e51b815260206004820152600a6024820152691393d50811905253115160b21b604482015290519081900360640190fd5b336000908152602360205260408120601a54601754919291610efe91611d33565b600f5490915060009060ff16610f8b5760048054604080516370a0823160e01b81523093810193909352516001600160a01b03909116916370a08231916024808301926020929190829003018186803b158015610f5a57600080fd5b505afa158015610f6e573d6000803e3d6000fd5b505050506040513d6020811015610f8457600080fd5b5051610f8d565b475b90506000610fb283610fac866000015485611f3190919063ffffffff16565b90611f8a565b905060008111610fff576040805162461bcd60e51b81526020600482015260136024820152724e4f5448494e4720544f20574954484452415760681b604482015290519081900360640190fd5b8354601a5461100d91611fcc565b601a5560008455600454600f54611035916001600160a01b0316903390849060ff1615612026565b505060016000555050565b601d546001600160a01b031681565b601654601754601854601954601a54601b54601c5460ff8088169761010081048216976201000090910490911695909490939092909189565b600260005414156110ce576040805162461bcd60e51b815260206004820152601f602482015260008051602061275b833981519152604482015290519081900360640190fd5b6002600055601654610100900460ff1615611126576040805162461bcd60e51b815260206004820152601360248201527247454e45524154494f4e20434f4d504c45544560681b604482015290519081900360640190fd5b61112e610cfc565b600214611170576040805162461bcd60e51b815260206004820152600b60248201526a4e4f54205355434345535360a81b604482015290519081900360640190fd5b601e546003546004805460408051638d8c70bb60e01b81526001600160a01b03948516938101939093529083166024830152519190921691638d8c70bb916044808301926020929190829003018186803b1580156111cd57600080fd5b505afa1580156111e1573d6000803e3d6000fd5b505050506040513d60208110156111f757600080fd5b505115611214576016805462ff00001916620100001790556116cf565b60105460175460009161122f916103e891610fac9190611f31565b905060006112606103e8610fac60026008015461125a86601660010154611d3390919063ffffffff16565b90611f31565b600f5490915060ff16156112d857602260009054906101000a90046001600160a01b03166001600160a01b031663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b1580156112be57600080fd5b505af11580156112d2573d6000803e3d6000fd5b50505050505b600454601e546112f5916001600160a01b039081169116836121d3565b600480546040805163313ce56760e01b8152905160009361137e936001600160a01b03169263313ce5679281830192602092829003018186803b15801561133b57600080fd5b505afa15801561134f573d6000803e3d6000fd5b505050506040513d602081101561136557600080fd5b5051600b5460ff909116600a0a90610fac908590611f31565b600354601e5491925061139e916001600160a01b039182169116836121d3565b601e5460048054600354600e5460025460408051632277d0e360e01b81526001600160a01b039586169681019690965292841660248601526044850188905260648501879052429091016084850152821660a484015251921691632277d0e39160c48082019260009290919082900301818387803b15801561141f57600080fd5b505af1158015611433573d6000803e3d6000fd5b50506011546018546000935061145292506103e891610fac9190611f31565b6015549091506001600160a01b03161561150c5760006114866103e8610fac60106002015488611f3190919063ffffffff16565b600454601554600f549293506114b1926001600160a01b039283169290911690849060ff1615612026565b6114bb8582611d33565b945060006114dd6103e8610fac60106002015486611f3190919063ffffffff16565b6003546015549192506114fd916001600160a01b03918216911683611db2565b6115078382611d33565b925050505b600454601354600f54611532926001600160a01b03908116921690879060ff1615612026565b60035460145461154f916001600160a01b03908116911683611db2565b600354604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561159a57600080fd5b505afa1580156115ae573d6000803e3d6000fd5b505050506040513d60208110156115c457600080fd5b5051601854909150811115611602576018546000906115e4908390611d33565b600354909150611600906001600160a01b031661dead83611db2565b505b600f5460009060ff1661168c5760048054604080516370a0823160e01b81523093810193909352516001600160a01b03909116916370a08231916024808301926020929190829003018186803b15801561165b57600080fd5b505afa15801561166f573d6000803e3d6000fd5b505050506040513d602081101561168557600080fd5b505161168e565b475b600454600254600f549293506116b9926001600160a01b039283169290911690849060ff1615612026565b50506016805461ff001916610100179055505050505b6001600055565b601654610100900460ff161580156116f7575060165462010000900460ff16155b61170057600080fd5b601e546003546004805460408051638d8c70bb60e01b81526001600160a01b03948516938101939093529083166024830152519190921691638d8c70bb916044808301926020929190829003018186803b15801561175d57600080fd5b505afa158015611771573d6000803e3d6000fd5b505050506040513d602081101561178757600080fd5b505115610cfa576016805462ff0000191662010000179055565b600260005414156117e7576040805162461bcd60e51b815260206004820152601f602482015260008051602061275b833981519152604482015290519081900360640190fd5b60026000556117f4610cfc565b600114611835576040805162461bcd60e51b815260206004820152600a6024820152694e4f542041435449564560b01b604482015290519081900360640190fd5b60165460ff161561188e5761184b602433611f1c565b61188e576040805162461bcd60e51b815260206004820152600f60248201526e1393d50815d2125511531254d51151608a1b604482015290519081900360640190fd5b601b54600c540143101561194e57601f5460408051634a6da48160e01b815233600482015290516001600160a01b0390921691634a6da48191602480820192602092909190829003018186803b1580156118e757600080fd5b505afa1580156118fb573d6000803e3d6000fd5b505050506040513d602081101561191157600080fd5b505161194e5760405162461bcd60e51b81526004018080602001828103825260218152602001806127186021913960400191505060405180910390fd5b336000908152602360205260408120600f5490919060ff166119705782611972565b345b825460065491925060009161198691611d33565b601754600854919250900380821161199e57816119a0565b805b9150818311156119ae578192505b600480546040805163313ce56760e01b81529051600093611a37936001600160a01b03169263313ce5679281830192602092829003018186803b1580156119f457600080fd5b505afa158015611a08573d6000803e3d6000fd5b505050506040513d6020811015611a1e57600080fd5b505160055460ff909116600a0a90610fac908790611f31565b905060008111611a7c576040805162461bcd60e51b815260206004820152600b60248201526a5a45524f20544f4b454e5360a81b604482015290519081900360640190fd5b8454611a8c57601c805460010190555b8454611a989085611fcc565b85556001850154611aa99082611fcc565b6001860155601754611abb9085611fcc565b601755601854611acb9082611fcc565b601855600f5460ff168015611adf57503484105b15611b1c57336108fc611af23487611d33565b6040518115909202916000818181858888f19350505050158015611b1a573d6000803e3d6000fd5b505b600f5460ff16611b3e57600454611b3e906001600160a01b0316333087612336565b5050600160005550505050565b60026000541415611b91576040805162461bcd60e51b815260206004820152601f602482015260008051602061275b833981519152604482015290519081900360640190fd5b6002600055601654610100900460ff16611beb576040805162461bcd60e51b815260206004820152601660248201527520aba0a4aa24a7239026281023a2a722a920aa24a7a760511b604482015290519081900360640190fd5b336000908152602360205260408120601954601854919291611c0c91611d33565b6001830154600354604080516370a0823160e01b81523060048201529051939450600093611c9f938693610fac9391926001600160a01b03909116916370a08231916024808301926020929190829003018186803b158015611c6d57600080fd5b505afa158015611c81573d6000803e3d6000fd5b505050506040513d6020811015611c9757600080fd5b505190611f31565b905060008111611cec576040805162461bcd60e51b81526020600482015260136024820152724e4f5448494e4720544f20574954484452415760681b604482015290519081900360640190fd5b6001830154601954611cfd91611fcc565b60195560006001840155600354611d1e906001600160a01b03163383611db2565b5050600160005550565b6000610b038261248b565b6000611d7583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061248f565b9392505050565b6000611d758383612526565b6000611d75836001600160a01b03841661258a565b6000611d75836001600160a01b0384166125d4565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b178152925182516000946060949389169392918291908083835b60208310611e2f5780518252601f199092019160209182019101611e10565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611e91576040519150601f19603f3d011682016040523d82523d6000602084013e611e96565b606091505b5091509150818015611ec4575080511580611ec45750808060200190516020811015611ec157600080fd5b50515b611f15576040805162461bcd60e51b815260206004820152601f60248201527f5472616e7366657248656c7065723a205452414e534645525f4641494c454400604482015290519081900360640190fd5b5050505050565b6000611d75836001600160a01b03841661269a565b600082611f4057506000610b03565b82820282848281611f4d57fe5b0414611d755760405162461bcd60e51b815260040180806020018281038252602181526020018061277b6021913960400191505060405180910390fd5b6000611d7583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506126b2565b600082820183811015611d75576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b80612067576040516001600160a01b0384169083156108fc029084906000818181858888f19350505050158015612061573d6000803e3d6000fd5b506121cd565b604080516001600160a01b038581166024830152604480830186905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b17815292518251600094606094938a169392918291908083835b602083106120e45780518252601f1990920191602091820191016120c5565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114612146576040519150601f19603f3d011682016040523d82523d6000602084013e61214b565b606091505b5091509150818015612179575080511580612179575080806020019051602081101561217657600080fd5b50515b6121ca576040805162461bcd60e51b815260206004820152601f60248201527f5472616e7366657248656c7065723a205452414e534645525f4641494c454400604482015290519081900360640190fd5b50505b50505050565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663095ea7b360e01b178152925182516000946060949389169392918291908083835b602083106122505780518252601f199092019160209182019101612231565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d80600081146122b2576040519150601f19603f3d011682016040523d82523d6000602084013e6122b7565b606091505b50915091508180156122e55750805115806122e557508080602001905160208110156122e257600080fd5b50515b611f15576040805162461bcd60e51b815260206004820152601e60248201527f5472616e7366657248656c7065723a20415050524f56455f4641494c45440000604482015290519081900360640190fd5b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180516001600160e01b03166323b872dd60e01b17815292518251600094606094938a169392918291908083835b602083106123bb5780518252601f19909201916020918201910161239c565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d806000811461241d576040519150601f19603f3d011682016040523d82523d6000602084013e612422565b606091505b5091509150818015612450575080511580612450575080806020019051602081101561244d57600080fd5b50515b6121ca5760405162461bcd60e51b815260040180806020018281038252602481526020018061279c6024913960400191505060405180910390fd5b5490565b6000818484111561251e5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156124e35781810151838201526020016124cb565b50505050905090810190601f1680156125105780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b815460009082106125685760405162461bcd60e51b81526004018080602001828103825260228152602001806127396022913960400191505060405180910390fd5b82600001828154811061257757fe5b9060005260206000200154905092915050565b6000612596838361269a565b6125cc57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610b03565b506000610b03565b60008181526001830160205260408120548015612690578354600019808301919081019060009087908390811061260757fe5b906000526020600020015490508087600001848154811061262457fe5b60009182526020808320909101929092558281526001898101909252604090209084019055865487908061265457fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050610b03565b6000915050610b03565b60009081526001919091016020526040902054151590565b600081836127015760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156124e35781810151838201526020016124cb565b50600083858161270d57fe5b049594505050505056fe494e535546464943454e5420524f554e44203120544f4b454e2042414c414e4345456e756d657261626c655365743a20696e646578206f7574206f6620626f756e64735265656e7472616e637947756172643a207265656e7472616e742063616c6c00536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775472616e7366657248656c7065723a205452414e534645525f46524f4d5f4641494c4544a2646970667358221220918b10967b23995af0a9d898f2e72c7ab6dd9309789ad1ca17c98a5aa3060e9064736f6c634300060c00334f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775472616e7366657248656c7065723a205452414e534645525f46524f4d5f4641494c4544a26469706673582212200695f81e5060b8dc0f6abacb2675dfca03d4f06d586234bf55b33d5a38106a7764736f6c634300060c0033

External libraries