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:
- MojitoProfile
- Optimization enabled
- true
- Compiler version
- v0.6.12+commit.27d51765
- Optimization runs
- 200
- EVM Version
- default
- Verified at
- 2022-01-26T09:14:25.586447Z
Constructor Arguments
0000000000000000000000002ca48b4eea5a731c2b54e7c3944dbdb87c0cfb6f00000000000000000000000000000000000000000000000029a2241af62c00000000000000000000000000000000000000000000000000004563918244f400000000000000000000000000000000000000000000000000000de0b6b3a7640000
Arg [0] (address) : 0x2ca48b4eea5a731c2b54e7c3944dbdb87c0cfb6f
Arg [1] (uint256) : 3000000000000000000
Arg [2] (uint256) : 5000000000000000000
Arg [3] (uint256) : 1000000000000000000
Contract source code
// SPDX-License-Identifier: MIT pragma solidity =0.6.12; // File: @openzeppelin/contracts/utils/EnumerableSet.sol /** * @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 /** * @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 /* * @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 /** * @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/math/SafeMath.sol /** * @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/utils/Counters.sol /** * @title Counters * @author Matt Condon (@shrugs) * @dev Provides counters that can only be incremented or decremented by one. This can be used e.g. to track the number * of elements in a mapping, issuing ERC721 ids, or counting request ids. * * Include with `using Counters for Counters.Counter;` * Since it is not possible to overflow a 256 bit integer with increments of one, `increment` can skip the {SafeMath} * overflow check, thereby saving gas. This does assume however correct usage, in that the underlying `_value` is never * directly accessed. */ library Counters { using SafeMath for uint256; struct Counter { // This variable should never be directly accessed by users of the library: interactions must be restricted to // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add // this feature: see https://github.com/ethereum/solidity/issues/4637 uint256 _value; // default: 0 } function current(Counter storage counter) internal view returns (uint256) { return counter._value; } function increment(Counter storage counter) internal { // The {SafeMath} overflow check can be skipped here, see the comment at the top counter._value += 1; } function decrement(Counter storage counter) internal { counter._value = counter._value.sub(1); } } // File: @openzeppelin/contracts/token/ERC20/IERC20.sol /** * @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/token/ERC20/SafeERC20.sol /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using 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: @openzeppelin/contracts/introspection/IERC165.sol /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); } // File: @openzeppelin/contracts/token/ERC721/IERC721.sol /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom(address from, address to, uint256 tokenId) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 tokenId) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external; } // File: @openzeppelin/contracts/token/ERC721/IERC721Receiver.sol /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721Receiver { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`. */ function onERC721Received(address operator, address from, uint256 tokenId, bytes calldata data) external returns (bytes4); } // File: @openzeppelin/contracts/token/ERC721/ERC721Holder.sol /** * @dev Implementation of the {IERC721Receiver} interface. * * Accepts all token transfers. * Make sure the contract is able to use its token with {IERC721-safeTransferFrom}, {IERC721-approve} or {IERC721-setApprovalForAll}. */ contract ERC721Holder is IERC721Receiver { /** * @dev See {IERC721Receiver-onERC721Received}. * * Always returns `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received(address, address, uint256, bytes memory) public virtual override returns (bytes4) { return this.onERC721Received.selector; } } // File: @openzeppelin/contracts/utils/ReentrancyGuard.sol /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor () internal { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and make it call a * `private` function that does the actual work. */ modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } } // File: contracts/interfaces/IKRC20.sol interface IKRC20 is IERC20 { /** * @dev Returns the token name. */ function name() external view returns (string memory); /** * @dev Returns the token symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the token decimals. */ function decimals() external view returns (uint8); } // File: contracts/MojitoProfile.sol /** @title MojitoProfile. @dev It is a contract for users to bind their address to a customizable profile by depositing a NFT. */ contract MojitoProfile is AccessControl, ERC721Holder, ReentrancyGuard { using Counters for Counters.Counter; using SafeERC20 for IKRC20; using SafeMath for uint256; IKRC20 public mojitoToken; bytes32 public constant NFT_ROLE = keccak256("NFT_ROLE"); bytes32 public constant POINT_ROLE = keccak256("POINT_ROLE"); bytes32 public constant SPECIAL_ROLE = keccak256("SPECIAL_ROLE"); uint256 public numberActiveProfiles; uint256 public numberMojitoToReactivate; uint256 public numberMojitoToRegister; uint256 public numberMojitoToUpdate; uint256 public numberTeams; mapping(address => bool) public hasRegistered; mapping(uint256 => Team) private teams; mapping(address => User) private users; // Used for generating the teamId Counters.Counter private _countTeams; // Used for generating the userId Counters.Counter private _countUsers; // Event to notify a new team is created event TeamAdd(uint256 teamId, string teamName); // Event to notify that team points are increased event TeamPointIncrease( uint256 indexed teamId, uint256 numberPoints, uint256 indexed campaignId ); event UserChangeTeam( address indexed userAddress, uint256 oldTeamId, uint256 newTeamId ); // Event to notify that a user is registered event UserNew( address indexed userAddress, uint256 teamId, address nftAddress, uint256 tokenId ); // Event to notify a user pausing profile event UserPause(address indexed userAddress, uint256 teamId); // Event to notify that user points are increased event UserPointIncrease( address indexed userAddress, uint256 numberPoints, uint256 indexed campaignId ); // Event to notify that a list of users have an increase in points event UserPointIncreaseMultiple( address[] userAddresses, uint256 numberPoints, uint256 indexed campaignId ); // Event to notify that a user is reactivating profile event UserReactivate( address indexed userAddress, uint256 teamId, address nftAddress, uint256 tokenId ); // Event to notify that a user is pausing profile event UserUpdate( address indexed userAddress, address nftAddress, uint256 tokenId ); // Modifier for admin roles modifier onlyOwner() { require(hasRole(DEFAULT_ADMIN_ROLE, _msgSender()), "MojitoProfile::onlyOwner: Not the main admin"); _; } // Modifier for point roles modifier onlyPoint() { require(hasRole(POINT_ROLE, _msgSender()), "MojitoProfile::onlyPoint: Not a point admin"); _; } // Modifier for special roles modifier onlySpecial() { require(hasRole(SPECIAL_ROLE, _msgSender()), "MojitoProfile::onlySpecial: Not a special admin"); _; } struct Team { string teamName; string teamDescription; uint256 numberUsers; uint256 numberPoints; bool isJoinable; } struct User { uint256 userId; uint256 numberPoints; uint256 teamId; address nftAddress; uint256 tokenId; bool isActive; } constructor( IKRC20 _mojitoToken, uint256 _numberMojitoToReactivate, uint256 _numberMojitoToRegister, uint256 _numberMojitoToUpdate ) public { mojitoToken = _mojitoToken; numberMojitoToReactivate = _numberMojitoToReactivate; numberMojitoToRegister = _numberMojitoToRegister; numberMojitoToUpdate = _numberMojitoToUpdate; _setupRole(DEFAULT_ADMIN_ROLE, _msgSender()); } /** * @dev To create a user profile. It sends the NFT to the contract * and sends MJT to burn address. Requires 2 token approvals. */ function createProfile(uint256 _teamId, address _nftAddress, uint256 _tokenId) external nonReentrant { require(!hasRegistered[_msgSender()], "MojitoProfile::createProfile: Already registered"); require((_teamId <= numberTeams) && (_teamId > 0), "MojitoProfile::createProfile: Invalid teamId"); require(teams[_teamId].isJoinable, "MojitoProfile::createProfile: Team not joinable"); require(hasRole(NFT_ROLE, _nftAddress), "MojitoProfile::createProfile: NFT address invalid"); // Loads the interface to deposit the NFT contract IERC721 nftToken = IERC721(_nftAddress); require(_msgSender() == nftToken.ownerOf(_tokenId), "MojitoProfile::createProfile: Only NFT owner can register"); // Transfer NFT to this contract nftToken.safeTransferFrom(_msgSender(), address(this), _tokenId); // Transfer MJT tokens to this contract mojitoToken.safeTransferFrom(_msgSender(), address(this), numberMojitoToRegister); // Increment the _countUsers counter and get userId _countUsers.increment(); uint256 newUserId = _countUsers.current(); // Add data to the struct for newUserId users[_msgSender()] = User({ userId : newUserId, numberPoints : 0, teamId : _teamId, nftAddress : _nftAddress, tokenId : _tokenId, isActive : true }); // Update registration status hasRegistered[_msgSender()] = true; // Update number of active profiles numberActiveProfiles = numberActiveProfiles.add(1); // Increase the number of users for the team teams[_teamId].numberUsers = teams[_teamId].numberUsers.add(1); // Emit an event emit UserNew(_msgSender(), _teamId, _nftAddress, _tokenId); } /** * @dev To pause user profile. It releases the NFT. * Callable only by registered users. */ function pauseProfile() external nonReentrant { require(hasRegistered[_msgSender()], "MojitoProfile::pauseProfile: Has not registered"); // Checks whether user has already paused require(users[_msgSender()].isActive, "MojitoProfile::pauseProfile: User not active"); // Change status of user to make it inactive users[_msgSender()].isActive = false; // Retrieve the teamId of the user calling uint256 userTeamId = users[_msgSender()].teamId; // Reduce number of active users and team users teams[userTeamId].numberUsers = teams[userTeamId].numberUsers.sub(1); numberActiveProfiles = numberActiveProfiles.sub(1); // Interface to deposit the NFT contract IERC721 nftToken = IERC721(users[_msgSender()].nftAddress); // tokenId of NFT redeemed uint256 redeemedTokenId = users[_msgSender()].tokenId; // Change internal statuses as extra safety users[_msgSender()].nftAddress = address(0x0); users[_msgSender()].tokenId = 0; // Transfer the NFT back to the user nftToken.safeTransferFrom(address(this), _msgSender(), redeemedTokenId); // Emit event emit UserPause(_msgSender(), userTeamId); } /** * @dev To update user profile. * Callable only by registered users. */ function updateProfile(address _nftAddress, uint256 _tokenId) external nonReentrant { require(hasRegistered[_msgSender()], "MojitoProfile::updateProfile: Has not registered"); require(hasRole(NFT_ROLE, _nftAddress), "MojitoProfile::updateProfile: NFT address invalid"); require(users[_msgSender()].isActive, "MojitoProfile::updateProfile: User not active"); address currentAddress = users[_msgSender()].nftAddress; uint256 currentTokenId = users[_msgSender()].tokenId; // Interface to deposit the NFT contract IERC721 nftNewToken = IERC721(_nftAddress); require(_msgSender() == nftNewToken.ownerOf(_tokenId), "MojitoProfile::updateProfile: Only NFT owner can update"); // Transfer token to new address nftNewToken.safeTransferFrom(_msgSender(), address(this), _tokenId); // Transfer MJT token to this address mojitoToken.safeTransferFrom(_msgSender(), address(this), numberMojitoToUpdate); // Interface to deposit the NFT contract IERC721 nftCurrentToken = IERC721(currentAddress); // Transfer old token back to the owner nftCurrentToken.safeTransferFrom(address(this), _msgSender(), currentTokenId); // Update mapping in storage users[_msgSender()].nftAddress = _nftAddress; users[_msgSender()].tokenId = _tokenId; emit UserUpdate(_msgSender(), _nftAddress, _tokenId); } /** * @dev To reactivate user profile. * Callable only by registered users. */ function reactivateProfile(address _nftAddress, uint256 _tokenId) external nonReentrant { require(hasRegistered[_msgSender()], "MojitoProfile::reactivateProfile: Has not registered"); require(hasRole(NFT_ROLE, _nftAddress), "MojitoProfile::reactivateProfile: NFT address invalid"); require(!users[_msgSender()].isActive, "MojitoProfile::reactivateProfile: User is active"); // Interface to deposit the NFT contract IERC721 nftToken = IERC721(_nftAddress); require(_msgSender() == nftToken.ownerOf(_tokenId), "MojitoProfile::reactivateProfile: Only NFT owner can update"); // Transfer NFT to contract nftToken.safeTransferFrom(_msgSender(), address(this), _tokenId); // Transfer to this address mojitoToken.safeTransferFrom(_msgSender(), address(this), numberMojitoToReactivate); // Retrieve teamId of the user uint256 userTeamId = users[_msgSender()].teamId; // Update number of users for the team and number of active profiles numberActiveProfiles = numberActiveProfiles.add(1); teams[userTeamId].numberUsers = teams[userTeamId].numberUsers.add(1); // Update user statuses users[_msgSender()].isActive = true; users[_msgSender()].nftAddress = _nftAddress; users[_msgSender()].tokenId = _tokenId; // Emit event emit UserReactivate(_msgSender(), userTeamId, _nftAddress, _tokenId); } /** * @dev To increase the number of points for a user. * Callable only by point admins */ function increaseUserPoints(address _userAddress, uint256 _numberPoints, uint256 _campaignId) external onlyPoint { // Increase the number of points for the user users[_userAddress].numberPoints = users[_userAddress].numberPoints.add(_numberPoints); emit UserPointIncrease(_userAddress, _numberPoints, _campaignId); } /** * @dev To increase the number of points for a set of users. * Callable only by point admins */ function increaseUserPointsMultiple(address[] calldata _userAddresses, uint256 _numberPoints, uint256 _campaignId) external onlyPoint { require(_userAddresses.length < 1001, "MojitoProfile::increaseUserPointsMultiple: Length must be < 1001"); for (uint256 i = 0; i < _userAddresses.length; i++) { users[_userAddresses[i]].numberPoints = users[_userAddresses[i]].numberPoints.add(_numberPoints); } emit UserPointIncreaseMultiple(_userAddresses, _numberPoints, _campaignId); } /** * @dev To increase the number of points for a team. * Callable only by point admins */ function increaseTeamPoints(uint256 _teamId, uint256 _numberPoints, uint256 _campaignId) external onlyPoint { // Increase the number of points for the team teams[_teamId].numberPoints = teams[_teamId].numberPoints.add(_numberPoints); emit TeamPointIncrease(_teamId, _numberPoints, _campaignId); } /** * @dev To remove the number of points for a user. * Callable only by point admins */ function removeUserPoints(address _userAddress, uint256 _numberPoints) external onlyPoint { // Increase the number of points for the user users[_userAddress].numberPoints = users[_userAddress].numberPoints.sub(_numberPoints); } /** * @dev To remove a set number of points for a set of users. */ function removeUserPointsMultiple(address[] calldata _userAddresses, uint256 _numberPoints) external onlyPoint { require(_userAddresses.length < 1001, "MojitoProfile::removeUserPointsMultiple: Length must be < 1001"); for (uint256 i = 0; i < _userAddresses.length; i++) { users[_userAddresses[i]].numberPoints = users[_userAddresses[i]].numberPoints.sub(_numberPoints); } } /** * @dev To remove the number of points for a team. * Callable only by point admins */ function removeTeamPoints(uint256 _teamId, uint256 _numberPoints) external onlyPoint { // Increase the number of points for the team teams[_teamId].numberPoints = teams[_teamId].numberPoints.sub(_numberPoints); } /** * @dev To add a NFT contract address for users to set their profile. * Callable only by owner admins. */ function addNftAddress(address _nftAddress) external onlyOwner { require(IERC721(_nftAddress).supportsInterface(0x80ac58cd), "MojitoProfile::addNftAddress: Not ERC721"); grantRole(NFT_ROLE, _nftAddress); } /** * @dev Add a new teamId * Callable only by owner admins. */ function addTeam(string calldata _teamName, string calldata _teamDescription) external onlyOwner { // Verify length is between 3 and 16 bytes memory strBytes = bytes(_teamName); require(strBytes.length < 20, "MojitoProfile::addTeam: Must be < 20"); require(strBytes.length > 3, "MojitoProfile::addTeam: Must be > 3"); // Increment the _countTeams counter and get teamId _countTeams.increment(); uint256 newTeamId = _countTeams.current(); // Add new team data to the struct teams[newTeamId] = Team({ teamName : _teamName, teamDescription : _teamDescription, numberUsers : 0, numberPoints : 0, isJoinable : true }); numberTeams = newTeamId; emit TeamAdd(newTeamId, _teamName); } /** * @dev Function to change team. * Callable only by special admins. */ function changeTeam(address _userAddress, uint256 _newTeamId) external onlySpecial { require(hasRegistered[_userAddress], "MojitoProfile::changeTeam: Has not registered"); require((_newTeamId <= numberTeams) && (_newTeamId > 0), "MojitoProfile::changeTeam: Invalid teamId"); require(teams[_newTeamId].isJoinable, "MojitoProfile::changeTeam: Team not joinable"); require(users[_userAddress].teamId != _newTeamId, "MojitoProfile::changeTeam: Already in the team"); // Get old teamId uint256 oldTeamId = users[_userAddress].teamId; // Change number of users in old team teams[oldTeamId].numberUsers = teams[oldTeamId].numberUsers.sub(1); // Change teamId in user mapping users[_userAddress].teamId = _newTeamId; // Change number of users in new team teams[_newTeamId].numberUsers = teams[_newTeamId].numberUsers.add(1); emit UserChangeTeam(_userAddress, oldTeamId, _newTeamId); } /** * @dev Claim MJT to burn later. * Callable only by owner admins. */ function claimFee(uint256 _amount) external onlyOwner { mojitoToken.safeTransfer(_msgSender(), _amount); } /** * @dev Make a team joinable again. * Callable only by owner admins. */ function makeTeamJoinable(uint256 _teamId) external onlyOwner { require((_teamId <= numberTeams) && (_teamId > 0), "MojitoProfile::makeTeamJoinable: Invalid teamId"); teams[_teamId].isJoinable = true; } /** * @dev Make a team not joinable. * Callable only by owner admins. */ function makeTeamNotJoinable(uint256 _teamId) external onlyOwner { require((_teamId <= numberTeams) && (_teamId > 0), "MojitoProfile::makeTeamNotJoinable: Invalid teamId"); teams[_teamId].isJoinable = false; } /** * @dev Rename a team * Callable only by owner admins. */ function renameTeam(uint256 _teamId, string calldata _teamName, string calldata _teamDescription) external onlyOwner { require((_teamId <= numberTeams) && (_teamId > 0), "MojitoProfile::renameTeam: Invalid teamId"); // Verify length is between 3 and 16 bytes memory strBytes = bytes(_teamName); require(strBytes.length < 20, "MojitoProfile::renameTeam: Must be < 20"); require(strBytes.length > 3, "MojitoProfile::renameTeam: Must be > 3"); teams[_teamId].teamName = _teamName; teams[_teamId].teamDescription = _teamDescription; } /** * @dev Update the number of MJT to register * Callable only by owner admins. */ function updateNumberMojito(uint256 _newNumberMojitoToReactivate, uint256 _newNumberMojitoToRegister, uint256 _newNumberMojitoToUpdate) external onlyOwner { numberMojitoToReactivate = _newNumberMojitoToReactivate; numberMojitoToRegister = _newNumberMojitoToRegister; numberMojitoToUpdate = _newNumberMojitoToUpdate; } /** * @dev Check the user's profile for a given address */ function getUserProfile(address _userAddress) external view returns ( uint256, uint256, uint256, address, uint256, bool ) { require(hasRegistered[_userAddress], "MojitoProfile::getUserProfile: Has not registered"); return ( users[_userAddress].userId, users[_userAddress].numberPoints, users[_userAddress].teamId, users[_userAddress].nftAddress, users[_userAddress].tokenId, users[_userAddress].isActive ); } /** * @dev Check the user's status for a given address */ function getUserStatus(address _userAddress) external view returns (bool) { return (users[_userAddress].isActive); } /** * @dev Check a team's profile */ function getTeamProfile(uint256 _teamId) external view returns ( string memory, string memory, uint256, uint256, bool ) { require((_teamId <= numberTeams) && (_teamId > 0), "MojitoProfile::getTeamProfile: Invalid teamId"); return ( teams[_teamId].teamName, teams[_teamId].teamDescription, teams[_teamId].numberUsers, teams[_teamId].numberPoints, teams[_teamId].isJoinable ); } }
Contract ABI
[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"_mojitoToken","internalType":"contract IKRC20"},{"type":"uint256","name":"_numberMojitoToReactivate","internalType":"uint256"},{"type":"uint256","name":"_numberMojitoToRegister","internalType":"uint256"},{"type":"uint256","name":"_numberMojitoToUpdate","internalType":"uint256"}]},{"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":"TeamAdd","inputs":[{"type":"uint256","name":"teamId","internalType":"uint256","indexed":false},{"type":"string","name":"teamName","internalType":"string","indexed":false}],"anonymous":false},{"type":"event","name":"TeamPointIncrease","inputs":[{"type":"uint256","name":"teamId","internalType":"uint256","indexed":true},{"type":"uint256","name":"numberPoints","internalType":"uint256","indexed":false},{"type":"uint256","name":"campaignId","internalType":"uint256","indexed":true}],"anonymous":false},{"type":"event","name":"UserChangeTeam","inputs":[{"type":"address","name":"userAddress","internalType":"address","indexed":true},{"type":"uint256","name":"oldTeamId","internalType":"uint256","indexed":false},{"type":"uint256","name":"newTeamId","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"UserNew","inputs":[{"type":"address","name":"userAddress","internalType":"address","indexed":true},{"type":"uint256","name":"teamId","internalType":"uint256","indexed":false},{"type":"address","name":"nftAddress","internalType":"address","indexed":false},{"type":"uint256","name":"tokenId","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"UserPause","inputs":[{"type":"address","name":"userAddress","internalType":"address","indexed":true},{"type":"uint256","name":"teamId","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"UserPointIncrease","inputs":[{"type":"address","name":"userAddress","internalType":"address","indexed":true},{"type":"uint256","name":"numberPoints","internalType":"uint256","indexed":false},{"type":"uint256","name":"campaignId","internalType":"uint256","indexed":true}],"anonymous":false},{"type":"event","name":"UserPointIncreaseMultiple","inputs":[{"type":"address[]","name":"userAddresses","internalType":"address[]","indexed":false},{"type":"uint256","name":"numberPoints","internalType":"uint256","indexed":false},{"type":"uint256","name":"campaignId","internalType":"uint256","indexed":true}],"anonymous":false},{"type":"event","name":"UserReactivate","inputs":[{"type":"address","name":"userAddress","internalType":"address","indexed":true},{"type":"uint256","name":"teamId","internalType":"uint256","indexed":false},{"type":"address","name":"nftAddress","internalType":"address","indexed":false},{"type":"uint256","name":"tokenId","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"UserUpdate","inputs":[{"type":"address","name":"userAddress","internalType":"address","indexed":true},{"type":"address","name":"nftAddress","internalType":"address","indexed":false},{"type":"uint256","name":"tokenId","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":"NFT_ROLE","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"POINT_ROLE","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"SPECIAL_ROLE","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"addNftAddress","inputs":[{"type":"address","name":"_nftAddress","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"addTeam","inputs":[{"type":"string","name":"_teamName","internalType":"string"},{"type":"string","name":"_teamDescription","internalType":"string"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"changeTeam","inputs":[{"type":"address","name":"_userAddress","internalType":"address"},{"type":"uint256","name":"_newTeamId","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"claimFee","inputs":[{"type":"uint256","name":"_amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"createProfile","inputs":[{"type":"uint256","name":"_teamId","internalType":"uint256"},{"type":"address","name":"_nftAddress","internalType":"address"},{"type":"uint256","name":"_tokenId","internalType":"uint256"}]},{"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":"view","outputs":[{"type":"string","name":"","internalType":"string"},{"type":"string","name":"","internalType":"string"},{"type":"uint256","name":"","internalType":"uint256"},{"type":"uint256","name":"","internalType":"uint256"},{"type":"bool","name":"","internalType":"bool"}],"name":"getTeamProfile","inputs":[{"type":"uint256","name":"_teamId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"},{"type":"uint256","name":"","internalType":"uint256"},{"type":"uint256","name":"","internalType":"uint256"},{"type":"address","name":"","internalType":"address"},{"type":"uint256","name":"","internalType":"uint256"},{"type":"bool","name":"","internalType":"bool"}],"name":"getUserProfile","inputs":[{"type":"address","name":"_userAddress","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"getUserStatus","inputs":[{"type":"address","name":"_userAddress","internalType":"address"}]},{"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":"hasRegistered","inputs":[{"type":"address","name":"","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":"nonpayable","outputs":[],"name":"increaseTeamPoints","inputs":[{"type":"uint256","name":"_teamId","internalType":"uint256"},{"type":"uint256","name":"_numberPoints","internalType":"uint256"},{"type":"uint256","name":"_campaignId","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"increaseUserPoints","inputs":[{"type":"address","name":"_userAddress","internalType":"address"},{"type":"uint256","name":"_numberPoints","internalType":"uint256"},{"type":"uint256","name":"_campaignId","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"increaseUserPointsMultiple","inputs":[{"type":"address[]","name":"_userAddresses","internalType":"address[]"},{"type":"uint256","name":"_numberPoints","internalType":"uint256"},{"type":"uint256","name":"_campaignId","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"makeTeamJoinable","inputs":[{"type":"uint256","name":"_teamId","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"makeTeamNotJoinable","inputs":[{"type":"uint256","name":"_teamId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IKRC20"}],"name":"mojitoToken","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"numberActiveProfiles","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"numberMojitoToReactivate","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"numberMojitoToRegister","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"numberMojitoToUpdate","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"numberTeams","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bytes4","name":"","internalType":"bytes4"}],"name":"onERC721Received","inputs":[{"type":"address","name":"","internalType":"address"},{"type":"address","name":"","internalType":"address"},{"type":"uint256","name":"","internalType":"uint256"},{"type":"bytes","name":"","internalType":"bytes"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"pauseProfile","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"reactivateProfile","inputs":[{"type":"address","name":"_nftAddress","internalType":"address"},{"type":"uint256","name":"_tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"removeTeamPoints","inputs":[{"type":"uint256","name":"_teamId","internalType":"uint256"},{"type":"uint256","name":"_numberPoints","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"removeUserPoints","inputs":[{"type":"address","name":"_userAddress","internalType":"address"},{"type":"uint256","name":"_numberPoints","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"removeUserPointsMultiple","inputs":[{"type":"address[]","name":"_userAddresses","internalType":"address[]"},{"type":"uint256","name":"_numberPoints","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renameTeam","inputs":[{"type":"uint256","name":"_teamId","internalType":"uint256"},{"type":"string","name":"_teamName","internalType":"string"},{"type":"string","name":"_teamDescription","internalType":"string"}]},{"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":"nonpayable","outputs":[],"name":"updateNumberMojito","inputs":[{"type":"uint256","name":"_newNumberMojitoToReactivate","internalType":"uint256"},{"type":"uint256","name":"_newNumberMojitoToRegister","internalType":"uint256"},{"type":"uint256","name":"_newNumberMojitoToUpdate","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"updateProfile","inputs":[{"type":"address","name":"_nftAddress","internalType":"address"},{"type":"uint256","name":"_tokenId","internalType":"uint256"}]}]
Contract Creation Code
0x60806040523480156200001157600080fd5b506040516200427e3803806200427e833981810160405260808110156200003757600080fd5b5080516020820151604083015160609093015160018055600280546001600160a01b0319166001600160a01b038516179055600482905560058490556006819055919290916200009260006200008c6200009c565b620000a0565b50505050620001b0565b3390565b620000ac8282620000b0565b5050565b600082815260208181526040909120620000d5918390620030e962000129821b17901c565b15620000ac57620000e56200009c565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600062000140836001600160a01b03841662000149565b90505b92915050565b600062000157838362000198565b6200018f5750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915562000143565b50600062000143565b60009081526001919091016020526040902054151590565b6140be80620001c06000396000f3fe608060405234801561001057600080fd5b50600436106102485760003560e01c8063aee2f47f1161013b578063dd3f8717116100b8578063ebc4ffc71161007c578063ebc4ffc714610a87578063f65eeb0914610aa4578063f667526a14610aac578063f684f33c14610ac9578063fd825f5814610ad157610248565b8063dd3f8717146109b1578063e2fa2ff3146109b9578063e5020a6214610a2d578063ea0d5dcd14610a59578063ebb263e414610a7f57610248565b8063c9bed948116100ff578063c9bed94814610911578063ca15c87314610919578063d1d0954c14610936578063d547741f14610959578063da83fe4a1461098557610248565b8063aee2f47f146107be578063be4f9bd6146108d0578063bf051c13146108d8578063c1694a2f146108e0578063c1c73674146108e857610248565b80633dd452d6116101c9578063987ee1561161018d578063987ee15614610693578063a0d03526146106f6578063a217fddf1461071c578063a40601ee14610724578063a56bd1de1461075057610248565b80633dd452d6146105215780635da3c240146105295780635db345661461054f5780639010d07c1461061457806391d148541461065357610248565b8063218188d711610210578063218188d714610475578063248a9ca31461049257806328593623146104c15780632f2ff15d146104c957806336568abe146104f557610248565b80630a82697b1461024d5780630d4fb8031461027b578063150b7a02146103395780631bdc17f61461041a5780631e47a4761461044c575b600080fd5b6102796004803603604081101561026357600080fd5b506001600160a01b038135169060200135610b03565b005b6102796004803603604081101561029157600080fd5b810190602081018135600160201b8111156102ab57600080fd5b8201836020820111156102bd57600080fd5b803590602001918460018302840111600160201b831117156102de57600080fd5b919390929091602081019035600160201b8111156102fb57600080fd5b82018360208201111561030d57600080fd5b803590602001918460018302840111600160201b8311171561032e57600080fd5b509092509050610fb1565b6103fd6004803603608081101561034f57600080fd5b6001600160a01b03823581169260208101359091169160408201359190810190608081016060820135600160201b81111561038957600080fd5b82018360208201111561039b57600080fd5b803590602001918460018302840111600160201b831117156103bc57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550611246945050505050565b604080516001600160e01b03199092168252519081900360200190f35b6102796004803603606081101561043057600080fd5b506001600160a01b038135169060208101359060400135611256565b6102796004803603606081101561046257600080fd5b508035906020810135906040013561132a565b6102796004803603602081101561048b57600080fd5b50356113f3565b6104af600480360360208110156104a857600080fd5b50356114a3565b60408051918252519081900360200190f35b6104af6114b8565b610279600480360360408110156104df57600080fd5b50803590602001356001600160a01b03166114be565b6102796004803603604081101561050b57600080fd5b50803590602001356001600160a01b0316611525565b6104af611586565b6102796004803603602081101561053f57600080fd5b50356001600160a01b031661158c565b6102796004803603606081101561056557600080fd5b81359190810190604081016020820135600160201b81111561058657600080fd5b82018360208201111561059857600080fd5b803590602001918460018302840111600160201b831117156105b957600080fd5b919390929091602081019035600160201b8111156105d657600080fd5b8201836020820111156105e857600080fd5b803590602001918460018302840111600160201b8311171561060957600080fd5b5090925090506116a3565b6106376004803603604081101561062a57600080fd5b5080359060200135611835565b604080516001600160a01b039092168252519081900360200190f35b61067f6004803603604081101561066957600080fd5b50803590602001356001600160a01b0316611856565b604080519115158252519081900360200190f35b6106b9600480360360208110156106a957600080fd5b50356001600160a01b031661186e565b604080519687526020870195909552858501939093526001600160a01b0390911660608501526080840152151560a0830152519081900360c00190f35b61067f6004803603602081101561070c57600080fd5b50356001600160a01b031661191a565b6104af61192f565b6102796004803603604081101561073a57600080fd5b506001600160a01b038135169060200135611934565b6102796004803603604081101561076657600080fd5b810190602081018135600160201b81111561078057600080fd5b82018360208201111561079257600080fd5b803590602001918460208302840111600160201b831117156107b357600080fd5b919350915035611daa565b6107db600480360360208110156107d457600080fd5b5035611efa565b6040518080602001806020018681526020018581526020018415158152602001838103835288818151815260200191508051906020019080838360005b83811015610830578181015183820152602001610818565b50505050905090810190601f16801561085d5780820380516001836020036101000a031916815260200191505b50838103825287518152875160209182019189019080838360005b83811015610890578181015183820152602001610878565b50505050905090810190601f1680156108bd5780820380516001836020036101000a031916815260200191505b5097505050505050505060405180910390f35b6104af6120ac565b6104af6120b2565b6102796120d6565b610279600480360360608110156108fe57600080fd5b508035906020810135906040013561246c565b6104af6124c2565b6104af6004803603602081101561092f57600080fd5b50356124d4565b6102796004803603604081101561094c57600080fd5b50803590602001356124eb565b6102796004803603604081101561096f57600080fd5b50803590602001356001600160a01b0316612575565b6102796004803603604081101561099b57600080fd5b506001600160a01b0381351690602001356125ce565b6104af61266c565b610279600480360360608110156109cf57600080fd5b810190602081018135600160201b8111156109e957600080fd5b8201836020820111156109fb57600080fd5b803590602001918460208302840111600160201b83111715610a1c57600080fd5b919350915080359060200135612672565b61027960048036036040811015610a4357600080fd5b506001600160a01b03813516906020013561282f565b61067f60048036036020811015610a6f57600080fd5b50356001600160a01b0316612ac4565b6104af612ae5565b61027960048036036020811015610a9d57600080fd5b5035612aeb565b610637612b9e565b61027960048036036020811015610ac257600080fd5b5035612bad565b6104af612c13565b61027960048036036060811015610ae757600080fd5b508035906001600160a01b036020820135169060400135612c25565b60026001541415610b49576040805162461bcd60e51b815260206004820152601f60248201526000805160206139a4833981519152604482015290519081900360640190fd5b600260015560086000610b5a6130fe565b6001600160a01b0316815260208101919091526040016000205460ff16610bb25760405162461bcd60e51b8152600401808060200182810382526030815260200180613d396030913960400191505060405180910390fd5b610bca600080516020613aa983398151915283611856565b610c055760405162461bcd60e51b8152600401808060200182810382526031815260200180613fcb6031913960400191505060405180910390fd5b600a6000610c116130fe565b6001600160a01b0316815260208101919091526040016000206005015460ff16610c6c5760405162461bcd60e51b815260040180806020018281038252602d8152602001806138e8602d913960400191505060405180910390fd5b6000600a6000610c7a6130fe565b6001600160a01b03908116825260208201929092526040016000908120600301549091169150600a81610cab6130fe565b6001600160a01b03166001600160a01b031681526020019081526020016000206004015490506000849050806001600160a01b0316636352211e856040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b158015610d1a57600080fd5b505afa158015610d2e573d6000803e3d6000fd5b505050506040513d6020811015610d4457600080fd5b50516001600160a01b0316610d576130fe565b6001600160a01b031614610d9c5760405162461bcd60e51b8152600401808060200182810382526037815260200180613b2b6037913960400191505060405180910390fd5b806001600160a01b03166342842e0e610db36130fe565b30876040518463ffffffff1660e01b815260040180846001600160a01b03168152602001836001600160a01b031681526020018281526020019350505050600060405180830381600087803b158015610e0b57600080fd5b505af1158015610e1f573d6000803e3d6000fd5b50505050610e46610e2e6130fe565b6006546002546001600160a01b031691903090613102565b826001600160a01b0381166342842e0e30610e5f6130fe565b866040518463ffffffff1660e01b815260040180846001600160a01b03168152602001836001600160a01b031681526020018281526020019350505050600060405180830381600087803b158015610eb657600080fd5b505af1158015610eca573d6000803e3d6000fd5b5050505085600a6000610edb6130fe565b6001600160a01b03166001600160a01b0316815260200190815260200160002060030160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555084600a6000610f2f6130fe565b6001600160a01b03168152602081019190915260400160002060040155610f546130fe565b6001600160a01b03167fe8e88d4216f3bbc2d1a4dd55aa66fd3e0065ef03970fa056a19d018ca19d5805878760405180836001600160a01b031681526020018281526020019250505060405180910390a250506001805550505050565b610fc36000610fbe6130fe565b611856565b610ffe5760405162461bcd60e51b815260040180806020018281038252602c815260200180613d69602c913960400191505060405180910390fd5b606084848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250508251929350506014909110905061107c5760405162461bcd60e51b8152600401808060200182810382526024815260200180613a5c6024913960400191505060405180910390fd5b60038151116110bc5760405162461bcd60e51b8152600401808060200182810382526023815260200180613e766023913960400191505060405180910390fd5b6110c6600b61315c565b60006110d2600b613165565b6040805160c06020601f8a01819004028201810190925260a081018881529293509182918990899081908501838280828437600092019190915250505090825250604080516020601f880181900481028201810190925286815291810191908790879081908401838280828437600092018290525093855250505060208083018290526040808401839052600160609094019390935284825260098152919020825180519192611187928492909101906137e6565b5060208281015180516111a092600185019201906137e6565b50604082810151600283015560608084015160038401556080909301516004909201805460ff19169215159290921790915560078390558051838152602081018281529181018890527f1137f48534f03e02268dec7839069a7484bc6788c43e4ed9dc38dd8a2f269bc79284928a928a929091908201848480828437600083820152604051601f909101601f1916909201829003965090945050505050a1505050505050565b630a85bd0160e11b949350505050565b611270600080516020613fab833981519152610fbe6130fe565b6112ab5760405162461bcd60e51b815260040180806020018281038252602b815260200180613b88602b913960400191505060405180910390fd5b6001600160a01b0383166000908152600a60205260409020600101546112d19083613169565b6001600160a01b0384166000818152600a6020908152604091829020600101939093558051858152905184937f04bc07bcb78bb21e5665cf01cd24f6a6a06e21fd20d60df8f0fa8d58c66f2934928290030190a3505050565b611344600080516020613fab833981519152610fbe6130fe565b61137f5760405162461bcd60e51b815260040180806020018281038252602b815260200180613b88602b913960400191505060405180910390fd5b60008381526009602052604090206003015461139b9083613169565b600960008581526020019081526020016000206003018190555080837f2056366a9d1345af9da00985231357931fb77dc7fa7bdf71058e3ca3816f9d38846040518082815260200191505060405180910390a3505050565b6114006000610fbe6130fe565b61143b5760405162461bcd60e51b815260040180806020018281038252602c815260200180613d69602c913960400191505060405180910390fd5b600754811115801561144d5750600081115b6114885760405162461bcd60e51b8152600401808060200182810382526032815260200180613c7a6032913960400191505060405180910390fd5b6000908152600960205260409020600401805460ff19169055565b60009081526020819052604090206002015490565b60045481565b6000828152602081905260409020600201546114dc90610fbe6130fe565b6115175760405162461bcd60e51b815260040180806020018281038252602f815260200180613975602f913960400191505060405180910390fd5b61152182826131c3565b5050565b61152d6130fe565b6001600160a01b0316816001600160a01b03161461157c5760405162461bcd60e51b815260040180806020018281038252602f81526020018061405a602f913960400191505060405180910390fd5b611521828261322c565b60075481565b6115996000610fbe6130fe565b6115d45760405162461bcd60e51b815260040180806020018281038252602c815260200180613d69602c913960400191505060405180910390fd5b604080516301ffc9a760e01b81526380ac58cd60e01b600482015290516001600160a01b038316916301ffc9a7916024808301926020929190829003018186803b15801561162157600080fd5b505afa158015611635573d6000803e3d6000fd5b505050506040513d602081101561164b57600080fd5b50516116885760405162461bcd60e51b8152600401808060200182810382526028815260200180613e1a6028913960400191505060405180910390fd5b6116a0600080516020613aa9833981519152826114be565b50565b6116b06000610fbe6130fe565b6116eb5760405162461bcd60e51b815260040180806020018281038252602c815260200180613d69602c913960400191505060405180910390fd5b60075485111580156116fd5750600085115b6117385760405162461bcd60e51b8152600401808060200182810382526029815260200180613df16029913960400191505060405180910390fd5b606084848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050825192935050601490911090506117b65760405162461bcd60e51b8152600401808060200182810382526027815260200180613f846027913960400191505060405180910390fd5b60038151116117f65760405162461bcd60e51b8152600401808060200182810382526026815260200180613f1e6026913960400191505060405180910390fd5b600086815260096020526040902061180f908686613864565b50600086815260096020526040902061182c906001018484613864565b50505050505050565b600082815260208190526040812061184d9083613295565b90505b92915050565b600082815260208190526040812061184d90836132a1565b6001600160a01b0381166000908152600860205260408120548190819081908190819060ff166118cf5760405162461bcd60e51b8152600401808060200182810382526031815260200180613a2b6031913960400191505060405180910390fd5b505050506001600160a01b039283166000908152600a60205260409020805460018201546002830154600384015460048501546005909501549398929791965016935060ff90911690565b60086020526000908152604090205460ff1681565b600081565b6002600154141561197a576040805162461bcd60e51b815260206004820152601f60248201526000805160206139a4833981519152604482015290519081900360640190fd5b60026001556008600061198b6130fe565b6001600160a01b0316815260208101919091526040016000205460ff166119e35760405162461bcd60e51b8152600401808060200182810382526034815260200180613e426034913960400191505060405180910390fd5b6119fb600080516020613aa983398151915283611856565b611a365760405162461bcd60e51b8152600401808060200182810382526035815260200180613ac96035913960400191505060405180910390fd5b600a6000611a426130fe565b6001600160a01b0316815260208101919091526040016000206005015460ff1615611a9e5760405162461bcd60e51b8152600401808060200182810382526030815260200180613dc16030913960400191505060405180910390fd5b6000829050806001600160a01b0316636352211e836040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b158015611ae757600080fd5b505afa158015611afb573d6000803e3d6000fd5b505050506040513d6020811015611b1157600080fd5b50516001600160a01b0316611b246130fe565b6001600160a01b031614611b695760405162461bcd60e51b815260040180806020018281038252603b8152602001806139f0603b913960400191505060405180910390fd5b806001600160a01b03166342842e0e611b806130fe565b30856040518463ffffffff1660e01b815260040180846001600160a01b03168152602001836001600160a01b031681526020018281526020019350505050600060405180830381600087803b158015611bd857600080fd5b505af1158015611bec573d6000803e3d6000fd5b50505050611c13611bfb6130fe565b6004546002546001600160a01b031691903090613102565b6000600a6000611c216130fe565b6001600160a01b03168152602081019190915260400160002060020154600354909150611c4f906001613169565b600355600081815260096020526040902060020154611c6f906001613169565b600082815260096020526040812060020191909155600190600a90611c926130fe565b6001600160a01b03166001600160a01b0316815260200190815260200160002060050160006101000a81548160ff02191690831515021790555083600a6000611cd96130fe565b6001600160a01b03166001600160a01b0316815260200190815260200160002060030160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555082600a6000611d2d6130fe565b6001600160a01b03168152602081019190915260400160002060040155611d526130fe565b604080518381526001600160a01b038781166020830152818301879052915192909116917fdb76eea80687b6553e5d689ff9d000c0ce2c10574b39d64cacc2b4f6f54f68389181900360600190a25050600180555050565b611dc4600080516020613fab833981519152610fbe6130fe565b611dff5760405162461bcd60e51b815260040180806020018281038252602b815260200180613b88602b913960400191505060405180910390fd5b6103e98210611e3f5760405162461bcd60e51b815260040180806020018281038252603e815260200180613937603e913960400191505060405180910390fd5b60005b82811015611ef457611ea082600a6000878786818110611e5e57fe5b905060200201356001600160a01b03166001600160a01b03166001600160a01b03168152602001908152602001600020600101546132b690919063ffffffff16565b600a6000868685818110611eb057fe5b905060200201356001600160a01b03166001600160a01b03166001600160a01b03168152602001908152602001600020600101819055508080600101915050611e42565b50505050565b60608060008060006007548611158015611f145750600086115b611f4f5760405162461bcd60e51b815260040180806020018281038252602d815260200180613d0c602d913960400191505060405180910390fd5b6000868152600960209081526040918290206002808201546003830154600484015484548751601f6000196001848116156101000291909101909316969096049586018890048802810188019098528488529496948701959294919360ff909116928791908301828280156120055780601f10611fda57610100808354040283529160200191612005565b820191906000526020600020905b815481529060010190602001808311611fe857829003601f168201915b5050875460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152959a50899450925084019050828280156120935780601f1061206857610100808354040283529160200191612093565b820191906000526020600020905b81548152906001019060200180831161207657829003601f168201915b50989f939e50959c50939a509198509650505050505050565b60035481565b7f3f12a51c1a5d4235e47a0365ddc220be1678ccffcdf71bfd6ee9c417f801e00881565b6002600154141561211c576040805162461bcd60e51b815260206004820152601f60248201526000805160206139a4833981519152604482015290519081900360640190fd5b60026001556008600061212d6130fe565b6001600160a01b0316815260208101919091526040016000205460ff166121855760405162461bcd60e51b815260040180806020018281038252602f815260200180613cac602f913960400191505060405180910390fd5b600a60006121916130fe565b6001600160a01b0316815260208101919091526040016000206005015460ff166121ec5760405162461bcd60e51b815260040180806020018281038252602c815260200180613d95602c913960400191505060405180910390fd5b6000600a60006121fa6130fe565b6001600160a01b0316815260208101919091526040016000908120600501805460ff191692151592909217909155600a816122336130fe565b6001600160a01b03166001600160a01b03168152602001908152602001600020600201549050612283600160096000848152602001908152602001600020600201546132b690919063ffffffff16565b6000828152600960205260409020600201556003546122a39060016132b6565b6003556000600a816122b36130fe565b6001600160a01b03908116825260208201929092526040016000908120600301549091169150600a816122e46130fe565b6001600160a01b03166001600160a01b031681526020019081526020016000206004015490506000600a60006123186130fe565b6001600160a01b03166001600160a01b0316815260200190815260200160002060030160006101000a8154816001600160a01b0302191690836001600160a01b031602179055506000600a600061236d6130fe565b6001600160a01b03166001600160a01b0316815260200190815260200160002060040181905550816001600160a01b03166342842e0e306123ac6130fe565b846040518463ffffffff1660e01b815260040180846001600160a01b03168152602001836001600160a01b031681526020018281526020019350505050600060405180830381600087803b15801561240357600080fd5b505af1158015612417573d6000803e3d6000fd5b505050506124236130fe565b6001600160a01b03167fe0ed25582c4d86fd51bfe26383781fc8bbf5636813cbfdf93c440b5828c93040846040518082815260200191505060405180910390a250506001805550565b6124796000610fbe6130fe565b6124b45760405162461bcd60e51b815260040180806020018281038252602c815260200180613d69602c913960400191505060405180910390fd5b600492909255600555600655565b600080516020613fab83398151915281565b600081815260208190526040812061185090613313565b612505600080516020613fab833981519152610fbe6130fe565b6125405760405162461bcd60e51b815260040180806020018281038252602b815260200180613b88602b913960400191505060405180910390fd5b60008281526009602052604090206003015461255c90826132b6565b6000928352600960205260409092206003019190915550565b60008281526020819052604090206002015461259390610fbe6130fe565b61157c5760405162461bcd60e51b8152600401808060200182810382526030815260200180613bb36030913960400191505060405180910390fd5b6125e8600080516020613fab833981519152610fbe6130fe565b6126235760405162461bcd60e51b815260040180806020018281038252602b815260200180613b88602b913960400191505060405180910390fd5b6001600160a01b0382166000908152600a602052604090206001015461264990826132b6565b6001600160a01b039092166000908152600a602052604090206001019190915550565b60055481565b61268c600080516020613fab833981519152610fbe6130fe565b6126c75760405162461bcd60e51b815260040180806020018281038252602b815260200180613b88602b913960400191505060405180910390fd5b6103e983106127075760405162461bcd60e51b8152600401808060200182810382526040815260200180613f446040913960400191505060405180910390fd5b60005b838110156127bc5761276883600a600088888681811061272657fe5b905060200201356001600160a01b03166001600160a01b03166001600160a01b031681526020019081526020016000206001015461316990919063ffffffff16565b600a600087878581811061277857fe5b905060200201356001600160a01b03166001600160a01b03166001600160a01b0316815260200190815260200160002060010181905550808060010191505061270a565b50807f473f8fafa9bb6f152b95565955b672a2c8b798b9c0a7c17f2e43bd4577f972de85858560405180806020018381526020018281038252858582818152602001925060200280828437600083820152604051601f909101601f1916909201829003965090945050505050a250505050565b61285b7f3f12a51c1a5d4235e47a0365ddc220be1678ccffcdf71bfd6ee9c417f801e008610fbe6130fe565b6128965760405162461bcd60e51b815260040180806020018281038252602f815260200180613ffc602f913960400191505060405180910390fd5b6001600160a01b03821660009081526008602052604090205460ff166128ed5760405162461bcd60e51b815260040180806020018281038252602d815260200180613afe602d913960400191505060405180910390fd5b60075481111580156128ff5750600081115b61293a5760405162461bcd60e51b8152600401808060200182810382526029815260200180613a806029913960400191505060405180910390fd5b60008181526009602052604090206004015460ff1661298a5760405162461bcd60e51b815260040180806020018281038252602c815260200180613e99602c913960400191505060405180910390fd5b6001600160a01b0382166000908152600a60205260409020600201548114156129e45760405162461bcd60e51b815260040180806020018281038252602e815260200180613be3602e913960400191505060405180910390fd5b6001600160a01b0382166000908152600a602090815260408083206002908101548085526009909352922090910154612a1e9060016132b6565b60008281526009602081815260408084206002908101959095556001600160a01b0388168452600a8252808420850187905586845291905290200154612a65906001613169565b60008381526009602090815260409182902060020192909255805183815291820184905280516001600160a01b038616927f74c08ece62e2369a06a4cac8609fd31e7f3ae99e0dbedbc2bfcf0b9397d9a69192908290030190a2505050565b6001600160a01b03166000908152600a602052604090206005015460ff1690565b60065481565b612af86000610fbe6130fe565b612b335760405162461bcd60e51b815260040180806020018281038252602c815260200180613d69602c913960400191505060405180910390fd5b6007548111158015612b455750600081115b612b805760405162461bcd60e51b815260040180806020018281038252602f815260200180613eef602f913960400191505060405180910390fd5b6000908152600960205260409020600401805460ff19166001179055565b6002546001600160a01b031681565b612bba6000610fbe6130fe565b612bf55760405162461bcd60e51b815260040180806020018281038252602c815260200180613d69602c913960400191505060405180910390fd5b6116a0612c006130fe565b6002546001600160a01b0316908361331e565b600080516020613aa983398151915281565b60026001541415612c6b576040805162461bcd60e51b815260206004820152601f60248201526000805160206139a4833981519152604482015290519081900360640190fd5b600260015560086000612c7c6130fe565b6001600160a01b0316815260208101919091526040016000205460ff1615612cd55760405162461bcd60e51b8152600401808060200182810382526030815260200180613c4a6030913960400191505060405180910390fd5b6007548311158015612ce75750600083115b612d225760405162461bcd60e51b815260040180806020018281038252602c8152602001806139c4602c913960400191505060405180910390fd5b60008381526009602052604090206004015460ff16612d725760405162461bcd60e51b815260040180806020018281038252602f81526020018061402b602f913960400191505060405180910390fd5b612d8a600080516020613aa983398151915283611856565b612dc55760405162461bcd60e51b8152600401808060200182810382526031815260200180613cdb6031913960400191505060405180910390fd5b6000829050806001600160a01b0316636352211e836040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b158015612e0e57600080fd5b505afa158015612e22573d6000803e3d6000fd5b505050506040513d6020811015612e3857600080fd5b50516001600160a01b0316612e4b6130fe565b6001600160a01b031614612e905760405162461bcd60e51b8152600401808060200182810382526039815260200180613c116039913960400191505060405180910390fd5b806001600160a01b03166342842e0e612ea76130fe565b30856040518463ffffffff1660e01b815260040180846001600160a01b03168152602001836001600160a01b031681526020018281526020019350505050600060405180830381600087803b158015612eff57600080fd5b505af1158015612f13573d6000803e3d6000fd5b50505050612f3a612f226130fe565b6005546002546001600160a01b031691903090613102565b612f44600c61315c565b6000612f50600c613165565b90506040518060c0016040528082815260200160008152602001868152602001856001600160a01b0316815260200184815260200160011515815250600a6000612f986130fe565b6001600160a01b03908116825260208083019390935260409182016000908120855181559385015160018086019190915592850151600285015560608501516003850180546001600160a01b03191691909316179091556080840151600484015560a0909301516005909201805460ff191692151592909217909155906008906130206130fe565b6001600160a01b031681526020810191909152604001600020805460ff1916911515919091179055600354613056906001613169565b600355600085815260096020526040902060020154613076906001613169565b6000868152600960205260409020600201556130906130fe565b604080518781526001600160a01b038781166020830152818301879052915192909116917f628915737ae1dae037b128d0892692746d4e63e2f72632781c0a08f7168b1be89181900360600190a2505060018055505050565b600061184d836001600160a01b038416613375565b3390565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052611ef49085906133bf565b80546001019055565b5490565b60008282018381101561184d576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b60008281526020819052604090206131db90826130e9565b15611521576131e86130fe565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60008281526020819052604090206132449082613470565b15611521576132516130fe565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b600061184d8383613485565b600061184d836001600160a01b0384166134e9565b60008282111561330d576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b600061185082613165565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b1790526133709084906133bf565b505050565b600061338183836134e9565b6133b757508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155611850565b506000611850565b6060613414826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166135019092919063ffffffff16565b8051909150156133705780806020019051602081101561343357600080fd5b50516133705760405162461bcd60e51b815260040180806020018281038252602a815260200180613ec5602a913960400191505060405180910390fd5b600061184d836001600160a01b03841661351a565b815460009082106134c75760405162461bcd60e51b81526004018080602001828103825260228152602001806139156022913960400191505060405180910390fd5b8260000182815481106134d657fe5b9060005260206000200154905092915050565b60009081526001919091016020526040902054151590565b606061351084846000856135e0565b90505b9392505050565b600081815260018301602052604081205480156135d6578354600019808301919081019060009087908390811061354d57fe5b906000526020600020015490508087600001848154811061356a57fe5b60009182526020808320909101929092558281526001898101909252604090209084019055865487908061359a57fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050611850565b6000915050611850565b6060824710156136215760405162461bcd60e51b8152600401808060200182810382526026815260200180613b626026913960400191505060405180910390fd5b61362a8561373c565b61367b576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b602083106136ba5780518252601f19909201916020918201910161369b565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d806000811461371c576040519150601f19603f3d011682016040523d82523d6000602084013e613721565b606091505b5091509150613731828286613742565b979650505050505050565b3b151590565b60608315613751575081613513565b8251156137615782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156137ab578181015183820152602001613793565b50505050905090810190601f1680156137d85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061382757805160ff1916838001178555613854565b82800160010185558215613854579182015b82811115613854578251825591602001919060010190613839565b506138609291506138d2565b5090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106138a55782800160ff19823516178555613854565b82800160010185558215613854579182015b828111156138545782358255916020019190600101906138b7565b5b8082111561386057600081556001016138d356fe4d6f6a69746f50726f66696c653a3a75706461746550726f66696c653a2055736572206e6f7420616374697665456e756d657261626c655365743a20696e646578206f7574206f6620626f756e64734d6f6a69746f50726f66696c653a3a72656d6f766555736572506f696e74734d756c7469706c653a204c656e677468206d757374206265203c2031303031416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e2061646d696e20746f206772616e745265656e7472616e637947756172643a207265656e7472616e742063616c6c004d6f6a69746f50726f66696c653a3a63726561746550726f66696c653a20496e76616c6964207465616d49644d6f6a69746f50726f66696c653a3a7265616374697661746550726f66696c653a204f6e6c79204e4654206f776e65722063616e207570646174654d6f6a69746f50726f66696c653a3a6765745573657250726f66696c653a20486173206e6f7420726567697374657265644d6f6a69746f50726f66696c653a3a6164645465616d3a204d757374206265203c2032304d6f6a69746f50726f66696c653a3a6368616e67655465616d3a20496e76616c6964207465616d49648736816fdbcc15d6cc3f6dcf60e42b0ef33eb02281d312c807a38b4ad09190c04d6f6a69746f50726f66696c653a3a7265616374697661746550726f66696c653a204e4654206164647265737320696e76616c69644d6f6a69746f50726f66696c653a3a6368616e67655465616d3a20486173206e6f7420726567697374657265644d6f6a69746f50726f66696c653a3a75706461746550726f66696c653a204f6e6c79204e4654206f776e65722063616e20757064617465416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c4d6f6a69746f50726f66696c653a3a6f6e6c79506f696e743a204e6f74206120706f696e742061646d696e416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e2061646d696e20746f207265766f6b654d6f6a69746f50726f66696c653a3a6368616e67655465616d3a20416c726561647920696e20746865207465616d4d6f6a69746f50726f66696c653a3a63726561746550726f66696c653a204f6e6c79204e4654206f776e65722063616e2072656769737465724d6f6a69746f50726f66696c653a3a63726561746550726f66696c653a20416c726561647920726567697374657265644d6f6a69746f50726f66696c653a3a6d616b655465616d4e6f744a6f696e61626c653a20496e76616c6964207465616d49644d6f6a69746f50726f66696c653a3a706175736550726f66696c653a20486173206e6f7420726567697374657265644d6f6a69746f50726f66696c653a3a63726561746550726f66696c653a204e4654206164647265737320696e76616c69644d6f6a69746f50726f66696c653a3a6765745465616d50726f66696c653a20496e76616c6964207465616d49644d6f6a69746f50726f66696c653a3a75706461746550726f66696c653a20486173206e6f7420726567697374657265644d6f6a69746f50726f66696c653a3a6f6e6c794f776e65723a204e6f7420746865206d61696e2061646d696e4d6f6a69746f50726f66696c653a3a706175736550726f66696c653a2055736572206e6f74206163746976654d6f6a69746f50726f66696c653a3a7265616374697661746550726f66696c653a2055736572206973206163746976654d6f6a69746f50726f66696c653a3a72656e616d655465616d3a20496e76616c6964207465616d49644d6f6a69746f50726f66696c653a3a6164644e6674416464726573733a204e6f74204552433732314d6f6a69746f50726f66696c653a3a7265616374697661746550726f66696c653a20486173206e6f7420726567697374657265644d6f6a69746f50726f66696c653a3a6164645465616d3a204d757374206265203e20334d6f6a69746f50726f66696c653a3a6368616e67655465616d3a205465616d206e6f74206a6f696e61626c655361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565644d6f6a69746f50726f66696c653a3a6d616b655465616d4a6f696e61626c653a20496e76616c6964207465616d49644d6f6a69746f50726f66696c653a3a72656e616d655465616d3a204d757374206265203e20334d6f6a69746f50726f66696c653a3a696e63726561736555736572506f696e74734d756c7469706c653a204c656e677468206d757374206265203c20313030314d6f6a69746f50726f66696c653a3a72656e616d655465616d3a204d757374206265203c203230110b44e4bccdedbab0625f137765abddea8ae658791a82fff3fb5e80db2bad484d6f6a69746f50726f66696c653a3a75706461746550726f66696c653a204e4654206164647265737320696e76616c69644d6f6a69746f50726f66696c653a3a6f6e6c795370656369616c3a204e6f742061207370656369616c2061646d696e4d6f6a69746f50726f66696c653a3a63726561746550726f66696c653a205465616d206e6f74206a6f696e61626c65416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636520726f6c657320666f722073656c66a2646970667358221220659b1fc63090bddf9453a0700489196fa15242fa4cc82aadf5ca2db7a799d28f64736f6c634300060c00330000000000000000000000002ca48b4eea5a731c2b54e7c3944dbdb87c0cfb6f00000000000000000000000000000000000000000000000029a2241af62c00000000000000000000000000000000000000000000000000004563918244f400000000000000000000000000000000000000000000000000000de0b6b3a7640000
Deployed ByteCode
0x608060405234801561001057600080fd5b50600436106102485760003560e01c8063aee2f47f1161013b578063dd3f8717116100b8578063ebc4ffc71161007c578063ebc4ffc714610a87578063f65eeb0914610aa4578063f667526a14610aac578063f684f33c14610ac9578063fd825f5814610ad157610248565b8063dd3f8717146109b1578063e2fa2ff3146109b9578063e5020a6214610a2d578063ea0d5dcd14610a59578063ebb263e414610a7f57610248565b8063c9bed948116100ff578063c9bed94814610911578063ca15c87314610919578063d1d0954c14610936578063d547741f14610959578063da83fe4a1461098557610248565b8063aee2f47f146107be578063be4f9bd6146108d0578063bf051c13146108d8578063c1694a2f146108e0578063c1c73674146108e857610248565b80633dd452d6116101c9578063987ee1561161018d578063987ee15614610693578063a0d03526146106f6578063a217fddf1461071c578063a40601ee14610724578063a56bd1de1461075057610248565b80633dd452d6146105215780635da3c240146105295780635db345661461054f5780639010d07c1461061457806391d148541461065357610248565b8063218188d711610210578063218188d714610475578063248a9ca31461049257806328593623146104c15780632f2ff15d146104c957806336568abe146104f557610248565b80630a82697b1461024d5780630d4fb8031461027b578063150b7a02146103395780631bdc17f61461041a5780631e47a4761461044c575b600080fd5b6102796004803603604081101561026357600080fd5b506001600160a01b038135169060200135610b03565b005b6102796004803603604081101561029157600080fd5b810190602081018135600160201b8111156102ab57600080fd5b8201836020820111156102bd57600080fd5b803590602001918460018302840111600160201b831117156102de57600080fd5b919390929091602081019035600160201b8111156102fb57600080fd5b82018360208201111561030d57600080fd5b803590602001918460018302840111600160201b8311171561032e57600080fd5b509092509050610fb1565b6103fd6004803603608081101561034f57600080fd5b6001600160a01b03823581169260208101359091169160408201359190810190608081016060820135600160201b81111561038957600080fd5b82018360208201111561039b57600080fd5b803590602001918460018302840111600160201b831117156103bc57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550611246945050505050565b604080516001600160e01b03199092168252519081900360200190f35b6102796004803603606081101561043057600080fd5b506001600160a01b038135169060208101359060400135611256565b6102796004803603606081101561046257600080fd5b508035906020810135906040013561132a565b6102796004803603602081101561048b57600080fd5b50356113f3565b6104af600480360360208110156104a857600080fd5b50356114a3565b60408051918252519081900360200190f35b6104af6114b8565b610279600480360360408110156104df57600080fd5b50803590602001356001600160a01b03166114be565b6102796004803603604081101561050b57600080fd5b50803590602001356001600160a01b0316611525565b6104af611586565b6102796004803603602081101561053f57600080fd5b50356001600160a01b031661158c565b6102796004803603606081101561056557600080fd5b81359190810190604081016020820135600160201b81111561058657600080fd5b82018360208201111561059857600080fd5b803590602001918460018302840111600160201b831117156105b957600080fd5b919390929091602081019035600160201b8111156105d657600080fd5b8201836020820111156105e857600080fd5b803590602001918460018302840111600160201b8311171561060957600080fd5b5090925090506116a3565b6106376004803603604081101561062a57600080fd5b5080359060200135611835565b604080516001600160a01b039092168252519081900360200190f35b61067f6004803603604081101561066957600080fd5b50803590602001356001600160a01b0316611856565b604080519115158252519081900360200190f35b6106b9600480360360208110156106a957600080fd5b50356001600160a01b031661186e565b604080519687526020870195909552858501939093526001600160a01b0390911660608501526080840152151560a0830152519081900360c00190f35b61067f6004803603602081101561070c57600080fd5b50356001600160a01b031661191a565b6104af61192f565b6102796004803603604081101561073a57600080fd5b506001600160a01b038135169060200135611934565b6102796004803603604081101561076657600080fd5b810190602081018135600160201b81111561078057600080fd5b82018360208201111561079257600080fd5b803590602001918460208302840111600160201b831117156107b357600080fd5b919350915035611daa565b6107db600480360360208110156107d457600080fd5b5035611efa565b6040518080602001806020018681526020018581526020018415158152602001838103835288818151815260200191508051906020019080838360005b83811015610830578181015183820152602001610818565b50505050905090810190601f16801561085d5780820380516001836020036101000a031916815260200191505b50838103825287518152875160209182019189019080838360005b83811015610890578181015183820152602001610878565b50505050905090810190601f1680156108bd5780820380516001836020036101000a031916815260200191505b5097505050505050505060405180910390f35b6104af6120ac565b6104af6120b2565b6102796120d6565b610279600480360360608110156108fe57600080fd5b508035906020810135906040013561246c565b6104af6124c2565b6104af6004803603602081101561092f57600080fd5b50356124d4565b6102796004803603604081101561094c57600080fd5b50803590602001356124eb565b6102796004803603604081101561096f57600080fd5b50803590602001356001600160a01b0316612575565b6102796004803603604081101561099b57600080fd5b506001600160a01b0381351690602001356125ce565b6104af61266c565b610279600480360360608110156109cf57600080fd5b810190602081018135600160201b8111156109e957600080fd5b8201836020820111156109fb57600080fd5b803590602001918460208302840111600160201b83111715610a1c57600080fd5b919350915080359060200135612672565b61027960048036036040811015610a4357600080fd5b506001600160a01b03813516906020013561282f565b61067f60048036036020811015610a6f57600080fd5b50356001600160a01b0316612ac4565b6104af612ae5565b61027960048036036020811015610a9d57600080fd5b5035612aeb565b610637612b9e565b61027960048036036020811015610ac257600080fd5b5035612bad565b6104af612c13565b61027960048036036060811015610ae757600080fd5b508035906001600160a01b036020820135169060400135612c25565b60026001541415610b49576040805162461bcd60e51b815260206004820152601f60248201526000805160206139a4833981519152604482015290519081900360640190fd5b600260015560086000610b5a6130fe565b6001600160a01b0316815260208101919091526040016000205460ff16610bb25760405162461bcd60e51b8152600401808060200182810382526030815260200180613d396030913960400191505060405180910390fd5b610bca600080516020613aa983398151915283611856565b610c055760405162461bcd60e51b8152600401808060200182810382526031815260200180613fcb6031913960400191505060405180910390fd5b600a6000610c116130fe565b6001600160a01b0316815260208101919091526040016000206005015460ff16610c6c5760405162461bcd60e51b815260040180806020018281038252602d8152602001806138e8602d913960400191505060405180910390fd5b6000600a6000610c7a6130fe565b6001600160a01b03908116825260208201929092526040016000908120600301549091169150600a81610cab6130fe565b6001600160a01b03166001600160a01b031681526020019081526020016000206004015490506000849050806001600160a01b0316636352211e856040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b158015610d1a57600080fd5b505afa158015610d2e573d6000803e3d6000fd5b505050506040513d6020811015610d4457600080fd5b50516001600160a01b0316610d576130fe565b6001600160a01b031614610d9c5760405162461bcd60e51b8152600401808060200182810382526037815260200180613b2b6037913960400191505060405180910390fd5b806001600160a01b03166342842e0e610db36130fe565b30876040518463ffffffff1660e01b815260040180846001600160a01b03168152602001836001600160a01b031681526020018281526020019350505050600060405180830381600087803b158015610e0b57600080fd5b505af1158015610e1f573d6000803e3d6000fd5b50505050610e46610e2e6130fe565b6006546002546001600160a01b031691903090613102565b826001600160a01b0381166342842e0e30610e5f6130fe565b866040518463ffffffff1660e01b815260040180846001600160a01b03168152602001836001600160a01b031681526020018281526020019350505050600060405180830381600087803b158015610eb657600080fd5b505af1158015610eca573d6000803e3d6000fd5b5050505085600a6000610edb6130fe565b6001600160a01b03166001600160a01b0316815260200190815260200160002060030160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555084600a6000610f2f6130fe565b6001600160a01b03168152602081019190915260400160002060040155610f546130fe565b6001600160a01b03167fe8e88d4216f3bbc2d1a4dd55aa66fd3e0065ef03970fa056a19d018ca19d5805878760405180836001600160a01b031681526020018281526020019250505060405180910390a250506001805550505050565b610fc36000610fbe6130fe565b611856565b610ffe5760405162461bcd60e51b815260040180806020018281038252602c815260200180613d69602c913960400191505060405180910390fd5b606084848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250508251929350506014909110905061107c5760405162461bcd60e51b8152600401808060200182810382526024815260200180613a5c6024913960400191505060405180910390fd5b60038151116110bc5760405162461bcd60e51b8152600401808060200182810382526023815260200180613e766023913960400191505060405180910390fd5b6110c6600b61315c565b60006110d2600b613165565b6040805160c06020601f8a01819004028201810190925260a081018881529293509182918990899081908501838280828437600092019190915250505090825250604080516020601f880181900481028201810190925286815291810191908790879081908401838280828437600092018290525093855250505060208083018290526040808401839052600160609094019390935284825260098152919020825180519192611187928492909101906137e6565b5060208281015180516111a092600185019201906137e6565b50604082810151600283015560608084015160038401556080909301516004909201805460ff19169215159290921790915560078390558051838152602081018281529181018890527f1137f48534f03e02268dec7839069a7484bc6788c43e4ed9dc38dd8a2f269bc79284928a928a929091908201848480828437600083820152604051601f909101601f1916909201829003965090945050505050a1505050505050565b630a85bd0160e11b949350505050565b611270600080516020613fab833981519152610fbe6130fe565b6112ab5760405162461bcd60e51b815260040180806020018281038252602b815260200180613b88602b913960400191505060405180910390fd5b6001600160a01b0383166000908152600a60205260409020600101546112d19083613169565b6001600160a01b0384166000818152600a6020908152604091829020600101939093558051858152905184937f04bc07bcb78bb21e5665cf01cd24f6a6a06e21fd20d60df8f0fa8d58c66f2934928290030190a3505050565b611344600080516020613fab833981519152610fbe6130fe565b61137f5760405162461bcd60e51b815260040180806020018281038252602b815260200180613b88602b913960400191505060405180910390fd5b60008381526009602052604090206003015461139b9083613169565b600960008581526020019081526020016000206003018190555080837f2056366a9d1345af9da00985231357931fb77dc7fa7bdf71058e3ca3816f9d38846040518082815260200191505060405180910390a3505050565b6114006000610fbe6130fe565b61143b5760405162461bcd60e51b815260040180806020018281038252602c815260200180613d69602c913960400191505060405180910390fd5b600754811115801561144d5750600081115b6114885760405162461bcd60e51b8152600401808060200182810382526032815260200180613c7a6032913960400191505060405180910390fd5b6000908152600960205260409020600401805460ff19169055565b60009081526020819052604090206002015490565b60045481565b6000828152602081905260409020600201546114dc90610fbe6130fe565b6115175760405162461bcd60e51b815260040180806020018281038252602f815260200180613975602f913960400191505060405180910390fd5b61152182826131c3565b5050565b61152d6130fe565b6001600160a01b0316816001600160a01b03161461157c5760405162461bcd60e51b815260040180806020018281038252602f81526020018061405a602f913960400191505060405180910390fd5b611521828261322c565b60075481565b6115996000610fbe6130fe565b6115d45760405162461bcd60e51b815260040180806020018281038252602c815260200180613d69602c913960400191505060405180910390fd5b604080516301ffc9a760e01b81526380ac58cd60e01b600482015290516001600160a01b038316916301ffc9a7916024808301926020929190829003018186803b15801561162157600080fd5b505afa158015611635573d6000803e3d6000fd5b505050506040513d602081101561164b57600080fd5b50516116885760405162461bcd60e51b8152600401808060200182810382526028815260200180613e1a6028913960400191505060405180910390fd5b6116a0600080516020613aa9833981519152826114be565b50565b6116b06000610fbe6130fe565b6116eb5760405162461bcd60e51b815260040180806020018281038252602c815260200180613d69602c913960400191505060405180910390fd5b60075485111580156116fd5750600085115b6117385760405162461bcd60e51b8152600401808060200182810382526029815260200180613df16029913960400191505060405180910390fd5b606084848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050825192935050601490911090506117b65760405162461bcd60e51b8152600401808060200182810382526027815260200180613f846027913960400191505060405180910390fd5b60038151116117f65760405162461bcd60e51b8152600401808060200182810382526026815260200180613f1e6026913960400191505060405180910390fd5b600086815260096020526040902061180f908686613864565b50600086815260096020526040902061182c906001018484613864565b50505050505050565b600082815260208190526040812061184d9083613295565b90505b92915050565b600082815260208190526040812061184d90836132a1565b6001600160a01b0381166000908152600860205260408120548190819081908190819060ff166118cf5760405162461bcd60e51b8152600401808060200182810382526031815260200180613a2b6031913960400191505060405180910390fd5b505050506001600160a01b039283166000908152600a60205260409020805460018201546002830154600384015460048501546005909501549398929791965016935060ff90911690565b60086020526000908152604090205460ff1681565b600081565b6002600154141561197a576040805162461bcd60e51b815260206004820152601f60248201526000805160206139a4833981519152604482015290519081900360640190fd5b60026001556008600061198b6130fe565b6001600160a01b0316815260208101919091526040016000205460ff166119e35760405162461bcd60e51b8152600401808060200182810382526034815260200180613e426034913960400191505060405180910390fd5b6119fb600080516020613aa983398151915283611856565b611a365760405162461bcd60e51b8152600401808060200182810382526035815260200180613ac96035913960400191505060405180910390fd5b600a6000611a426130fe565b6001600160a01b0316815260208101919091526040016000206005015460ff1615611a9e5760405162461bcd60e51b8152600401808060200182810382526030815260200180613dc16030913960400191505060405180910390fd5b6000829050806001600160a01b0316636352211e836040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b158015611ae757600080fd5b505afa158015611afb573d6000803e3d6000fd5b505050506040513d6020811015611b1157600080fd5b50516001600160a01b0316611b246130fe565b6001600160a01b031614611b695760405162461bcd60e51b815260040180806020018281038252603b8152602001806139f0603b913960400191505060405180910390fd5b806001600160a01b03166342842e0e611b806130fe565b30856040518463ffffffff1660e01b815260040180846001600160a01b03168152602001836001600160a01b031681526020018281526020019350505050600060405180830381600087803b158015611bd857600080fd5b505af1158015611bec573d6000803e3d6000fd5b50505050611c13611bfb6130fe565b6004546002546001600160a01b031691903090613102565b6000600a6000611c216130fe565b6001600160a01b03168152602081019190915260400160002060020154600354909150611c4f906001613169565b600355600081815260096020526040902060020154611c6f906001613169565b600082815260096020526040812060020191909155600190600a90611c926130fe565b6001600160a01b03166001600160a01b0316815260200190815260200160002060050160006101000a81548160ff02191690831515021790555083600a6000611cd96130fe565b6001600160a01b03166001600160a01b0316815260200190815260200160002060030160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555082600a6000611d2d6130fe565b6001600160a01b03168152602081019190915260400160002060040155611d526130fe565b604080518381526001600160a01b038781166020830152818301879052915192909116917fdb76eea80687b6553e5d689ff9d000c0ce2c10574b39d64cacc2b4f6f54f68389181900360600190a25050600180555050565b611dc4600080516020613fab833981519152610fbe6130fe565b611dff5760405162461bcd60e51b815260040180806020018281038252602b815260200180613b88602b913960400191505060405180910390fd5b6103e98210611e3f5760405162461bcd60e51b815260040180806020018281038252603e815260200180613937603e913960400191505060405180910390fd5b60005b82811015611ef457611ea082600a6000878786818110611e5e57fe5b905060200201356001600160a01b03166001600160a01b03166001600160a01b03168152602001908152602001600020600101546132b690919063ffffffff16565b600a6000868685818110611eb057fe5b905060200201356001600160a01b03166001600160a01b03166001600160a01b03168152602001908152602001600020600101819055508080600101915050611e42565b50505050565b60608060008060006007548611158015611f145750600086115b611f4f5760405162461bcd60e51b815260040180806020018281038252602d815260200180613d0c602d913960400191505060405180910390fd5b6000868152600960209081526040918290206002808201546003830154600484015484548751601f6000196001848116156101000291909101909316969096049586018890048802810188019098528488529496948701959294919360ff909116928791908301828280156120055780601f10611fda57610100808354040283529160200191612005565b820191906000526020600020905b815481529060010190602001808311611fe857829003601f168201915b5050875460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152959a50899450925084019050828280156120935780601f1061206857610100808354040283529160200191612093565b820191906000526020600020905b81548152906001019060200180831161207657829003601f168201915b50989f939e50959c50939a509198509650505050505050565b60035481565b7f3f12a51c1a5d4235e47a0365ddc220be1678ccffcdf71bfd6ee9c417f801e00881565b6002600154141561211c576040805162461bcd60e51b815260206004820152601f60248201526000805160206139a4833981519152604482015290519081900360640190fd5b60026001556008600061212d6130fe565b6001600160a01b0316815260208101919091526040016000205460ff166121855760405162461bcd60e51b815260040180806020018281038252602f815260200180613cac602f913960400191505060405180910390fd5b600a60006121916130fe565b6001600160a01b0316815260208101919091526040016000206005015460ff166121ec5760405162461bcd60e51b815260040180806020018281038252602c815260200180613d95602c913960400191505060405180910390fd5b6000600a60006121fa6130fe565b6001600160a01b0316815260208101919091526040016000908120600501805460ff191692151592909217909155600a816122336130fe565b6001600160a01b03166001600160a01b03168152602001908152602001600020600201549050612283600160096000848152602001908152602001600020600201546132b690919063ffffffff16565b6000828152600960205260409020600201556003546122a39060016132b6565b6003556000600a816122b36130fe565b6001600160a01b03908116825260208201929092526040016000908120600301549091169150600a816122e46130fe565b6001600160a01b03166001600160a01b031681526020019081526020016000206004015490506000600a60006123186130fe565b6001600160a01b03166001600160a01b0316815260200190815260200160002060030160006101000a8154816001600160a01b0302191690836001600160a01b031602179055506000600a600061236d6130fe565b6001600160a01b03166001600160a01b0316815260200190815260200160002060040181905550816001600160a01b03166342842e0e306123ac6130fe565b846040518463ffffffff1660e01b815260040180846001600160a01b03168152602001836001600160a01b031681526020018281526020019350505050600060405180830381600087803b15801561240357600080fd5b505af1158015612417573d6000803e3d6000fd5b505050506124236130fe565b6001600160a01b03167fe0ed25582c4d86fd51bfe26383781fc8bbf5636813cbfdf93c440b5828c93040846040518082815260200191505060405180910390a250506001805550565b6124796000610fbe6130fe565b6124b45760405162461bcd60e51b815260040180806020018281038252602c815260200180613d69602c913960400191505060405180910390fd5b600492909255600555600655565b600080516020613fab83398151915281565b600081815260208190526040812061185090613313565b612505600080516020613fab833981519152610fbe6130fe565b6125405760405162461bcd60e51b815260040180806020018281038252602b815260200180613b88602b913960400191505060405180910390fd5b60008281526009602052604090206003015461255c90826132b6565b6000928352600960205260409092206003019190915550565b60008281526020819052604090206002015461259390610fbe6130fe565b61157c5760405162461bcd60e51b8152600401808060200182810382526030815260200180613bb36030913960400191505060405180910390fd5b6125e8600080516020613fab833981519152610fbe6130fe565b6126235760405162461bcd60e51b815260040180806020018281038252602b815260200180613b88602b913960400191505060405180910390fd5b6001600160a01b0382166000908152600a602052604090206001015461264990826132b6565b6001600160a01b039092166000908152600a602052604090206001019190915550565b60055481565b61268c600080516020613fab833981519152610fbe6130fe565b6126c75760405162461bcd60e51b815260040180806020018281038252602b815260200180613b88602b913960400191505060405180910390fd5b6103e983106127075760405162461bcd60e51b8152600401808060200182810382526040815260200180613f446040913960400191505060405180910390fd5b60005b838110156127bc5761276883600a600088888681811061272657fe5b905060200201356001600160a01b03166001600160a01b03166001600160a01b031681526020019081526020016000206001015461316990919063ffffffff16565b600a600087878581811061277857fe5b905060200201356001600160a01b03166001600160a01b03166001600160a01b0316815260200190815260200160002060010181905550808060010191505061270a565b50807f473f8fafa9bb6f152b95565955b672a2c8b798b9c0a7c17f2e43bd4577f972de85858560405180806020018381526020018281038252858582818152602001925060200280828437600083820152604051601f909101601f1916909201829003965090945050505050a250505050565b61285b7f3f12a51c1a5d4235e47a0365ddc220be1678ccffcdf71bfd6ee9c417f801e008610fbe6130fe565b6128965760405162461bcd60e51b815260040180806020018281038252602f815260200180613ffc602f913960400191505060405180910390fd5b6001600160a01b03821660009081526008602052604090205460ff166128ed5760405162461bcd60e51b815260040180806020018281038252602d815260200180613afe602d913960400191505060405180910390fd5b60075481111580156128ff5750600081115b61293a5760405162461bcd60e51b8152600401808060200182810382526029815260200180613a806029913960400191505060405180910390fd5b60008181526009602052604090206004015460ff1661298a5760405162461bcd60e51b815260040180806020018281038252602c815260200180613e99602c913960400191505060405180910390fd5b6001600160a01b0382166000908152600a60205260409020600201548114156129e45760405162461bcd60e51b815260040180806020018281038252602e815260200180613be3602e913960400191505060405180910390fd5b6001600160a01b0382166000908152600a602090815260408083206002908101548085526009909352922090910154612a1e9060016132b6565b60008281526009602081815260408084206002908101959095556001600160a01b0388168452600a8252808420850187905586845291905290200154612a65906001613169565b60008381526009602090815260409182902060020192909255805183815291820184905280516001600160a01b038616927f74c08ece62e2369a06a4cac8609fd31e7f3ae99e0dbedbc2bfcf0b9397d9a69192908290030190a2505050565b6001600160a01b03166000908152600a602052604090206005015460ff1690565b60065481565b612af86000610fbe6130fe565b612b335760405162461bcd60e51b815260040180806020018281038252602c815260200180613d69602c913960400191505060405180910390fd5b6007548111158015612b455750600081115b612b805760405162461bcd60e51b815260040180806020018281038252602f815260200180613eef602f913960400191505060405180910390fd5b6000908152600960205260409020600401805460ff19166001179055565b6002546001600160a01b031681565b612bba6000610fbe6130fe565b612bf55760405162461bcd60e51b815260040180806020018281038252602c815260200180613d69602c913960400191505060405180910390fd5b6116a0612c006130fe565b6002546001600160a01b0316908361331e565b600080516020613aa983398151915281565b60026001541415612c6b576040805162461bcd60e51b815260206004820152601f60248201526000805160206139a4833981519152604482015290519081900360640190fd5b600260015560086000612c7c6130fe565b6001600160a01b0316815260208101919091526040016000205460ff1615612cd55760405162461bcd60e51b8152600401808060200182810382526030815260200180613c4a6030913960400191505060405180910390fd5b6007548311158015612ce75750600083115b612d225760405162461bcd60e51b815260040180806020018281038252602c8152602001806139c4602c913960400191505060405180910390fd5b60008381526009602052604090206004015460ff16612d725760405162461bcd60e51b815260040180806020018281038252602f81526020018061402b602f913960400191505060405180910390fd5b612d8a600080516020613aa983398151915283611856565b612dc55760405162461bcd60e51b8152600401808060200182810382526031815260200180613cdb6031913960400191505060405180910390fd5b6000829050806001600160a01b0316636352211e836040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b158015612e0e57600080fd5b505afa158015612e22573d6000803e3d6000fd5b505050506040513d6020811015612e3857600080fd5b50516001600160a01b0316612e4b6130fe565b6001600160a01b031614612e905760405162461bcd60e51b8152600401808060200182810382526039815260200180613c116039913960400191505060405180910390fd5b806001600160a01b03166342842e0e612ea76130fe565b30856040518463ffffffff1660e01b815260040180846001600160a01b03168152602001836001600160a01b031681526020018281526020019350505050600060405180830381600087803b158015612eff57600080fd5b505af1158015612f13573d6000803e3d6000fd5b50505050612f3a612f226130fe565b6005546002546001600160a01b031691903090613102565b612f44600c61315c565b6000612f50600c613165565b90506040518060c0016040528082815260200160008152602001868152602001856001600160a01b0316815260200184815260200160011515815250600a6000612f986130fe565b6001600160a01b03908116825260208083019390935260409182016000908120855181559385015160018086019190915592850151600285015560608501516003850180546001600160a01b03191691909316179091556080840151600484015560a0909301516005909201805460ff191692151592909217909155906008906130206130fe565b6001600160a01b031681526020810191909152604001600020805460ff1916911515919091179055600354613056906001613169565b600355600085815260096020526040902060020154613076906001613169565b6000868152600960205260409020600201556130906130fe565b604080518781526001600160a01b038781166020830152818301879052915192909116917f628915737ae1dae037b128d0892692746d4e63e2f72632781c0a08f7168b1be89181900360600190a2505060018055505050565b600061184d836001600160a01b038416613375565b3390565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052611ef49085906133bf565b80546001019055565b5490565b60008282018381101561184d576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b60008281526020819052604090206131db90826130e9565b15611521576131e86130fe565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60008281526020819052604090206132449082613470565b15611521576132516130fe565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b600061184d8383613485565b600061184d836001600160a01b0384166134e9565b60008282111561330d576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b600061185082613165565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b1790526133709084906133bf565b505050565b600061338183836134e9565b6133b757508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155611850565b506000611850565b6060613414826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166135019092919063ffffffff16565b8051909150156133705780806020019051602081101561343357600080fd5b50516133705760405162461bcd60e51b815260040180806020018281038252602a815260200180613ec5602a913960400191505060405180910390fd5b600061184d836001600160a01b03841661351a565b815460009082106134c75760405162461bcd60e51b81526004018080602001828103825260228152602001806139156022913960400191505060405180910390fd5b8260000182815481106134d657fe5b9060005260206000200154905092915050565b60009081526001919091016020526040902054151590565b606061351084846000856135e0565b90505b9392505050565b600081815260018301602052604081205480156135d6578354600019808301919081019060009087908390811061354d57fe5b906000526020600020015490508087600001848154811061356a57fe5b60009182526020808320909101929092558281526001898101909252604090209084019055865487908061359a57fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050611850565b6000915050611850565b6060824710156136215760405162461bcd60e51b8152600401808060200182810382526026815260200180613b626026913960400191505060405180910390fd5b61362a8561373c565b61367b576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b602083106136ba5780518252601f19909201916020918201910161369b565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d806000811461371c576040519150601f19603f3d011682016040523d82523d6000602084013e613721565b606091505b5091509150613731828286613742565b979650505050505050565b3b151590565b60608315613751575081613513565b8251156137615782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156137ab578181015183820152602001613793565b50505050905090810190601f1680156137d85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061382757805160ff1916838001178555613854565b82800160010185558215613854579182015b82811115613854578251825591602001919060010190613839565b506138609291506138d2565b5090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106138a55782800160ff19823516178555613854565b82800160010185558215613854579182015b828111156138545782358255916020019190600101906138b7565b5b8082111561386057600081556001016138d356fe4d6f6a69746f50726f66696c653a3a75706461746550726f66696c653a2055736572206e6f7420616374697665456e756d657261626c655365743a20696e646578206f7574206f6620626f756e64734d6f6a69746f50726f66696c653a3a72656d6f766555736572506f696e74734d756c7469706c653a204c656e677468206d757374206265203c2031303031416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e2061646d696e20746f206772616e745265656e7472616e637947756172643a207265656e7472616e742063616c6c004d6f6a69746f50726f66696c653a3a63726561746550726f66696c653a20496e76616c6964207465616d49644d6f6a69746f50726f66696c653a3a7265616374697661746550726f66696c653a204f6e6c79204e4654206f776e65722063616e207570646174654d6f6a69746f50726f66696c653a3a6765745573657250726f66696c653a20486173206e6f7420726567697374657265644d6f6a69746f50726f66696c653a3a6164645465616d3a204d757374206265203c2032304d6f6a69746f50726f66696c653a3a6368616e67655465616d3a20496e76616c6964207465616d49648736816fdbcc15d6cc3f6dcf60e42b0ef33eb02281d312c807a38b4ad09190c04d6f6a69746f50726f66696c653a3a7265616374697661746550726f66696c653a204e4654206164647265737320696e76616c69644d6f6a69746f50726f66696c653a3a6368616e67655465616d3a20486173206e6f7420726567697374657265644d6f6a69746f50726f66696c653a3a75706461746550726f66696c653a204f6e6c79204e4654206f776e65722063616e20757064617465416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c4d6f6a69746f50726f66696c653a3a6f6e6c79506f696e743a204e6f74206120706f696e742061646d696e416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e2061646d696e20746f207265766f6b654d6f6a69746f50726f66696c653a3a6368616e67655465616d3a20416c726561647920696e20746865207465616d4d6f6a69746f50726f66696c653a3a63726561746550726f66696c653a204f6e6c79204e4654206f776e65722063616e2072656769737465724d6f6a69746f50726f66696c653a3a63726561746550726f66696c653a20416c726561647920726567697374657265644d6f6a69746f50726f66696c653a3a6d616b655465616d4e6f744a6f696e61626c653a20496e76616c6964207465616d49644d6f6a69746f50726f66696c653a3a706175736550726f66696c653a20486173206e6f7420726567697374657265644d6f6a69746f50726f66696c653a3a63726561746550726f66696c653a204e4654206164647265737320696e76616c69644d6f6a69746f50726f66696c653a3a6765745465616d50726f66696c653a20496e76616c6964207465616d49644d6f6a69746f50726f66696c653a3a75706461746550726f66696c653a20486173206e6f7420726567697374657265644d6f6a69746f50726f66696c653a3a6f6e6c794f776e65723a204e6f7420746865206d61696e2061646d696e4d6f6a69746f50726f66696c653a3a706175736550726f66696c653a2055736572206e6f74206163746976654d6f6a69746f50726f66696c653a3a7265616374697661746550726f66696c653a2055736572206973206163746976654d6f6a69746f50726f66696c653a3a72656e616d655465616d3a20496e76616c6964207465616d49644d6f6a69746f50726f66696c653a3a6164644e6674416464726573733a204e6f74204552433732314d6f6a69746f50726f66696c653a3a7265616374697661746550726f66696c653a20486173206e6f7420726567697374657265644d6f6a69746f50726f66696c653a3a6164645465616d3a204d757374206265203e20334d6f6a69746f50726f66696c653a3a6368616e67655465616d3a205465616d206e6f74206a6f696e61626c655361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565644d6f6a69746f50726f66696c653a3a6d616b655465616d4a6f696e61626c653a20496e76616c6964207465616d49644d6f6a69746f50726f66696c653a3a72656e616d655465616d3a204d757374206265203e20334d6f6a69746f50726f66696c653a3a696e63726561736555736572506f696e74734d756c7469706c653a204c656e677468206d757374206265203c20313030314d6f6a69746f50726f66696c653a3a72656e616d655465616d3a204d757374206265203c203230110b44e4bccdedbab0625f137765abddea8ae658791a82fff3fb5e80db2bad484d6f6a69746f50726f66696c653a3a75706461746550726f66696c653a204e4654206164647265737320696e76616c69644d6f6a69746f50726f66696c653a3a6f6e6c795370656369616c3a204e6f742061207370656369616c2061646d696e4d6f6a69746f50726f66696c653a3a63726561746550726f66696c653a205465616d206e6f74206a6f696e61626c65416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636520726f6c657320666f722073656c66a2646970667358221220659b1fc63090bddf9453a0700489196fa15242fa4cc82aadf5ca2db7a799d28f64736f6c634300060c0033