Transactions
Token Transfers
Tokens
Internal Transactions
Coin Balance History
Logs
Code
Read Contract
Write Contract
Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
- Contract name:
- SwapMining
- Optimization enabled
- true
- Compiler version
- v0.6.12+commit.27d51765
- Optimization runs
- 200
- EVM Version
- default
- Verified at
- 2021-11-10T14:10:12.311621Z
Constructor Arguments
0000000000000000000000002ca48b4eea5a731c2b54e7c3944dbdb87c0cfb6f0000000000000000000000008c8067ed3bc19acce28c1953bfc18dc85a2127f7000000000000000000000000c8a01e731ecc1443028f6bba2706c077d544a6fd0000000000000000000000000039f574ee5cc39bdd162e9a88e3eb1f111baf480000000000000000000000000000000000000000000000000429d069189e00000000000000000000000000000000000000000000000000000000000000478bf8
Arg [0] (address) : 0x2ca48b4eea5a731c2b54e7c3944dbdb87c0cfb6f
Arg [1] (address) : 0x8c8067ed3bc19acce28c1953bfc18dc85a2127f7
Arg [2] (address) : 0xc8a01e731ecc1443028f6bba2706c077d544a6fd
Arg [3] (address) : 0x0039f574ee5cc39bdd162e9a88e3eb1f111baf48
Arg [4] (uint256) : 300000000000000000
Arg [5] (uint256) : 4688888
Contract source code
// File: @openzeppelin/contracts/utils/EnumerableSet.sol // SPDX-License-Identifier: MIT 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(uint160(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(uint160(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(uint160(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(uint160(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: @openzeppelin/contracts/utils/Address.sol pragma solidity >=0.6.2 <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; // solhint-disable-next-line no-inline-assembly 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"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (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"); // solhint-disable-next-line avoid-low-level-calls (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"); // solhint-disable-next-line avoid-low-level-calls (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"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.delegatecall(data); return _verifyCallResult(success, returndata, errorMessage); } function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private 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 // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } // File: @openzeppelin/contracts/utils/Context.sol 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: @openzeppelin/contracts/access/AccessControl.sol pragma solidity >=0.6.0 <0.8.0; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ``` * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ``` * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. */ abstract contract AccessControl is Context { using EnumerableSet for EnumerableSet.AddressSet; using Address for address; struct RoleData { EnumerableSet.AddressSet members; bytes32 adminRole; } mapping (bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. * * _Available since v3.1._ */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call, an admin role * bearer except when using {_setupRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view returns (bool) { return _roles[role].members.contains(account); } /** * @dev Returns the number of accounts that have `role`. Can be used * together with {getRoleMember} to enumerate all bearers of a role. */ function getRoleMemberCount(bytes32 role) public view returns (uint256) { return _roles[role].members.length(); } /** * @dev Returns one of the accounts that have `role`. `index` must be a * value between 0 and {getRoleMemberCount}, non-inclusive. * * Role bearers are not sorted in any particular way, and their ordering may * change at any point. * * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure * you perform all queries on the same block. See the following * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] * for more information. */ function getRoleMember(bytes32 role, uint256 index) public view returns (address) { return _roles[role].members.at(index); } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) public virtual { require(hasRole(_roles[role].adminRole, _msgSender()), "AccessControl: sender must be an admin to grant"); _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) public virtual { require(hasRole(_roles[role].adminRole, _msgSender()), "AccessControl: sender must be an admin to revoke"); _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) public virtual { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. Note that unlike {grantRole}, this function doesn't perform any * checks on the calling account. * * [WARNING] * ==== * This function should only be called from the constructor when setting * up the initial roles for the system. * * Using this function in any other way is effectively circumventing the admin * system imposed by {AccessControl}. * ==== */ function _setupRole(bytes32 role, address account) internal virtual { _grantRole(role, account); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { emit RoleAdminChanged(role, _roles[role].adminRole, adminRole); _roles[role].adminRole = adminRole; } function _grantRole(bytes32 role, address account) private { if (_roles[role].members.add(account)) { emit RoleGranted(role, account, _msgSender()); } } function _revokeRole(bytes32 role, address account) private { if (_roles[role].members.remove(account)) { emit RoleRevoked(role, account, _msgSender()); } } } // File: @openzeppelin/contracts/token/ERC20/IERC20.sol pragma solidity >=0.6.0 <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); } // File: @openzeppelin/contracts/math/SafeMath.sol 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, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { 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) { 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) { // 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) { 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) { 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) { 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) { require(b <= a, "SafeMath: subtraction overflow"); 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) { 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, reverting 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) { require(b > 0, "SafeMath: division by zero"); 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) { require(b > 0, "SafeMath: modulo by zero"); 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) { 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. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryDiv}. * * 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); 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) { require(b > 0, errorMessage); return a % b; } } // File: @openzeppelin/contracts/token/ERC20/SafeERC20.sol pragma solidity >=0.6.0 <0.8.0; /** * @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 SafeMath for uint256; 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' // solhint-disable-next-line max-line-length 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).add(value); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero"); _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 // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } // File: contracts/interfaces/IMojitoFactory.sol pragma solidity 0.6.12; interface IMojitoFactory { function getPair(address tokenA, address tokenB) external view returns (address pair); } // File: contracts/interfaces/IMojitoOracle.sol pragma solidity 0.6.12; interface IMojitoOracle { function update(address tokenA, address tokenB) external; function consult(address tokenIn, uint amountIn, address tokenOut) external view returns (uint amountOut); } // File: contracts/interfaces/IMojitoRouter.sol pragma solidity 0.6.12; interface IMojitoRouter { function factory() external pure returns (address); } // File: contracts/interfaces/IMojitoToken.sol pragma solidity =0.6.12; interface IMojitoToken is IERC20 { /** * @notice Mint new tokens * @param dst The address of the destination account * @param amount The number of tokens to be minted */ function mint(address dst, uint256 amount) external; } // File: @openzeppelin/contracts/access/Ownable.sol 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 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 { 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/Schedule.sol pragma solidity =0.6.12; contract Schedule is Ownable { using SafeMath for uint256; uint256 public mintPeriodDuration = 5184000; //day 180 uint256 public decayRateNumerator = 20; //20% uint256 public decayRateDenominator = 100; // uint256 public epochStartBlock = 0; //the block number when mojito starts uint256 public mojitoPerBlock = 0; //mojito tokens created per block event MintPeriodDurationTransferred(uint256 indexed previousMintPeriodDuration, uint256 indexed newMintPeriodDuration); event DecayRateNumeratorTransferred(uint256 indexed previousDecayRateNumerator, uint256 indexed newDecayRateNumerator); event EpochStartBlockTransferred(uint256 indexed previousEpochStartBlock, uint256 indexed newEpochStartBlock); event MojitoPerBlockTransferred(uint256 indexed previousMojitoPerBlock, uint256 indexed newMojitoPerBlock); constructor(uint256 _mojitoPerBlock) public { emit MojitoPerBlockTransferred(mojitoPerBlock, _mojitoPerBlock); mojitoPerBlock = _mojitoPerBlock; } function setMintPeriodDuration(uint256 _mintPeriodDuration) public onlyOwner { emit MintPeriodDurationTransferred(mintPeriodDuration, _mintPeriodDuration); mintPeriodDuration = _mintPeriodDuration; } function setDecayRateNumerator(uint256 _decayRateNumerator) public onlyOwner { require(_decayRateNumerator < decayRateDenominator, "Schedule::setDecayRateNumerator: _decayRateNumerator overflow"); emit DecayRateNumeratorTransferred(decayRateNumerator, _decayRateNumerator); decayRateNumerator = _decayRateNumerator; } function setEpochStartBlock(uint256 _epochStartBlock) public onlyOwner { emit EpochStartBlockTransferred(epochStartBlock, _epochStartBlock); epochStartBlock = _epochStartBlock; } function setMojitoPerBlock(uint256 _mojitoPerBlock) public virtual onlyOwner { emit MojitoPerBlockTransferred(mojitoPerBlock, _mojitoPerBlock); mojitoPerBlock = _mojitoPerBlock; } function epoch(uint256 blockNumber) public view returns (uint256) { if (mintPeriodDuration == 0) { return 0; } if (blockNumber > epochStartBlock) { return (blockNumber.sub(epochStartBlock).sub(1)).div(mintPeriodDuration); } return 0; } function reward(uint256 blockNumber) public view returns (uint256) { uint256 currentEpoch = epoch(blockNumber); uint256 numerator = pow(decayRateDenominator.sub(decayRateNumerator), currentEpoch); uint256 denominator = pow(decayRateDenominator, currentEpoch); return mojitoPerBlock.mul(numerator).div(denominator); } function mintable(uint256 blockNumber) public view returns (uint256) { require(blockNumber <= block.number, "Schedule::mintable: blockNumber overflow"); uint256 _mintable = 0; uint256 lastMintableBlock = blockNumber; uint256 n = epoch(lastMintableBlock); uint256 m = epoch(block.number); while (n < m) { n++; uint256 r = n.mul(mintPeriodDuration).add(epochStartBlock); _mintable = _mintable.add((r.sub(lastMintableBlock)).mul(reward(r))); lastMintableBlock = r; } _mintable = _mintable.add((block.number.sub(lastMintableBlock)).mul(reward(block.number))); return _mintable; } // https://mpark.github.io/programming/2014/08/18/exponentiation-by-squaring/ function pow(uint256 x, uint256 n) internal pure returns (uint256) { uint256 result = 1; while (n > 0) { if (n % 2 != 0) { result = result.mul(x); } x = x.mul(x); n /= 2; } return result; } } // File: contracts/SwapMining.sol pragma solidity =0.6.12; contract SwapMining is Schedule, AccessControl { bytes32 public constant WHITELIST_ROLE = keccak256("WHITELIST_ROLE"); using SafeMath for uint256; using SafeERC20 for IERC20; // Info of each user. struct UserInfo { uint256 quantity; // How many quantity the user has swaped. uint256 blockNumber; // Last transaction block. } // Info of each pool. struct PoolInfo { address lpToken; // Address of LP token contract. uint256 allocPoint; // How many allocation points assigned to this pool. MJTs to distribute per block. uint256 lastRewardBlock; // Last block number that MJTs distribution occurs. uint256 quantity; // Current amount of LPs uint256 totalQuantity; // All quantity uint256 allocMojitoAmount; // How many MJTs } // The mojito token IMojitoToken public mojito; // The swap router IMojitoRouter public router; // The swap factory IMojitoFactory public factory; // The price oracle IMojitoOracle public oracle; // The base coin address public usdt; // Info of each pool. PoolInfo[] public poolInfo; // Info of each user that swap quantity. mapping(uint256 => mapping(address => UserInfo)) public userInfo; // Pair corresponding pid mapping(address => uint256) public pairOfPid; // Total allocation points. Must be the sum of all allocation points in all pools. uint256 public totalAllocPoint = 0; // The block number when mojito mining starts. uint256 public startBlock; event Deposit(address indexed user, uint256 indexed pid, uint256 amount); event Withdraw(address indexed user, uint256 indexed pid, uint256 amount); event EmergencyWithdraw(address indexed user, uint256 indexed pid, uint256 amount); constructor( IMojitoToken _mojito, IMojitoRouter _router, IMojitoOracle _oracle, address _usdt, uint256 _mojitoPerBlock, uint256 _startBlock ) public Schedule(_mojitoPerBlock) { _setupRole(DEFAULT_ADMIN_ROLE, _msgSender()); mojito = _mojito; router = _router; factory = IMojitoFactory(router.factory()); oracle = _oracle; usdt = _usdt; startBlock = _startBlock; } function poolLength() public view returns (uint256) { return poolInfo.length; } // DO NOT add the same LP token more than once function checkPoolDuplicate(address _lpToken) internal view { uint256 length = poolInfo.length; for (uint256 pid = 0; pid < length; ++pid) { require(poolInfo[pid].lpToken != _lpToken, "SwapMining::add: existing pool"); } } // Add a new lp to the pool. Can only be called by the owner. // XXX DO NOT add the same LP token more than once. Rewards will be messed up if you do. function add(uint256 _allocPoint, address _lpToken, bool _withUpdate) public onlyOwner { checkPoolDuplicate(_lpToken); if (_withUpdate) { massUpdatePools(); } uint256 lastRewardBlock = block.number > startBlock ? block.number : startBlock; totalAllocPoint = totalAllocPoint.add(_allocPoint); poolInfo.push(PoolInfo({ lpToken : _lpToken, allocPoint : _allocPoint, lastRewardBlock : lastRewardBlock, quantity : 0, totalQuantity : 0, allocMojitoAmount : 0 })); pairOfPid[_lpToken] = poolLength() - 1; } // Update the given pool's Mojito allocation point. Can only be called by the owner. function set(uint256 _pid, uint256 _allocPoint, bool _withUpdate) public onlyOwner { if (_withUpdate) { massUpdatePools(); } totalAllocPoint = totalAllocPoint.sub(poolInfo[_pid].allocPoint).add(_allocPoint); poolInfo[_pid].allocPoint = _allocPoint; } function setMojitoPerBlock(uint256 _mojitoPerBlock) public virtual override onlyOwner { massUpdatePools(); super.setMojitoPerBlock(_mojitoPerBlock); } function setRouter(IMojitoRouter _router) public onlyOwner { require(address(_router) != address(0), "SwapMining::setRouter: _router is the zero address"); router = _router; factory = IMojitoFactory(router.factory()); } function setOracle(IMojitoOracle _oracle) public onlyOwner { require(address(_oracle) != address(0), "SwapMining::setOracle: _oracle is the zero address"); oracle = _oracle; } function isWhitelist(address token) public view returns (bool) { return hasRole(WHITELIST_ROLE, token); } // View function to see pending MJTs on frontend. function pendingMojito(uint256 _pid) external view returns (uint256) { require(_pid <= poolInfo.length - 1, "SwapMining::pendingMojito: not find this pool"); PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; uint256 allocMojitoAmount = pool.allocMojitoAmount; if (user.quantity > 0) { uint256 blockReward = mintable(pool.lastRewardBlock); uint256 mojitoReward = blockReward.mul(pool.allocPoint).div(totalAllocPoint); allocMojitoAmount = allocMojitoAmount.add(mojitoReward); return user.quantity.mul(allocMojitoAmount).div(pool.quantity); } return 0; } // Update reward variables for all pools. Be careful of gas spending! function massUpdatePools() public { uint256 length = poolInfo.length; for (uint256 pid = 0; pid < length; ++pid) { updatePool(pid); } } // Update reward variables of the given pool to be up-to-date. function updatePool(uint256 _pid) public { PoolInfo storage pool = poolInfo[_pid]; if (block.number <= pool.lastRewardBlock) { return; } if (pool.quantity == 0) { pool.lastRewardBlock = block.number; return; } uint256 blockReward = mintable(pool.lastRewardBlock); if (blockReward <= 0) { return; } uint256 mojitoReward = blockReward.mul(pool.allocPoint).div(totalAllocPoint); mojito.mint(address(this), mojitoReward); pool.allocMojitoAmount = pool.allocMojitoAmount.add(mojitoReward); pool.lastRewardBlock = block.number; } function swap(address account, address input, address output, uint256 amount) public onlyRouter returns (bool) { require(account != address(0), "SwapMining::swap: taker swap account is the zero address"); require(input != address(0), "SwapMining::swap: taker swap input is the zero address"); require(output != address(0), "SwapMining::swap: taker swap output is the zero address"); if (poolLength() <= 0) { return false; } if (!isWhitelist(input) || !isWhitelist(output)) { return false; } // if it does not exist or the alloc-point is 0 then return address pair = IMojitoFactory(factory).getPair(input, output); PoolInfo storage pool = poolInfo[pairOfPid[pair]]; if (pool.lpToken != pair || pool.allocPoint <= 0) { return false; } uint256 quantity = getQuantity(output, amount, usdt); if (quantity <= 0) { return false; } updatePool(pairOfPid[pair]); pool.quantity = pool.quantity.add(quantity); pool.totalQuantity = pool.totalQuantity.add(quantity); UserInfo storage user = userInfo[pairOfPid[pair]][account]; user.quantity = user.quantity.add(quantity); user.blockNumber = block.number; return true; } // The user withdraws all the transaction rewards of the pool function withdraw() public { uint256 userSub; uint256 length = poolInfo.length; for (uint256 pid = 0; pid < length; ++pid) { PoolInfo storage pool = poolInfo[pid]; UserInfo storage user = userInfo[pid][msg.sender]; if (user.quantity > 0) { updatePool(pid); // The reward held by the user in this pool uint256 userReward = pool.allocMojitoAmount.mul(user.quantity).div(pool.quantity); pool.quantity = pool.quantity.sub(user.quantity); pool.allocMojitoAmount = pool.allocMojitoAmount.sub(userReward); user.quantity = 0; user.blockNumber = block.number; userSub = userSub.add(userReward); } } if (userSub <= 0) { return; } safeMojitoTransfer(msg.sender, userSub); } function getQuantity(address outputToken, uint256 outputAmount, address anchorToken) public view returns (uint256) { uint256 quantity = 0; if (outputToken == anchorToken) { quantity = outputAmount; } else if (factory.getPair(outputToken, anchorToken) != address(0)) { quantity = oracle.consult(outputToken, outputAmount, anchorToken); } else { uint256 length = getRoleMemberCount(WHITELIST_ROLE); for (uint256 index = 0; index < length; index++) { address intermediate = getRoleMember(WHITELIST_ROLE, index); if (factory.getPair(outputToken, intermediate) != address(0) && factory.getPair(intermediate, anchorToken) != address(0)) { uint256 interQuantity = oracle.consult(outputToken, outputAmount, intermediate); quantity = oracle.consult(intermediate, interQuantity, anchorToken); break; } } } return quantity; } // Safe mojito transfer function, just in case if rounding error causes pool to not have enough MJTs. function safeMojitoTransfer(address _to, uint256 _amount) internal { uint256 mojitoBal = mojito.balanceOf(address(this)); if (_amount > mojitoBal) { mojito.transfer(_to, mojitoBal); } else { mojito.transfer(_to, _amount); } } modifier onlyRouter() { require(msg.sender == address(router), "SwapMining::onlyRouter: caller is not the router"); _; } }
Contract ABI
[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"_mojito","internalType":"contract IMojitoToken"},{"type":"address","name":"_router","internalType":"contract IMojitoRouter"},{"type":"address","name":"_oracle","internalType":"contract IMojitoOracle"},{"type":"address","name":"_usdt","internalType":"address"},{"type":"uint256","name":"_mojitoPerBlock","internalType":"uint256"},{"type":"uint256","name":"_startBlock","internalType":"uint256"}]},{"type":"event","name":"DecayRateNumeratorTransferred","inputs":[{"type":"uint256","name":"previousDecayRateNumerator","internalType":"uint256","indexed":true},{"type":"uint256","name":"newDecayRateNumerator","internalType":"uint256","indexed":true}],"anonymous":false},{"type":"event","name":"Deposit","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"uint256","name":"pid","internalType":"uint256","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"EmergencyWithdraw","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"uint256","name":"pid","internalType":"uint256","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"EpochStartBlockTransferred","inputs":[{"type":"uint256","name":"previousEpochStartBlock","internalType":"uint256","indexed":true},{"type":"uint256","name":"newEpochStartBlock","internalType":"uint256","indexed":true}],"anonymous":false},{"type":"event","name":"MintPeriodDurationTransferred","inputs":[{"type":"uint256","name":"previousMintPeriodDuration","internalType":"uint256","indexed":true},{"type":"uint256","name":"newMintPeriodDuration","internalType":"uint256","indexed":true}],"anonymous":false},{"type":"event","name":"MojitoPerBlockTransferred","inputs":[{"type":"uint256","name":"previousMojitoPerBlock","internalType":"uint256","indexed":true},{"type":"uint256","name":"newMojitoPerBlock","internalType":"uint256","indexed":true}],"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":"RoleAdminChanged","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32","indexed":true},{"type":"bytes32","name":"previousAdminRole","internalType":"bytes32","indexed":true},{"type":"bytes32","name":"newAdminRole","internalType":"bytes32","indexed":true}],"anonymous":false},{"type":"event","name":"RoleGranted","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32","indexed":true},{"type":"address","name":"account","internalType":"address","indexed":true},{"type":"address","name":"sender","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"RoleRevoked","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32","indexed":true},{"type":"address","name":"account","internalType":"address","indexed":true},{"type":"address","name":"sender","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"Withdraw","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"uint256","name":"pid","internalType":"uint256","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"DEFAULT_ADMIN_ROLE","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"WHITELIST_ROLE","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"add","inputs":[{"type":"uint256","name":"_allocPoint","internalType":"uint256"},{"type":"address","name":"_lpToken","internalType":"address"},{"type":"bool","name":"_withUpdate","internalType":"bool"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"decayRateDenominator","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"decayRateNumerator","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"epoch","inputs":[{"type":"uint256","name":"blockNumber","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"epochStartBlock","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IMojitoFactory"}],"name":"factory","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getQuantity","inputs":[{"type":"address","name":"outputToken","internalType":"address"},{"type":"uint256","name":"outputAmount","internalType":"uint256"},{"type":"address","name":"anchorToken","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"getRoleAdmin","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"getRoleMember","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"},{"type":"uint256","name":"index","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getRoleMemberCount","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"grantRole","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"},{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"hasRole","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"},{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isWhitelist","inputs":[{"type":"address","name":"token","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"massUpdatePools","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"mintPeriodDuration","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"mintable","inputs":[{"type":"uint256","name":"blockNumber","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IMojitoToken"}],"name":"mojito","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"mojitoPerBlock","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IMojitoOracle"}],"name":"oracle","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"pairOfPid","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"pendingMojito","inputs":[{"type":"uint256","name":"_pid","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"lpToken","internalType":"address"},{"type":"uint256","name":"allocPoint","internalType":"uint256"},{"type":"uint256","name":"lastRewardBlock","internalType":"uint256"},{"type":"uint256","name":"quantity","internalType":"uint256"},{"type":"uint256","name":"totalQuantity","internalType":"uint256"},{"type":"uint256","name":"allocMojitoAmount","internalType":"uint256"}],"name":"poolInfo","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"poolLength","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceRole","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"},{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"revokeRole","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"},{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"reward","inputs":[{"type":"uint256","name":"blockNumber","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IMojitoRouter"}],"name":"router","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"set","inputs":[{"type":"uint256","name":"_pid","internalType":"uint256"},{"type":"uint256","name":"_allocPoint","internalType":"uint256"},{"type":"bool","name":"_withUpdate","internalType":"bool"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setDecayRateNumerator","inputs":[{"type":"uint256","name":"_decayRateNumerator","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setEpochStartBlock","inputs":[{"type":"uint256","name":"_epochStartBlock","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setMintPeriodDuration","inputs":[{"type":"uint256","name":"_mintPeriodDuration","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setMojitoPerBlock","inputs":[{"type":"uint256","name":"_mojitoPerBlock","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setOracle","inputs":[{"type":"address","name":"_oracle","internalType":"contract IMojitoOracle"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setRouter","inputs":[{"type":"address","name":"_router","internalType":"contract IMojitoRouter"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"startBlock","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"swap","inputs":[{"type":"address","name":"account","internalType":"address"},{"type":"address","name":"input","internalType":"address"},{"type":"address","name":"output","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalAllocPoint","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"updatePool","inputs":[{"type":"uint256","name":"_pid","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"usdt","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"quantity","internalType":"uint256"},{"type":"uint256","name":"blockNumber","internalType":"uint256"}],"name":"userInfo","inputs":[{"type":"uint256","name":"","internalType":"uint256"},{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"withdraw","inputs":[]}]
Contract Creation Code
0x6080604052624f1a0060015560146002556064600355600060045560006005556000600f553480156200003157600080fd5b5060405162002cd638038062002cd6833981810160405260c08110156200005757600080fd5b508051602082015160408301516060840151608085015160a09095015193949293919290918160006200008962000200565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3506005546040518291907f3a001379932b03e39ab44ee007da68f4e6c68330334748446fb35df170bb0ee790600090a36005556200011b60006200011562000200565b62000204565b600780546001600160a01b038089166001600160a01b03199283161790925560088054888416921691909117908190556040805163c45a015560e01b81529051919092169163c45a0155916004808301926020929190829003018186803b1580156200018657600080fd5b505afa1580156200019b573d6000803e3d6000fd5b505050506040513d6020811015620001b257600080fd5b5051600980546001600160a01b03199081166001600160a01b0393841617909155600a8054821696831696909617909555600b80549095169316929092179092556010555062000316915050565b3390565b62000210828262000214565b5050565b60008281526006602090815260409091206200023b91839062001f486200028f821b17901c565b1562000210576200024b62000200565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000620002a6836001600160a01b038416620002af565b90505b92915050565b6000620002bd8383620002fe565b620002f557508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155620002a9565b506000620002a9565b60009081526001919091016020526040902054151590565b6129b080620003266000396000f3fe608060405234801561001057600080fd5b506004361061028a5760003560e01c80637a997ab71161015c578063a9678a18116100ce578063c683630d11610087578063c683630d146106f1578063ca15c87314610717578063d547741f14610734578063f2fde38b14610760578063f887ea4014610786578063f99264121461078e5761028a565b8063a9678a1814610645578063a9fb763c14610681578063ab410f421461069e578063c0d78655146106a6578063c4098704146106cc578063c45a0155146106e95761028a565b80639010d07c116101205780639010d07c1461054257806391d148541461056557806393f1a40b146105a5578063a217fddf146105ea578063a7ef67f6146105f2578063a8be5d7c146106285761028a565b80637a997ab7146104fc5780637adbf973146105045780637dc0d1d01461052a5780638da5cb5b146105325780638f3a7a491461053a5761028a565b80633ccfd60b116102005780635487c577116101b95780635487c5771461047f57806362bcdd6a1461049c578063630b5ba1146104a457806363fb2fe5146104ac57806364482f79146104c9578063715018a6146104f45761028a565b80633ccfd60b146104255780633ed55b7b1461042d57806342f62bc61461043557806348cd4cb11461045257806351eb05a61461045a57806352d9f48c146104775761028a565b80631eaaa045116102525780631eaaa0451461034e578063248a9ca3146103845780632519442c146103a15780632f2ff15d146103a95780632f48ab7d146103d557806336568abe146103f95761028a565b80630495de501461028f578063081e3eda146102c75780630f784943146102cf5780631526fe27146102ec57806317caf6f114610346575b600080fd5b6102b5600480360360208110156102a557600080fd5b50356001600160a01b03166107ab565b60408051918252519081900360200190f35b6102b56107bd565b6102b5600480360360208110156102e557600080fd5b50356107c3565b6103096004803603602081101561030257600080fd5b50356108a8565b604080516001600160a01b0390971687526020870195909552858501939093526060850191909152608084015260a0830152519081900360c00190f35b6102b56108f5565b6103826004803603606081101561036457600080fd5b508035906001600160a01b03602082013516906040013515156108fb565b005b6102b56004803603602081101561039a57600080fd5b5035610b11565b6102b5610b26565b610382600480360360408110156103bf57600080fd5b50803590602001356001600160a01b0316610b2c565b6103dd610b98565b604080516001600160a01b039092168252519081900360200190f35b6103826004803603604081101561040f57600080fd5b50803590602001356001600160a01b0316610ba7565b610382610c08565b6102b5610cf5565b6103826004803603602081101561044b57600080fd5b5035610cfb565b6102b5610d91565b6103826004803603602081101561047057600080fd5b5035610d97565b6103dd610eaa565b6102b56004803603602081101561049557600080fd5b5035610eb9565b6102b5610f0d565b610382610f13565b6102b5600480360360208110156104c257600080fd5b5035610f32565b610382600480360360608110156104df57600080fd5b5080359060208101359060400135151561102b565b610382611100565b6102b56111ac565b6103826004803603602081101561051a57600080fd5b50356001600160a01b03166111be565b6103dd611287565b6103dd611296565b6102b56112a5565b6103dd6004803603604081101561055857600080fd5b50803590602001356112ab565b6105916004803603604081101561057b57600080fd5b50803590602001356001600160a01b03166112cc565b604080519115158252519081900360200190f35b6105d1600480360360408110156105bb57600080fd5b50803590602001356001600160a01b03166112e4565b6040805192835260208301919091528051918290030190f35b6102b5611308565b6102b56004803603606081101561060857600080fd5b506001600160a01b0381358116916020810135916040909101351661130d565b6103826004803603602081101561063e57600080fd5b50356116ee565b6105916004803603608081101561065b57600080fd5b506001600160a01b03813581169160208101358216916040820135169060600135611761565b6102b56004803603602081101561069757600080fd5b5035611a77565b6102b5611adb565b610382600480360360208110156106bc57600080fd5b50356001600160a01b0316611ae1565b610382600480360360208110156106e257600080fd5b5035611c32565b6103dd611d08565b6105916004803603602081101561070757600080fd5b50356001600160a01b0316611d17565b6102b56004803603602081101561072d57600080fd5b5035611d31565b6103826004803603604081101561074a57600080fd5b50803590602001356001600160a01b0316611d48565b6103826004803603602081101561077657600080fd5b50356001600160a01b0316611da1565b6103dd611ea3565b610382600480360360208110156107a457600080fd5b5035611eb2565b600e6020526000908152604090205481565b600c5490565b6000438211156108045760405162461bcd60e51b81526004018080602001828103825260288152602001806128656028913960400191505060405180910390fd5b6000828161081182610eb9565b9050600061081e43610eb9565b90505b8082101561087c576004546001805493019260009161084b91610845908690611f5d565b90611fb6565b905061087361086c61085c83611a77565b6108668488612010565b90611f5d565b8690611fb6565b94509250610821565b61089c61089561088b43611a77565b6108664387612010565b8590611fb6565b9450505050505b919050565b600c81815481106108b557fe5b60009182526020909120600690910201805460018201546002830154600384015460048501546005909501546001600160a01b0390941695509193909286565b600f5481565b61090361206d565b6001600160a01b0316610914611296565b6001600160a01b03161461095d576040805162461bcd60e51b8152602060048201819052602482015260008051602061288d833981519152604482015290519081900360640190fd5b61096682612071565b801561097457610974610f13565b6000601054431161098757601054610989565b435b600f549091506109999085611fb6565b600f556040805160c0810182526001600160a01b038581168252602082018781529282018481526000606084018181526080850182815260a08601838152600c8054600180820183559190955296517fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c7600690950294850180546001600160a01b031916919097161790955595517fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c883015591517fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c982015590517fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8ca82015592517fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8cb840155517fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8cc90920191909155610aee6107bd565b6001600160a01b039094166000908152600e602052604090209303909255505050565b60009081526006602052604090206002015490565b60055481565b600082815260066020526040902060020154610b4f90610b4a61206d565b6112cc565b610b8a5760405162461bcd60e51b815260040180806020018281038252602f8152602001806126c8602f913960400191505060405180910390fd5b610b948282612110565b5050565b600b546001600160a01b031681565b610baf61206d565b6001600160a01b0316816001600160a01b031614610bfe5760405162461bcd60e51b815260040180806020018281038252602f81526020018061294c602f913960400191505060405180910390fd5b610b948282612179565b600c54600090815b81811015610cd9576000600c8281548110610c2757fe5b60009182526020808320858452600d82526040808520338652909252922080546006909202909201925015610ccf57610c5f83610d97565b6000610c8a8360030154610c8484600001548660050154611f5d90919063ffffffff16565b906121e2565b82546003850154919250610c9e9190612010565b60038401556005830154610cb29082612010565b600584015560008255436001830155610ccb8682611fb6565b9550505b5050600101610c10565b5060008211610ce9575050610cf3565b610b943383612249565b565b60045481565b610d0361206d565b6001600160a01b0316610d14611296565b6001600160a01b031614610d5d576040805162461bcd60e51b8152602060048201819052602482015260008051602061288d833981519152604482015290519081900360640190fd5b6004546040518291907f9215e4bc65bb3bef4c30f5fb914aac965dfe9eec525c0959be32a533b1b37afa90600090a3600455565b60105481565b6000600c8281548110610da657fe5b9060005260206000209060060201905080600201544311610dc75750610ea7565b6003810154610ddc5743600290910155610ea7565b6000610deb82600201546107c3565b905060008111610dfc575050610ea7565b6000610e1b600f54610c84856001015485611f5d90919063ffffffff16565b600754604080516340c10f1960e01b81523060048201526024810184905290519293506001600160a01b03909116916340c10f199160448082019260009290919082900301818387803b158015610e7157600080fd5b505af1158015610e85573d6000803e3d6000fd5b5050506005840154610e98915082611fb6565b60058401555050436002909101555b50565b6007546001600160a01b031681565b600060015460001415610ece575060006108a3565b600454821115610f0557610efe600154610c846001610ef86004548761201090919063ffffffff16565b90612010565b90506108a3565b506000919050565b60035481565b600c5460005b81811015610b9457610f2a81610d97565b600101610f19565b600c5460009060001901821115610f7a5760405162461bcd60e51b815260040180806020018281038252602d815260200180612679602d913960400191505060405180910390fd5b6000600c8381548110610f8957fe5b60009182526020808320868452600d825260408085203386529092529220600560069092029092019081015482549193509015611020576000610fcf84600201546107c3565b90506000610ff0600f54610c84876001015485611f5d90919063ffffffff16565b9050610ffc8382611fb6565b6003860154855491945061101491610c849086611f5d565b955050505050506108a3565b506000949350505050565b61103361206d565b6001600160a01b0316611044611296565b6001600160a01b03161461108d576040805162461bcd60e51b8152602060048201819052602482015260008051602061288d833981519152604482015290519081900360640190fd5b801561109b5761109b610f13565b6110d282610845600c86815481106110af57fe5b906000526020600020906006020160010154600f5461201090919063ffffffff16565b600f8190555081600c84815481106110e657fe5b906000526020600020906006020160010181905550505050565b61110861206d565b6001600160a01b0316611119611296565b6001600160a01b031614611162576040805162461bcd60e51b8152602060048201819052602482015260008051602061288d833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60008051602061274f83398151915281565b6111c661206d565b6001600160a01b03166111d7611296565b6001600160a01b031614611220576040805162461bcd60e51b8152602060048201819052602482015260008051602061288d833981519152604482015290519081900360640190fd5b6001600160a01b0381166112655760405162461bcd60e51b815260040180806020018281038252603281526020018061271d6032913960400191505060405180910390fd5b600a80546001600160a01b0319166001600160a01b0392909216919091179055565b600a546001600160a01b031681565b6000546001600160a01b031690565b60015481565b60008281526006602052604081206112c390836123d9565b90505b92915050565b60008281526006602052604081206112c390836123e5565b600d6020908152600092835260408084209091529082529020805460019091015482565b600081565b6000806001600160a01b03858116908416141561132b5750826116e6565b6009546040805163e6a4390560e01b81526001600160a01b038881166004830152868116602483015291516000939092169163e6a4390591604480820192602092909190829003018186803b15801561138357600080fd5b505afa158015611397573d6000803e3d6000fd5b505050506040513d60208110156113ad57600080fd5b50516001600160a01b03161461144c57600a5460408051632321bc7960e21b81526001600160a01b03888116600483015260248201889052868116604483015291519190921691638c86f1e4916064808301926020929190829003018186803b15801561141957600080fd5b505afa15801561142d573d6000803e3d6000fd5b505050506040513d602081101561144357600080fd5b505190506116e6565b600061146560008051602061274f833981519152611d31565b905060005b818110156116e357600061148c60008051602061274f833981519152836112ab565b6009546040805163e6a4390560e01b81526001600160a01b038c8116600483015284811660248301529151939450600093919092169163e6a43905916044808301926020929190829003018186803b1580156114e757600080fd5b505afa1580156114fb573d6000803e3d6000fd5b505050506040513d602081101561151157600080fd5b50516001600160a01b0316148015906115b557506009546040805163e6a4390560e01b81526001600160a01b038481166004830152898116602483015291516000939092169163e6a4390591604480820192602092909190829003018186803b15801561157d57600080fd5b505afa158015611591573d6000803e3d6000fd5b505050506040513d60208110156115a757600080fd5b50516001600160a01b031614155b156116da57600a5460408051632321bc7960e21b81526001600160a01b038b81166004830152602482018b9052848116604483015291516000939290921691638c86f1e491606480820192602092909190829003018186803b15801561161a57600080fd5b505afa15801561162e573d6000803e3d6000fd5b505050506040513d602081101561164457600080fd5b5051600a5460408051632321bc7960e21b81526001600160a01b038681166004830152602482018590528b811660448301529151939450911691638c86f1e491606480820192602092909190829003018186803b1580156116a457600080fd5b505afa1580156116b8573d6000803e3d6000fd5b505050506040513d60208110156116ce57600080fd5b505194506116e3915050565b5060010161146a565b50505b949350505050565b6116f661206d565b6001600160a01b0316611707611296565b6001600160a01b031614611750576040805162461bcd60e51b8152602060048201819052602482015260008051602061288d833981519152604482015290519081900360640190fd5b611758610f13565b610ea7816123fa565b6008546000906001600160a01b031633146117ad5760405162461bcd60e51b81526004018080602001828103825260308152602001806128e56030913960400191505060405180910390fd5b6001600160a01b0385166117f25760405162461bcd60e51b81526004018080602001828103825260388152602001806128ad6038913960400191505060405180910390fd5b6001600160a01b0384166118375760405162461bcd60e51b815260040180806020018281038252603681526020018061280e6036913960400191505060405180910390fd5b6001600160a01b03831661187c5760405162461bcd60e51b81526004018080602001828103825260378152602001806129156037913960400191505060405180910390fd5b60006118866107bd565b11611893575060006116e6565b61189c84611d17565b15806118ae57506118ac83611d17565b155b156118bb575060006116e6565b6009546040805163e6a4390560e01b81526001600160a01b03878116600483015286811660248301529151600093929092169163e6a4390591604480820192602092909190829003018186803b15801561191457600080fd5b505afa158015611928573d6000803e3d6000fd5b505050506040513d602081101561193e57600080fd5b50516001600160a01b0381166000908152600e6020526040812054600c80549394509192811061196a57fe5b6000918252602090912060069091020180549091506001600160a01b03838116911614158061199b57506001810154155b156119ab576000925050506116e6565b600b546000906119c790879087906001600160a01b031661130d565b9050600081116119dd57600093505050506116e6565b6001600160a01b0383166000908152600e60205260409020546119ff90610d97565b6003820154611a0e9082611fb6565b60038301556004820154611a229082611fb6565b60048301556001600160a01b038084166000908152600e60209081526040808320548352600d8252808320938c168352929052208054611a629083611fb6565b81554360019182015598975050505050505050565b600080611a8383610eb9565b90506000611aa7611aa160025460035461201090919063ffffffff16565b83612490565b90506000611ab760035484612490565b9050611ad281610c8484600554611f5d90919063ffffffff16565b95945050505050565b60025481565b611ae961206d565b6001600160a01b0316611afa611296565b6001600160a01b031614611b43576040805162461bcd60e51b8152602060048201819052602482015260008051602061288d833981519152604482015290519081900360640190fd5b6001600160a01b038116611b885760405162461bcd60e51b815260040180806020018281038252603281526020018061276f6032913960400191505060405180910390fd5b600880546001600160a01b0319166001600160a01b0383811691909117918290556040805163c45a015560e01b81529051929091169163c45a015591600480820192602092909190829003018186803b158015611be457600080fd5b505afa158015611bf8573d6000803e3d6000fd5b505050506040513d6020811015611c0e57600080fd5b5051600980546001600160a01b0319166001600160a01b0390921691909117905550565b611c3a61206d565b6001600160a01b0316611c4b611296565b6001600160a01b031614611c94576040805162461bcd60e51b8152602060048201819052602482015260008051602061288d833981519152604482015290519081900360640190fd5b6003548110611cd45760405162461bcd60e51b815260040180806020018281038252603d8152602001806127a1603d913960400191505060405180910390fd5b6002546040518291907f19d581e9a84078f50c42ec7ed0491727560c65ac4005acee12802e4ed328779690600090a3600255565b6009546001600160a01b031681565b60006112c660008051602061274f833981519152836112cc565b60008181526006602052604081206112c6906124c8565b600082815260066020526040902060020154611d6690610b4a61206d565b610bfe5760405162461bcd60e51b81526004018080602001828103825260308152602001806127de6030913960400191505060405180910390fd5b611da961206d565b6001600160a01b0316611dba611296565b6001600160a01b031614611e03576040805162461bcd60e51b8152602060048201819052602482015260008051602061288d833981519152604482015290519081900360640190fd5b6001600160a01b038116611e485760405162461bcd60e51b81526004018080602001828103825260268152602001806126f76026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6008546001600160a01b031681565b611eba61206d565b6001600160a01b0316611ecb611296565b6001600160a01b031614611f14576040805162461bcd60e51b8152602060048201819052602482015260008051602061288d833981519152604482015290519081900360640190fd5b6001546040518291907fe371fc8c6b0c4a0d57450919fe6dbb06e5094421af69d673fd7fc28f7a60d97790600090a3600155565b60006112c3836001600160a01b0384166124d3565b600082611f6c575060006112c6565b82820282848281611f7957fe5b04146112c35760405162461bcd60e51b81526004018080602001828103825260218152602001806128446021913960400191505060405180910390fd5b6000828201838110156112c3576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600082821115612067576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b3390565b600c5460005b8181101561210b57826001600160a01b0316600c828154811061209657fe5b60009182526020909120600690910201546001600160a01b03161415612103576040805162461bcd60e51b815260206004820152601e60248201527f537761704d696e696e673a3a6164643a206578697374696e6720706f6f6c0000604482015290519081900360640190fd5b600101612077565b505050565b60008281526006602052604090206121289082611f48565b15610b945761213561206d565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000828152600660205260409020612191908261251d565b15610b945761219e61206d565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000808211612238576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b81838161224157fe5b049392505050565b600754604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561229457600080fd5b505afa1580156122a8573d6000803e3d6000fd5b505050506040513d60208110156122be57600080fd5b5051905080821115612352576007546040805163a9059cbb60e01b81526001600160a01b038681166004830152602482018590529151919092169163a9059cbb9160448083019260209291908290030181600087803b15801561232057600080fd5b505af1158015612334573d6000803e3d6000fd5b505050506040513d602081101561234a57600080fd5b5061210b9050565b6007546040805163a9059cbb60e01b81526001600160a01b038681166004830152602482018690529151919092169163a9059cbb9160448083019260209291908290030181600087803b1580156123a857600080fd5b505af11580156123bc573d6000803e3d6000fd5b505050506040513d60208110156123d257600080fd5b5050505050565b60006112c38383612532565b60006112c3836001600160a01b038416612596565b61240261206d565b6001600160a01b0316612413611296565b6001600160a01b03161461245c576040805162461bcd60e51b8152602060048201819052602482015260008051602061288d833981519152604482015290519081900360640190fd5b6005546040518291907f3a001379932b03e39ab44ee007da68f4e6c68330334748446fb35df170bb0ee790600090a3600555565b600060015b82156112c35760028306156124b1576124ae8185611f5d565b90505b6124bb8480611f5d565b9350600283049250612495565b60006112c6826125ae565b60006124df8383612596565b612515575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556112c6565b5060006112c6565b60006112c3836001600160a01b0384166125b2565b815460009082106125745760405162461bcd60e51b81526004018080602001828103825260228152602001806126a66022913960400191505060405180910390fd5b82600001828154811061258357fe5b9060005260206000200154905092915050565b60009081526001919091016020526040902054151590565b5490565b6000818152600183016020526040812054801561266e57835460001980830191908101906000908790839081106125e557fe5b906000526020600020015490508087600001848154811061260257fe5b60009182526020808320909101929092558281526001898101909252604090209084019055865487908061263257fe5b600190038181906000526020600020016000905590558660010160008781526020019081526020016000206000905560019450505050506112c6565b60009150506112c656fe537761704d696e696e673a3a70656e64696e674d6f6a69746f3a206e6f742066696e64207468697320706f6f6c456e756d657261626c655365743a20696e646578206f7574206f6620626f756e6473416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e2061646d696e20746f206772616e744f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373537761704d696e696e673a3a7365744f7261636c653a205f6f7261636c6520697320746865207a65726f2061646472657373dc72ed553f2544c34465af23b847953efeb813428162d767f9ba5f4013be6760537761704d696e696e673a3a736574526f757465723a205f726f7574657220697320746865207a65726f20616464726573735363686564756c653a3a7365744465636179526174654e756d657261746f723a205f6465636179526174654e756d657261746f72206f766572666c6f77416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e2061646d696e20746f207265766f6b65537761704d696e696e673a3a737761703a2074616b6572207377617020696e70757420697320746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775363686564756c653a3a6d696e7461626c653a20626c6f636b4e756d626572206f766572666c6f774f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572537761704d696e696e673a3a737761703a2074616b65722073776170206163636f756e7420697320746865207a65726f2061646472657373537761704d696e696e673a3a6f6e6c79526f757465723a2063616c6c6572206973206e6f742074686520726f75746572537761704d696e696e673a3a737761703a2074616b65722073776170206f757470757420697320746865207a65726f2061646472657373416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636520726f6c657320666f722073656c66a2646970667358221220caf6b3c452a3f238e15928d9a967449616b38ee5196ca2ecadee599c96e96ebf64736f6c634300060c00330000000000000000000000002ca48b4eea5a731c2b54e7c3944dbdb87c0cfb6f0000000000000000000000008c8067ed3bc19acce28c1953bfc18dc85a2127f7000000000000000000000000c8a01e731ecc1443028f6bba2706c077d544a6fd0000000000000000000000000039f574ee5cc39bdd162e9a88e3eb1f111baf480000000000000000000000000000000000000000000000000429d069189e00000000000000000000000000000000000000000000000000000000000000478bf8
Deployed ByteCode
0x608060405234801561001057600080fd5b506004361061028a5760003560e01c80637a997ab71161015c578063a9678a18116100ce578063c683630d11610087578063c683630d146106f1578063ca15c87314610717578063d547741f14610734578063f2fde38b14610760578063f887ea4014610786578063f99264121461078e5761028a565b8063a9678a1814610645578063a9fb763c14610681578063ab410f421461069e578063c0d78655146106a6578063c4098704146106cc578063c45a0155146106e95761028a565b80639010d07c116101205780639010d07c1461054257806391d148541461056557806393f1a40b146105a5578063a217fddf146105ea578063a7ef67f6146105f2578063a8be5d7c146106285761028a565b80637a997ab7146104fc5780637adbf973146105045780637dc0d1d01461052a5780638da5cb5b146105325780638f3a7a491461053a5761028a565b80633ccfd60b116102005780635487c577116101b95780635487c5771461047f57806362bcdd6a1461049c578063630b5ba1146104a457806363fb2fe5146104ac57806364482f79146104c9578063715018a6146104f45761028a565b80633ccfd60b146104255780633ed55b7b1461042d57806342f62bc61461043557806348cd4cb11461045257806351eb05a61461045a57806352d9f48c146104775761028a565b80631eaaa045116102525780631eaaa0451461034e578063248a9ca3146103845780632519442c146103a15780632f2ff15d146103a95780632f48ab7d146103d557806336568abe146103f95761028a565b80630495de501461028f578063081e3eda146102c75780630f784943146102cf5780631526fe27146102ec57806317caf6f114610346575b600080fd5b6102b5600480360360208110156102a557600080fd5b50356001600160a01b03166107ab565b60408051918252519081900360200190f35b6102b56107bd565b6102b5600480360360208110156102e557600080fd5b50356107c3565b6103096004803603602081101561030257600080fd5b50356108a8565b604080516001600160a01b0390971687526020870195909552858501939093526060850191909152608084015260a0830152519081900360c00190f35b6102b56108f5565b6103826004803603606081101561036457600080fd5b508035906001600160a01b03602082013516906040013515156108fb565b005b6102b56004803603602081101561039a57600080fd5b5035610b11565b6102b5610b26565b610382600480360360408110156103bf57600080fd5b50803590602001356001600160a01b0316610b2c565b6103dd610b98565b604080516001600160a01b039092168252519081900360200190f35b6103826004803603604081101561040f57600080fd5b50803590602001356001600160a01b0316610ba7565b610382610c08565b6102b5610cf5565b6103826004803603602081101561044b57600080fd5b5035610cfb565b6102b5610d91565b6103826004803603602081101561047057600080fd5b5035610d97565b6103dd610eaa565b6102b56004803603602081101561049557600080fd5b5035610eb9565b6102b5610f0d565b610382610f13565b6102b5600480360360208110156104c257600080fd5b5035610f32565b610382600480360360608110156104df57600080fd5b5080359060208101359060400135151561102b565b610382611100565b6102b56111ac565b6103826004803603602081101561051a57600080fd5b50356001600160a01b03166111be565b6103dd611287565b6103dd611296565b6102b56112a5565b6103dd6004803603604081101561055857600080fd5b50803590602001356112ab565b6105916004803603604081101561057b57600080fd5b50803590602001356001600160a01b03166112cc565b604080519115158252519081900360200190f35b6105d1600480360360408110156105bb57600080fd5b50803590602001356001600160a01b03166112e4565b6040805192835260208301919091528051918290030190f35b6102b5611308565b6102b56004803603606081101561060857600080fd5b506001600160a01b0381358116916020810135916040909101351661130d565b6103826004803603602081101561063e57600080fd5b50356116ee565b6105916004803603608081101561065b57600080fd5b506001600160a01b03813581169160208101358216916040820135169060600135611761565b6102b56004803603602081101561069757600080fd5b5035611a77565b6102b5611adb565b610382600480360360208110156106bc57600080fd5b50356001600160a01b0316611ae1565b610382600480360360208110156106e257600080fd5b5035611c32565b6103dd611d08565b6105916004803603602081101561070757600080fd5b50356001600160a01b0316611d17565b6102b56004803603602081101561072d57600080fd5b5035611d31565b6103826004803603604081101561074a57600080fd5b50803590602001356001600160a01b0316611d48565b6103826004803603602081101561077657600080fd5b50356001600160a01b0316611da1565b6103dd611ea3565b610382600480360360208110156107a457600080fd5b5035611eb2565b600e6020526000908152604090205481565b600c5490565b6000438211156108045760405162461bcd60e51b81526004018080602001828103825260288152602001806128656028913960400191505060405180910390fd5b6000828161081182610eb9565b9050600061081e43610eb9565b90505b8082101561087c576004546001805493019260009161084b91610845908690611f5d565b90611fb6565b905061087361086c61085c83611a77565b6108668488612010565b90611f5d565b8690611fb6565b94509250610821565b61089c61089561088b43611a77565b6108664387612010565b8590611fb6565b9450505050505b919050565b600c81815481106108b557fe5b60009182526020909120600690910201805460018201546002830154600384015460048501546005909501546001600160a01b0390941695509193909286565b600f5481565b61090361206d565b6001600160a01b0316610914611296565b6001600160a01b03161461095d576040805162461bcd60e51b8152602060048201819052602482015260008051602061288d833981519152604482015290519081900360640190fd5b61096682612071565b801561097457610974610f13565b6000601054431161098757601054610989565b435b600f549091506109999085611fb6565b600f556040805160c0810182526001600160a01b038581168252602082018781529282018481526000606084018181526080850182815260a08601838152600c8054600180820183559190955296517fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c7600690950294850180546001600160a01b031916919097161790955595517fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c883015591517fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c982015590517fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8ca82015592517fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8cb840155517fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8cc90920191909155610aee6107bd565b6001600160a01b039094166000908152600e602052604090209303909255505050565b60009081526006602052604090206002015490565b60055481565b600082815260066020526040902060020154610b4f90610b4a61206d565b6112cc565b610b8a5760405162461bcd60e51b815260040180806020018281038252602f8152602001806126c8602f913960400191505060405180910390fd5b610b948282612110565b5050565b600b546001600160a01b031681565b610baf61206d565b6001600160a01b0316816001600160a01b031614610bfe5760405162461bcd60e51b815260040180806020018281038252602f81526020018061294c602f913960400191505060405180910390fd5b610b948282612179565b600c54600090815b81811015610cd9576000600c8281548110610c2757fe5b60009182526020808320858452600d82526040808520338652909252922080546006909202909201925015610ccf57610c5f83610d97565b6000610c8a8360030154610c8484600001548660050154611f5d90919063ffffffff16565b906121e2565b82546003850154919250610c9e9190612010565b60038401556005830154610cb29082612010565b600584015560008255436001830155610ccb8682611fb6565b9550505b5050600101610c10565b5060008211610ce9575050610cf3565b610b943383612249565b565b60045481565b610d0361206d565b6001600160a01b0316610d14611296565b6001600160a01b031614610d5d576040805162461bcd60e51b8152602060048201819052602482015260008051602061288d833981519152604482015290519081900360640190fd5b6004546040518291907f9215e4bc65bb3bef4c30f5fb914aac965dfe9eec525c0959be32a533b1b37afa90600090a3600455565b60105481565b6000600c8281548110610da657fe5b9060005260206000209060060201905080600201544311610dc75750610ea7565b6003810154610ddc5743600290910155610ea7565b6000610deb82600201546107c3565b905060008111610dfc575050610ea7565b6000610e1b600f54610c84856001015485611f5d90919063ffffffff16565b600754604080516340c10f1960e01b81523060048201526024810184905290519293506001600160a01b03909116916340c10f199160448082019260009290919082900301818387803b158015610e7157600080fd5b505af1158015610e85573d6000803e3d6000fd5b5050506005840154610e98915082611fb6565b60058401555050436002909101555b50565b6007546001600160a01b031681565b600060015460001415610ece575060006108a3565b600454821115610f0557610efe600154610c846001610ef86004548761201090919063ffffffff16565b90612010565b90506108a3565b506000919050565b60035481565b600c5460005b81811015610b9457610f2a81610d97565b600101610f19565b600c5460009060001901821115610f7a5760405162461bcd60e51b815260040180806020018281038252602d815260200180612679602d913960400191505060405180910390fd5b6000600c8381548110610f8957fe5b60009182526020808320868452600d825260408085203386529092529220600560069092029092019081015482549193509015611020576000610fcf84600201546107c3565b90506000610ff0600f54610c84876001015485611f5d90919063ffffffff16565b9050610ffc8382611fb6565b6003860154855491945061101491610c849086611f5d565b955050505050506108a3565b506000949350505050565b61103361206d565b6001600160a01b0316611044611296565b6001600160a01b03161461108d576040805162461bcd60e51b8152602060048201819052602482015260008051602061288d833981519152604482015290519081900360640190fd5b801561109b5761109b610f13565b6110d282610845600c86815481106110af57fe5b906000526020600020906006020160010154600f5461201090919063ffffffff16565b600f8190555081600c84815481106110e657fe5b906000526020600020906006020160010181905550505050565b61110861206d565b6001600160a01b0316611119611296565b6001600160a01b031614611162576040805162461bcd60e51b8152602060048201819052602482015260008051602061288d833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60008051602061274f83398151915281565b6111c661206d565b6001600160a01b03166111d7611296565b6001600160a01b031614611220576040805162461bcd60e51b8152602060048201819052602482015260008051602061288d833981519152604482015290519081900360640190fd5b6001600160a01b0381166112655760405162461bcd60e51b815260040180806020018281038252603281526020018061271d6032913960400191505060405180910390fd5b600a80546001600160a01b0319166001600160a01b0392909216919091179055565b600a546001600160a01b031681565b6000546001600160a01b031690565b60015481565b60008281526006602052604081206112c390836123d9565b90505b92915050565b60008281526006602052604081206112c390836123e5565b600d6020908152600092835260408084209091529082529020805460019091015482565b600081565b6000806001600160a01b03858116908416141561132b5750826116e6565b6009546040805163e6a4390560e01b81526001600160a01b038881166004830152868116602483015291516000939092169163e6a4390591604480820192602092909190829003018186803b15801561138357600080fd5b505afa158015611397573d6000803e3d6000fd5b505050506040513d60208110156113ad57600080fd5b50516001600160a01b03161461144c57600a5460408051632321bc7960e21b81526001600160a01b03888116600483015260248201889052868116604483015291519190921691638c86f1e4916064808301926020929190829003018186803b15801561141957600080fd5b505afa15801561142d573d6000803e3d6000fd5b505050506040513d602081101561144357600080fd5b505190506116e6565b600061146560008051602061274f833981519152611d31565b905060005b818110156116e357600061148c60008051602061274f833981519152836112ab565b6009546040805163e6a4390560e01b81526001600160a01b038c8116600483015284811660248301529151939450600093919092169163e6a43905916044808301926020929190829003018186803b1580156114e757600080fd5b505afa1580156114fb573d6000803e3d6000fd5b505050506040513d602081101561151157600080fd5b50516001600160a01b0316148015906115b557506009546040805163e6a4390560e01b81526001600160a01b038481166004830152898116602483015291516000939092169163e6a4390591604480820192602092909190829003018186803b15801561157d57600080fd5b505afa158015611591573d6000803e3d6000fd5b505050506040513d60208110156115a757600080fd5b50516001600160a01b031614155b156116da57600a5460408051632321bc7960e21b81526001600160a01b038b81166004830152602482018b9052848116604483015291516000939290921691638c86f1e491606480820192602092909190829003018186803b15801561161a57600080fd5b505afa15801561162e573d6000803e3d6000fd5b505050506040513d602081101561164457600080fd5b5051600a5460408051632321bc7960e21b81526001600160a01b038681166004830152602482018590528b811660448301529151939450911691638c86f1e491606480820192602092909190829003018186803b1580156116a457600080fd5b505afa1580156116b8573d6000803e3d6000fd5b505050506040513d60208110156116ce57600080fd5b505194506116e3915050565b5060010161146a565b50505b949350505050565b6116f661206d565b6001600160a01b0316611707611296565b6001600160a01b031614611750576040805162461bcd60e51b8152602060048201819052602482015260008051602061288d833981519152604482015290519081900360640190fd5b611758610f13565b610ea7816123fa565b6008546000906001600160a01b031633146117ad5760405162461bcd60e51b81526004018080602001828103825260308152602001806128e56030913960400191505060405180910390fd5b6001600160a01b0385166117f25760405162461bcd60e51b81526004018080602001828103825260388152602001806128ad6038913960400191505060405180910390fd5b6001600160a01b0384166118375760405162461bcd60e51b815260040180806020018281038252603681526020018061280e6036913960400191505060405180910390fd5b6001600160a01b03831661187c5760405162461bcd60e51b81526004018080602001828103825260378152602001806129156037913960400191505060405180910390fd5b60006118866107bd565b11611893575060006116e6565b61189c84611d17565b15806118ae57506118ac83611d17565b155b156118bb575060006116e6565b6009546040805163e6a4390560e01b81526001600160a01b03878116600483015286811660248301529151600093929092169163e6a4390591604480820192602092909190829003018186803b15801561191457600080fd5b505afa158015611928573d6000803e3d6000fd5b505050506040513d602081101561193e57600080fd5b50516001600160a01b0381166000908152600e6020526040812054600c80549394509192811061196a57fe5b6000918252602090912060069091020180549091506001600160a01b03838116911614158061199b57506001810154155b156119ab576000925050506116e6565b600b546000906119c790879087906001600160a01b031661130d565b9050600081116119dd57600093505050506116e6565b6001600160a01b0383166000908152600e60205260409020546119ff90610d97565b6003820154611a0e9082611fb6565b60038301556004820154611a229082611fb6565b60048301556001600160a01b038084166000908152600e60209081526040808320548352600d8252808320938c168352929052208054611a629083611fb6565b81554360019182015598975050505050505050565b600080611a8383610eb9565b90506000611aa7611aa160025460035461201090919063ffffffff16565b83612490565b90506000611ab760035484612490565b9050611ad281610c8484600554611f5d90919063ffffffff16565b95945050505050565b60025481565b611ae961206d565b6001600160a01b0316611afa611296565b6001600160a01b031614611b43576040805162461bcd60e51b8152602060048201819052602482015260008051602061288d833981519152604482015290519081900360640190fd5b6001600160a01b038116611b885760405162461bcd60e51b815260040180806020018281038252603281526020018061276f6032913960400191505060405180910390fd5b600880546001600160a01b0319166001600160a01b0383811691909117918290556040805163c45a015560e01b81529051929091169163c45a015591600480820192602092909190829003018186803b158015611be457600080fd5b505afa158015611bf8573d6000803e3d6000fd5b505050506040513d6020811015611c0e57600080fd5b5051600980546001600160a01b0319166001600160a01b0390921691909117905550565b611c3a61206d565b6001600160a01b0316611c4b611296565b6001600160a01b031614611c94576040805162461bcd60e51b8152602060048201819052602482015260008051602061288d833981519152604482015290519081900360640190fd5b6003548110611cd45760405162461bcd60e51b815260040180806020018281038252603d8152602001806127a1603d913960400191505060405180910390fd5b6002546040518291907f19d581e9a84078f50c42ec7ed0491727560c65ac4005acee12802e4ed328779690600090a3600255565b6009546001600160a01b031681565b60006112c660008051602061274f833981519152836112cc565b60008181526006602052604081206112c6906124c8565b600082815260066020526040902060020154611d6690610b4a61206d565b610bfe5760405162461bcd60e51b81526004018080602001828103825260308152602001806127de6030913960400191505060405180910390fd5b611da961206d565b6001600160a01b0316611dba611296565b6001600160a01b031614611e03576040805162461bcd60e51b8152602060048201819052602482015260008051602061288d833981519152604482015290519081900360640190fd5b6001600160a01b038116611e485760405162461bcd60e51b81526004018080602001828103825260268152602001806126f76026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6008546001600160a01b031681565b611eba61206d565b6001600160a01b0316611ecb611296565b6001600160a01b031614611f14576040805162461bcd60e51b8152602060048201819052602482015260008051602061288d833981519152604482015290519081900360640190fd5b6001546040518291907fe371fc8c6b0c4a0d57450919fe6dbb06e5094421af69d673fd7fc28f7a60d97790600090a3600155565b60006112c3836001600160a01b0384166124d3565b600082611f6c575060006112c6565b82820282848281611f7957fe5b04146112c35760405162461bcd60e51b81526004018080602001828103825260218152602001806128446021913960400191505060405180910390fd5b6000828201838110156112c3576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600082821115612067576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b3390565b600c5460005b8181101561210b57826001600160a01b0316600c828154811061209657fe5b60009182526020909120600690910201546001600160a01b03161415612103576040805162461bcd60e51b815260206004820152601e60248201527f537761704d696e696e673a3a6164643a206578697374696e6720706f6f6c0000604482015290519081900360640190fd5b600101612077565b505050565b60008281526006602052604090206121289082611f48565b15610b945761213561206d565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000828152600660205260409020612191908261251d565b15610b945761219e61206d565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000808211612238576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b81838161224157fe5b049392505050565b600754604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561229457600080fd5b505afa1580156122a8573d6000803e3d6000fd5b505050506040513d60208110156122be57600080fd5b5051905080821115612352576007546040805163a9059cbb60e01b81526001600160a01b038681166004830152602482018590529151919092169163a9059cbb9160448083019260209291908290030181600087803b15801561232057600080fd5b505af1158015612334573d6000803e3d6000fd5b505050506040513d602081101561234a57600080fd5b5061210b9050565b6007546040805163a9059cbb60e01b81526001600160a01b038681166004830152602482018690529151919092169163a9059cbb9160448083019260209291908290030181600087803b1580156123a857600080fd5b505af11580156123bc573d6000803e3d6000fd5b505050506040513d60208110156123d257600080fd5b5050505050565b60006112c38383612532565b60006112c3836001600160a01b038416612596565b61240261206d565b6001600160a01b0316612413611296565b6001600160a01b03161461245c576040805162461bcd60e51b8152602060048201819052602482015260008051602061288d833981519152604482015290519081900360640190fd5b6005546040518291907f3a001379932b03e39ab44ee007da68f4e6c68330334748446fb35df170bb0ee790600090a3600555565b600060015b82156112c35760028306156124b1576124ae8185611f5d565b90505b6124bb8480611f5d565b9350600283049250612495565b60006112c6826125ae565b60006124df8383612596565b612515575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556112c6565b5060006112c6565b60006112c3836001600160a01b0384166125b2565b815460009082106125745760405162461bcd60e51b81526004018080602001828103825260228152602001806126a66022913960400191505060405180910390fd5b82600001828154811061258357fe5b9060005260206000200154905092915050565b60009081526001919091016020526040902054151590565b5490565b6000818152600183016020526040812054801561266e57835460001980830191908101906000908790839081106125e557fe5b906000526020600020015490508087600001848154811061260257fe5b60009182526020808320909101929092558281526001898101909252604090209084019055865487908061263257fe5b600190038181906000526020600020016000905590558660010160008781526020019081526020016000206000905560019450505050506112c6565b60009150506112c656fe537761704d696e696e673a3a70656e64696e674d6f6a69746f3a206e6f742066696e64207468697320706f6f6c456e756d657261626c655365743a20696e646578206f7574206f6620626f756e6473416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e2061646d696e20746f206772616e744f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373537761704d696e696e673a3a7365744f7261636c653a205f6f7261636c6520697320746865207a65726f2061646472657373dc72ed553f2544c34465af23b847953efeb813428162d767f9ba5f4013be6760537761704d696e696e673a3a736574526f757465723a205f726f7574657220697320746865207a65726f20616464726573735363686564756c653a3a7365744465636179526174654e756d657261746f723a205f6465636179526174654e756d657261746f72206f766572666c6f77416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e2061646d696e20746f207265766f6b65537761704d696e696e673a3a737761703a2074616b6572207377617020696e70757420697320746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775363686564756c653a3a6d696e7461626c653a20626c6f636b4e756d626572206f766572666c6f774f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572537761704d696e696e673a3a737761703a2074616b65722073776170206163636f756e7420697320746865207a65726f2061646472657373537761704d696e696e673a3a6f6e6c79526f757465723a2063616c6c6572206973206e6f742074686520726f75746572537761704d696e696e673a3a737761703a2074616b65722073776170206f757470757420697320746865207a65726f2061646472657373416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636520726f6c657320666f722073656c66a2646970667358221220caf6b3c452a3f238e15928d9a967449616b38ee5196ca2ecadee599c96e96ebf64736f6c634300060c0033