Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
OperatorFilteredToken
Compiler Version
v0.8.25+commit.b61c2a91
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.25; import "./LockableRevealERC721EnumerableToken.sol"; import "operator-filter-registry/src/IOperatorFilterRegistry.sol"; contract OperatorFilteredToken is LockableRevealERC721EnumerableToken { error OperatorNotAllowed(address operator); bool public OSFiltering = true; address public DEFAULT_SUBSCRIPTION = address(0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6); IOperatorFilterRegistry public OPERATOR_FILTER_REGISTRY = IOperatorFilterRegistry(0x000000000000AAeB6D7670E522A718067333cd4E); constructor(address _galaxisRegistry) LockableRevealERC721EnumerableToken(_galaxisRegistry){ } function init(TokenConstructorConfig memory config, address _actualOwner) public virtual override { if (address(OPERATOR_FILTER_REGISTRY).code.length > 0) { OPERATOR_FILTER_REGISTRY.registerAndSubscribe(address(this), DEFAULT_SUBSCRIPTION); } super.init(config,_actualOwner); } // Toggle to disable OS filtering function toggleOSFilterOperatorState() public onlyOwner() { OSFiltering = !OSFiltering; } function setApprovalForAll(address operator, bool approved) public override(ERC721, IERC721) { if(OSFiltering) { _checkFilterOperator(operator); } super.setApprovalForAll(operator, approved); } function approve(address operator, uint256 tokenId) public override(ERC721, IERC721) { if(OSFiltering) { _checkFilterOperator(operator); } super.approve(operator, tokenId); } function transferFrom(address from, address to, uint256 tokenId) public override(ERC721, IERC721) { if (OSFiltering && from != msg.sender) { _checkFilterOperator(msg.sender); } super.transferFrom(from, to, tokenId); } function safeTransferFrom(address from, address to, uint256 tokenId) public override(ERC721, IERC721) { if (OSFiltering && from != msg.sender) { _checkFilterOperator(msg.sender); } super.safeTransferFrom(from, to, tokenId); } function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public override(ERC721, IERC721) { if (OSFiltering && from != msg.sender) { _checkFilterOperator(msg.sender); } super.safeTransferFrom(from, to, tokenId, data); } function _checkFilterOperator(address operator) internal view virtual { // Check registry code length to facilitate testing in environments without a deployed registry. if (address(OPERATOR_FILTER_REGISTRY).code.length > 0) { if (!OPERATOR_FILTER_REGISTRY.isOperatorAllowed(address(this), operator)) { revert OperatorNotAllowed(operator); } } } }
// 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 * 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, IAccessControl, ERC165 { struct RoleData { mapping(address => bool) members; bytes32 adminRole; } mapping(bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Modifier that checks that an account has a specific role. Reverts * with a standardized message including the required role. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ * * _Available since v4.1._ */ modifier onlyRole(bytes32 role) { _checkRole(role); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view virtual override returns (bool) { return _roles[role].members[account]; } /** * @dev Revert with a standard message if `_msgSender()` is missing `role`. * Overriding this function changes the behavior of the {onlyRole} modifier. * * Format of the revert message is described in {_checkRole}. * * _Available since v4.6._ */ function _checkRole(bytes32 role) internal view virtual { _checkRole(role, _msgSender()); } /** * @dev Revert with a standard message if `account` is missing `role`. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ */ function _checkRole(bytes32 role, address account) internal view virtual { if (!hasRole(role, account)) { revert( string( abi.encodePacked( "AccessControl: account ", Strings.toHexString(uint160(account), 20), " is missing role ", Strings.toHexString(uint256(role), 32) ) ) ); } } /** * @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 virtual override 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. * * May emit a {RoleGranted} event. */ function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _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. * * May emit a {RoleRevoked} event. */ function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _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 revoked `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. * * May emit a {RoleRevoked} event. */ function renounceRole(bytes32 role, address account) public virtual override { 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. * * May emit a {RoleGranted} event. * * [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}. * ==== * * NOTE: This function is deprecated in favor of {_grantRole}. */ 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 { bytes32 previousAdminRole = getRoleAdmin(role); _roles[role].adminRole = adminRole; emit RoleAdminChanged(role, previousAdminRole, adminRole); } /** * @dev Grants `role` to `account`. * * Internal function without access restriction. * * May emit a {RoleGranted} event. */ function _grantRole(bytes32 role, address account) internal virtual { if (!hasRole(role, account)) { _roles[role].members[account] = true; emit RoleGranted(role, account, _msgSender()); } } /** * @dev Revokes `role` from `account`. * * Internal function without access restriction. * * May emit a {RoleRevoked} event. */ function _revokeRole(bytes32 role, address account) internal virtual { if (hasRole(role, account)) { _roles[role].members[account] = false; emit RoleRevoked(role, account, _msgSender()); } } }
// 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); } /** * @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 virtual override returns (uint256) { return _roleMembers[role].length(); } /** * @dev Overload {_grantRole} to track enumerable memberships */ function _grantRole(bytes32 role, address account) internal virtual override { super._grantRole(role, account); _roleMembers[role].add(account); } /** * @dev Overload {_revokeRole} to track enumerable memberships */ function _revokeRole(bytes32 role, address account) internal virtual override { super._revokeRole(role, account); _roleMembers[role].remove(account); } }
// 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); /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {AccessControl-_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) external view returns (bytes32); /** * @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) external; /** * @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) external; /** * @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) external; }
// 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); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @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); /** * @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 `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, 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 `from` to `to` 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 from, address to, uint256 amount ) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/ERC721.sol) pragma solidity ^0.8.0; import "./IERC721.sol"; import "./IERC721Receiver.sol"; import "./extensions/IERC721Metadata.sol"; import "../../utils/Address.sol"; import "../../utils/Context.sol"; import "../../utils/Strings.sol"; import "../../utils/introspection/ERC165.sol"; /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension, but not including the Enumerable extension, which is available separately as * {ERC721Enumerable}. */ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings for uint256; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to owner address mapping(uint256 => address) private _owners; // Mapping owner address to token count mapping(address => uint256) private _balances; // Mapping from token ID to approved address mapping(uint256 => address) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; /** * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC721).interfaceId || interfaceId == type(IERC721Metadata).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view virtual override returns (uint256) { require(owner != address(0), "ERC721: address zero is not a valid owner"); return _balances[owner]; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { address owner = _owners[tokenId]; require(owner != address(0), "ERC721: invalid token ID"); return owner; } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { _requireMinted(tokenId); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : ""; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overridden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ""; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual override { address owner = ERC721.ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require( _msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721: approve caller is not token owner nor approved for all" ); _approve(to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { _requireMinted(tokenId); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom( address from, address to, uint256 tokenId ) public virtual override { //solhint-disable-next-line max-line-length require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner nor approved"); _transfer(from, to, tokenId); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory data ) public virtual override { require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner nor approved"); _safeTransfer(from, to, tokenId, data); } /** * @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. * * `data` is additional data, it has no specified format and it is sent in call to `to`. * * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeTransfer( address from, address to, uint256 tokenId, bytes memory data ) internal virtual { _transfer(from, to, tokenId); require(_checkOnERC721Received(from, to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer"); } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted (`_mint`), * and stop existing when they are burned (`_burn`). */ function _exists(uint256 tokenId) internal view virtual returns (bool) { return _owners[tokenId] != address(0); } /** * @dev Returns whether `spender` is allowed to manage `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) { address owner = ERC721.ownerOf(tokenId); return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender); } /** * @dev Safely mints `tokenId` and transfers it to `to`. * * Requirements: * * - `tokenId` must not exist. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeMint(address to, uint256 tokenId) internal virtual { _safeMint(to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeMint( address to, uint256 tokenId, bytes memory data ) internal virtual { _mint(to, tokenId); require( _checkOnERC721Received(address(0), to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer" ); } /** * @dev Mints `tokenId` and transfers it to `to`. * * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible * * Requirements: * * - `tokenId` must not exist. * - `to` cannot be the zero address. * * Emits a {Transfer} event. */ function _mint(address to, uint256 tokenId) internal virtual { require(to != address(0), "ERC721: mint to the zero address"); require(!_exists(tokenId), "ERC721: token already minted"); _beforeTokenTransfer(address(0), to, tokenId); _balances[to] += 1; _owners[tokenId] = to; emit Transfer(address(0), to, tokenId); _afterTokenTransfer(address(0), to, tokenId); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual { address owner = ERC721.ownerOf(tokenId); _beforeTokenTransfer(owner, address(0), tokenId); // Clear approvals _approve(address(0), tokenId); _balances[owner] -= 1; delete _owners[tokenId]; emit Transfer(owner, address(0), tokenId); _afterTokenTransfer(owner, address(0), tokenId); } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer( address from, address to, uint256 tokenId ) internal virtual { require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner"); require(to != address(0), "ERC721: transfer to the zero address"); _beforeTokenTransfer(from, to, tokenId); // Clear approvals from the previous owner _approve(address(0), tokenId); _balances[from] -= 1; _balances[to] += 1; _owners[tokenId] = to; emit Transfer(from, to, tokenId); _afterTokenTransfer(from, to, tokenId); } /** * @dev Approve `to` to operate on `tokenId` * * Emits an {Approval} event. */ function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ERC721.ownerOf(tokenId), to, tokenId); } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Emits an {ApprovalForAll} event. */ function _setApprovalForAll( address owner, address operator, bool approved ) internal virtual { require(owner != operator, "ERC721: approve to caller"); _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Reverts if the `tokenId` has not been minted yet. */ function _requireMinted(uint256 tokenId) internal view virtual { require(_exists(tokenId), "ERC721: invalid token ID"); } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. * The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ function _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory data ) private returns (bool) { if (to.isContract()) { try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) { return retval == IERC721Receiver.onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert("ERC721: transfer to non ERC721Receiver implementer"); } else { /// @solidity memory-safe-assembly assembly { revert(add(32, reason), mload(reason)) } } } } else { return true; } } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``from``'s `tokenId` will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual {} /** * @dev Hook that is called after any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address from, address to, uint256 tokenId ) internal virtual {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/ERC721Enumerable.sol) pragma solidity ^0.8.0; import "../ERC721.sol"; import "./IERC721Enumerable.sol"; /** * @dev This implements an optional extension of {ERC721} defined in the EIP that adds * enumerability of all the token ids in the contract as well as all token ids owned by each * account. */ abstract contract ERC721Enumerable is ERC721, IERC721Enumerable { // Mapping from owner to list of owned token IDs mapping(address => mapping(uint256 => uint256)) private _ownedTokens; // Mapping from token ID to index of the owner tokens list mapping(uint256 => uint256) private _ownedTokensIndex; // Array with all token ids, used for enumeration uint256[] private _allTokens; // Mapping from token id to position in the allTokens array mapping(uint256 => uint256) private _allTokensIndex; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) { return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}. */ function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) { require(index < ERC721.balanceOf(owner), "ERC721Enumerable: owner index out of bounds"); return _ownedTokens[owner][index]; } /** * @dev See {IERC721Enumerable-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _allTokens.length; } /** * @dev See {IERC721Enumerable-tokenByIndex}. */ function tokenByIndex(uint256 index) public view virtual override returns (uint256) { require(index < ERC721Enumerable.totalSupply(), "ERC721Enumerable: global index out of bounds"); return _allTokens[index]; } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``from``'s `tokenId` will be burned. * - `from` cannot be the zero address. * - `to` cannot be the zero address. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual override { super._beforeTokenTransfer(from, to, tokenId); if (from == address(0)) { _addTokenToAllTokensEnumeration(tokenId); } else if (from != to) { _removeTokenFromOwnerEnumeration(from, tokenId); } if (to == address(0)) { _removeTokenFromAllTokensEnumeration(tokenId); } else if (to != from) { _addTokenToOwnerEnumeration(to, tokenId); } } /** * @dev Private function to add a token to this extension's ownership-tracking data structures. * @param to address representing the new owner of the given token ID * @param tokenId uint256 ID of the token to be added to the tokens list of the given address */ function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private { uint256 length = ERC721.balanceOf(to); _ownedTokens[to][length] = tokenId; _ownedTokensIndex[tokenId] = length; } /** * @dev Private function to add a token to this extension's token tracking data structures. * @param tokenId uint256 ID of the token to be added to the tokens list */ function _addTokenToAllTokensEnumeration(uint256 tokenId) private { _allTokensIndex[tokenId] = _allTokens.length; _allTokens.push(tokenId); } /** * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for * gas optimizations e.g. when performing a transfer operation (avoiding double writes). * This has O(1) time complexity, but alters the order of the _ownedTokens array. * @param from address representing the previous owner of the given token ID * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address */ function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private { // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = ERC721.balanceOf(from) - 1; uint256 tokenIndex = _ownedTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary if (tokenIndex != lastTokenIndex) { uint256 lastTokenId = _ownedTokens[from][lastTokenIndex]; _ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index } // This also deletes the contents at the last position of the array delete _ownedTokensIndex[tokenId]; delete _ownedTokens[from][lastTokenIndex]; } /** * @dev Private function to remove a token from this extension's token tracking data structures. * This has O(1) time complexity, but alters the order of the _allTokens array. * @param tokenId uint256 ID of the token to be removed from the tokens list */ function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private { // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = _allTokens.length - 1; uint256 tokenIndex = _allTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding // an 'if' statement (like in _removeTokenFromOwnerEnumeration) uint256 lastTokenId = _allTokens[lastTokenIndex]; _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index // This also deletes the contents at the last position of the array delete _allTokensIndex[tokenId]; _allTokens.pop(); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol) pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Enumerable is IERC721 { /** * @dev Returns the total amount of tokens stored by the contract. */ function totalSupply() external view returns (uint256); /** * @dev Returns a token ID owned by `owner` at a given `index` of its token list. * Use along with {balanceOf} to enumerate all of ``owner``'s tokens. */ function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256); /** * @dev Returns a token ID at a given `index` of all the tokens stored by the contract. * Use along with {totalSupply} to enumerate all tokens. */ function tokenByIndex(uint256 index) external view returns (uint256); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol) pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Metadata is IERC721 { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); }
// 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); /** * @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; /** * @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 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 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 the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @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); }
// 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); }
// 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; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// 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; } }
// 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; } }
// 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); }
// 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.sol if (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) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } }
// 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. // 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; if (lastIndex != toDeleteIndex) { 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] = valueIndex; // Replace lastValue's index to valueIndex } // 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) { return set._values[index]; } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function _values(Set storage set) private view returns (bytes32[] memory) { return set._values; } // 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); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(Bytes32Set storage set) internal view returns (bytes32[] memory) { return _values(set._inner); } // 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)))); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(AddressSet storage set) internal view returns (address[] memory) { bytes32[] memory store = _values(set._inner); address[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } // 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)); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(UintSet storage set) internal view returns (uint256[] memory) { bytes32[] memory store = _values(set._inner); uint256[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } }
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.25; import "@openzeppelin/contracts/access/AccessControlEnumerable.sol"; import "./Versionable/IVersionable.sol"; contract CommunityList is AccessControlEnumerable, IVersionable { function version() external pure returns (uint256) { return 2024040301; } bytes32 public constant CONTRACT_ADMIN = keccak256("CONTRACT_ADMIN"); uint256 public numberOfEntries; struct community_entry { string name; address registry; uint32 id; } mapping(uint32 => community_entry) public communities; // community_id => record mapping(uint256 => uint32) public index; // entryNumber => community_id for enumeration event CommunityAdded(uint256 pos, string community_name, address community_registry, uint32 community_id); constructor() { _setupRole(DEFAULT_ADMIN_ROLE, msg.sender); _setupRole(CONTRACT_ADMIN,msg.sender); } function addCommunity(uint32 community_id, string memory community_name, address community_registry) external onlyRole(CONTRACT_ADMIN) { uint256 pos = numberOfEntries++; index[pos] = community_id; communities[community_id] = community_entry(community_name, community_registry, community_id); emit CommunityAdded(pos, community_name, community_registry, community_id); } }
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.25; import "@openzeppelin/contracts/access/AccessControlEnumerable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "./Versionable/IVersionable.sol"; import "./UsesGalaxisRegistry.sol"; contract CommunityRegistry is AccessControlEnumerable, UsesGalaxisRegistry, IVersionable { function version() virtual external pure returns(uint256) { return 2024040401; } bytes32 public constant COMMUNITY_REGISTRY_ADMIN = keccak256("COMMUNITY_REGISTRY_ADMIN"); uint32 public community_id; string public community_name; mapping(bytes32 => address) addresses; mapping(bytes32 => uint256) uints; mapping(bytes32 => bool) booleans; mapping(bytes32 => string) strings; mapping (uint => string) public addressEntries; mapping (uint => string) public uintEntries; mapping (uint => string) public boolEntries; mapping (uint => string) public stringEntries; uint public numberOfAddresses; uint public numberOfUINTs; uint public numberOfBooleans; uint public numberOfStrings; bool initialised; bool public independant; event IndependanceDay(bool gain_independance); modifier onlyAdmin() { require( isUserCommunityAdmin(COMMUNITY_REGISTRY_ADMIN,msg.sender) ,"CommunityRegistry : Unauthorised"); _; } modifier onlyPropertyAdmin() { require( isUserCommunityAdmin(COMMUNITY_REGISTRY_ADMIN,msg.sender) || hasRole(COMMUNITY_REGISTRY_ADMIN,msg.sender) ,"CommunityRegistry : Unauthorised"); _; } function isUserCommunityAdmin(bytes32 role, address user) public view returns (bool) { if (hasRole(DEFAULT_ADMIN_ROLE,user) ) return true; // community_admin can do anything if (independant){ return( hasRole(role,user) ); } else { // for Factories return(roleManager().hasRole(role,user)); } } function roleManager() internal view returns (IAccessControlEnumerable) { address addr = galaxisRegistry.getRegistryAddress("ROLE_MANAGER"); // universal if (addr != address(0)) return IAccessControlEnumerable(addr); addr = galaxisRegistry.getRegistryAddress("MAINNET_CHAIN_IMPLEMENTER"); // mainnet if (addr != address(0)) return IAccessControlEnumerable(addr); addr = galaxisRegistry.getRegistryAddress("L2_RECEIVER"); // mainnet require(addr != address(0),"CommunityRegistry : no higher authority found"); return IAccessControlEnumerable(addr); } function grantRole(bytes32 key, address user) public override(AccessControl,IAccessControl) onlyAdmin { _grantRole(key,user); // need to be able to grant it } constructor ( address _galaxisRegistry, uint32 _community_id, address _community_admin, string memory _community_name ) UsesGalaxisRegistry(_galaxisRegistry){ _init(_community_id,_community_admin,_community_name); } function init( uint32 _community_id, address _community_admin, string memory _community_name ) external { _init(_community_id,_community_admin,_community_name); } function _init( uint32 _community_id, address _community_admin, string memory _community_name ) internal { require(!initialised,"This can only be called once"); initialised = true; community_id = _community_id; community_name = _community_name; _setupRole(DEFAULT_ADMIN_ROLE, _community_admin); // default admin = launchpad } event AdminUpdated(address user, bool isAdmin); event AppAdminChanged(address app,address user,bool state); //=== event AddressChanged(string key, address value); event UintChanged(string key, uint256 value); event BooleanChanged(string key, bool value); event StringChanged(string key, string value); function setIndependant(bool gain_independance) external onlyAdmin { if (independant != gain_independance) { independant = gain_independance; emit IndependanceDay(gain_independance); } } function setAdmin(address user,bool status ) external onlyAdmin { if (status) _grantRole(COMMUNITY_REGISTRY_ADMIN,user); else _revokeRole(COMMUNITY_REGISTRY_ADMIN,user); } function hash(string memory field) internal pure returns (bytes32) { return keccak256(abi.encode(field)); } function setRegistryAddress(string memory fn, address value) external onlyPropertyAdmin { bytes32 hf = hash(fn); addresses[hf] = value; addressEntries[numberOfAddresses++] = fn; emit AddressChanged(fn,value); } function setRegistryBool(string memory fn, bool value) external onlyPropertyAdmin { bytes32 hf = hash(fn); booleans[hf] = value; boolEntries[numberOfBooleans++] = fn; emit BooleanChanged(fn,value); } function setRegistryString(string memory fn, string memory value) external onlyPropertyAdmin { bytes32 hf = hash(fn); strings[hf] = value; stringEntries[numberOfStrings++] = fn; emit StringChanged(fn,value); } function setRegistryUINT(string memory fn, uint value) external onlyPropertyAdmin { bytes32 hf = hash(fn); uints[hf] = value; uintEntries[numberOfUINTs++] = fn; emit UintChanged(fn,value); } function getRegistryAddress(string memory key) external view returns (address) { return addresses[hash(key)]; } function getRegistryBool(string memory key) external view returns (bool) { return booleans[hash(key)]; } function getRegistryUINT(string memory key) external view returns (uint256) { return uints[hash(key)]; } function getRegistryString(string memory key) external view returns (string memory) { return strings[hash(key)]; } }
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.25; interface IRegistry { function setRegistryAddress(string memory fn, address value) external ; function setRegistryBool(string memory fn, bool value) external ; function setRegistryUINT(string memory key) external returns (uint256) ; function setRegistryString(string memory fn, string memory value) external ; function setAdmin(address user,bool status ) external; function setAppAdmin(address app, address user, bool state) external; function getRegistryAddress(string memory key) external view returns (address) ; function getRegistryBool(string memory key) external view returns (bool); function getRegistryUINT(string memory key) external view returns (uint256) ; function getRegistryString(string memory key) external view returns (string memory) ; function isAdmin(address user) external view returns (bool) ; function isAppAdmin(address app, address user) external view returns (bool); }
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.25; import "./IRegistry.sol"; contract UsesGalaxisRegistry { IRegistry immutable public galaxisRegistry; constructor(address _galaxisRegistry) { galaxisRegistry = IRegistry(_galaxisRegistry); } }
//SPDX-License-Identifier: Unlicensed pragma solidity 0.8.25; /** * @title IVersionable * @dev Interface for versionable contracts. */ interface IVersionable { /** * @notice Get the current version of the contract. * @return The current version. */ function version() external pure returns (uint256); }
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.25; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; contract BlackHolePrevention is Ownable { // blackhole prevention methods function retrieveETH() external onlyOwner { payable(msg.sender).transfer(address(this).balance); } function retrieveERC20(address _tracker, uint256 amount) external onlyOwner { IERC20(_tracker).transfer(msg.sender, amount); } function retrieve721(address _tracker, uint256 id) external onlyOwner { IERC721(_tracker).transferFrom(address(this), msg.sender, id); } }
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.25; interface IRandomNumberProvider { function requestRandomNumber() external returns (uint256 requestId); function requestRandomNumberWithCallback() external returns (uint256); function isRequestComplete(uint256 requestId) external view returns (bool isCompleted); function randomNumber(uint256 requestId) external view returns (uint256 randomNum); function setAuth(address user, bool grant) external; }
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.25; interface IRandomNumberRequester { function process(uint256 rand, uint256 requestId) external; }
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.25; interface IRegistryConsumer { function getRegistryAddress(string memory key) external view returns (address) ; function getRegistryBool(string memory key) external view returns (bool); function getRegistryUINT(string memory key) external view returns (uint256) ; function getRegistryString(string memory key) external view returns (string memory) ; function isAdmin(address user) external view returns (bool); }
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.25; struct revealStruct { uint256 REQUEST_ID; uint256 RANDOM_NUM; uint256 SHIFT; uint256 RANGE_START; uint256 RANGE_END; bool processed; } struct TokenInfoForSale { uint256 projectID; uint256 maxSupply; uint256 reservedSupply; } struct TokenInfo { string name; string symbol; uint256 projectID; uint256 maxSupply; uint256 mintedSupply; uint256 mintedReserve; uint256 reservedSupply; uint256 giveawaySupply; string tokenPreRevealURI; string tokenRevealURI; bool transferLocked; bool lastRevealRequested; uint256 totalSupply; revealStruct[] reveals; address owner; address[] managers; address[] controllers; uint256 version; bool VRFShifting; } struct TokenConstructorConfig { uint256 projectID; uint256 maxSupply; string erc721name; string erc721symbol; string tokenPreRevealURI; string tokenRevealURI; bool transferLocked; uint256 reservedSupply; uint256 giveawaySupply; bool VRFShifting; } interface IToken { function init(TokenConstructorConfig memory config, address _actualOwner) external; function TOKEN_CONTRACT_GIVEAWAY() external returns (bytes32); function TOKEN_CONTRACT_ACCESS_SALE() external returns (bytes32); function TOKEN_CONTRACT_ACCESS_ADMIN() external returns (bytes32); function TOKEN_CONTRACT_ACCESS_LOCK() external returns (bytes32); function TOKEN_CONTRACT_ACCESS_REVEAL() external returns (bytes32); function mintIncrementalCards(uint256, address) external; function mintReservedCards(uint256, address) external; function mintGiveawayCard(uint256, address) external; function setPreRevealURI(string calldata) external; function setRevealURI(string calldata) external; function revealAtCurrentSupply() external; function lastReveal() external; function process(uint256, uint256) external; function uri(uint256) external view returns (uint256); function tokenURI(uint256) external view returns (string memory); function setTransferLock(bool) external; function hasRole(bytes32, address) external view returns (bool); function isAllowed(bytes32, address) external view returns (bool); function getFirstGiveawayCardId() external view returns (uint256); function tellEverything() external view returns (TokenInfo memory); function getTokenInfoForSale() external view returns (TokenInfoForSale memory); }
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.25; import "./IToken.sol"; import "../interfaces/IRegistryConsumer.sol"; import "../interfaces/IRandomNumberProvider.sol"; import "../interfaces/IRandomNumberRequester.sol"; import "../extras/recovery/BlackHolePrevention.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; import "../../@galaxis/registries/contracts/CommunityList.sol"; import "../../@galaxis/registries/contracts/CommunityRegistry.sol"; import "../../@galaxis/registries/contracts/UsesGalaxisRegistry.sol"; import "../../@galaxis/registries/contracts/Versionable/IVersionable.sol"; contract LockableRevealERC721EnumerableToken is IToken, ERC721Enumerable, Ownable, BlackHolePrevention, UsesGalaxisRegistry, IVersionable { function version() public pure returns (uint256) { return 2024040301; } using Strings for uint256; bytes32 public constant TOKEN_CONTRACT_GIVEAWAY = keccak256("TOKEN_CONTRACT_GIVEAWAY"); bytes32 public constant TOKEN_CONTRACT_ACCESS_SALE = keccak256("TOKEN_CONTRACT_ACCESS_SALE"); bytes32 public constant TOKEN_CONTRACT_ACCESS_ADMIN = keccak256("TOKEN_CONTRACT_ACCESS_ADMIN"); bytes32 public constant TOKEN_CONTRACT_ACCESS_LOCK = keccak256("TOKEN_CONTRACT_ACCESS_LOCK"); bytes32 public constant TOKEN_CONTRACT_ACCESS_REVEAL = keccak256("TOKEN_CONTRACT_ACCESS_REVEAL"); constructor(address _galaxisRegistry) ERC721("GOLDEN_TOKEN_CONTRACT","GT") UsesGalaxisRegistry(_galaxisRegistry){ //_initialized = true; } string constant public REGISTRY_KEY_RANDOM_CONTRACT = "RANDOMV2_SSP"; string constant public USER_RANDOM = "USER_RANDOM"; bool constant public useCommunityRandom = true; uint256 public projectID; uint256 public maxSupply; uint256 public mintedSupply; // minted incrementally uint256 public mintedReserve; uint256 public reservedSupply; // includes giveaway supply uint256 public giveawaySupply; string public tokenPreRevealURI; string public tokenRevealURI; bool public transferLocked; bool public lastRevealRequested; mapping(uint16 => revealStruct) public reveals; mapping(uint256 => uint16) public requestToRevealId; string public revealURI; uint16 public currentRevealCount; string public contractURI; bool _initialized; bool public VRFShifting; string public chain; string private _name; string private _symbol; CommunityRegistry public myCommunityRegistry; using EnumerableSet for EnumerableSet.AddressSet; // onlyOwner can change contractControllers and transfer it's ownership // any contractController can setData EnumerableSet.AddressSet contractControllers; event contractControllerEvent(address _address, bool mode); EnumerableSet.AddressSet contractManagers; event contractManagerEvent(address _address, bool mode); event Locked(bool); event RandomProcessed(uint256 stage, uint256 randNumber, uint256 _shiftsBy, uint256 _start, uint256 _end); event ContractURIset(string contractURI); function init(TokenConstructorConfig memory config, address _actualOwner ) public virtual { require(!_initialized, "Token: Contract already initialized"); _name = config.erc721name; _symbol = config.erc721symbol; projectID = config.projectID; tokenPreRevealURI = config.tokenPreRevealURI; tokenRevealURI = config.tokenRevealURI; maxSupply = config.maxSupply; transferLocked = config.transferLocked; reservedSupply = config.reservedSupply; giveawaySupply = config.giveawaySupply; CommunityList COMMUNITY_LIST = CommunityList(galaxisRegistry.getRegistryAddress("COMMUNITY_LIST")); (,address crAddr,) = COMMUNITY_LIST.communities(uint32(projectID)); myCommunityRegistry = CommunityRegistry(crAddr); VRFShifting = config.VRFShifting; uint256 id; assembly { id := chainid() } chain = id.toString(); _transferOwnership(_actualOwner); _initialized = true; } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. */ function _beforeTokenTransfer( address from, address to, uint256 _tokenId ) internal override { if(from != address(0)) { require(!transferLocked, "Token: Transfers are not enabled"); } super._beforeTokenTransfer(from, to, _tokenId); } /** * @dev Sale: mint cards. * - DEFAULT_ADMIN_ROLE or TOKEN_CONTRACT_ACCESS_SALE */ function mintIncrementalCards(uint256 numberOfCards, address recipient) external onlyAllowed(TOKEN_CONTRACT_ACCESS_SALE) { require(!lastRevealRequested, "Token: Cannot mint after last reveal"); require(mintedSupply + numberOfCards <= maxSupply - reservedSupply, "Token: This would exceed the number of cards available"); uint256 mintId = mintedSupply + 1; for (uint j = 0; j < numberOfCards; j++) { _mint(recipient, mintId++); } mintedSupply+=numberOfCards; } /** * @dev Admin: mint reserved cards. * Should only mint reserved AFTER the sale is over. * - DEFAULT_ADMIN_ROLE or TOKEN_CONTRACT_ACCESS_ADMIN */ function mintReservedCards(uint256 numberOfCards, address recipient) external onlyAllowed(TOKEN_CONTRACT_ACCESS_ADMIN) { require(lastRevealRequested, "Token: Last reveal must be requested first"); require(mintedReserve + numberOfCards <= reservedSupply - giveawaySupply, "Token: This would exceed the number of reserved cards available"); uint256 mintId = mintedSupply + mintedReserve + 1; for (uint j = 0; j < numberOfCards; j++) { _mint(recipient, mintId++); } mintedReserve+=numberOfCards; } /** * @dev DropRegistry util */ function getFirstGiveawayCardId() public view returns (uint256) { return mintedSupply + reservedSupply - giveawaySupply + 1; } /** * @dev DropRegistry: mint specific giveaway card. * Can only mint after reserve has been minted. * - DEFAULT_ADMIN_ROLE or TOKEN_CONTRACT_GIVEAWAY */ function mintGiveawayCard(uint256 _index, address _recipient) external onlyAllowed(TOKEN_CONTRACT_GIVEAWAY) { require(lastRevealRequested, "Token: Last reveal must be requested first"); require(mintedReserve == reservedSupply - giveawaySupply, "Token: Must mint reserved cards first"); uint256 firstIndex = getFirstGiveawayCardId(); require( _index >= firstIndex && _index < firstIndex + giveawaySupply, "Token: Card id not in range"); _mint(_recipient, _index); } /** * @dev Admin: set PreRevealURI * - DEFAULT_ADMIN_ROLE or TOKEN_CONTRACT_ACCESS_ADMIN */ function setPreRevealURI(string calldata _tokenPreRevealURI) external onlyAllowed(TOKEN_CONTRACT_ACCESS_ADMIN) { tokenPreRevealURI = _tokenPreRevealURI; } /** * @dev Admin: set RevealURI * - DEFAULT_ADMIN_ROLE or TOKEN_CONTRACT_ACCESS_ADMIN */ function setRevealURI(string calldata _tokenRevealURI) external onlyAllowed(TOKEN_CONTRACT_ACCESS_ADMIN) { tokenRevealURI = _tokenRevealURI; } function getRandomSource() internal view returns (IRandomNumberProvider) { // console.log("*",useCommunityRandom,address(myCommunityRegistry),myCommunityRegistry.getRegistryAddress(USER_RANDOM)); if (useCommunityRandom) { return IRandomNumberProvider(myCommunityRegistry.getRegistryAddress(USER_RANDOM)); } else { return IRandomNumberProvider(galaxisRegistry.getRegistryAddress(REGISTRY_KEY_RANDOM_CONTRACT)); } } /** * @dev Admin: reveal tokens starting at prev range end to current supply * - DEFAULT_ADMIN_ROLE or TOKEN_CONTRACT_ACCESS_REVEAL */ function revealAtCurrentSupply() external onlyAllowed(TOKEN_CONTRACT_ACCESS_REVEAL) { require(VRFShifting, "Token: VRF Shifting must be enabled"); require(!lastRevealRequested, "Token: Last reveal already requested"); require(reveals[currentRevealCount].RANGE_END < mintedSupply, "Token: Reveal request already exists"); // make sure we have minted at least 1 token, else process() will fail with modulo / div by 0 revealStruct storage currentReveal = reveals[++currentRevealCount]; // if previous RANGE_END does not exist, this is 0 currentReveal.RANGE_START = reveals[currentRevealCount-1].RANGE_END; currentReveal.RANGE_END = mintedSupply; require(currentReveal.RANGE_END - currentReveal.RANGE_START > 0, "Token: requires minted tokens for current range to be at least 1"); // // console.log(mintedSupply , reservedSupply , maxSupply); require(mintedSupply + reservedSupply < maxSupply, "Token: Please request LastReveal"); currentReveal.REQUEST_ID = getRandomSource().requestRandomNumberWithCallback(); requestToRevealId[currentReveal.REQUEST_ID] = currentRevealCount; } /** * @dev Admin: reveal tokens starting at prev range end to: * - if(!VRFShifting) then RANGE_END = maxSupply * - if(VRFShifting) then RANGE_END = maxSupply * * - DEFAULT_ADMIN_ROLE or TOKEN_CONTRACT_ACCESS_REVEAL */ function lastReveal() external onlyAllowed(TOKEN_CONTRACT_ACCESS_REVEAL) { require(!lastRevealRequested, "Token: Last reveal already requested"); require(reveals[currentRevealCount].RANGE_END < maxSupply, "Token: Reveal request already exists"); lastRevealRequested = true; revealStruct storage currentReveal = reveals[++currentRevealCount]; // if previous RANGE_END does not exist, this is 0 currentReveal.RANGE_START = reveals[currentRevealCount-1].RANGE_END; // Normal VRF Shifting process if(VRFShifting) { // since reservedSupply currentReveal.RANGE_END = mintedSupply + reservedSupply; // currentReveal.RANGE_END = maxSupply; require(currentReveal.RANGE_END - currentReveal.RANGE_START > 0, "Token: requires minted tokens for current range to be at least 1"); // console.log("241 ",address(getRandomSource())); currentReveal.REQUEST_ID = getRandomSource().requestRandomNumberWithCallback(); requestToRevealId[currentReveal.REQUEST_ID] = currentRevealCount; } else { require(mintedSupply > 0, "Token: requires minted tokens for current range to be at least 1"); // Non shifted token // Does not do a VRF call // Just sets max supply as revealed and emits RandomProcessed so Metadata Server ca pick it up and reveal things currentReveal.RANDOM_NUM = 0; currentReveal.SHIFT = 0; currentReveal.RANGE_START = 0; currentReveal.RANGE_END = maxSupply; emit RandomProcessed( currentRevealCount, currentReveal.RANDOM_NUM, currentReveal.SHIFT, currentReveal.RANGE_START, currentReveal.RANGE_END ); } } /** * @dev Chainlink VRF callback */ function process(uint256 _random, uint256 _requestId) external { require(VRFShifting, "Token: VRF Shifting must be enabled"); require( msg.sender == address(getRandomSource()), "Token: process() Unauthorised caller" ); // get reveal using _requestId uint16 thisRevealId = requestToRevealId[_requestId]; revealStruct storage thisReveal = reveals[thisRevealId]; require(!thisReveal.processed, "Token: reveal already processed."); if(thisReveal.REQUEST_ID == _requestId) { thisReveal.RANDOM_NUM = _random / 2; // Set msb to zero // in the very rare case where RANDOM_NUM is 0, use currentReveal.RANGE_END / 3 if(thisReveal.RANDOM_NUM == 0) { thisReveal.RANDOM_NUM = thisReveal.RANGE_END * (10 ** 5) / 3; } thisReveal.SHIFT = thisReveal.RANDOM_NUM % ( thisReveal.RANGE_END - thisReveal.RANGE_START ); // in the very rare case where the shifting result is 0, do it again but divide by 3 if(thisReveal.SHIFT == 0) { thisReveal.RANDOM_NUM = thisReveal.RANDOM_NUM / 3; thisReveal.SHIFT = thisReveal.RANDOM_NUM % ( thisReveal.RANGE_END - thisReveal.RANGE_START ); } thisReveal.processed = true; emit RandomProcessed( thisRevealId, thisReveal.RANDOM_NUM, thisReveal.SHIFT, thisReveal.RANGE_START, thisReveal.RANGE_END ); } else revert("Token: Incorrect requestId received"); } function findRevealRangeForN(uint256 n) public view returns (uint16) { for(uint16 i = 1; i <= currentRevealCount; i++) { if(n <= reveals[i].RANGE_END) { return i; } } return 0; } function uri(uint256 n) public view returns (uint256) { uint16 rangeId = findRevealRangeForN(n); // outside ranges if(rangeId == 0) { return n; } revealStruct memory currentReveal = reveals[rangeId]; uint256 shiftedN = n + currentReveal.SHIFT; if (shiftedN <= currentReveal.RANGE_END) { return shiftedN; } return currentReveal.RANGE_START + shiftedN - currentReveal.RANGE_END; } /** * @dev Reserved are always at the end of current minted */ function _reserved(uint256 _tokenId) public view returns (bool) { if(_tokenId > mintedSupply + mintedReserve && _tokenId <= mintedSupply + reservedSupply) { return true; } return false; } /** * @dev Get metadata server url for tokenId */ function tokenURI(uint256 _tokenId) public view override(IToken, ERC721) returns (string memory) { require(_exists(_tokenId) || _reserved(_tokenId), 'Token: Token does not exist'); if(VRFShifting) { uint16 rangeId = findRevealRangeForN(_tokenId); // outside ranges if(rangeId == 0) { return tokenPreRevealURI; } revealStruct memory currentReveal = reveals[rangeId]; // if random number was not set, return pre reveal // TODO: most likely remove this.. as we never get here.. we're already outside range if(currentReveal.RANDOM_NUM == 0) { return tokenPreRevealURI; } } uint256 newTokenId = uri(_tokenId); string memory folder = (newTokenId % 100).toString(); string memory file = newTokenId.toString(); string memory slash = "/"; return string.concat(tokenRevealURI, chain, slash, folder, slash, file); } /** * @dev Admin: Lock / Unlock transfers * - DEFAULT_ADMIN_ROLE or TOKEN_CONTRACT_ACCESS_LOCK */ function setTransferLock(bool _locked) external onlyAllowed(TOKEN_CONTRACT_ACCESS_LOCK) { transferLocked = _locked; emit Locked(_locked); } function hasRole(bytes32 key, address user) public view returns (bool) { return myCommunityRegistry.hasRole(key, user); } /** * @dev Admin: Allow / Dissalow addresses */ modifier onlyAllowed(bytes32 role) { require(isAllowed(role, msg.sender), "Token: Unauthorised"); _; } function isAllowed(bytes32 role, address user) public view returns (bool) { return( user == owner() || hasRole(role, user)); } function tellEverything() external view returns (TokenInfo memory) { revealStruct[] memory _reveals = new revealStruct[](currentRevealCount); for(uint16 i = 1; i <= currentRevealCount; i++) { _reveals[i - 1] = reveals[i]; } uint256 contractManagers_length = contractManagers.length(); address[] memory _managers = new address[](contractManagers_length); for(uint16 i = 0; i < contractManagers_length; i++) { _managers[i] = contractManagers.at(i); } uint256 contractControllers_length = contractControllers.length(); address[] memory _controllers = new address[](contractControllers_length); for(uint16 i = 0; i < contractControllers_length; i++) { _controllers[i] = contractControllers.at(i); } return TokenInfo( name(), symbol(), projectID, maxSupply, mintedSupply, mintedReserve, reservedSupply, giveawaySupply, tokenPreRevealURI, tokenRevealURI, transferLocked, lastRevealRequested, totalSupply(), _reveals, owner(), _managers, _controllers, version(), VRFShifting ); } function getTokenInfoForSale() external view returns (TokenInfoForSale memory) { return TokenInfoForSale( projectID, maxSupply, reservedSupply ); } function name() public view override returns (string memory) { return _name; } function symbol() public view override returns (string memory) { return _symbol; } /** * @dev Admin: set setContractURI * - DEFAULT_ADMIN_ROLE or TOKEN_CONTRACT_ACCESS_ADMIN */ function setContractURI(string memory _contractURI) external onlyAllowed(TOKEN_CONTRACT_ACCESS_ADMIN) { contractURI = _contractURI; emit ContractURIset(_contractURI); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; interface IOperatorFilterRegistry { /** * @notice Returns true if operator is not filtered for a given token, either by address or codeHash. Also returns * true if supplied registrant address is not registered. */ function isOperatorAllowed(address registrant, address operator) external view returns (bool); /** * @notice Registers an address with the registry. May be called by address itself or by EIP-173 owner. */ function register(address registrant) external; /** * @notice Registers an address with the registry and "subscribes" to another address's filtered operators and codeHashes. */ function registerAndSubscribe(address registrant, address subscription) external; /** * @notice Registers an address with the registry and copies the filtered operators and codeHashes from another * address without subscribing. */ function registerAndCopyEntries(address registrant, address registrantToCopy) external; /** * @notice Unregisters an address with the registry and removes its subscription. May be called by address itself or by EIP-173 owner. * Note that this does not remove any filtered addresses or codeHashes. * Also note that any subscriptions to this registrant will still be active and follow the existing filtered addresses and codehashes. */ function unregister(address addr) external; /** * @notice Update an operator address for a registered address - when filtered is true, the operator is filtered. */ function updateOperator(address registrant, address operator, bool filtered) external; /** * @notice Update multiple operators for a registered address - when filtered is true, the operators will be filtered. Reverts on duplicates. */ function updateOperators(address registrant, address[] calldata operators, bool filtered) external; /** * @notice Update a codeHash for a registered address - when filtered is true, the codeHash is filtered. */ function updateCodeHash(address registrant, bytes32 codehash, bool filtered) external; /** * @notice Update multiple codeHashes for a registered address - when filtered is true, the codeHashes will be filtered. Reverts on duplicates. */ function updateCodeHashes(address registrant, bytes32[] calldata codeHashes, bool filtered) external; /** * @notice Subscribe an address to another registrant's filtered operators and codeHashes. Will remove previous * subscription if present. * Note that accounts with subscriptions may go on to subscribe to other accounts - in this case, * subscriptions will not be forwarded. Instead the former subscription's existing entries will still be * used. */ function subscribe(address registrant, address registrantToSubscribe) external; /** * @notice Unsubscribe an address from its current subscribed registrant, and optionally copy its filtered operators and codeHashes. */ function unsubscribe(address registrant, bool copyExistingEntries) external; /** * @notice Get the subscription address of a given registrant, if any. */ function subscriptionOf(address addr) external returns (address registrant); /** * @notice Get the set of addresses subscribed to a given registrant. * Note that order is not guaranteed as updates are made. */ function subscribers(address registrant) external returns (address[] memory); /** * @notice Get the subscriber at a given index in the set of addresses subscribed to a given registrant. * Note that order is not guaranteed as updates are made. */ function subscriberAt(address registrant, uint256 index) external returns (address); /** * @notice Copy filtered operators and codeHashes from a different registrantToCopy to addr. */ function copyEntriesOf(address registrant, address registrantToCopy) external; /** * @notice Returns true if operator is filtered by a given address or its subscription. */ function isOperatorFiltered(address registrant, address operator) external returns (bool); /** * @notice Returns true if the hash of an address's code is filtered by a given address or its subscription. */ function isCodeHashOfFiltered(address registrant, address operatorWithCode) external returns (bool); /** * @notice Returns true if a codeHash is filtered by a given address or its subscription. */ function isCodeHashFiltered(address registrant, bytes32 codeHash) external returns (bool); /** * @notice Returns a list of filtered operators for a given address or its subscription. */ function filteredOperators(address addr) external returns (address[] memory); /** * @notice Returns the set of filtered codeHashes for a given address or its subscription. * Note that order is not guaranteed as updates are made. */ function filteredCodeHashes(address addr) external returns (bytes32[] memory); /** * @notice Returns the filtered operator at the given index of the set of filtered operators for a given address or * its subscription. * Note that order is not guaranteed as updates are made. */ function filteredOperatorAt(address registrant, uint256 index) external returns (address); /** * @notice Returns the filtered codeHash at the given index of the list of filtered codeHashes for a given address or * its subscription. * Note that order is not guaranteed as updates are made. */ function filteredCodeHashAt(address registrant, uint256 index) external returns (bytes32); /** * @notice Returns true if an address has registered */ function isRegistered(address addr) external returns (bool); /** * @dev Convenience method to compute the code hash of an arbitrary contract */ function codeHashOf(address addr) external returns (bytes32); }
{ "optimizer": { "enabled": true, "runs": 200 }, "evmVersion": "paris", "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_galaxisRegistry","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"OperatorNotAllowed","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"contractURI","type":"string"}],"name":"ContractURIset","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"","type":"bool"}],"name":"Locked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"stage","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"randNumber","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_shiftsBy","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_start","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_end","type":"uint256"}],"name":"RandomProcessed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_address","type":"address"},{"indexed":false,"internalType":"bool","name":"mode","type":"bool"}],"name":"contractControllerEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_address","type":"address"},{"indexed":false,"internalType":"bool","name":"mode","type":"bool"}],"name":"contractManagerEvent","type":"event"},{"inputs":[],"name":"DEFAULT_SUBSCRIPTION","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"OPERATOR_FILTER_REGISTRY","outputs":[{"internalType":"contract IOperatorFilterRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"OSFiltering","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"REGISTRY_KEY_RANDOM_CONTRACT","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TOKEN_CONTRACT_ACCESS_ADMIN","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TOKEN_CONTRACT_ACCESS_LOCK","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TOKEN_CONTRACT_ACCESS_REVEAL","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TOKEN_CONTRACT_ACCESS_SALE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TOKEN_CONTRACT_GIVEAWAY","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"USER_RANDOM","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"VRFShifting","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"_reserved","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"chain","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"contractURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentRevealCount","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"n","type":"uint256"}],"name":"findRevealRangeForN","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"galaxisRegistry","outputs":[{"internalType":"contract IRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getFirstGiveawayCardId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTokenInfoForSale","outputs":[{"components":[{"internalType":"uint256","name":"projectID","type":"uint256"},{"internalType":"uint256","name":"maxSupply","type":"uint256"},{"internalType":"uint256","name":"reservedSupply","type":"uint256"}],"internalType":"struct TokenInfoForSale","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"giveawaySupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"key","type":"bytes32"},{"internalType":"address","name":"user","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"projectID","type":"uint256"},{"internalType":"uint256","name":"maxSupply","type":"uint256"},{"internalType":"string","name":"erc721name","type":"string"},{"internalType":"string","name":"erc721symbol","type":"string"},{"internalType":"string","name":"tokenPreRevealURI","type":"string"},{"internalType":"string","name":"tokenRevealURI","type":"string"},{"internalType":"bool","name":"transferLocked","type":"bool"},{"internalType":"uint256","name":"reservedSupply","type":"uint256"},{"internalType":"uint256","name":"giveawaySupply","type":"uint256"},{"internalType":"bool","name":"VRFShifting","type":"bool"}],"internalType":"struct TokenConstructorConfig","name":"config","type":"tuple"},{"internalType":"address","name":"_actualOwner","type":"address"}],"name":"init","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"user","type":"address"}],"name":"isAllowed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastReveal","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lastRevealRequested","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_index","type":"uint256"},{"internalType":"address","name":"_recipient","type":"address"}],"name":"mintGiveawayCard","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"numberOfCards","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"}],"name":"mintIncrementalCards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"numberOfCards","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"}],"name":"mintReservedCards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"mintedReserve","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mintedSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"myCommunityRegistry","outputs":[{"internalType":"contract CommunityRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_random","type":"uint256"},{"internalType":"uint256","name":"_requestId","type":"uint256"}],"name":"process","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"projectID","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"requestToRevealId","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"reservedSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_tracker","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"retrieve721","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_tracker","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"retrieveERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"retrieveETH","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"revealAtCurrentSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"revealURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"","type":"uint16"}],"name":"reveals","outputs":[{"internalType":"uint256","name":"REQUEST_ID","type":"uint256"},{"internalType":"uint256","name":"RANDOM_NUM","type":"uint256"},{"internalType":"uint256","name":"SHIFT","type":"uint256"},{"internalType":"uint256","name":"RANGE_START","type":"uint256"},{"internalType":"uint256","name":"RANGE_END","type":"uint256"},{"internalType":"bool","name":"processed","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_contractURI","type":"string"}],"name":"setContractURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_tokenPreRevealURI","type":"string"}],"name":"setPreRevealURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_tokenRevealURI","type":"string"}],"name":"setRevealURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_locked","type":"bool"}],"name":"setTransferLock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tellEverything","outputs":[{"components":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"uint256","name":"projectID","type":"uint256"},{"internalType":"uint256","name":"maxSupply","type":"uint256"},{"internalType":"uint256","name":"mintedSupply","type":"uint256"},{"internalType":"uint256","name":"mintedReserve","type":"uint256"},{"internalType":"uint256","name":"reservedSupply","type":"uint256"},{"internalType":"uint256","name":"giveawaySupply","type":"uint256"},{"internalType":"string","name":"tokenPreRevealURI","type":"string"},{"internalType":"string","name":"tokenRevealURI","type":"string"},{"internalType":"bool","name":"transferLocked","type":"bool"},{"internalType":"bool","name":"lastRevealRequested","type":"bool"},{"internalType":"uint256","name":"totalSupply","type":"uint256"},{"components":[{"internalType":"uint256","name":"REQUEST_ID","type":"uint256"},{"internalType":"uint256","name":"RANDOM_NUM","type":"uint256"},{"internalType":"uint256","name":"SHIFT","type":"uint256"},{"internalType":"uint256","name":"RANGE_START","type":"uint256"},{"internalType":"uint256","name":"RANGE_END","type":"uint256"},{"internalType":"bool","name":"processed","type":"bool"}],"internalType":"struct revealStruct[]","name":"reveals","type":"tuple[]"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"address[]","name":"managers","type":"address[]"},{"internalType":"address[]","name":"controllers","type":"address[]"},{"internalType":"uint256","name":"version","type":"uint256"},{"internalType":"bool","name":"VRFShifting","type":"bool"}],"internalType":"struct TokenInfo","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"toggleOSFilterOperatorState","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenPreRevealURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenRevealURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"transferLocked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"n","type":"uint256"}],"name":"uri","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"useCommunityRandom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"version","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"}]
Contract Creation Code
60a060405260228054743cc6cdda760b79bafa08df41ecfa224f810dceb6016001600160a81b0319909116179055602380546001600160a01b0319166daaeb6d7670e522a718067333cd4e17905534801561005957600080fd5b50604051614ce6380380614ce68339810160408190526100789161016a565b80806040518060400160405280601581526020017f474f4c44454e5f544f4b454e5f434f4e545241435400000000000000000000008152506040518060400160405280600281526020016111d560f21b81525081600090816100da919061023b565b5060016100e7828261023b565b5050506101006100fb61011460201b60201c565b610118565b6001600160a01b0316608052506102fa9050565b3390565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60006020828403121561017c57600080fd5b81516001600160a01b038116811461019357600080fd5b9392505050565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806101c457607f821691505b6020821081036101e457634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115610236576000816000526020600020601f850160051c810160208610156102135750805b601f850160051c820191505b818110156102325782815560010161021f565b5050505b505050565b81516001600160401b038111156102545761025461019a565b6102688161026284546101b0565b846101ea565b602080601f83116001811461029d57600084156102855750858301515b600019600386901b1c1916600185901b178555610232565b600085815260208120601f198616915b828110156102cc578886015182559484019460019091019084016102ad565b50858210156102ea5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6080516149ca61031c600039600081816106770152612fd101526149ca6000f3fe608060405234801561001057600080fd5b50600436106104335760003560e01c8063938e3d7b11610236578063c763e5a11161013b578063e9419325116100c3578063f2fde38b11610087578063f2fde38b146109dc578063f9c0611c146109ef578063fbd106f914610a07578063fc83b82714610a1c578063fd6a382e14610a4357600080fd5b8063e941932514610953578063e985e9c514610966578063ea09e473146109a2578063ea9d6824146109cc578063ee198b97146109d457600080fd5b8063d5b014c31161010a578063d5b014c3146108ec578063dbd5fd9b146108f4578063e288e73314610918578063e7713baa14610921578063e8a3d4851461094b57600080fd5b8063c763e5a1146108b5578063c87b56dd146108bd578063d255fe03146108d0578063d5abeb01146108e357600080fd5b8063a4b744e2116101be578063afa88e551161018d578063afa88e551461086c578063b88d4fde1461087e578063bcc0f72514610891578063bff3561814610899578063c1bd8cf9146108ac57600080fd5b8063a4b744e21461082b578063a5b3abfb1461083e578063a811a37b14610851578063abb8def31461086457600080fd5b806398f5b2381161020557806398f5b238146107605780639c30ea51146107d55780639d759d5f146107de5780639e0f0018146107f1578063a22cb4651461081857600080fd5b8063938e3d7b1461072b5780639456d7271461073e57806395d89b41146107505780639871d6fa1461075857600080fd5b806342842e0e1161033c57806370a08231116102c45780637f72f036116102935780637f72f036146106ba57806382027b6d146106cd5780638da5cb5b146106e05780638ffc20e2146106f157806391d148541461071857600080fd5b806370a0823114610657578063715018a61461066a5780637671114d1461067257806377d4b5041461069957600080fd5b80634f6ccce71161030b5780634f6ccce7146105ed57806354fd4d50146106005780636352211e1461060a57806366d47d841461061d57806369b2b9a71461064457600080fd5b806342842e0e1461059e578063432e2006146105b157806344d19d2b146105b95780634cf29258146105c257600080fd5b806317fd1e2f116103bf5780632a85db551161038e5780632a85db551461053d5780632f151b76146105505780632f745c59146105655780633f5916561461057857806341f434341461058b57600080fd5b806317fd1e2f146104fc57806318160ddd1461050f5780631f4bc79d1461051757806323b872dd1461052a57600080fd5b8063095ea7b311610406578063095ea7b3146104b75780630e89341c146104cc57806310d51dd9146104df57806312686aae146104e7578063160fba56146104f457600080fd5b806301ffc9a7146104385780630677ef811461046057806306fdde0314610477578063081812fc1461048c575b600080fd5b61044b6104463660046139f8565b610a50565b60405190151581526020015b60405180910390f35b610469600e5481565b604051908152602001610457565b61047f610a7b565b6040516104579190613a65565b61049f61049a366004613a78565b610b0d565b6040516001600160a01b039091168152602001610457565b6104ca6104c5366004613ab6565b610b34565b005b6104696104da366004613a78565b610b56565b61047f610c1c565b60135461044b9060ff1681565b61047f610caa565b6104ca61050a366004613ab6565b610cb7565b600854610469565b61044b610525366004613a78565b610d35565b6104ca610538366004613ae2565b610d79565b6104ca61054b366004613b23565b610dad565b610558610dfe565b6040516104579190613c40565b610469610573366004613ab6565b611347565b6104ca610586366004613de0565b6113dd565b60235461049f906001600160a01b031681565b6104ca6105ac366004613ae2565b611672565b6104696116a6565b610469600f5481565b61047f6040518060400160405280600c81526020016b052414e444f4d56325f5353560a41b81525081565b6104696105fb366004613a78565b6116d5565b6378a4676d610469565b61049f610618366004613a78565b611768565b6104697f78095cc8201dcba39b170f4873756afcc9c5fe4c54fba1731ca3be8a9544e76b81565b6104ca610652366004613e02565b6117c8565b610469610665366004613e32565b611957565b6104ca6119dd565b61049f7f000000000000000000000000000000000000000000000000000000000000000081565b6017546106a79061ffff1681565b60405161ffff9091168152602001610457565b6106a76106c8366004613a78565b6119f1565b61044b6106db366004613e02565b611a45565b600a546001600160a01b031661049f565b6104697f7d4398cf7d551d8cb071f228c3b0838dfaf546b384e93039ea180fba606dfac381565b61044b610726366004613e02565b611a84565b6104ca610739366004613f43565b611afa565b60195461044b90610100900460ff1681565b61047f611b77565b6104ca611b86565b6107a661076e366004613f77565b601460205260009081526040902080546001820154600283015460038401546004850154600590950154939492939192909160ff1686565b6040805196875260208701959095529385019290925260608401526080830152151560a082015260c001610457565b610469600b5481565b601d5461049f906001600160a01b031681565b6104697f2f237764fc2d5c1022c2b3369211bf066f9f9b112c1a699afe91573a989d407f81565b6104ca610826366004613fb4565b611e3d565b6104ca610839366004613fe2565b611e5b565b6104ca61084c366004613ab6565b611ee4565b6104ca61085f366004613b23565b611f56565b6104ca611f98565b60135461044b90610100900460ff1681565b6104ca61088c36600461411c565b611fb4565b61047f611fe9565b6104ca6108a736600461419b565b611ff6565b610469600d5481565b61047f61207e565b61047f6108cb366004613a78565b61208b565b6104ca6108de366004613e02565b61233d565b610469600c5481565b6104ca612496565b6106a7610902366004613a78565b60156020526000908152604090205461ffff1681565b61046960105481565b6109296124cd565b6040805182518152602080840151908201529181015190820152606001610457565b61047f612517565b6104ca610961366004613e02565b612524565b61044b6109743660046141b8565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b61047f6040518060400160405280600b81526020016a555345525f52414e444f4d60a81b81525081565b6104ca612665565b61044b600181565b6104ca6109ea366004613e32565b6128de565b60225461049f9061010090046001600160a01b031681565b61046960008051602061497583398151915281565b6104697fdbd612d55a9aa50e9cdaf6dcccb9ec8386fea10c2783e3ba35c8652cd4932d7c81565b60225461044b9060ff1681565b60006001600160e01b0319821663780e9d6360e01b1480610a755750610a7582612954565b92915050565b6060601b8054610a8a906141e6565b80601f0160208091040260200160405190810160405280929190818152602001828054610ab6906141e6565b8015610b035780601f10610ad857610100808354040283529160200191610b03565b820191906000526020600020905b815481529060010190602001808311610ae657829003601f168201915b5050505050905090565b6000610b18826129a4565b506000908152600460205260409020546001600160a01b031690565b60225460ff1615610b4857610b4882612a03565b610b528282612ab1565b5050565b600080610b62836119f1565b90508061ffff16600003610b77575090919050565b61ffff81166000908152601460209081526040808320815160c08101835281548152600182015493810193909352600281015491830182905260038101546060840152600481015460808401526005015460ff16151560a0830152909190610bdf9086614236565b905081608001518111610bf457949350505050565b8160800151818360600151610c099190614236565b610c139190614249565b95945050505050565b60128054610c29906141e6565b80601f0160208091040260200160405190810160405280929190818152602001828054610c55906141e6565b8015610ca25780601f10610c7757610100808354040283529160200191610ca2565b820191906000526020600020905b815481529060010190602001808311610c8557829003601f168201915b505050505081565b60168054610c29906141e6565b610cbf612bc1565b60405163a9059cbb60e01b8152336004820152602481018290526001600160a01b0383169063a9059cbb906044016020604051808303816000875af1158015610d0c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d30919061425c565b505050565b6000600e54600d54610d479190614236565b82118015610d645750600f54600d54610d609190614236565b8211155b15610d7157506001919050565b506000919050565b60225460ff168015610d9457506001600160a01b0383163314155b15610da257610da233612a03565b610d30838383612c1b565b600080516020614975833981519152610dc68133611a45565b610deb5760405162461bcd60e51b8152600401610de290614279565b60405180910390fd5b6011610df88385836142ee565b50505050565b610ea260405180610260016040528060608152602001606081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016060815260200160608152602001600015158152602001600015158152602001600081526020016060815260200160006001600160a01b031681526020016060815260200160608152602001600081526020016000151581525090565b60175460009061ffff166001600160401b03811115610ec357610ec3613e4f565b604051908082528060200260200182016040528015610f2f57816020015b610f1c6040518060c0016040528060008152602001600081526020016000815260200160008152602001600081526020016000151581525090565b815260200190600190039081610ee15790505b50905060015b60175461ffff90811690821611610fe25761ffff8116600090815260146020908152604091829020825160c081018452815481526001808301549382019390935260028201549381019390935260038101546060840152600481015460808401526005015460ff16151560a08301528390610fb090846143ae565b61ffff1681518110610fc457610fc46143d0565b60200260200101819052508080610fda906143e6565b915050610f35565b506000610fef6020612c4c565b90506000816001600160401b0381111561100b5761100b613e4f565b604051908082528060200260200182016040528015611034578160200160208202803683370190505b50905060005b828161ffff16101561109557611055602061ffff8316612c56565b828261ffff168151811061106b5761106b6143d0565b6001600160a01b03909216602092830291909101909101528061108d816143e6565b91505061103a565b5060006110a2601e612c4c565b90506000816001600160401b038111156110be576110be613e4f565b6040519080825280602002602001820160405280156110e7578160200160208202803683370190505b50905060005b828161ffff16101561114857611108601e61ffff8316612c56565b828261ffff168151811061111e5761111e6143d0565b6001600160a01b039092166020928302919091019091015280611140816143e6565b9150506110ed565b5060405180610260016040528061115d610a7b565b815260200161116a611b77565b8152602001600b548152602001600c548152602001600d548152602001600e548152602001600f5481526020016010548152602001601180546111ac906141e6565b80601f01602080910402602001604051908101604052809291908181526020018280546111d8906141e6565b80156112255780601f106111fa57610100808354040283529160200191611225565b820191906000526020600020905b81548152906001019060200180831161120857829003601f168201915b505050505081526020016012805461123c906141e6565b80601f0160208091040260200160405190810160405280929190818152602001828054611268906141e6565b80156112b55780601f1061128a576101008083540402835291602001916112b5565b820191906000526020600020905b81548152906001019060200180831161129857829003601f168201915b505050918352505060135460ff8082161515602084015261010090910416151560408201526060016112e660085490565b8152602001868152602001611303600a546001600160a01b031690565b6001600160a01b031681526020018481526020018281526020016113286378a4676d90565b8152601954610100900460ff1615156020909101529695505050505050565b600061135283611957565b82106113b45760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b6064820152608401610de2565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b601954610100900460ff166114045760405162461bcd60e51b8152600401610de290614407565b61140c612c62565b6001600160a01b0316336001600160a01b0316146114785760405162461bcd60e51b8152602060048201526024808201527f546f6b656e3a2070726f63657373282920556e617574686f7269736564206361604482015263363632b960e11b6064820152608401610de2565b60008181526015602090815260408083205461ffff168084526014909252909120600581015460ff16156114ee5760405162461bcd60e51b815260206004820181905260248201527f546f6b656e3a2072657665616c20616c72656164792070726f6365737365642e6044820152606401610de2565b805483900361161e57611502600285614460565b600182018190556000036115355760038160040154620186a06115259190614474565b61152f9190614460565b60018201555b806003015481600401546115499190614249565b8160010154611558919061448b565b600282018190556000036115a557600381600101546115779190614460565b6001820155600381015460048201546115909190614249565b816001015461159f919061448b565b60028201555b60058101805460ff191660019081179091558101546002820154600383015460048401546040805161ffff881681526020810195909552840192909252606083015260808201527f959b44b0b513e15fb6ff0120336443b895d08969842e3aed3ac22eb9e933f7b39060a00160405180910390a1610df8565b60405162461bcd60e51b815260206004820152602360248201527f546f6b656e3a20496e636f7272656374207265717565737449642072656365696044820152621d995960ea1b6064820152608401610de2565b60225460ff16801561168d57506001600160a01b0383163314155b1561169b5761169b33612a03565b610d30838383612cf3565b6000601054600f54600d546116bb9190614236565b6116c59190614249565b6116d0906001614236565b905090565b60006116e060085490565b82106117435760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b6064820152608401610de2565b60088281548110611756576117566143d0565b90600052602060002001549050919050565b6000818152600260205260408120546001600160a01b031680610a755760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610de2565b7f78095cc8201dcba39b170f4873756afcc9c5fe4c54fba1731ca3be8a9544e76b6117f38133611a45565b61180f5760405162461bcd60e51b8152600401610de290614279565b601354610100900460ff16156118735760405162461bcd60e51b8152602060048201526024808201527f546f6b656e3a2043616e6e6f74206d696e74206166746572206c6173742072656044820152631d99585b60e21b6064820152608401610de2565b600f54600c546118839190614249565b83600d546118919190614236565b11156118fe5760405162461bcd60e51b815260206004820152603660248201527f546f6b656e3a205468697320776f756c642065786365656420746865206e756d604482015275626572206f6620636172647320617661696c61626c6560501b6064820152608401610de2565b6000600d54600161190f9190614236565b905060005b8481101561193957611931848361192a8161449f565b9450612d0e565b600101611914565b5083600d600082825461194c9190614236565b909155505050505050565b60006001600160a01b0382166119c15760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152608401610de2565b506001600160a01b031660009081526003602052604090205490565b6119e5612bc1565b6119ef6000612e5c565b565b600060015b60175461ffff90811690821611611a3c5761ffff81166000908152601460205260409020600401548311611a2a5792915050565b80611a34816143e6565b9150506119f6565b50600092915050565b6000611a59600a546001600160a01b031690565b6001600160a01b0316826001600160a01b03161480611a7d5750611a7d8383611a84565b9392505050565b601d54604051632474521560e21b8152600481018490526001600160a01b03838116602483015260009216906391d1485490604401602060405180830381865afa158015611ad6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a7d919061425c565b600080516020614975833981519152611b138133611a45565b611b2f5760405162461bcd60e51b8152600401610de290614279565b6018611b3b83826144b8565b507f74c497646a57fa0eeedc14ff6eec2da957c18c9c77881fe1aff368249b52b5c182604051611b6b9190613a65565b60405180910390a15050565b6060601c8054610a8a906141e6565b7f2f237764fc2d5c1022c2b3369211bf066f9f9b112c1a699afe91573a989d407f611bb18133611a45565b611bcd5760405162461bcd60e51b8152600401610de290614279565b601354610100900460ff1615611bf55760405162461bcd60e51b8152600401610de290614577565b600c5460175461ffff1660009081526014602052604090206004015410611c2e5760405162461bcd60e51b8152600401610de2906145bb565b6013805461ff001916610100179055601780546000916014918391908290611c599061ffff166143e6565b825461ffff9182166101009390930a8381029083021990911617909255825260208201929092526040016000908120601754909350601492611c9e91600191166143ae565b61ffff1681526020810191909152604001600020600401546003820155601954610100900460ff1615611da857600f54600d54611cdb9190614236565b600482018190556003820154600091611cf49190614249565b11611d115760405162461bcd60e51b8152600401610de2906145ff565b611d19612c62565b6001600160a01b031663c532bbac6040518163ffffffff1660e01b81526004016020604051808303816000875af1158015611d58573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d7c919061465d565b808255601754600091825260156020526040909120805461ffff191661ffff9092169190911790555050565b6000600d5411611dca5760405162461bcd60e51b8152600401610de2906145ff565b6000600182018190556002820181905560038201819055600c54600483018190556017546040805161ffff9092168252602082018490528101839052606081019290925260808201527f959b44b0b513e15fb6ff0120336443b895d08969842e3aed3ac22eb9e933f7b39060a001611b6b565b60225460ff1615611e5157611e5182612a03565b610b528282612eae565b6023546001600160a01b03163b15611eda57602354602254604051633e9f1edf60e11b81523060048201526001600160a01b0361010090920482166024820152911690637d3e3dbe90604401600060405180830381600087803b158015611ec157600080fd5b505af1158015611ed5573d6000803e3d6000fd5b505050505b610b528282612eb9565b611eec612bc1565b6040516323b872dd60e01b8152306004820152336024820152604481018290526001600160a01b038316906323b872dd90606401600060405180830381600087803b158015611f3a57600080fd5b505af1158015611f4e573d6000803e3d6000fd5b505050505050565b600080516020614975833981519152611f6f8133611a45565b611f8b5760405162461bcd60e51b8152600401610de290614279565b6012610df88385836142ee565b611fa0612bc1565b6022805460ff19811660ff90911615179055565b60225460ff168015611fcf57506001600160a01b0384163314155b15611fdd57611fdd33612a03565b610df884848484613134565b60118054610c29906141e6565b7f7d4398cf7d551d8cb071f228c3b0838dfaf546b384e93039ea180fba606dfac36120218133611a45565b61203d5760405162461bcd60e51b8152600401610de290614279565b6013805460ff19168315159081179091556040519081527fe3f0ec9c4af57e69d5aeff78a5912ca25733e4458710bab2b55d0985e98aeb5e90602001611b6b565b601a8054610c29906141e6565b6000818152600260205260409020546060906001600160a01b03161515806120b757506120b782610d35565b6121035760405162461bcd60e51b815260206004820152601b60248201527f546f6b656e3a20546f6b656e20646f6573206e6f7420657869737400000000006044820152606401610de2565b601954610100900460ff16156122b757600061211e836119f1565b90508061ffff166000036121bf5760118054612139906141e6565b80601f0160208091040260200160405190810160405280929190818152602001828054612165906141e6565b80156121b25780601f10612187576101008083540402835291602001916121b2565b820191906000526020600020905b81548152906001019060200180831161219557829003601f168201915b5050505050915050919050565b61ffff81166000908152601460209081526040808320815160c08101835281548152600182015493810184905260028201549281019290925260038101546060830152600481015460808301526005015460ff16151560a082015291036122b4576011805461222d906141e6565b80601f0160208091040260200160405190810160405280929190818152602001828054612259906141e6565b80156122a65780601f1061227b576101008083540402835291602001916122a6565b820191906000526020600020905b81548152906001019060200180831161228957829003601f168201915b505050505092505050919050565b50505b60006122c283610b56565b905060006122d96122d460648461448b565b613166565b905060006122e683613166565b90506000604051806040016040528060018152602001602f60f81b81525090506012601a82858486604051602001612323969594939291906146e9565b604051602081830303815290604052945050505050919050565b7fdbd612d55a9aa50e9cdaf6dcccb9ec8386fea10c2783e3ba35c8652cd4932d7c6123688133611a45565b6123845760405162461bcd60e51b8152600401610de290614279565b601354610100900460ff166123ab5760405162461bcd60e51b8152600401610de290614754565b601054600f546123bb9190614249565b600e54146124195760405162461bcd60e51b815260206004820152602560248201527f546f6b656e3a204d757374206d696e7420726573657276656420636172647320604482015264199a5c9cdd60da1b6064820152608401610de2565b60006124236116a6565b9050808410158015612440575060105461243d9082614236565b84105b61248c5760405162461bcd60e51b815260206004820152601b60248201527f546f6b656e3a2043617264206964206e6f7420696e2072616e676500000000006044820152606401610de2565b610df88385612d0e565b61249e612bc1565b60405133904780156108fc02916000818181858888f193505050501580156124ca573d6000803e3d6000fd5b50565b6124f160405180606001604052806000815260200160008152602001600081525090565b6040518060600160405280600b548152602001600c548152602001600f54815250905090565b60188054610c29906141e6565b60008051602061497583398151915261253d8133611a45565b6125595760405162461bcd60e51b8152600401610de290614279565b601354610100900460ff166125805760405162461bcd60e51b8152600401610de290614754565b601054600f546125909190614249565b83600e5461259e9190614236565b11156126125760405162461bcd60e51b815260206004820152603f60248201527f546f6b656e3a205468697320776f756c642065786365656420746865206e756d60448201527f626572206f6620726573657276656420636172647320617661696c61626c65006064820152608401610de2565b6000600e54600d546126249190614236565b61262f906001614236565b905060005b848110156126525761264a848361192a8161449f565b600101612634565b5083600e600082825461194c9190614236565b7f2f237764fc2d5c1022c2b3369211bf066f9f9b112c1a699afe91573a989d407f6126908133611a45565b6126ac5760405162461bcd60e51b8152600401610de290614279565b601954610100900460ff166126d35760405162461bcd60e51b8152600401610de290614407565b601354610100900460ff16156126fb5760405162461bcd60e51b8152600401610de290614577565b600d5460175461ffff16600090815260146020526040902060040154106127345760405162461bcd60e51b8152600401610de2906145bb565b6017805460009160149183919082906127509061ffff166143e6565b825461ffff9182166101009390930a838102908302199091161790925582526020820192909252604001600090812060175490935060149261279591600191166143ae565b61ffff1681526020810191909152604001600090812060049081015460038401819055600d549184018290556127ca91614249565b116127e75760405162461bcd60e51b8152600401610de2906145ff565b600c54600f54600d546127fa9190614236565b106128475760405162461bcd60e51b815260206004820181905260248201527f546f6b656e3a20506c656173652072657175657374204c61737452657665616c6044820152606401610de2565b61284f612c62565b6001600160a01b031663c532bbac6040518163ffffffff1660e01b81526004016020604051808303816000875af115801561288e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128b2919061465d565b90819055601754600091825260156020526040909120805461ffff191661ffff90921691909117905550565b6128e6612bc1565b6001600160a01b03811661294b5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610de2565b6124ca81612e5c565b60006001600160e01b031982166380ac58cd60e01b148061298557506001600160e01b03198216635b5e139f60e01b145b80610a7557506301ffc9a760e01b6001600160e01b0319831614610a75565b6000818152600260205260409020546001600160a01b03166124ca5760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610de2565b6023546001600160a01b03163b156124ca57602354604051633185c44d60e21b81523060048201526001600160a01b0383811660248301529091169063c617113490604401602060405180830381865afa158015612a65573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a89919061425c565b6124ca57604051633b79c77360e21b81526001600160a01b0382166004820152602401610de2565b6000612abc82611768565b9050806001600160a01b0316836001600160a01b031603612b295760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610de2565b336001600160a01b0382161480612b455750612b458133610974565b612bb75760405162461bcd60e51b815260206004820152603e60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206e6f7220617070726f76656420666f7220616c6c00006064820152608401610de2565b610d30838361326e565b600a546001600160a01b031633146119ef5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610de2565b612c2533826132dc565b612c415760405162461bcd60e51b8152600401610de29061479e565b610d3083838361335a565b6000610a75825490565b6000611a7d8383613501565b6000601d54604080518082018252600b81526a555345525f52414e444f4d60a81b60208201529051631d2e660b60e21b81526001600160a01b03909216916374b9982c91612cb291600401613a65565b602060405180830381865afa158015612ccf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116d091906147ec565b610d3083838360405180602001604052806000815250611fb4565b6001600160a01b038216612d645760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610de2565b6000818152600260205260409020546001600160a01b031615612dc95760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610de2565b612dd56000838361352b565b6001600160a01b0382166000908152600360205260408120805460019290612dfe908490614236565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b610b52338383613598565b60195460ff1615612f185760405162461bcd60e51b815260206004820152602360248201527f546f6b656e3a20436f6e747261637420616c726561647920696e697469616c696044820152621e995960ea1b6064820152608401610de2565b6040820151601b90612f2a90826144b8565b506060820151601c90612f3d90826144b8565b508151600b556080820151601190612f5590826144b8565b5060a0820151601290612f6890826144b8565b50602082810151600c5560c08301516013805460ff191691151591909117905560e0830151600f55610100830151601055604051631d2e660b60e21b81526004810191909152600e60248201526d10d3d353555392551657d31254d560921b60448201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906374b9982c90606401602060405180830381865afa158015613020573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061304491906147ec565b600b5460405163d0f4a53760e01b815263ffffffff90911660048201529091506000906001600160a01b0383169063d0f4a53790602401600060405180830381865afa158015613098573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526130c09190810190614809565b50601d80546001600160a01b0319166001600160a01b0383161790556101208601516019805461ff00191661010092151592909202919091179055915046905061310981613166565b601a9061311690826144b8565b5061312084612e5c565b50506019805460ff19166001179055505050565b61313e33836132dc565b61315a5760405162461bcd60e51b8152600401610de29061479e565b610df884848484613666565b60608160000361318d5750506040805180820190915260018152600360fc1b602082015290565b8160005b81156131b757806131a18161449f565b91506131b09050600a83614460565b9150613191565b6000816001600160401b038111156131d1576131d1613e4f565b6040519080825280601f01601f1916602001820160405280156131fb576020820181803683370190505b5090505b841561326657613210600183614249565b915061321d600a8661448b565b613228906030614236565b60f81b81838151811061323d5761323d6143d0565b60200101906001600160f81b031916908160001a90535061325f600a86614460565b94506131ff565b949350505050565b600081815260046020526040902080546001600160a01b0319166001600160a01b03841690811790915581906132a382611768565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000806132e883611768565b9050806001600160a01b0316846001600160a01b0316148061332f57506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b806132665750836001600160a01b031661334884610b0d565b6001600160a01b031614949350505050565b826001600160a01b031661336d82611768565b6001600160a01b0316146133d15760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b6064820152608401610de2565b6001600160a01b0382166134335760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610de2565b61343e83838361352b565b61344960008261326e565b6001600160a01b0383166000908152600360205260408120805460019290613472908490614249565b90915550506001600160a01b03821660009081526003602052604081208054600192906134a0908490614236565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6000826000018281548110613518576135186143d0565b9060005260206000200154905092915050565b6001600160a01b0383161561358d5760135460ff161561358d5760405162461bcd60e51b815260206004820181905260248201527f546f6b656e3a205472616e736665727320617265206e6f7420656e61626c65646044820152606401610de2565b610d30838383613699565b816001600160a01b0316836001600160a01b0316036135f95760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610de2565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b61367184848461335a565b61367d84848484613751565b610df85760405162461bcd60e51b8152600401610de2906148b2565b6001600160a01b0383166136f4576136ef81600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b613717565b816001600160a01b0316836001600160a01b031614613717576137178382613852565b6001600160a01b03821661372e57610d30816138ef565b826001600160a01b0316826001600160a01b031614610d3057610d30828261399e565b60006001600160a01b0384163b1561384757604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290613795903390899088908890600401614904565b6020604051808303816000875af19250505080156137d0575060408051601f3d908101601f191682019092526137cd91810190614941565b60015b61382d573d8080156137fe576040519150601f19603f3d011682016040523d82523d6000602084013e613803565b606091505b5080516000036138255760405162461bcd60e51b8152600401610de2906148b2565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050613266565b506001949350505050565b6000600161385f84611957565b6138699190614249565b6000838152600760205260409020549091508082146138bc576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b60085460009061390190600190614249565b60008381526009602052604081205460088054939450909284908110613929576139296143d0565b90600052602060002001549050806008838154811061394a5761394a6143d0565b60009182526020808320909101929092558281526009909152604080822084905585825281205560088054806139825761398261495e565b6001900381819060005260206000200160009055905550505050565b60006139a983611957565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b6001600160e01b0319811681146124ca57600080fd5b600060208284031215613a0a57600080fd5b8135611a7d816139e2565b60005b83811015613a30578181015183820152602001613a18565b50506000910152565b60008151808452613a51816020860160208601613a15565b601f01601f19169290920160200192915050565b602081526000611a7d6020830184613a39565b600060208284031215613a8a57600080fd5b5035919050565b6001600160a01b03811681146124ca57600080fd5b8035613ab181613a91565b919050565b60008060408385031215613ac957600080fd5b8235613ad481613a91565b946020939093013593505050565b600080600060608486031215613af757600080fd5b8335613b0281613a91565b92506020840135613b1281613a91565b929592945050506040919091013590565b60008060208385031215613b3657600080fd5b82356001600160401b0380821115613b4d57600080fd5b818501915085601f830112613b6157600080fd5b813581811115613b7057600080fd5b866020828501011115613b8257600080fd5b60209290920196919550909350505050565b60008151808452602080850194506020840160005b83811015613bfb57815180518852838101518489015260408082015190890152606080820151908901526080808201519089015260a09081015115159088015260c09096019590820190600101613ba9565b509495945050505050565b60008151808452602080850194506020840160005b83811015613bfb5781516001600160a01b031687529582019590820190600101613c1b565b6020815260008251610260806020850152613c5f610280850183613a39565b91506020850151601f1980868503016040870152613c7d8483613a39565b93506040870151606087015260608701516080870152608087015160a087015260a087015160c087015260c087015160e087015260e08701519150610100828188015280880151925050610120818786030181880152613cdd8584613a39565b945080880151925050610140818786030181880152613cfc8584613a39565b945080880151925050610160613d158188018415159052565b8701519150610180613d2a8782018415159052565b808801519250506101a08281880152808801519250506101c0818786030181880152613d568584613b94565b9450808801519250506101e0613d76818801846001600160a01b03169052565b80880151925050610200818786030181880152613d938584613c06565b945080880151925050610220818786030181880152613db28584613c06565b9088015161024088810191909152880151801515858901529094509150613dd69050565b5090949350505050565b60008060408385031215613df357600080fd5b50508035926020909101359150565b60008060408385031215613e1557600080fd5b823591506020830135613e2781613a91565b809150509250929050565b600060208284031215613e4457600080fd5b8135611a7d81613a91565b634e487b7160e01b600052604160045260246000fd5b60405161014081016001600160401b0381118282101715613e8857613e88613e4f565b60405290565b604051601f8201601f191681016001600160401b0381118282101715613eb657613eb6613e4f565b604052919050565b60006001600160401b03821115613ed757613ed7613e4f565b50601f01601f191660200190565b6000613ef8613ef384613ebe565b613e8e565b9050828152838383011115613f0c57600080fd5b828260208301376000602084830101529392505050565b600082601f830112613f3457600080fd5b611a7d83833560208501613ee5565b600060208284031215613f5557600080fd5b81356001600160401b03811115613f6b57600080fd5b61326684828501613f23565b600060208284031215613f8957600080fd5b813561ffff81168114611a7d57600080fd5b80151581146124ca57600080fd5b8035613ab181613f9b565b60008060408385031215613fc757600080fd5b8235613fd281613a91565b91506020830135613e2781613f9b565b60008060408385031215613ff557600080fd5b82356001600160401b038082111561400c57600080fd5b90840190610140828703121561402157600080fd5b614029613e65565b823581526020830135602082015260408301358281111561404957600080fd5b61405588828601613f23565b60408301525060608301358281111561406d57600080fd5b61407988828601613f23565b60608301525060808301358281111561409157600080fd5b61409d88828601613f23565b60808301525060a0830135828111156140b557600080fd5b6140c188828601613f23565b60a0830152506140d360c08401613fa9565b60c082015260e08381013590820152610100808401359082015261012091506140fd828401613fa9565b8282015280945050505061411360208401613aa6565b90509250929050565b6000806000806080858703121561413257600080fd5b843561413d81613a91565b9350602085013561414d81613a91565b92506040850135915060608501356001600160401b0381111561416f57600080fd5b8501601f8101871361418057600080fd5b61418f87823560208401613ee5565b91505092959194509250565b6000602082840312156141ad57600080fd5b8135611a7d81613f9b565b600080604083850312156141cb57600080fd5b82356141d681613a91565b91506020830135613e2781613a91565b600181811c908216806141fa57607f821691505b60208210810361421a57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b80820180821115610a7557610a75614220565b81810381811115610a7557610a75614220565b60006020828403121561426e57600080fd5b8151611a7d81613f9b565b602080825260139082015272151bdad95b8e88155b985d5d1a1bdc9a5cd959606a1b604082015260600190565b601f821115610d30576000816000526020600020601f850160051c810160208610156142cf5750805b601f850160051c820191505b81811015611f4e578281556001016142db565b6001600160401b0383111561430557614305613e4f565b6143198361431383546141e6565b836142a6565b6000601f84116001811461434d57600085156143355750838201355b600019600387901b1c1916600186901b1783556143a7565b600083815260209020601f19861690835b8281101561437e578685013582556020948501946001909201910161435e565b508682101561439b5760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b61ffff8281168282160390808211156143c9576143c9614220565b5092915050565b634e487b7160e01b600052603260045260246000fd5b600061ffff8083168181036143fd576143fd614220565b6001019392505050565b60208082526023908201527f546f6b656e3a20565246205368696674696e67206d75737420626520656e61626040820152621b195960ea1b606082015260800190565b634e487b7160e01b600052601260045260246000fd5b60008261446f5761446f61444a565b500490565b8082028115828204841417610a7557610a75614220565b60008261449a5761449a61444a565b500690565b6000600182016144b1576144b1614220565b5060010190565b81516001600160401b038111156144d1576144d1613e4f565b6144e5816144df84546141e6565b846142a6565b602080601f83116001811461451a57600084156145025750858301515b600019600386901b1c1916600185901b178555611f4e565b600085815260208120601f198616915b828110156145495788860151825594840194600190910190840161452a565b50858210156145675787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60208082526024908201527f546f6b656e3a204c6173742072657665616c20616c72656164792072657175656040820152631cdd195960e21b606082015260800190565b60208082526024908201527f546f6b656e3a2052657665616c207265717565737420616c72656164792065786040820152636973747360e01b606082015260800190565b602080825260409082018190527f546f6b656e3a207265717569726573206d696e74656420746f6b656e7320666f908201527f722063757272656e742072616e676520746f206265206174206c656173742031606082015260800190565b60006020828403121561466f57600080fd5b5051919050565b60008154614683816141e6565b6001828116801561469b57600181146146b0576146df565b60ff19841687528215158302870194506146df565b8560005260208060002060005b858110156146d65781548a8201529084019082016146bd565b50505082870194505b5050505092915050565b60006146fe6146f8838a614676565b88614676565b865161470e818360208b01613a15565b8651910190614721818360208a01613a15565b8551910190614734818360208901613a15565b8451910190614747818360208801613a15565b0198975050505050505050565b6020808252602a908201527f546f6b656e3a204c6173742072657665616c206d7573742062652072657175656040820152691cdd195908199a5c9cdd60b21b606082015260800190565b6020808252602e908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526d1c881b9bdc88185c1c1c9bdd995960921b606082015260800190565b6000602082840312156147fe57600080fd5b8151611a7d81613a91565b60008060006060848603121561481e57600080fd5b83516001600160401b0381111561483457600080fd5b8401601f8101861361484557600080fd5b8051614853613ef382613ebe565b81815287602083850101111561486857600080fd5b614879826020830160208601613a15565b809550505050602084015161488d81613a91565b604085015190925063ffffffff811681146148a757600080fd5b809150509250925092565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061493790830184613a39565b9695505050505050565b60006020828403121561495357600080fd5b8151611a7d816139e2565b634e487b7160e01b600052603160045260246000fdfe0c7112aae6457f5c6a25de7d80f58f2fb755235d06d4473246b07240659a270fa2646970667358221220fca68d38e02565015263c10834b02d000d6a19d9027fed55a4e316d650dc016364736f6c63430008190033000000000000000000000000dbd9608fbca959828c1615d29aeb3dc872d40ae2
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106104335760003560e01c8063938e3d7b11610236578063c763e5a11161013b578063e9419325116100c3578063f2fde38b11610087578063f2fde38b146109dc578063f9c0611c146109ef578063fbd106f914610a07578063fc83b82714610a1c578063fd6a382e14610a4357600080fd5b8063e941932514610953578063e985e9c514610966578063ea09e473146109a2578063ea9d6824146109cc578063ee198b97146109d457600080fd5b8063d5b014c31161010a578063d5b014c3146108ec578063dbd5fd9b146108f4578063e288e73314610918578063e7713baa14610921578063e8a3d4851461094b57600080fd5b8063c763e5a1146108b5578063c87b56dd146108bd578063d255fe03146108d0578063d5abeb01146108e357600080fd5b8063a4b744e2116101be578063afa88e551161018d578063afa88e551461086c578063b88d4fde1461087e578063bcc0f72514610891578063bff3561814610899578063c1bd8cf9146108ac57600080fd5b8063a4b744e21461082b578063a5b3abfb1461083e578063a811a37b14610851578063abb8def31461086457600080fd5b806398f5b2381161020557806398f5b238146107605780639c30ea51146107d55780639d759d5f146107de5780639e0f0018146107f1578063a22cb4651461081857600080fd5b8063938e3d7b1461072b5780639456d7271461073e57806395d89b41146107505780639871d6fa1461075857600080fd5b806342842e0e1161033c57806370a08231116102c45780637f72f036116102935780637f72f036146106ba57806382027b6d146106cd5780638da5cb5b146106e05780638ffc20e2146106f157806391d148541461071857600080fd5b806370a0823114610657578063715018a61461066a5780637671114d1461067257806377d4b5041461069957600080fd5b80634f6ccce71161030b5780634f6ccce7146105ed57806354fd4d50146106005780636352211e1461060a57806366d47d841461061d57806369b2b9a71461064457600080fd5b806342842e0e1461059e578063432e2006146105b157806344d19d2b146105b95780634cf29258146105c257600080fd5b806317fd1e2f116103bf5780632a85db551161038e5780632a85db551461053d5780632f151b76146105505780632f745c59146105655780633f5916561461057857806341f434341461058b57600080fd5b806317fd1e2f146104fc57806318160ddd1461050f5780631f4bc79d1461051757806323b872dd1461052a57600080fd5b8063095ea7b311610406578063095ea7b3146104b75780630e89341c146104cc57806310d51dd9146104df57806312686aae146104e7578063160fba56146104f457600080fd5b806301ffc9a7146104385780630677ef811461046057806306fdde0314610477578063081812fc1461048c575b600080fd5b61044b6104463660046139f8565b610a50565b60405190151581526020015b60405180910390f35b610469600e5481565b604051908152602001610457565b61047f610a7b565b6040516104579190613a65565b61049f61049a366004613a78565b610b0d565b6040516001600160a01b039091168152602001610457565b6104ca6104c5366004613ab6565b610b34565b005b6104696104da366004613a78565b610b56565b61047f610c1c565b60135461044b9060ff1681565b61047f610caa565b6104ca61050a366004613ab6565b610cb7565b600854610469565b61044b610525366004613a78565b610d35565b6104ca610538366004613ae2565b610d79565b6104ca61054b366004613b23565b610dad565b610558610dfe565b6040516104579190613c40565b610469610573366004613ab6565b611347565b6104ca610586366004613de0565b6113dd565b60235461049f906001600160a01b031681565b6104ca6105ac366004613ae2565b611672565b6104696116a6565b610469600f5481565b61047f6040518060400160405280600c81526020016b052414e444f4d56325f5353560a41b81525081565b6104696105fb366004613a78565b6116d5565b6378a4676d610469565b61049f610618366004613a78565b611768565b6104697f78095cc8201dcba39b170f4873756afcc9c5fe4c54fba1731ca3be8a9544e76b81565b6104ca610652366004613e02565b6117c8565b610469610665366004613e32565b611957565b6104ca6119dd565b61049f7f000000000000000000000000dbd9608fbca959828c1615d29aeb3dc872d40ae281565b6017546106a79061ffff1681565b60405161ffff9091168152602001610457565b6106a76106c8366004613a78565b6119f1565b61044b6106db366004613e02565b611a45565b600a546001600160a01b031661049f565b6104697f7d4398cf7d551d8cb071f228c3b0838dfaf546b384e93039ea180fba606dfac381565b61044b610726366004613e02565b611a84565b6104ca610739366004613f43565b611afa565b60195461044b90610100900460ff1681565b61047f611b77565b6104ca611b86565b6107a661076e366004613f77565b601460205260009081526040902080546001820154600283015460038401546004850154600590950154939492939192909160ff1686565b6040805196875260208701959095529385019290925260608401526080830152151560a082015260c001610457565b610469600b5481565b601d5461049f906001600160a01b031681565b6104697f2f237764fc2d5c1022c2b3369211bf066f9f9b112c1a699afe91573a989d407f81565b6104ca610826366004613fb4565b611e3d565b6104ca610839366004613fe2565b611e5b565b6104ca61084c366004613ab6565b611ee4565b6104ca61085f366004613b23565b611f56565b6104ca611f98565b60135461044b90610100900460ff1681565b6104ca61088c36600461411c565b611fb4565b61047f611fe9565b6104ca6108a736600461419b565b611ff6565b610469600d5481565b61047f61207e565b61047f6108cb366004613a78565b61208b565b6104ca6108de366004613e02565b61233d565b610469600c5481565b6104ca612496565b6106a7610902366004613a78565b60156020526000908152604090205461ffff1681565b61046960105481565b6109296124cd565b6040805182518152602080840151908201529181015190820152606001610457565b61047f612517565b6104ca610961366004613e02565b612524565b61044b6109743660046141b8565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b61047f6040518060400160405280600b81526020016a555345525f52414e444f4d60a81b81525081565b6104ca612665565b61044b600181565b6104ca6109ea366004613e32565b6128de565b60225461049f9061010090046001600160a01b031681565b61046960008051602061497583398151915281565b6104697fdbd612d55a9aa50e9cdaf6dcccb9ec8386fea10c2783e3ba35c8652cd4932d7c81565b60225461044b9060ff1681565b60006001600160e01b0319821663780e9d6360e01b1480610a755750610a7582612954565b92915050565b6060601b8054610a8a906141e6565b80601f0160208091040260200160405190810160405280929190818152602001828054610ab6906141e6565b8015610b035780601f10610ad857610100808354040283529160200191610b03565b820191906000526020600020905b815481529060010190602001808311610ae657829003601f168201915b5050505050905090565b6000610b18826129a4565b506000908152600460205260409020546001600160a01b031690565b60225460ff1615610b4857610b4882612a03565b610b528282612ab1565b5050565b600080610b62836119f1565b90508061ffff16600003610b77575090919050565b61ffff81166000908152601460209081526040808320815160c08101835281548152600182015493810193909352600281015491830182905260038101546060840152600481015460808401526005015460ff16151560a0830152909190610bdf9086614236565b905081608001518111610bf457949350505050565b8160800151818360600151610c099190614236565b610c139190614249565b95945050505050565b60128054610c29906141e6565b80601f0160208091040260200160405190810160405280929190818152602001828054610c55906141e6565b8015610ca25780601f10610c7757610100808354040283529160200191610ca2565b820191906000526020600020905b815481529060010190602001808311610c8557829003601f168201915b505050505081565b60168054610c29906141e6565b610cbf612bc1565b60405163a9059cbb60e01b8152336004820152602481018290526001600160a01b0383169063a9059cbb906044016020604051808303816000875af1158015610d0c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d30919061425c565b505050565b6000600e54600d54610d479190614236565b82118015610d645750600f54600d54610d609190614236565b8211155b15610d7157506001919050565b506000919050565b60225460ff168015610d9457506001600160a01b0383163314155b15610da257610da233612a03565b610d30838383612c1b565b600080516020614975833981519152610dc68133611a45565b610deb5760405162461bcd60e51b8152600401610de290614279565b60405180910390fd5b6011610df88385836142ee565b50505050565b610ea260405180610260016040528060608152602001606081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016060815260200160608152602001600015158152602001600015158152602001600081526020016060815260200160006001600160a01b031681526020016060815260200160608152602001600081526020016000151581525090565b60175460009061ffff166001600160401b03811115610ec357610ec3613e4f565b604051908082528060200260200182016040528015610f2f57816020015b610f1c6040518060c0016040528060008152602001600081526020016000815260200160008152602001600081526020016000151581525090565b815260200190600190039081610ee15790505b50905060015b60175461ffff90811690821611610fe25761ffff8116600090815260146020908152604091829020825160c081018452815481526001808301549382019390935260028201549381019390935260038101546060840152600481015460808401526005015460ff16151560a08301528390610fb090846143ae565b61ffff1681518110610fc457610fc46143d0565b60200260200101819052508080610fda906143e6565b915050610f35565b506000610fef6020612c4c565b90506000816001600160401b0381111561100b5761100b613e4f565b604051908082528060200260200182016040528015611034578160200160208202803683370190505b50905060005b828161ffff16101561109557611055602061ffff8316612c56565b828261ffff168151811061106b5761106b6143d0565b6001600160a01b03909216602092830291909101909101528061108d816143e6565b91505061103a565b5060006110a2601e612c4c565b90506000816001600160401b038111156110be576110be613e4f565b6040519080825280602002602001820160405280156110e7578160200160208202803683370190505b50905060005b828161ffff16101561114857611108601e61ffff8316612c56565b828261ffff168151811061111e5761111e6143d0565b6001600160a01b039092166020928302919091019091015280611140816143e6565b9150506110ed565b5060405180610260016040528061115d610a7b565b815260200161116a611b77565b8152602001600b548152602001600c548152602001600d548152602001600e548152602001600f5481526020016010548152602001601180546111ac906141e6565b80601f01602080910402602001604051908101604052809291908181526020018280546111d8906141e6565b80156112255780601f106111fa57610100808354040283529160200191611225565b820191906000526020600020905b81548152906001019060200180831161120857829003601f168201915b505050505081526020016012805461123c906141e6565b80601f0160208091040260200160405190810160405280929190818152602001828054611268906141e6565b80156112b55780601f1061128a576101008083540402835291602001916112b5565b820191906000526020600020905b81548152906001019060200180831161129857829003601f168201915b505050918352505060135460ff8082161515602084015261010090910416151560408201526060016112e660085490565b8152602001868152602001611303600a546001600160a01b031690565b6001600160a01b031681526020018481526020018281526020016113286378a4676d90565b8152601954610100900460ff1615156020909101529695505050505050565b600061135283611957565b82106113b45760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b6064820152608401610de2565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b601954610100900460ff166114045760405162461bcd60e51b8152600401610de290614407565b61140c612c62565b6001600160a01b0316336001600160a01b0316146114785760405162461bcd60e51b8152602060048201526024808201527f546f6b656e3a2070726f63657373282920556e617574686f7269736564206361604482015263363632b960e11b6064820152608401610de2565b60008181526015602090815260408083205461ffff168084526014909252909120600581015460ff16156114ee5760405162461bcd60e51b815260206004820181905260248201527f546f6b656e3a2072657665616c20616c72656164792070726f6365737365642e6044820152606401610de2565b805483900361161e57611502600285614460565b600182018190556000036115355760038160040154620186a06115259190614474565b61152f9190614460565b60018201555b806003015481600401546115499190614249565b8160010154611558919061448b565b600282018190556000036115a557600381600101546115779190614460565b6001820155600381015460048201546115909190614249565b816001015461159f919061448b565b60028201555b60058101805460ff191660019081179091558101546002820154600383015460048401546040805161ffff881681526020810195909552840192909252606083015260808201527f959b44b0b513e15fb6ff0120336443b895d08969842e3aed3ac22eb9e933f7b39060a00160405180910390a1610df8565b60405162461bcd60e51b815260206004820152602360248201527f546f6b656e3a20496e636f7272656374207265717565737449642072656365696044820152621d995960ea1b6064820152608401610de2565b60225460ff16801561168d57506001600160a01b0383163314155b1561169b5761169b33612a03565b610d30838383612cf3565b6000601054600f54600d546116bb9190614236565b6116c59190614249565b6116d0906001614236565b905090565b60006116e060085490565b82106117435760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b6064820152608401610de2565b60088281548110611756576117566143d0565b90600052602060002001549050919050565b6000818152600260205260408120546001600160a01b031680610a755760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610de2565b7f78095cc8201dcba39b170f4873756afcc9c5fe4c54fba1731ca3be8a9544e76b6117f38133611a45565b61180f5760405162461bcd60e51b8152600401610de290614279565b601354610100900460ff16156118735760405162461bcd60e51b8152602060048201526024808201527f546f6b656e3a2043616e6e6f74206d696e74206166746572206c6173742072656044820152631d99585b60e21b6064820152608401610de2565b600f54600c546118839190614249565b83600d546118919190614236565b11156118fe5760405162461bcd60e51b815260206004820152603660248201527f546f6b656e3a205468697320776f756c642065786365656420746865206e756d604482015275626572206f6620636172647320617661696c61626c6560501b6064820152608401610de2565b6000600d54600161190f9190614236565b905060005b8481101561193957611931848361192a8161449f565b9450612d0e565b600101611914565b5083600d600082825461194c9190614236565b909155505050505050565b60006001600160a01b0382166119c15760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152608401610de2565b506001600160a01b031660009081526003602052604090205490565b6119e5612bc1565b6119ef6000612e5c565b565b600060015b60175461ffff90811690821611611a3c5761ffff81166000908152601460205260409020600401548311611a2a5792915050565b80611a34816143e6565b9150506119f6565b50600092915050565b6000611a59600a546001600160a01b031690565b6001600160a01b0316826001600160a01b03161480611a7d5750611a7d8383611a84565b9392505050565b601d54604051632474521560e21b8152600481018490526001600160a01b03838116602483015260009216906391d1485490604401602060405180830381865afa158015611ad6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a7d919061425c565b600080516020614975833981519152611b138133611a45565b611b2f5760405162461bcd60e51b8152600401610de290614279565b6018611b3b83826144b8565b507f74c497646a57fa0eeedc14ff6eec2da957c18c9c77881fe1aff368249b52b5c182604051611b6b9190613a65565b60405180910390a15050565b6060601c8054610a8a906141e6565b7f2f237764fc2d5c1022c2b3369211bf066f9f9b112c1a699afe91573a989d407f611bb18133611a45565b611bcd5760405162461bcd60e51b8152600401610de290614279565b601354610100900460ff1615611bf55760405162461bcd60e51b8152600401610de290614577565b600c5460175461ffff1660009081526014602052604090206004015410611c2e5760405162461bcd60e51b8152600401610de2906145bb565b6013805461ff001916610100179055601780546000916014918391908290611c599061ffff166143e6565b825461ffff9182166101009390930a8381029083021990911617909255825260208201929092526040016000908120601754909350601492611c9e91600191166143ae565b61ffff1681526020810191909152604001600020600401546003820155601954610100900460ff1615611da857600f54600d54611cdb9190614236565b600482018190556003820154600091611cf49190614249565b11611d115760405162461bcd60e51b8152600401610de2906145ff565b611d19612c62565b6001600160a01b031663c532bbac6040518163ffffffff1660e01b81526004016020604051808303816000875af1158015611d58573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d7c919061465d565b808255601754600091825260156020526040909120805461ffff191661ffff9092169190911790555050565b6000600d5411611dca5760405162461bcd60e51b8152600401610de2906145ff565b6000600182018190556002820181905560038201819055600c54600483018190556017546040805161ffff9092168252602082018490528101839052606081019290925260808201527f959b44b0b513e15fb6ff0120336443b895d08969842e3aed3ac22eb9e933f7b39060a001611b6b565b60225460ff1615611e5157611e5182612a03565b610b528282612eae565b6023546001600160a01b03163b15611eda57602354602254604051633e9f1edf60e11b81523060048201526001600160a01b0361010090920482166024820152911690637d3e3dbe90604401600060405180830381600087803b158015611ec157600080fd5b505af1158015611ed5573d6000803e3d6000fd5b505050505b610b528282612eb9565b611eec612bc1565b6040516323b872dd60e01b8152306004820152336024820152604481018290526001600160a01b038316906323b872dd90606401600060405180830381600087803b158015611f3a57600080fd5b505af1158015611f4e573d6000803e3d6000fd5b505050505050565b600080516020614975833981519152611f6f8133611a45565b611f8b5760405162461bcd60e51b8152600401610de290614279565b6012610df88385836142ee565b611fa0612bc1565b6022805460ff19811660ff90911615179055565b60225460ff168015611fcf57506001600160a01b0384163314155b15611fdd57611fdd33612a03565b610df884848484613134565b60118054610c29906141e6565b7f7d4398cf7d551d8cb071f228c3b0838dfaf546b384e93039ea180fba606dfac36120218133611a45565b61203d5760405162461bcd60e51b8152600401610de290614279565b6013805460ff19168315159081179091556040519081527fe3f0ec9c4af57e69d5aeff78a5912ca25733e4458710bab2b55d0985e98aeb5e90602001611b6b565b601a8054610c29906141e6565b6000818152600260205260409020546060906001600160a01b03161515806120b757506120b782610d35565b6121035760405162461bcd60e51b815260206004820152601b60248201527f546f6b656e3a20546f6b656e20646f6573206e6f7420657869737400000000006044820152606401610de2565b601954610100900460ff16156122b757600061211e836119f1565b90508061ffff166000036121bf5760118054612139906141e6565b80601f0160208091040260200160405190810160405280929190818152602001828054612165906141e6565b80156121b25780601f10612187576101008083540402835291602001916121b2565b820191906000526020600020905b81548152906001019060200180831161219557829003601f168201915b5050505050915050919050565b61ffff81166000908152601460209081526040808320815160c08101835281548152600182015493810184905260028201549281019290925260038101546060830152600481015460808301526005015460ff16151560a082015291036122b4576011805461222d906141e6565b80601f0160208091040260200160405190810160405280929190818152602001828054612259906141e6565b80156122a65780601f1061227b576101008083540402835291602001916122a6565b820191906000526020600020905b81548152906001019060200180831161228957829003601f168201915b505050505092505050919050565b50505b60006122c283610b56565b905060006122d96122d460648461448b565b613166565b905060006122e683613166565b90506000604051806040016040528060018152602001602f60f81b81525090506012601a82858486604051602001612323969594939291906146e9565b604051602081830303815290604052945050505050919050565b7fdbd612d55a9aa50e9cdaf6dcccb9ec8386fea10c2783e3ba35c8652cd4932d7c6123688133611a45565b6123845760405162461bcd60e51b8152600401610de290614279565b601354610100900460ff166123ab5760405162461bcd60e51b8152600401610de290614754565b601054600f546123bb9190614249565b600e54146124195760405162461bcd60e51b815260206004820152602560248201527f546f6b656e3a204d757374206d696e7420726573657276656420636172647320604482015264199a5c9cdd60da1b6064820152608401610de2565b60006124236116a6565b9050808410158015612440575060105461243d9082614236565b84105b61248c5760405162461bcd60e51b815260206004820152601b60248201527f546f6b656e3a2043617264206964206e6f7420696e2072616e676500000000006044820152606401610de2565b610df88385612d0e565b61249e612bc1565b60405133904780156108fc02916000818181858888f193505050501580156124ca573d6000803e3d6000fd5b50565b6124f160405180606001604052806000815260200160008152602001600081525090565b6040518060600160405280600b548152602001600c548152602001600f54815250905090565b60188054610c29906141e6565b60008051602061497583398151915261253d8133611a45565b6125595760405162461bcd60e51b8152600401610de290614279565b601354610100900460ff166125805760405162461bcd60e51b8152600401610de290614754565b601054600f546125909190614249565b83600e5461259e9190614236565b11156126125760405162461bcd60e51b815260206004820152603f60248201527f546f6b656e3a205468697320776f756c642065786365656420746865206e756d60448201527f626572206f6620726573657276656420636172647320617661696c61626c65006064820152608401610de2565b6000600e54600d546126249190614236565b61262f906001614236565b905060005b848110156126525761264a848361192a8161449f565b600101612634565b5083600e600082825461194c9190614236565b7f2f237764fc2d5c1022c2b3369211bf066f9f9b112c1a699afe91573a989d407f6126908133611a45565b6126ac5760405162461bcd60e51b8152600401610de290614279565b601954610100900460ff166126d35760405162461bcd60e51b8152600401610de290614407565b601354610100900460ff16156126fb5760405162461bcd60e51b8152600401610de290614577565b600d5460175461ffff16600090815260146020526040902060040154106127345760405162461bcd60e51b8152600401610de2906145bb565b6017805460009160149183919082906127509061ffff166143e6565b825461ffff9182166101009390930a838102908302199091161790925582526020820192909252604001600090812060175490935060149261279591600191166143ae565b61ffff1681526020810191909152604001600090812060049081015460038401819055600d549184018290556127ca91614249565b116127e75760405162461bcd60e51b8152600401610de2906145ff565b600c54600f54600d546127fa9190614236565b106128475760405162461bcd60e51b815260206004820181905260248201527f546f6b656e3a20506c656173652072657175657374204c61737452657665616c6044820152606401610de2565b61284f612c62565b6001600160a01b031663c532bbac6040518163ffffffff1660e01b81526004016020604051808303816000875af115801561288e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128b2919061465d565b90819055601754600091825260156020526040909120805461ffff191661ffff90921691909117905550565b6128e6612bc1565b6001600160a01b03811661294b5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610de2565b6124ca81612e5c565b60006001600160e01b031982166380ac58cd60e01b148061298557506001600160e01b03198216635b5e139f60e01b145b80610a7557506301ffc9a760e01b6001600160e01b0319831614610a75565b6000818152600260205260409020546001600160a01b03166124ca5760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610de2565b6023546001600160a01b03163b156124ca57602354604051633185c44d60e21b81523060048201526001600160a01b0383811660248301529091169063c617113490604401602060405180830381865afa158015612a65573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a89919061425c565b6124ca57604051633b79c77360e21b81526001600160a01b0382166004820152602401610de2565b6000612abc82611768565b9050806001600160a01b0316836001600160a01b031603612b295760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610de2565b336001600160a01b0382161480612b455750612b458133610974565b612bb75760405162461bcd60e51b815260206004820152603e60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206e6f7220617070726f76656420666f7220616c6c00006064820152608401610de2565b610d30838361326e565b600a546001600160a01b031633146119ef5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610de2565b612c2533826132dc565b612c415760405162461bcd60e51b8152600401610de29061479e565b610d3083838361335a565b6000610a75825490565b6000611a7d8383613501565b6000601d54604080518082018252600b81526a555345525f52414e444f4d60a81b60208201529051631d2e660b60e21b81526001600160a01b03909216916374b9982c91612cb291600401613a65565b602060405180830381865afa158015612ccf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116d091906147ec565b610d3083838360405180602001604052806000815250611fb4565b6001600160a01b038216612d645760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610de2565b6000818152600260205260409020546001600160a01b031615612dc95760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610de2565b612dd56000838361352b565b6001600160a01b0382166000908152600360205260408120805460019290612dfe908490614236565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b610b52338383613598565b60195460ff1615612f185760405162461bcd60e51b815260206004820152602360248201527f546f6b656e3a20436f6e747261637420616c726561647920696e697469616c696044820152621e995960ea1b6064820152608401610de2565b6040820151601b90612f2a90826144b8565b506060820151601c90612f3d90826144b8565b508151600b556080820151601190612f5590826144b8565b5060a0820151601290612f6890826144b8565b50602082810151600c5560c08301516013805460ff191691151591909117905560e0830151600f55610100830151601055604051631d2e660b60e21b81526004810191909152600e60248201526d10d3d353555392551657d31254d560921b60448201526000907f000000000000000000000000dbd9608fbca959828c1615d29aeb3dc872d40ae26001600160a01b0316906374b9982c90606401602060405180830381865afa158015613020573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061304491906147ec565b600b5460405163d0f4a53760e01b815263ffffffff90911660048201529091506000906001600160a01b0383169063d0f4a53790602401600060405180830381865afa158015613098573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526130c09190810190614809565b50601d80546001600160a01b0319166001600160a01b0383161790556101208601516019805461ff00191661010092151592909202919091179055915046905061310981613166565b601a9061311690826144b8565b5061312084612e5c565b50506019805460ff19166001179055505050565b61313e33836132dc565b61315a5760405162461bcd60e51b8152600401610de29061479e565b610df884848484613666565b60608160000361318d5750506040805180820190915260018152600360fc1b602082015290565b8160005b81156131b757806131a18161449f565b91506131b09050600a83614460565b9150613191565b6000816001600160401b038111156131d1576131d1613e4f565b6040519080825280601f01601f1916602001820160405280156131fb576020820181803683370190505b5090505b841561326657613210600183614249565b915061321d600a8661448b565b613228906030614236565b60f81b81838151811061323d5761323d6143d0565b60200101906001600160f81b031916908160001a90535061325f600a86614460565b94506131ff565b949350505050565b600081815260046020526040902080546001600160a01b0319166001600160a01b03841690811790915581906132a382611768565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000806132e883611768565b9050806001600160a01b0316846001600160a01b0316148061332f57506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b806132665750836001600160a01b031661334884610b0d565b6001600160a01b031614949350505050565b826001600160a01b031661336d82611768565b6001600160a01b0316146133d15760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b6064820152608401610de2565b6001600160a01b0382166134335760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610de2565b61343e83838361352b565b61344960008261326e565b6001600160a01b0383166000908152600360205260408120805460019290613472908490614249565b90915550506001600160a01b03821660009081526003602052604081208054600192906134a0908490614236565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6000826000018281548110613518576135186143d0565b9060005260206000200154905092915050565b6001600160a01b0383161561358d5760135460ff161561358d5760405162461bcd60e51b815260206004820181905260248201527f546f6b656e3a205472616e736665727320617265206e6f7420656e61626c65646044820152606401610de2565b610d30838383613699565b816001600160a01b0316836001600160a01b0316036135f95760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610de2565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b61367184848461335a565b61367d84848484613751565b610df85760405162461bcd60e51b8152600401610de2906148b2565b6001600160a01b0383166136f4576136ef81600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b613717565b816001600160a01b0316836001600160a01b031614613717576137178382613852565b6001600160a01b03821661372e57610d30816138ef565b826001600160a01b0316826001600160a01b031614610d3057610d30828261399e565b60006001600160a01b0384163b1561384757604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290613795903390899088908890600401614904565b6020604051808303816000875af19250505080156137d0575060408051601f3d908101601f191682019092526137cd91810190614941565b60015b61382d573d8080156137fe576040519150601f19603f3d011682016040523d82523d6000602084013e613803565b606091505b5080516000036138255760405162461bcd60e51b8152600401610de2906148b2565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050613266565b506001949350505050565b6000600161385f84611957565b6138699190614249565b6000838152600760205260409020549091508082146138bc576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b60085460009061390190600190614249565b60008381526009602052604081205460088054939450909284908110613929576139296143d0565b90600052602060002001549050806008838154811061394a5761394a6143d0565b60009182526020808320909101929092558281526009909152604080822084905585825281205560088054806139825761398261495e565b6001900381819060005260206000200160009055905550505050565b60006139a983611957565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b6001600160e01b0319811681146124ca57600080fd5b600060208284031215613a0a57600080fd5b8135611a7d816139e2565b60005b83811015613a30578181015183820152602001613a18565b50506000910152565b60008151808452613a51816020860160208601613a15565b601f01601f19169290920160200192915050565b602081526000611a7d6020830184613a39565b600060208284031215613a8a57600080fd5b5035919050565b6001600160a01b03811681146124ca57600080fd5b8035613ab181613a91565b919050565b60008060408385031215613ac957600080fd5b8235613ad481613a91565b946020939093013593505050565b600080600060608486031215613af757600080fd5b8335613b0281613a91565b92506020840135613b1281613a91565b929592945050506040919091013590565b60008060208385031215613b3657600080fd5b82356001600160401b0380821115613b4d57600080fd5b818501915085601f830112613b6157600080fd5b813581811115613b7057600080fd5b866020828501011115613b8257600080fd5b60209290920196919550909350505050565b60008151808452602080850194506020840160005b83811015613bfb57815180518852838101518489015260408082015190890152606080820151908901526080808201519089015260a09081015115159088015260c09096019590820190600101613ba9565b509495945050505050565b60008151808452602080850194506020840160005b83811015613bfb5781516001600160a01b031687529582019590820190600101613c1b565b6020815260008251610260806020850152613c5f610280850183613a39565b91506020850151601f1980868503016040870152613c7d8483613a39565b93506040870151606087015260608701516080870152608087015160a087015260a087015160c087015260c087015160e087015260e08701519150610100828188015280880151925050610120818786030181880152613cdd8584613a39565b945080880151925050610140818786030181880152613cfc8584613a39565b945080880151925050610160613d158188018415159052565b8701519150610180613d2a8782018415159052565b808801519250506101a08281880152808801519250506101c0818786030181880152613d568584613b94565b9450808801519250506101e0613d76818801846001600160a01b03169052565b80880151925050610200818786030181880152613d938584613c06565b945080880151925050610220818786030181880152613db28584613c06565b9088015161024088810191909152880151801515858901529094509150613dd69050565b5090949350505050565b60008060408385031215613df357600080fd5b50508035926020909101359150565b60008060408385031215613e1557600080fd5b823591506020830135613e2781613a91565b809150509250929050565b600060208284031215613e4457600080fd5b8135611a7d81613a91565b634e487b7160e01b600052604160045260246000fd5b60405161014081016001600160401b0381118282101715613e8857613e88613e4f565b60405290565b604051601f8201601f191681016001600160401b0381118282101715613eb657613eb6613e4f565b604052919050565b60006001600160401b03821115613ed757613ed7613e4f565b50601f01601f191660200190565b6000613ef8613ef384613ebe565b613e8e565b9050828152838383011115613f0c57600080fd5b828260208301376000602084830101529392505050565b600082601f830112613f3457600080fd5b611a7d83833560208501613ee5565b600060208284031215613f5557600080fd5b81356001600160401b03811115613f6b57600080fd5b61326684828501613f23565b600060208284031215613f8957600080fd5b813561ffff81168114611a7d57600080fd5b80151581146124ca57600080fd5b8035613ab181613f9b565b60008060408385031215613fc757600080fd5b8235613fd281613a91565b91506020830135613e2781613f9b565b60008060408385031215613ff557600080fd5b82356001600160401b038082111561400c57600080fd5b90840190610140828703121561402157600080fd5b614029613e65565b823581526020830135602082015260408301358281111561404957600080fd5b61405588828601613f23565b60408301525060608301358281111561406d57600080fd5b61407988828601613f23565b60608301525060808301358281111561409157600080fd5b61409d88828601613f23565b60808301525060a0830135828111156140b557600080fd5b6140c188828601613f23565b60a0830152506140d360c08401613fa9565b60c082015260e08381013590820152610100808401359082015261012091506140fd828401613fa9565b8282015280945050505061411360208401613aa6565b90509250929050565b6000806000806080858703121561413257600080fd5b843561413d81613a91565b9350602085013561414d81613a91565b92506040850135915060608501356001600160401b0381111561416f57600080fd5b8501601f8101871361418057600080fd5b61418f87823560208401613ee5565b91505092959194509250565b6000602082840312156141ad57600080fd5b8135611a7d81613f9b565b600080604083850312156141cb57600080fd5b82356141d681613a91565b91506020830135613e2781613a91565b600181811c908216806141fa57607f821691505b60208210810361421a57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b80820180821115610a7557610a75614220565b81810381811115610a7557610a75614220565b60006020828403121561426e57600080fd5b8151611a7d81613f9b565b602080825260139082015272151bdad95b8e88155b985d5d1a1bdc9a5cd959606a1b604082015260600190565b601f821115610d30576000816000526020600020601f850160051c810160208610156142cf5750805b601f850160051c820191505b81811015611f4e578281556001016142db565b6001600160401b0383111561430557614305613e4f565b6143198361431383546141e6565b836142a6565b6000601f84116001811461434d57600085156143355750838201355b600019600387901b1c1916600186901b1783556143a7565b600083815260209020601f19861690835b8281101561437e578685013582556020948501946001909201910161435e565b508682101561439b5760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b61ffff8281168282160390808211156143c9576143c9614220565b5092915050565b634e487b7160e01b600052603260045260246000fd5b600061ffff8083168181036143fd576143fd614220565b6001019392505050565b60208082526023908201527f546f6b656e3a20565246205368696674696e67206d75737420626520656e61626040820152621b195960ea1b606082015260800190565b634e487b7160e01b600052601260045260246000fd5b60008261446f5761446f61444a565b500490565b8082028115828204841417610a7557610a75614220565b60008261449a5761449a61444a565b500690565b6000600182016144b1576144b1614220565b5060010190565b81516001600160401b038111156144d1576144d1613e4f565b6144e5816144df84546141e6565b846142a6565b602080601f83116001811461451a57600084156145025750858301515b600019600386901b1c1916600185901b178555611f4e565b600085815260208120601f198616915b828110156145495788860151825594840194600190910190840161452a565b50858210156145675787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60208082526024908201527f546f6b656e3a204c6173742072657665616c20616c72656164792072657175656040820152631cdd195960e21b606082015260800190565b60208082526024908201527f546f6b656e3a2052657665616c207265717565737420616c72656164792065786040820152636973747360e01b606082015260800190565b602080825260409082018190527f546f6b656e3a207265717569726573206d696e74656420746f6b656e7320666f908201527f722063757272656e742072616e676520746f206265206174206c656173742031606082015260800190565b60006020828403121561466f57600080fd5b5051919050565b60008154614683816141e6565b6001828116801561469b57600181146146b0576146df565b60ff19841687528215158302870194506146df565b8560005260208060002060005b858110156146d65781548a8201529084019082016146bd565b50505082870194505b5050505092915050565b60006146fe6146f8838a614676565b88614676565b865161470e818360208b01613a15565b8651910190614721818360208a01613a15565b8551910190614734818360208901613a15565b8451910190614747818360208801613a15565b0198975050505050505050565b6020808252602a908201527f546f6b656e3a204c6173742072657665616c206d7573742062652072657175656040820152691cdd195908199a5c9cdd60b21b606082015260800190565b6020808252602e908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526d1c881b9bdc88185c1c1c9bdd995960921b606082015260800190565b6000602082840312156147fe57600080fd5b8151611a7d81613a91565b60008060006060848603121561481e57600080fd5b83516001600160401b0381111561483457600080fd5b8401601f8101861361484557600080fd5b8051614853613ef382613ebe565b81815287602083850101111561486857600080fd5b614879826020830160208601613a15565b809550505050602084015161488d81613a91565b604085015190925063ffffffff811681146148a757600080fd5b809150509250925092565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061493790830184613a39565b9695505050505050565b60006020828403121561495357600080fd5b8151611a7d816139e2565b634e487b7160e01b600052603160045260246000fdfe0c7112aae6457f5c6a25de7d80f58f2fb755235d06d4473246b07240659a270fa2646970667358221220fca68d38e02565015263c10834b02d000d6a19d9027fed55a4e316d650dc016364736f6c63430008190033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000dbd9608fbca959828c1615d29aeb3dc872d40ae2
-----Decoded View---------------
Arg [0] : _galaxisRegistry (address): 0xdBD9608fBcA959828C1615d29AEb3dc872d40Ae2
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000dbd9608fbca959828c1615d29aeb3dc872d40ae2
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.