- Contract name:
- NewbieVilla
- Optimization enabled
- true
- Compiler version
- v0.8.10+commit.fc410830
- Optimization runs
- 200
- Verified at
- 2022-12-05T07:15:03.187246Z
contracts/misc/NewbieVilla.sol
// SPDX-License-Identifier: MITpragma solidity 0.8.10;import "@openzeppelin/contracts/proxy/utils/Initializable.sol";import "@openzeppelin/contracts/access/AccessControlEnumerable.sol";import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";import "@openzeppelin/contracts/token/ERC721/IERC721.sol";import "../interfaces/IWeb3Entry.sol";import "../libraries/OP.sol";/*** @dev Implementation of a contract to keep characters for others. The address with* the ADMIN_ROLE are expected to issue the proof to users. Then users could use the* proof to withdraw the corresponding character.*/contract NewbieVilla is Initializable, AccessControlEnumerable, IERC721Receiver {bytes32 public constant ADMIN_ROLE = keccak256("ADMIN_ROLE");address public web3Entry;address public xsyncOperator;modifier _notExpired(uint256 expires) {require(expires >= block.timestamp, "NewbieVilla: receipt has expired");_;}/*** @notice Initialize the Newbie Villa contract.* @dev msg.sender will be granted both DEFAULT_ADMIN_ROLE and ADMIN_ROLE.* @param _web3Entry Address of Web3Entry.* @param _xsyncOperator Address of xsyncOperator.*/function initialize(address _web3Entry, address _xsyncOperator) external initializer {web3Entry = _web3Entry;xsyncOperator = _xsyncOperator;_setupRole(DEFAULT_ADMIN_ROLE, _msgSender());_setupRole(ADMIN_ROLE, _msgSender());}
@openzeppelin/contracts/access/AccessControl.sol
// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v4.7.0) (access/AccessControl.sol)pragma solidity ^0.8.0;import "./IAccessControl.sol";import "../utils/Context.sol";import "../utils/Strings.sol";import "../utils/introspection/ERC165.sol";/*** @dev Contract module that allows children to implement role-based access* control mechanisms. This is a lightweight version that doesn't allow enumerating role* members except through off-chain means by accessing the contract event logs. Some* applications may benefit from on-chain enumerability, for those cases see* {AccessControlEnumerable}.** 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
@openzeppelin/contracts/access/AccessControlEnumerable.sol
// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControlEnumerable.sol)pragma solidity ^0.8.0;import "./IAccessControlEnumerable.sol";import "./AccessControl.sol";import "../utils/structs/EnumerableSet.sol";/*** @dev Extension of {AccessControl} that allows enumerating the members of each role.*/abstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessControl {using EnumerableSet for EnumerableSet.AddressSet;mapping(bytes32 => EnumerableSet.AddressSet) private _roleMembers;/*** @dev See {IERC165-supportsInterface}.*/function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {return interfaceId == type(IAccessControlEnumerable).interfaceId || super.supportsInterface(interfaceId);}/*** @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 virtual override returns (address) {return _roleMembers[role].at(index);}/**
@openzeppelin/contracts/access/IAccessControl.sol
// SPDX-License-Identifier: MIT// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)pragma solidity ^0.8.0;/*** @dev External interface of AccessControl declared to support ERC165 detection.*/interface IAccessControl {/*** @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 {AccessControl-_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) external view returns (bool);
@openzeppelin/contracts/access/IAccessControlEnumerable.sol
// SPDX-License-Identifier: MIT// OpenZeppelin Contracts v4.4.1 (access/IAccessControlEnumerable.sol)pragma solidity ^0.8.0;import "./IAccessControl.sol";/*** @dev External interface of AccessControlEnumerable declared to support ERC165 detection.*/interface IAccessControlEnumerable is IAccessControl {/*** @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) external view returns (address);/*** @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) external view returns (uint256);}
@openzeppelin/contracts/proxy/utils/Initializable.sol
// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v4.7.0) (proxy/utils/Initializable.sol)pragma solidity ^0.8.2;import "../../utils/Address.sol";/*** @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed* behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an* external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer* function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.** The initialization functions use a version number. Once a version number is used, it is consumed and cannot be* reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in* case an upgrade adds a module that needs to be initialized.** For example:** [.hljs-theme-light.nopadding]* ```* contract MyToken is ERC20Upgradeable {* function initialize() initializer public {* __ERC20_init("MyToken", "MTK");* }* }* contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {* function initializeV2() reinitializer(2) public {* __ERC20Permit_init("MyToken");* }* }* ```** TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as* possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.** CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure* that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.** [CAUTION]* ====
@openzeppelin/contracts/token/ERC721/IERC721.sol
// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/IERC721.sol)pragma solidity ^0.8.0;import "../../utils/introspection/IERC165.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);/**
@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol
// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)pragma solidity ^0.8.0;/*** @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 `IERC721Receiver.onERC721Received.selector`.*/function onERC721Received(address operator,address from,uint256 tokenId,bytes calldata data) external returns (bytes4);}
@openzeppelin/contracts/utils/Address.sol
// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)pragma solidity ^0.8.1;/*** @dev Collection of functions related to the address type*/library Address {/*** @dev Returns true if `account` is a contract.** [IMPORTANT]* ====* It is unsafe to assume that an address for which this function returns* false is an externally-owned account (EOA) and not a contract.** Among others, `isContract` will return false for the following* types of addresses:** - an externally-owned account* - a contract in construction* - an address where a contract will be created* - an address where a contract lived, but was destroyed* ====** [IMPORTANT]* ====* You shouldn't rely on `isContract` to protect against flash loan attacks!** Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract* constructor.* ====*/function isContract(address account) internal view returns (bool) {// This method relies on extcodesize/address.code.length, which returns 0// for contracts in construction, since the code is only stored at the end// of the constructor execution.return account.code.length > 0;
@openzeppelin/contracts/utils/Context.sol
// SPDX-License-Identifier: MIT// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)pragma solidity ^0.8.0;/*** @dev Provides information about the current execution context, including the* sender of the transaction and its data. While these are generally available* via msg.sender and msg.data, they should not be accessed in such a direct* manner, since when dealing with meta-transactions the account sending and* paying for execution may not be the actual sender (as far as an application* is concerned).** This contract is only required for intermediate, library-like contracts.*/abstract contract Context {function _msgSender() internal view virtual returns (address) {return msg.sender;}function _msgData() internal view virtual returns (bytes calldata) {return msg.data;}}
@openzeppelin/contracts/utils/Strings.sol
// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol)pragma solidity ^0.8.0;/*** @dev String operations.*/library Strings {bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";uint8 private constant _ADDRESS_LENGTH = 20;/*** @dev Converts a `uint256` to its ASCII `string` decimal representation.*/function toString(uint256 value) internal pure returns (string memory) {// Inspired by OraclizeAPI's implementation - MIT licence// https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.solif (value == 0) {return "0";}uint256 temp = value;uint256 digits;while (temp != 0) {digits++;temp /= 10;}bytes memory buffer = new bytes(digits);while (value != 0) {digits -= 1;buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));value /= 10;}return string(buffer);}/*** @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.*/function toHexString(uint256 value) internal pure returns (string memory) {
@openzeppelin/contracts/utils/introspection/ERC165.sol
// SPDX-License-Identifier: MIT// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)pragma solidity ^0.8.0;import "./IERC165.sol";/*** @dev Implementation of the {IERC165} interface.** Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check* for the additional interface id that will be supported. For example:** ```solidity* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);* }* ```** Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.*/abstract contract ERC165 is IERC165 {/*** @dev See {IERC165-supportsInterface}.*/function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {return interfaceId == type(IERC165).interfaceId;}}
@openzeppelin/contracts/utils/introspection/IERC165.sol
// SPDX-License-Identifier: MIT// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)pragma solidity ^0.8.0;/*** @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);}
@openzeppelin/contracts/utils/structs/EnumerableSet.sol
// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v4.7.0) (utils/structs/EnumerableSet.sol)pragma solidity ^0.8.0;/*** @dev Library for managing* https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive* types.** Sets have the following properties:** - Elements are added, removed, and checked for existence in constant time* (O(1)).* - Elements are enumerated in O(n). No guarantees are made on the ordering.** ```* contract Example {* // Add the library methods* using EnumerableSet for EnumerableSet.AddressSet;** // Declare a set state variable* EnumerableSet.AddressSet private mySet;* }* ```** As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)* and `uint256` (`UintSet`) are supported.** [WARNING]* ====* Trying to delete such a structure from storage will likely result in data corruption, rendering the structure unusable.* See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.** In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an array of EnumerableSet.* ====*/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.
contracts/interfaces/IWeb3Entry.sol
// SPDX-License-Identifier: MITpragma solidity 0.8.10;import "../libraries/DataTypes.sol";interface IWeb3Entry {function initialize(string calldata _name,string calldata _symbol,address _linklistContract,address _mintNFTImpl,address _periphery,address resolver) external;/////////////////////////////////////////////////////////// EXTERNAL VIEW FUNCTIONS////////////////////////////////////////////////////////function createCharacter(DataTypes.CreateCharacterData calldata vars) external;function setHandle(uint256 characterId, string calldata newHandle) external;function setSocialToken(uint256 characterId, address tokenAddress) external;function setCharacterUri(uint256 characterId, string calldata newUri) external;function setPrimaryCharacterId(uint256 characterId) external;function grantOperatorPermissions(uint256 characterId,address operator,uint256 permissionBitMap) external;function grantOperatorPermissions4Note(uint256 characterId,uint256 noteId,address operator,uint256 permissionBitMap
contracts/libraries/DataTypes.sol
// SPDX-License-Identifier: MITpragma solidity 0.8.10;library DataTypes {struct MigrateData {address account;string handle;string uri;address[] toAddresses;bytes32 linkType;}struct CreateCharacterData {address to;string handle;string uri;address linkModule;bytes linkModuleInitData;}struct createThenLinkCharacterData {uint256 fromCharacterId;address to;bytes32 linkType;}struct linkNoteData {uint256 fromCharacterId;uint256 toCharacterId;uint256 toNoteId;bytes32 linkType;bytes data;}struct unlinkNoteData {uint256 fromCharacterId;uint256 toCharacterId;uint256 toNoteId;bytes32 linkType;}
contracts/libraries/OP.sol
// SPDX-License-Identifier: MITpragma solidity 0.8.10;/*** @dev every uint8 stands for a single method in Web3Entry.sol.* For most cases, we recommend simply granting operators the OPERATOR_SIGN_PERMISSION_BITMAP,* which gives operator full permissions aside from owner permissions and future permissions, but for* those who're more aware of access control, the custom permission bitmap is all yours,* and you can find every customizable methods below.* `OPERATOR_SIGN_PERMISSION_BITMAP` have access to all methods in `OPERATOR_SYNC_PERMISSION_BITMAP`* plus more permissions for signing.* Permissions are laid out in a increasing order of power.* so the bitmap looks like this:* | opSync | opSign | future | owner |* |------------|------------|------------|----------|* |255------236|235------176|175-------21|20-------0|*/library OP {// [0,20] for owner permissionuint8 internal constant SET_HANDLE = 0;uint8 internal constant SET_SOCIAL_TOKEN = 1;uint8 internal constant GRANT_OPERATOR_PERMISSIONS = 2;// [21, 175] are reserved for future// [176, 235] for operator sign permissionsuint8 internal constant SET_CHARACTER_URI = 176;uint8 internal constant SET_LINK_LIST_URI = 177;uint8 internal constant LINK_CHARACTER = 178;uint8 internal constant UNLINK_CHARACTER = 179;uint8 internal constant CREATE_THEN_LINK_CHARACTER = 180;uint8 internal constant LINK_NOTE = 181;uint8 internal constant UNLINK_NOTE = 182;uint8 internal constant LINK_ERC721 = 183;uint8 internal constant UNLINK_ERC721 = 184;uint8 internal constant LINK_ADDRESS = 185;
Contract ABI
[{"type":"event","name":"Initialized","inputs":[{"type":"uint8","name":"version","internalType":"uint8","indexed":false}],"anonymous":false},{"type":"event","name":"RoleAdminChanged","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32","indexed":true},{"type":"bytes32","name":"previousAdminRole","internalType":"bytes32","indexed":true},{"type":"bytes32","name":"newAdminRole","internalType":"bytes32","indexed":true}],"anonymous":false},{"type":"event","name":"RoleGranted","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32","indexed":true},{"type":"address","name":"account","internalType":"address","indexed":true},{"type":"address","name":"sender","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"RoleRevoked","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32","indexed":true},{"type":"address","name":"account","internalType":"address","indexed":true},{"type":"address","name":"sender","internalType":"address","indexed":true}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"ADMIN_ROLE","inputs":[]},{"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":"getRoleAdmin","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"getRoleMember","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"},{"type":"uint256","name":"index","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getRoleMemberCount","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"grantRole","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"},{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"hasRole","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"},{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"initialize","inputs":[{"type":"address","name":"_web3Entry","internalType":"address"},{"type":"address","name":"_xsyncOperator","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bytes4","name":"","internalType":"bytes4"}],"name":"onERC721Received","inputs":[{"type":"address","name":"operator","internalType":"address"},{"type":"address","name":"","internalType":"address"},{"type":"uint256","name":"tokenId","internalType":"uint256"},{"type":"bytes","name":"data","internalType":"bytes"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceRole","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"},{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"revokeRole","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"},{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"supportsInterface","inputs":[{"type":"bytes4","name":"interfaceId","internalType":"bytes4"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"web3Entry","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"withdraw","inputs":[{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"characterId","internalType":"uint256"},{"type":"uint256","name":"nonce","internalType":"uint256"},{"type":"uint256","name":"expires","internalType":"uint256"},{"type":"bytes","name":"proof","internalType":"bytes"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"xsyncOperator","inputs":[]}]
Contract Creation Code
0x608060405234801561001057600080fd5b506113e9806100206000396000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c806375b238fc11610097578063ca15c87311610066578063ca15c87314610229578063d547741f1461023c578063ddf1858a1461024f578063e13322721461026257600080fd5b806375b238fc146101e65780639010d07c146101fb57806391d148541461020e578063a217fddf1461022157600080fd5b80632f2ff15d116100d35780632f2ff15d1461018057806332eba3b21461019557806336568abe146101c0578063485cc955146101d357600080fd5b806301ffc9a7146100fa578063150b7a0214610122578063248a9ca31461014e575b600080fd5b61010d610108366004610f89565b610275565b60405190151581526020015b60405180910390f35b610135610130366004610fc8565b6102a0565b6040516001600160e01b03199091168152602001610119565b61017261015c366004611067565b6000908152600160208190526040909120015490565b604051908152602001610119565b61019361018e366004611080565b61050d565b005b6004546101a8906001600160a01b031681565b6040516001600160a01b039091168152602001610119565b6101936101ce366004611080565b610538565b6101936101e13660046110b0565b6105b6565b61017260008051602061139483398151915281565b6101a86102093660046110de565b610719565b61010d61021c366004611080565b610738565b610172600081565b610172610237366004611067565b610763565b61019361024a366004611080565b61077a565b61019361025d366004611116565b6107a0565b6003546101a8906001600160a01b031681565b60006001600160e01b03198216635a05180f60e01b148061029a575061029a8261097e565b92915050565b6003546000906001600160a01b0316331461030d5760405162461bcd60e51b815260206004820152602260248201527f4e657762696556696c6c613a207265636569766520756e6b6e6f776e20746f6b60448201526132b760f11b60648201526084015b60405180910390fd5b61032560008051602061139483398151915287610738565b6103805760405162461bcd60e51b815260206004820152602660248201527f4e657762696556696c6c613a207265636569766520756e6b6e6f776e206368616044820152653930b1ba32b960d11b6064820152608401610304565b816103fe576003546040516310332bf960e11b8152600481018690526001600160a01b0388811660248301526001600160b01b031960448301529091169063206657f290606401600060405180830381600087803b1580156103e157600080fd5b505af11580156103f5573d6000803e3d6000fd5b50505050610484565b600061040c838501856111f7565b6003546040516310332bf960e11b8152600481018890526001600160a01b0380841660248301526001600160b01b0319604483015292935091169063206657f290606401600060405180830381600087803b15801561046a57600080fd5b505af115801561047e573d6000803e3d6000fd5b50505050505b600354600480546040516310332bf960e11b81529182018790526001600160a01b0390811660248301526001600160ec1b031960448301529091169063206657f290606401600060405180830381600087803b1580156104e357600080fd5b505af11580156104f7573d6000803e3d6000fd5b50630a85bd0160e11b9998505050505050505050565b60008281526001602081905260409091200154610529816109b3565b61053383836109c0565b505050565b6001600160a01b03811633146105a85760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610304565b6105b282826109e2565b5050565b600054610100900460ff16158080156105d65750600054600160ff909116105b806105f05750303b1580156105f0575060005460ff166001145b6106535760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610304565b6000805460ff191660011790558015610676576000805461ff0019166101001790555b600380546001600160a01b038086166001600160a01b03199283161790925560048054928516929091169190911790556106b760006106b23390565b610a04565b6106cf60008051602061139483398151915233610a04565b8015610533576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050565b60008281526002602052604081206107319083610a0e565b9392505050565b60009182526001602090815260408084206001600160a01b0393909316845291905290205460ff1690565b600081815260026020526040812061029a90610a1a565b60008281526001602081905260409091200154610796816109b3565b61053383836109e2565b81428110156107f15760405162461bcd60e51b815260206004820181905260248201527f4e657762696556696c6c613a20726563656970742068617320657870697265646044820152606401610304565b6040516bffffffffffffffffffffffff193060601b16602082015260348101869052605481018590526074810184905260009061089490609401604051602081830303815290604052805190602001206040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b90506108b260008051602061139483398151915261021c8386610a24565b6109095760405162461bcd60e51b815260206004820152602260248201527f4e657762696556696c6c613a20556e617574686f72697a656420776974686472604482015261617760f01b6064820152608401610304565b600354604051632142170760e11b81523060048201526001600160a01b03898116602483015260448201899052909116906342842e0e90606401600060405180830381600087803b15801561095d57600080fd5b505af1158015610971573d6000803e3d6000fd5b5050505050505050505050565b60006001600160e01b03198216637965db0b60e01b148061029a57506301ffc9a760e01b6001600160e01b031983161461029a565b6109bd8133610aa3565b50565b6109ca8282610b07565b60008281526002602052604090206105339082610b72565b6109ec8282610b87565b60008281526002602052604090206105339082610bee565b6105b282826109c0565b60006107318383610c03565b600061029a825490565b600080600080610a3385610c2d565b6040805160008152602081018083528b905260ff8516918101919091526060810183905260808101829052929550909350915060019060a0016020604051602081039080840390855afa158015610a8e573d6000803e3d6000fd5b5050604051601f190151979650505050505050565b610aad8282610738565b6105b257610ac5816001600160a01b03166014610cab565b610ad0836020610cab565b604051602001610ae1929190611244565b60408051601f198184030181529082905262461bcd60e51b8252610304916004016112b9565b610b118282610738565b6105b25760008281526001602081815260408084206001600160a01b0386168086529252808420805460ff19169093179092559051339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45050565b6000610731836001600160a01b038416610e47565b610b918282610738565b156105b25760008281526001602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000610731836001600160a01b038416610e96565b6000826000018281548110610c1a57610c1a6112ec565b9060005260206000200154905092915050565b60008060008351604114610c8f5760405162461bcd60e51b815260206004820152602360248201527f4e657762696556696c6c613a2057726f6e67207369676e6174757265206c656e6044820152620cee8d60eb1b6064820152608401610304565b5050506020810151604082015160609092015160001a92909190565b60606000610cba836002611318565b610cc5906002611337565b67ffffffffffffffff811115610cdd57610cdd611100565b6040519080825280601f01601f191660200182016040528015610d07576020820181803683370190505b509050600360fc1b81600081518110610d2257610d226112ec565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110610d5157610d516112ec565b60200101906001600160f81b031916908160001a9053506000610d75846002611318565b610d80906001611337565b90505b6001811115610df8576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110610db457610db46112ec565b1a60f81b828281518110610dca57610dca6112ec565b60200101906001600160f81b031916908160001a90535060049490941c93610df18161134f565b9050610d83565b5083156107315760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610304565b6000818152600183016020526040812054610e8e5750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561029a565b50600061029a565b60008181526001830160205260408120548015610f7f576000610eba600183611366565b8554909150600090610ece90600190611366565b9050818114610f33576000866000018281548110610eee57610eee6112ec565b9060005260206000200154905080876000018481548110610f1157610f116112ec565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080610f4457610f4461137d565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061029a565b600091505061029a565b600060208284031215610f9b57600080fd5b81356001600160e01b03198116811461073157600080fd5b6001600160a01b03811681146109bd57600080fd5b600080600080600060808688031215610fe057600080fd5b8535610feb81610fb3565b94506020860135610ffb81610fb3565b935060408601359250606086013567ffffffffffffffff8082111561101f57600080fd5b818801915088601f83011261103357600080fd5b81358181111561104257600080fd5b89602082850101111561105457600080fd5b9699959850939650602001949392505050565b60006020828403121561107957600080fd5b5035919050565b6000806040838503121561109357600080fd5b8235915060208301356110a581610fb3565b809150509250929050565b600080604083850312156110c357600080fd5b82356110ce81610fb3565b915060208301356110a581610fb3565b600080604083850312156110f157600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b600080600080600060a0868803121561112e57600080fd5b853561113981610fb3565b9450602086013593506040860135925060608601359150608086013567ffffffffffffffff8082111561116b57600080fd5b818801915088601f83011261117f57600080fd5b81358181111561119157611191611100565b604051601f8201601f19908116603f011681019083821181831017156111b9576111b9611100565b816040528281528b60208487010111156111d257600080fd5b8260208601602083013760006020848301015280955050505050509295509295909350565b60006020828403121561120957600080fd5b813561073181610fb3565b60005b8381101561122f578181015183820152602001611217565b8381111561123e576000848401525b50505050565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161127c816017850160208801611214565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516112ad816028840160208801611214565b01602801949350505050565b60208152600082518060208401526112d8816040850160208701611214565b601f01601f19169190910160400192915050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600081600019048311821515161561133257611332611302565b500290565b6000821982111561134a5761134a611302565b500190565b60008161135e5761135e611302565b506000190190565b60008282101561137857611378611302565b500390565b634e487b7160e01b600052603160045260246000fdfea49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775a26469706673582212200d7f99d40078375fb775b1da6bbcdad13da7c610d7f23968ec25d43ec1d8b0d664736f6c634300080a0033
Deployed ByteCode
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806375b238fc11610097578063ca15c87311610066578063ca15c87314610229578063d547741f1461023c578063ddf1858a1461024f578063e13322721461026257600080fd5b806375b238fc146101e65780639010d07c146101fb57806391d148541461020e578063a217fddf1461022157600080fd5b80632f2ff15d116100d35780632f2ff15d1461018057806332eba3b21461019557806336568abe146101c0578063485cc955146101d357600080fd5b806301ffc9a7146100fa578063150b7a0214610122578063248a9ca31461014e575b600080fd5b61010d610108366004610f89565b610275565b60405190151581526020015b60405180910390f35b610135610130366004610fc8565b6102a0565b6040516001600160e01b03199091168152602001610119565b61017261015c366004611067565b6000908152600160208190526040909120015490565b604051908152602001610119565b61019361018e366004611080565b61050d565b005b6004546101a8906001600160a01b031681565b6040516001600160a01b039091168152602001610119565b6101936101ce366004611080565b610538565b6101936101e13660046110b0565b6105b6565b61017260008051602061139483398151915281565b6101a86102093660046110de565b610719565b61010d61021c366004611080565b610738565b610172600081565b610172610237366004611067565b610763565b61019361024a366004611080565b61077a565b61019361025d366004611116565b6107a0565b6003546101a8906001600160a01b031681565b60006001600160e01b03198216635a05180f60e01b148061029a575061029a8261097e565b92915050565b6003546000906001600160a01b0316331461030d5760405162461bcd60e51b815260206004820152602260248201527f4e657762696556696c6c613a207265636569766520756e6b6e6f776e20746f6b60448201526132b760f11b60648201526084015b60405180910390fd5b61032560008051602061139483398151915287610738565b6103805760405162461bcd60e51b815260206004820152602660248201527f4e657762696556696c6c613a207265636569766520756e6b6e6f776e206368616044820152653930b1ba32b960d11b6064820152608401610304565b816103fe576003546040516310332bf960e11b8152600481018690526001600160a01b0388811660248301526001600160b01b031960448301529091169063206657f290606401600060405180830381600087803b1580156103e157600080fd5b505af11580156103f5573d6000803e3d6000fd5b50505050610484565b600061040c838501856111f7565b6003546040516310332bf960e11b8152600481018890526001600160a01b0380841660248301526001600160b01b0319604483015292935091169063206657f290606401600060405180830381600087803b15801561046a57600080fd5b505af115801561047e573d6000803e3d6000fd5b50505050505b600354600480546040516310332bf960e11b81529182018790526001600160a01b0390811660248301526001600160ec1b031960448301529091169063206657f290606401600060405180830381600087803b1580156104e357600080fd5b505af11580156104f7573d6000803e3d6000fd5b50630a85bd0160e11b9998505050505050505050565b60008281526001602081905260409091200154610529816109b3565b61053383836109c0565b505050565b6001600160a01b03811633146105a85760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610304565b6105b282826109e2565b5050565b600054610100900460ff16158080156105d65750600054600160ff909116105b806105f05750303b1580156105f0575060005460ff166001145b6106535760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610304565b6000805460ff191660011790558015610676576000805461ff0019166101001790555b600380546001600160a01b038086166001600160a01b03199283161790925560048054928516929091169190911790556106b760006106b23390565b610a04565b6106cf60008051602061139483398151915233610a04565b8015610533576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050565b60008281526002602052604081206107319083610a0e565b9392505050565b60009182526001602090815260408084206001600160a01b0393909316845291905290205460ff1690565b600081815260026020526040812061029a90610a1a565b60008281526001602081905260409091200154610796816109b3565b61053383836109e2565b81428110156107f15760405162461bcd60e51b815260206004820181905260248201527f4e657762696556696c6c613a20726563656970742068617320657870697265646044820152606401610304565b6040516bffffffffffffffffffffffff193060601b16602082015260348101869052605481018590526074810184905260009061089490609401604051602081830303815290604052805190602001206040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b90506108b260008051602061139483398151915261021c8386610a24565b6109095760405162461bcd60e51b815260206004820152602260248201527f4e657762696556696c6c613a20556e617574686f72697a656420776974686472604482015261617760f01b6064820152608401610304565b600354604051632142170760e11b81523060048201526001600160a01b03898116602483015260448201899052909116906342842e0e90606401600060405180830381600087803b15801561095d57600080fd5b505af1158015610971573d6000803e3d6000fd5b5050505050505050505050565b60006001600160e01b03198216637965db0b60e01b148061029a57506301ffc9a760e01b6001600160e01b031983161461029a565b6109bd8133610aa3565b50565b6109ca8282610b07565b60008281526002602052604090206105339082610b72565b6109ec8282610b87565b60008281526002602052604090206105339082610bee565b6105b282826109c0565b60006107318383610c03565b600061029a825490565b600080600080610a3385610c2d565b6040805160008152602081018083528b905260ff8516918101919091526060810183905260808101829052929550909350915060019060a0016020604051602081039080840390855afa158015610a8e573d6000803e3d6000fd5b5050604051601f190151979650505050505050565b610aad8282610738565b6105b257610ac5816001600160a01b03166014610cab565b610ad0836020610cab565b604051602001610ae1929190611244565b60408051601f198184030181529082905262461bcd60e51b8252610304916004016112b9565b610b118282610738565b6105b25760008281526001602081815260408084206001600160a01b0386168086529252808420805460ff19169093179092559051339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45050565b6000610731836001600160a01b038416610e47565b610b918282610738565b156105b25760008281526001602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000610731836001600160a01b038416610e96565b6000826000018281548110610c1a57610c1a6112ec565b9060005260206000200154905092915050565b60008060008351604114610c8f5760405162461bcd60e51b815260206004820152602360248201527f4e657762696556696c6c613a2057726f6e67207369676e6174757265206c656e6044820152620cee8d60eb1b6064820152608401610304565b5050506020810151604082015160609092015160001a92909190565b60606000610cba836002611318565b610cc5906002611337565b67ffffffffffffffff811115610cdd57610cdd611100565b6040519080825280601f01601f191660200182016040528015610d07576020820181803683370190505b509050600360fc1b81600081518110610d2257610d226112ec565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110610d5157610d516112ec565b60200101906001600160f81b031916908160001a9053506000610d75846002611318565b610d80906001611337565b90505b6001811115610df8576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110610db457610db46112ec565b1a60f81b828281518110610dca57610dca6112ec565b60200101906001600160f81b031916908160001a90535060049490941c93610df18161134f565b9050610d83565b5083156107315760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610304565b6000818152600183016020526040812054610e8e5750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561029a565b50600061029a565b60008181526001830160205260408120548015610f7f576000610eba600183611366565b8554909150600090610ece90600190611366565b9050818114610f33576000866000018281548110610eee57610eee6112ec565b9060005260206000200154905080876000018481548110610f1157610f116112ec565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080610f4457610f4461137d565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061029a565b600091505061029a565b600060208284031215610f9b57600080fd5b81356001600160e01b03198116811461073157600080fd5b6001600160a01b03811681146109bd57600080fd5b600080600080600060808688031215610fe057600080fd5b8535610feb81610fb3565b94506020860135610ffb81610fb3565b935060408601359250606086013567ffffffffffffffff8082111561101f57600080fd5b818801915088601f83011261103357600080fd5b81358181111561104257600080fd5b89602082850101111561105457600080fd5b9699959850939650602001949392505050565b60006020828403121561107957600080fd5b5035919050565b6000806040838503121561109357600080fd5b8235915060208301356110a581610fb3565b809150509250929050565b600080604083850312156110c357600080fd5b82356110ce81610fb3565b915060208301356110a581610fb3565b600080604083850312156110f157600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b600080600080600060a0868803121561112e57600080fd5b853561113981610fb3565b9450602086013593506040860135925060608601359150608086013567ffffffffffffffff8082111561116b57600080fd5b818801915088601f83011261117f57600080fd5b81358181111561119157611191611100565b604051601f8201601f19908116603f011681019083821181831017156111b9576111b9611100565b816040528281528b60208487010111156111d257600080fd5b8260208601602083013760006020848301015280955050505050509295509295909350565b60006020828403121561120957600080fd5b813561073181610fb3565b60005b8381101561122f578181015183820152602001611217565b8381111561123e576000848401525b50505050565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161127c816017850160208801611214565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516112ad816028840160208801611214565b01602801949350505050565b60208152600082518060208401526112d8816040850160208701611214565b601f01601f19169190910160400192915050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600081600019048311821515161561133257611332611302565b500290565b6000821982111561134a5761134a611302565b500190565b60008161135e5761135e611302565b506000190190565b60008282101561137857611378611302565b500390565b634e487b7160e01b600052603160045260246000fdfea49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775a26469706673582212200d7f99d40078375fb775b1da6bbcdad13da7c610d7f23968ec25d43ec1d8b0d664736f6c634300080a0033