Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Multichain Info
No addresses found
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
EntityManager
Compiler Version
v0.8.27+commit.40a35a09
Optimization Enabled:
Yes with 1000 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
/* Will you conquer your hunger or starve to death? - Website: https://butcher.money - App: https://app.butcher.money - Docs: https://docs.butcher.money - Telegram: https://t.me/butcher_portal - X: https://x.com/butchermoney */ pragma solidity ^0.8.0; import "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC721/extensions/ERC721EnumerableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC721/extensions/ERC721URIStorageUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts/utils/Base64.sol"; import "./interfaces/IRewardPool.sol"; import "./interfaces/IERC20.sol"; import "./interfaces/IButcher.sol"; contract EntityManager is Initializable, ERC721Upgradeable, ERC721EnumerableUpgradeable, ERC721URIStorageUpgradeable { bool isPaused; uint256 totalEntities; uint256 claimFees; mapping(uint256 => Entity) _entities; mapping(address => address) private _referrers; mapping(address => bool) private _operators; mapping(address => uint) private _ownedChicken; mapping(address => uint) private _ownedCow; mapping(address => uint) private _ownedMooDeng; IRewardPool private _rewardPool; address private _treasuryWallet; modifier onlyOperator() { require(_operators[msg.sender], "Not operator on the manager"); _; } mapping(uint256 => EntityType) _entityTypes; uint256 totalTypes; IButcher private _butcher; event EntityCreated( uint256 id, string name, uint256 typeId, uint256 createdAt, address referrer ); event EntitySlaughtered(uint256 id, uint256 rewards, address referrer); modifier notPaused() { require(!isPaused, "Butcher: Contract is paused"); _; } // modifier onlyEntityOwner() { // require( // balanceOf(msg.sender) > 0, // "Butcher: You do not own any entity" // ); // _; // } modifier entityExists(uint256 _entityId) { require(isEntityValid(_entityId), "Butcher: Entity does not exist"); _; } modifier onlyApprovedOrOwner(uint256 _entityId) { require( ownerOf(_entityId) == msg.sender || _isAuthorized(ownerOf(_entityId), msg.sender, _entityId), "Butcher: You are not authorized to perform this action" ); _; } modifier onlyAlive(uint256 _entityId) { require( !_entities[_entityId].slaughtered, "Butcher: Entity is slaughtered" ); _; } function initialize( address butcher, address rwPool, address treasuryWallet, uint256 _claimFees ) public initializer { __ERC721_init("Butcher", "FARM"); __ERC721Enumerable_init(); __ERC721URIStorage_init(); _butcher = IButcher(butcher); _operators[msg.sender] = true; _rewardPool = IRewardPool(rwPool); _treasuryWallet = treasuryWallet; claimFees = _claimFees; } struct Entity { uint256 id; string name; uint256 createdAt; uint256 typeId; bool exists; bool slaughtered; } struct EntityType { string imageURI; string name; uint256 price; uint256 total; uint256 totalSlaughtered; uint256 epochTime; uint256 incubationTime; // number of epoch uint256 rewardPerSecond; } function createEntity( uint256 _type, string memory _entityName, address _referrer ) external notPaused { if (_referrers[msg.sender] == address(0)) { _referrers[msg.sender] = _referrer; } EntityType storage entityType = _entityTypes[_type]; entityType.total += 1; _butcher.transferFrom(msg.sender, address(this), entityType.price); dispatchTokens(entityType.price, 30, 60, 10); entityType.total += 1; //TODO: burn, swap.. _mintEntity(msg.sender, _type, _entityName); emit EntityCreated( totalEntities, _entityName, _type, block.timestamp, _referrer ); } function _mintEntity( address _to, uint256 _type, string memory _entityName ) internal { if (_type == 0) { _ownedChicken[_to] += 1; } else if (_type == 1) { _ownedCow[_to] += 1; } else if (_type == 2) { _ownedMooDeng[_to] += 1; } totalEntities += 1; _entities[totalEntities] = Entity({ id: totalEntities, name: _entityName, createdAt: block.timestamp, typeId: _type, exists: true, slaughtered: false }); _mint(_to, totalEntities); } function slaughter( uint256 _entityId ) external entityExists(_entityId) onlyAlive(_entityId) onlyApprovedOrOwner(_entityId) { Entity storage entity = _entities[_entityId]; EntityType storage entityType = _entityTypes[entity.typeId]; entityType.totalSlaughtered += 1; if (entity.typeId == 0) { _ownedChicken[msg.sender] -= 1; } else if (entity.typeId == 1) { _ownedCow[msg.sender] -= 1; } else if (entity.typeId == 2) { _ownedMooDeng[msg.sender] -= 1; } uint256 rewards = calculateRewards(_entityId); uint refRewards = (rewards * 5) / 100; uint256 fees = (rewards * claimFees) / 100; if (_referrers[msg.sender] != address(0)) { _rewardPool.emitRewards(_referrers[msg.sender], refRewards); _rewardPool.emitRewards(_treasuryWallet, fees); _rewardPool.emitRewards(msg.sender, rewards - refRewards - fees); } else { _rewardPool.emitRewards(_treasuryWallet, fees); _rewardPool.emitRewards(msg.sender, rewards - fees); } entity.slaughtered = true; emit EntitySlaughtered(_entityId, rewards, _referrers[msg.sender]); } function calculateRewards( uint256 _entityId ) public view entityExists(_entityId) returns (uint256) { Entity storage entity = _entities[_entityId]; EntityType storage entityType = _entityTypes[entity.typeId]; uint256 elapsedEpochs = (block.timestamp - entity.createdAt) / entityType.epochTime; uint256 rest = (block.timestamp - entity.createdAt) % entityType.epochTime; uint256 rewards; if (elapsedEpochs == 0) { rewards = rest * entityType.rewardPerSecond; } else { uint256 currentRewardPerSecond = entityType.rewardPerSecond; // Calculate rewards for full epochs for (uint256 i = 0; i < elapsedEpochs; i++) { if (i == entityType.incubationTime) { rest += (elapsedEpochs - i) * entityType.epochTime; break; } rewards += currentRewardPerSecond * entityType.epochTime; currentRewardPerSecond *= 2; // Double the reward rate for next epoch } // Calculate rewards for the rest period rewards += currentRewardPerSecond * rest; } return rewards; } function setOperator(address user, bool value) external onlyOperator { _operators[user] = value; } function setEntityType( uint256 _type, uint256 _price, uint256 _rewardPerSecond, uint256 _epochTime, uint256 _incubationTime, string memory _name, string memory _imageURI ) external onlyOperator { _entityTypes[_type] = EntityType({ price: _price, rewardPerSecond: _rewardPerSecond, epochTime: _epochTime, total: 0, totalSlaughtered: 0, imageURI: _imageURI, incubationTime: _incubationTime, name: _name }); } function isEntityValid(uint256 _entityId) public view returns (bool) { require(_entityId >= 0, "Entity: Id must be equal or higher than zero"); require( _entityId <= totalEntities, "Entity: Id must be lower than total entities" ); return _entities[_entityId].exists; } function dispatchTokens( uint256 amount, uint256 _burnPercent, uint256 _rewardPoolPercent, uint256 _treasuryPercent ) internal { require( _burnPercent + _rewardPoolPercent + _treasuryPercent == 100, "EntityManager: Percentages must add up to 100" ); if (_burnPercent > 0) { _butcher.burn((amount * _burnPercent) / 100); } if (_rewardPoolPercent > 0) { _butcher.transfer( address(_rewardPool), (amount * _rewardPoolPercent) / 100 ); } if (_treasuryPercent > 0) { _butcher.transfer( address(_treasuryWallet), (amount * _treasuryPercent) / 100 ); } } function setWallets( address treasury, address rewardPool ) external onlyOperator { _treasuryWallet = treasury; _rewardPool = IRewardPool(rewardPool); } function getEntityTypeName( uint256 _entityId ) public view returns (string memory) { require(isEntityValid(_entityId), "Entity: Invalid entity ID"); Entity storage entity = _entities[_entityId]; EntityType storage entityType = _entityTypes[entity.typeId]; return entityType.name; } function isChickenOwner(address _user) public view returns (bool) { return _ownedChicken[_user] > 0; } function isCowOwner(address _user) public view returns (bool) { return _ownedCow[_user] > 0; } function isMooDengOwner(address _user) public view returns (bool) { return _ownedMooDeng[_user] > 0; } function getEntityIdsOf( address account ) public view returns (uint256[] memory) { uint256 entityNumber = balanceOf(account); uint256[] memory entityIds = new uint256[](entityNumber); for (uint256 i = 0; i < entityNumber; i++) { uint256 nodeId = tokenOfOwnerByIndex(account, i); require(isEntityValid(nodeId), "Entity: Given node id does not exist"); entityIds[i] = nodeId; } return entityIds; } function getDailyReward(uint256 _entityId) public view returns (uint256) { require(isEntityValid(_entityId), "Entity: Invalid entity ID"); return ( (_entityTypes[_entities[_entityId].typeId].rewardPerSecond * 86400) ); } function getEntityInfo( uint256 _entityId ) public view returns (string memory, uint256, bool) { Entity storage entity = _entities[_entityId]; return (entity.name, entity.typeId, entity.slaughtered); } function getEntityTypeInfo( uint256 _type ) public view returns ( string memory, uint256, uint256, uint256, uint256, uint256, uint256, string memory ) { EntityType storage entityType = _entityTypes[_type]; return ( entityType.name, entityType.total, entityType.totalSlaughtered, entityType.price, entityType.rewardPerSecond, entityType.epochTime, entityType.incubationTime, entityType.imageURI ); } // Mandatory overrides function _update( address to, uint256 tokenId, address auth ) internal override(ERC721Upgradeable, ERC721EnumerableUpgradeable) returns (address) { return super._update(to, tokenId, auth); } function _increaseBalance( address account, uint128 value ) internal override(ERC721Upgradeable, ERC721EnumerableUpgradeable) { super._increaseBalance(account, value); } function supportsInterface( bytes4 interfaceId ) public view override( ERC721Upgradeable, ERC721EnumerableUpgradeable, ERC721URIStorageUpgradeable ) returns (bool) { return super.supportsInterface(interfaceId); } function printAttributes( uint256 _entityId ) public view returns (string memory) { uint256 pendingRewards = calculateRewards(_entityId) / (1e18); bytes memory data = ""; data = abi.encodePacked( data, '{"trait_type":"', "Pending Rewards", '","value":"', int2str(pendingRewards), " BUTCHER", '"}', ',{"trait_type":"', "Type", '","value":"', _entityTypes[_entities[_entityId].typeId].name, '"}' ); return string(data); } function tokenURI( uint256 tokenId ) public view virtual override(ERC721URIStorageUpgradeable, ERC721Upgradeable) returns (string memory) { return string( abi.encodePacked( "data:application/json;base64,", Base64.encode( bytes( abi.encodePacked( "{", '"name": "', _entityTypes[_entities[tokenId].typeId].name, ": ", _entities[tokenId].name, '",', '"description": "This entity is farming ', int2str(getDailyReward(tokenId)), ' BUTCHER daily",', '"attributes": [', printAttributes(tokenId), "],", '"image":"', _entityTypes[_entities[tokenId].typeId].imageURI, '"}' ) ) ) ) ); } function int2str( uint256 _i ) public view returns (string memory _uintAsString) { if (_i == 0) { return "0"; } uint256 j = _i; uint256 len; while (j != 0) { len++; j /= 10; } bytes memory bstr = new bytes(len); uint256 k = len; while (_i != 0) { k = k - 1; uint8 temp = (48 + uint8(_i - (_i / 10) * 10)); bytes1 b1 = bytes1(temp); bstr[k] = b1; _i /= 10; } return string(bstr); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/Initializable.sol) pragma solidity ^0.8.20; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in * case an upgrade adds a module that needs to be initialized. * * For example: * * [.hljs-theme-light.nopadding] * ```solidity * contract MyToken is ERC20Upgradeable { * function initialize() initializer public { * __ERC20_init("MyToken", "MTK"); * } * } * * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable { * function initializeV2() reinitializer(2) public { * __ERC20Permit_init("MyToken"); * } * } * ``` * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. * * [CAUTION] * ==== * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() { * _disableInitializers(); * } * ``` * ==== */ abstract contract Initializable { /** * @dev Storage of the initializable contract. * * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions * when using with upgradeable contracts. * * @custom:storage-location erc7201:openzeppelin.storage.Initializable */ struct InitializableStorage { /** * @dev Indicates that the contract has been initialized. */ uint64 _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool _initializing; } // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Initializable")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant INITIALIZABLE_STORAGE = 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00; /** * @dev The contract is already initialized. */ error InvalidInitialization(); /** * @dev The contract is not initializing. */ error NotInitializing(); /** * @dev Triggered when the contract has been initialized or reinitialized. */ event Initialized(uint64 version); /** * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope, * `onlyInitializing` functions can be used to initialize parent contracts. * * Similar to `reinitializer(1)`, except that in the context of a constructor an `initializer` may be invoked any * number of times. This behavior in the constructor can be useful during testing and is not expected to be used in * production. * * Emits an {Initialized} event. */ modifier initializer() { // solhint-disable-next-line var-name-mixedcase InitializableStorage storage $ = _getInitializableStorage(); // Cache values to avoid duplicated sloads bool isTopLevelCall = !$._initializing; uint64 initialized = $._initialized; // Allowed calls: // - initialSetup: the contract is not in the initializing state and no previous version was // initialized // - construction: the contract is initialized at version 1 (no reininitialization) and the // current contract is just being deployed bool initialSetup = initialized == 0 && isTopLevelCall; bool construction = initialized == 1 && address(this).code.length == 0; if (!initialSetup && !construction) { revert InvalidInitialization(); } $._initialized = 1; if (isTopLevelCall) { $._initializing = true; } _; if (isTopLevelCall) { $._initializing = false; emit Initialized(1); } } /** * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be * used to initialize parent contracts. * * A reinitializer may be used after the original initialization step. This is essential to configure modules that * are added through upgrades and that require initialization. * * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer` * cannot be nested. If one is invoked in the context of another, execution will revert. * * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in * a contract, executing them in the right order is up to the developer or operator. * * WARNING: Setting the version to 2**64 - 1 will prevent any future reinitialization. * * Emits an {Initialized} event. */ modifier reinitializer(uint64 version) { // solhint-disable-next-line var-name-mixedcase InitializableStorage storage $ = _getInitializableStorage(); if ($._initializing || $._initialized >= version) { revert InvalidInitialization(); } $._initialized = version; $._initializing = true; _; $._initializing = false; emit Initialized(version); } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} and {reinitializer} modifiers, directly or indirectly. */ modifier onlyInitializing() { _checkInitializing(); _; } /** * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}. */ function _checkInitializing() internal view virtual { if (!_isInitializing()) { revert NotInitializing(); } } /** * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call. * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized * to any version. It is recommended to use this to lock implementation contracts that are designed to be called * through proxies. * * Emits an {Initialized} event the first time it is successfully executed. */ function _disableInitializers() internal virtual { // solhint-disable-next-line var-name-mixedcase InitializableStorage storage $ = _getInitializableStorage(); if ($._initializing) { revert InvalidInitialization(); } if ($._initialized != type(uint64).max) { $._initialized = type(uint64).max; emit Initialized(type(uint64).max); } } /** * @dev Returns the highest version that has been initialized. See {reinitializer}. */ function _getInitializedVersion() internal view returns (uint64) { return _getInitializableStorage()._initialized; } /** * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}. */ function _isInitializing() internal view returns (bool) { return _getInitializableStorage()._initializing; } /** * @dev Returns a pointer to the storage namespace. */ // solhint-disable-next-line var-name-mixedcase function _getInitializableStorage() private pure returns (InitializableStorage storage $) { assembly { $.slot := INITIALIZABLE_STORAGE } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/ERC721.sol) pragma solidity ^0.8.20; import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import {IERC721Receiver} from "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; import {IERC721Metadata} from "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol"; import {ContextUpgradeable} from "../../utils/ContextUpgradeable.sol"; import {Strings} from "@openzeppelin/contracts/utils/Strings.sol"; import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol"; import {ERC165Upgradeable} from "../../utils/introspection/ERC165Upgradeable.sol"; import {IERC721Errors} from "@openzeppelin/contracts/interfaces/draft-IERC6093.sol"; import {Initializable} from "../../proxy/utils/Initializable.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}. */ abstract contract ERC721Upgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC721, IERC721Metadata, IERC721Errors { using Strings for uint256; /// @custom:storage-location erc7201:openzeppelin.storage.ERC721 struct ERC721Storage { // Token name string _name; // Token symbol string _symbol; mapping(uint256 tokenId => address) _owners; mapping(address owner => uint256) _balances; mapping(uint256 tokenId => address) _tokenApprovals; mapping(address owner => mapping(address operator => bool)) _operatorApprovals; } // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.ERC721")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant ERC721StorageLocation = 0x80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab0079300; function _getERC721Storage() private pure returns (ERC721Storage storage $) { assembly { $.slot := ERC721StorageLocation } } /** * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. */ function __ERC721_init(string memory name_, string memory symbol_) internal onlyInitializing { __ERC721_init_unchained(name_, symbol_); } function __ERC721_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing { ERC721Storage storage $ = _getERC721Storage(); $._name = name_; $._symbol = symbol_; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165Upgradeable, 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 returns (uint256) { ERC721Storage storage $ = _getERC721Storage(); if (owner == address(0)) { revert ERC721InvalidOwner(address(0)); } return $._balances[owner]; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual returns (address) { return _requireOwned(tokenId); } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual returns (string memory) { ERC721Storage storage $ = _getERC721Storage(); return $._name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual returns (string memory) { ERC721Storage storage $ = _getERC721Storage(); return $._symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual returns (string memory) { _requireOwned(tokenId); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string.concat(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 { _approve(to, tokenId, _msgSender()); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual returns (address) { _requireOwned(tokenId); return _getApproved(tokenId); } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual returns (bool) { ERC721Storage storage $ = _getERC721Storage(); return $._operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom(address from, address to, uint256 tokenId) public virtual { if (to == address(0)) { revert ERC721InvalidReceiver(address(0)); } // Setting an "auth" arguments enables the `_isAuthorized` check which verifies that the token exists // (from != 0). Therefore, it is not needed to verify that the return value is not 0 here. address previousOwner = _update(to, tokenId, _msgSender()); if (previousOwner != from) { revert ERC721IncorrectOwner(from, tokenId, previousOwner); } } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom(address from, address to, uint256 tokenId) public { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public virtual { transferFrom(from, to, tokenId); _checkOnERC721Received(from, to, tokenId, data); } /** * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist * * IMPORTANT: Any overrides to this function that add ownership of tokens not tracked by the * core ERC721 logic MUST be matched with the use of {_increaseBalance} to keep balances * consistent with ownership. The invariant to preserve is that for any address `a` the value returned by * `balanceOf(a)` must be equal to the number of tokens such that `_ownerOf(tokenId)` is `a`. */ function _ownerOf(uint256 tokenId) internal view virtual returns (address) { ERC721Storage storage $ = _getERC721Storage(); return $._owners[tokenId]; } /** * @dev Returns the approved address for `tokenId`. Returns 0 if `tokenId` is not minted. */ function _getApproved(uint256 tokenId) internal view virtual returns (address) { ERC721Storage storage $ = _getERC721Storage(); return $._tokenApprovals[tokenId]; } /** * @dev Returns whether `spender` is allowed to manage `owner`'s tokens, or `tokenId` in * particular (ignoring whether it is owned by `owner`). * * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this * assumption. */ function _isAuthorized(address owner, address spender, uint256 tokenId) internal view virtual returns (bool) { return spender != address(0) && (owner == spender || isApprovedForAll(owner, spender) || _getApproved(tokenId) == spender); } /** * @dev Checks if `spender` can operate on `tokenId`, assuming the provided `owner` is the actual owner. * Reverts if `spender` does not have approval from the provided `owner` for the given token or for all its assets * the `spender` for the specific `tokenId`. * * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this * assumption. */ function _checkAuthorized(address owner, address spender, uint256 tokenId) internal view virtual { if (!_isAuthorized(owner, spender, tokenId)) { if (owner == address(0)) { revert ERC721NonexistentToken(tokenId); } else { revert ERC721InsufficientApproval(spender, tokenId); } } } /** * @dev Unsafe write access to the balances, used by extensions that "mint" tokens using an {ownerOf} override. * * NOTE: the value is limited to type(uint128).max. This protect against _balance overflow. It is unrealistic that * a uint256 would ever overflow from increments when these increments are bounded to uint128 values. * * WARNING: Increasing an account's balance using this function tends to be paired with an override of the * {_ownerOf} function to resolve the ownership of the corresponding tokens so that balances and ownership * remain consistent with one another. */ function _increaseBalance(address account, uint128 value) internal virtual { ERC721Storage storage $ = _getERC721Storage(); unchecked { $._balances[account] += value; } } /** * @dev Transfers `tokenId` from its current owner to `to`, or alternatively mints (or burns) if the current owner * (or `to`) is the zero address. Returns the owner of the `tokenId` before the update. * * The `auth` argument is optional. If the value passed is non 0, then this function will check that * `auth` is either the owner of the token, or approved to operate on the token (by the owner). * * Emits a {Transfer} event. * * NOTE: If overriding this function in a way that tracks balances, see also {_increaseBalance}. */ function _update(address to, uint256 tokenId, address auth) internal virtual returns (address) { ERC721Storage storage $ = _getERC721Storage(); address from = _ownerOf(tokenId); // Perform (optional) operator check if (auth != address(0)) { _checkAuthorized(from, auth, tokenId); } // Execute the update if (from != address(0)) { // Clear approval. No need to re-authorize or emit the Approval event _approve(address(0), tokenId, address(0), false); unchecked { $._balances[from] -= 1; } } if (to != address(0)) { unchecked { $._balances[to] += 1; } } $._owners[tokenId] = to; emit Transfer(from, to, tokenId); return from; } /** * @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 { if (to == address(0)) { revert ERC721InvalidReceiver(address(0)); } address previousOwner = _update(to, tokenId, address(0)); if (previousOwner != address(0)) { revert ERC721InvalidSender(address(0)); } } /** * @dev Mints `tokenId`, transfers it to `to` and checks for `to` acceptance. * * 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 { _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); _checkOnERC721Received(address(0), to, tokenId, data); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * This is an internal function that does not check if the sender is authorized to operate on the token. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal { address previousOwner = _update(address(0), tokenId, address(0)); if (previousOwner == address(0)) { revert ERC721NonexistentToken(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 { if (to == address(0)) { revert ERC721InvalidReceiver(address(0)); } address previousOwner = _update(to, tokenId, address(0)); if (previousOwner == address(0)) { revert ERC721NonexistentToken(tokenId); } else if (previousOwner != from) { revert ERC721IncorrectOwner(from, tokenId, previousOwner); } } /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking that contract recipients * are aware of the ERC721 standard 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 like {safeTransferFrom} in the sense that it invokes * {IERC721Receiver-onERC721Received} on the receiver, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. * * Requirements: * * - `tokenId` token must exist and be owned by `from`. * - `to` cannot be the zero address. * - `from` cannot be the zero address. * - 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) internal { _safeTransfer(from, to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeTransfer-address-address-uint256-}[`_safeTransfer`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeTransfer(address from, address to, uint256 tokenId, bytes memory data) internal virtual { _transfer(from, to, tokenId); _checkOnERC721Received(from, to, tokenId, data); } /** * @dev Approve `to` to operate on `tokenId` * * The `auth` argument is optional. If the value passed is non 0, then this function will check that `auth` is * either the owner of the token, or approved to operate on all tokens held by this owner. * * Emits an {Approval} event. * * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument. */ function _approve(address to, uint256 tokenId, address auth) internal { _approve(to, tokenId, auth, true); } /** * @dev Variant of `_approve` with an optional flag to enable or disable the {Approval} event. The event is not * emitted in the context of transfers. */ function _approve(address to, uint256 tokenId, address auth, bool emitEvent) internal virtual { ERC721Storage storage $ = _getERC721Storage(); // Avoid reading the owner unless necessary if (emitEvent || auth != address(0)) { address owner = _requireOwned(tokenId); // We do not use _isAuthorized because single-token approvals should not be able to call approve if (auth != address(0) && owner != auth && !isApprovedForAll(owner, auth)) { revert ERC721InvalidApprover(auth); } if (emitEvent) { emit Approval(owner, to, tokenId); } } $._tokenApprovals[tokenId] = to; } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Requirements: * - operator can't be the address zero. * * Emits an {ApprovalForAll} event. */ function _setApprovalForAll(address owner, address operator, bool approved) internal virtual { ERC721Storage storage $ = _getERC721Storage(); if (operator == address(0)) { revert ERC721InvalidOperator(operator); } $._operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Reverts if the `tokenId` doesn't have a current owner (it hasn't been minted, or it has been burned). * Returns the owner. * * Overrides to ownership logic should be done to {_ownerOf}. */ function _requireOwned(uint256 tokenId) internal view returns (address) { address owner = _ownerOf(tokenId); if (owner == address(0)) { revert ERC721NonexistentToken(tokenId); } return owner; } /** * @dev Private function to invoke {IERC721Receiver-onERC721Received} on a target address. This will revert if the * recipient doesn't accept the token transfer. 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 */ function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes memory data) private { if (to.code.length > 0) { try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) { if (retval != IERC721Receiver.onERC721Received.selector) { revert ERC721InvalidReceiver(to); } } catch (bytes memory reason) { if (reason.length == 0) { revert ERC721InvalidReceiver(to); } else { /// @solidity memory-safe-assembly assembly { revert(add(32, reason), mload(reason)) } } } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/ERC721Enumerable.sol) pragma solidity ^0.8.20; import {ERC721Upgradeable} from "../ERC721Upgradeable.sol"; import {IERC721Enumerable} from "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol"; import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol"; import {Initializable} from "../../../proxy/utils/Initializable.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. * * CAUTION: `ERC721` extensions that implement custom `balanceOf` logic, such as `ERC721Consecutive`, * interfere with enumerability and should not be used together with `ERC721Enumerable`. */ abstract contract ERC721EnumerableUpgradeable is Initializable, ERC721Upgradeable, IERC721Enumerable { /// @custom:storage-location erc7201:openzeppelin.storage.ERC721Enumerable struct ERC721EnumerableStorage { mapping(address owner => mapping(uint256 index => uint256)) _ownedTokens; mapping(uint256 tokenId => uint256) _ownedTokensIndex; uint256[] _allTokens; mapping(uint256 tokenId => uint256) _allTokensIndex; } // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.ERC721Enumerable")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant ERC721EnumerableStorageLocation = 0x645e039705490088daad89bae25049a34f4a9072d398537b1ab2425f24cbed00; function _getERC721EnumerableStorage() private pure returns (ERC721EnumerableStorage storage $) { assembly { $.slot := ERC721EnumerableStorageLocation } } /** * @dev An `owner`'s token query was out of bounds for `index`. * * NOTE: The owner being `address(0)` indicates a global out of bounds index. */ error ERC721OutOfBoundsIndex(address owner, uint256 index); /** * @dev Batch mint is not allowed. */ error ERC721EnumerableForbiddenBatchMint(); function __ERC721Enumerable_init() internal onlyInitializing { } function __ERC721Enumerable_init_unchained() internal onlyInitializing { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721Upgradeable) returns (bool) { return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}. */ function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual returns (uint256) { ERC721EnumerableStorage storage $ = _getERC721EnumerableStorage(); if (index >= balanceOf(owner)) { revert ERC721OutOfBoundsIndex(owner, index); } return $._ownedTokens[owner][index]; } /** * @dev See {IERC721Enumerable-totalSupply}. */ function totalSupply() public view virtual returns (uint256) { ERC721EnumerableStorage storage $ = _getERC721EnumerableStorage(); return $._allTokens.length; } /** * @dev See {IERC721Enumerable-tokenByIndex}. */ function tokenByIndex(uint256 index) public view virtual returns (uint256) { ERC721EnumerableStorage storage $ = _getERC721EnumerableStorage(); if (index >= totalSupply()) { revert ERC721OutOfBoundsIndex(address(0), index); } return $._allTokens[index]; } /** * @dev See {ERC721-_update}. */ function _update(address to, uint256 tokenId, address auth) internal virtual override returns (address) { address previousOwner = super._update(to, tokenId, auth); if (previousOwner == address(0)) { _addTokenToAllTokensEnumeration(tokenId); } else if (previousOwner != to) { _removeTokenFromOwnerEnumeration(previousOwner, tokenId); } if (to == address(0)) { _removeTokenFromAllTokensEnumeration(tokenId); } else if (previousOwner != to) { _addTokenToOwnerEnumeration(to, tokenId); } return previousOwner; } /** * @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 { ERC721EnumerableStorage storage $ = _getERC721EnumerableStorage(); uint256 length = balanceOf(to) - 1; $._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 { ERC721EnumerableStorage storage $ = _getERC721EnumerableStorage(); $._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 { ERC721EnumerableStorage storage $ = _getERC721EnumerableStorage(); // 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 = balanceOf(from); 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 { ERC721EnumerableStorage storage $ = _getERC721EnumerableStorage(); // 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(); } /** * See {ERC721-_increaseBalance}. We need that to account tokens that were minted in batch */ function _increaseBalance(address account, uint128 amount) internal virtual override { if (amount > 0) { revert ERC721EnumerableForbiddenBatchMint(); } super._increaseBalance(account, amount); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/ERC721URIStorage.sol) pragma solidity ^0.8.20; import {ERC721Upgradeable} from "../ERC721Upgradeable.sol"; import {Strings} from "@openzeppelin/contracts/utils/Strings.sol"; import {IERC4906} from "@openzeppelin/contracts/interfaces/IERC4906.sol"; import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol"; import {Initializable} from "../../../proxy/utils/Initializable.sol"; /** * @dev ERC721 token with storage based token URI management. */ abstract contract ERC721URIStorageUpgradeable is Initializable, IERC4906, ERC721Upgradeable { using Strings for uint256; // Interface ID as defined in ERC-4906. This does not correspond to a traditional interface ID as ERC-4906 only // defines events and does not include any external function. bytes4 private constant ERC4906_INTERFACE_ID = bytes4(0x49064906); /// @custom:storage-location erc7201:openzeppelin.storage.ERC721URIStorage struct ERC721URIStorageStorage { // Optional mapping for token URIs mapping(uint256 tokenId => string) _tokenURIs; } // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.ERC721URIStorage")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant ERC721URIStorageStorageLocation = 0x0542a41881ee128a365a727b282c86fa859579490b9bb45aab8503648c8e7900; function _getERC721URIStorageStorage() private pure returns (ERC721URIStorageStorage storage $) { assembly { $.slot := ERC721URIStorageStorageLocation } } function __ERC721URIStorage_init() internal onlyInitializing { } function __ERC721URIStorage_init_unchained() internal onlyInitializing { } /** * @dev See {IERC165-supportsInterface} */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721Upgradeable, IERC165) returns (bool) { return interfaceId == ERC4906_INTERFACE_ID || super.supportsInterface(interfaceId); } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { ERC721URIStorageStorage storage $ = _getERC721URIStorageStorage(); _requireOwned(tokenId); string memory _tokenURI = $._tokenURIs[tokenId]; string memory base = _baseURI(); // If there is no base URI, return the token URI. if (bytes(base).length == 0) { return _tokenURI; } // If both are set, concatenate the baseURI and tokenURI (via string.concat). if (bytes(_tokenURI).length > 0) { return string.concat(base, _tokenURI); } return super.tokenURI(tokenId); } /** * @dev Sets `_tokenURI` as the tokenURI of `tokenId`. * * Emits {MetadataUpdate}. */ function _setTokenURI(uint256 tokenId, string memory _tokenURI) internal virtual { ERC721URIStorageStorage storage $ = _getERC721URIStorageStorage(); $._tokenURIs[tokenId] = _tokenURI; emit MetadataUpdate(tokenId); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol) pragma solidity ^0.8.20; import {Initializable} from "../proxy/utils/Initializable.sol"; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with 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 ContextUpgradeable is Initializable { function __Context_init() internal onlyInitializing { } function __Context_init_unchained() internal onlyInitializing { } function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol) pragma solidity ^0.8.20; import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol"; import {Initializable} from "../../proxy/utils/Initializable.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); * } * ``` */ abstract contract ERC165Upgradeable is Initializable, IERC165 { function __ERC165_init() internal onlyInitializing { } function __ERC165_init_unchained() internal onlyInitializing { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC6093.sol) pragma solidity ^0.8.20; /** * @dev Standard ERC20 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC20 tokens. */ interface IERC20Errors { /** * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. * @param balance Current balance for the interacting account. * @param needed Minimum amount required to perform a transfer. */ error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC20InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC20InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers. * @param spender Address that may be allowed to operate on tokens without being their owner. * @param allowance Amount of tokens a `spender` is allowed to operate with. * @param needed Minimum amount required to perform a transfer. */ error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC20InvalidApprover(address approver); /** * @dev Indicates a failure with the `spender` to be approved. Used in approvals. * @param spender Address that may be allowed to operate on tokens without being their owner. */ error ERC20InvalidSpender(address spender); } /** * @dev Standard ERC721 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC721 tokens. */ interface IERC721Errors { /** * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in EIP-20. * Used in balance queries. * @param owner Address of the current owner of a token. */ error ERC721InvalidOwner(address owner); /** * @dev Indicates a `tokenId` whose `owner` is the zero address. * @param tokenId Identifier number of a token. */ error ERC721NonexistentToken(uint256 tokenId); /** * @dev Indicates an error related to the ownership over a particular token. Used in transfers. * @param sender Address whose tokens are being transferred. * @param tokenId Identifier number of a token. * @param owner Address of the current owner of a token. */ error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC721InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC721InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `operator`’s approval. Used in transfers. * @param operator Address that may be allowed to operate on tokens without being their owner. * @param tokenId Identifier number of a token. */ error ERC721InsufficientApproval(address operator, uint256 tokenId); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC721InvalidApprover(address approver); /** * @dev Indicates a failure with the `operator` to be approved. Used in approvals. * @param operator Address that may be allowed to operate on tokens without being their owner. */ error ERC721InvalidOperator(address operator); } /** * @dev Standard ERC1155 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC1155 tokens. */ interface IERC1155Errors { /** * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. * @param balance Current balance for the interacting account. * @param needed Minimum amount required to perform a transfer. * @param tokenId Identifier number of a token. */ error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC1155InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC1155InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `operator`’s approval. Used in transfers. * @param operator Address that may be allowed to operate on tokens without being their owner. * @param owner Address of the current owner of a token. */ error ERC1155MissingApprovalForAll(address operator, address owner); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC1155InvalidApprover(address approver); /** * @dev Indicates a failure with the `operator` to be approved. Used in approvals. * @param operator Address that may be allowed to operate on tokens without being their owner. */ error ERC1155InvalidOperator(address operator); /** * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation. * Used in batch transfers. * @param idsLength Length of the array of token identifiers * @param valuesLength Length of the array of token amounts */ error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol) pragma solidity ^0.8.20; import {IERC165} from "../utils/introspection/IERC165.sol";
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC4906.sol) pragma solidity ^0.8.20; import {IERC165} from "./IERC165.sol"; import {IERC721} from "./IERC721.sol"; /// @title EIP-721 Metadata Update Extension interface IERC4906 is IERC165, IERC721 { /// @dev This event emits when the metadata of a token is changed. /// So that the third-party platforms such as NFT market could /// timely update the images and related attributes of the NFT. event MetadataUpdate(uint256 _tokenId); /// @dev This event emits when the metadata of a range of tokens is changed. /// So that the third-party platforms such as NFT market could /// timely update the images and related attributes of the NFTs. event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC721.sol) pragma solidity ^0.8.20; import {IERC721} from "../token/ERC721/IERC721.sol";
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/IERC721Enumerable.sol) pragma solidity ^0.8.20; import {IERC721} from "../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 (last updated v5.0.0) (token/ERC721/extensions/IERC721Metadata.sol) pragma solidity ^0.8.20; import {IERC721} from "../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 v5.0.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.20; import {IERC165} from "../../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: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721 * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must * understand this adds an external call which potentially creates a reentrancy vulnerability. * * 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 address zero. * * 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 v5.0.0) (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.20; /** * @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 v5.0.2) (utils/Base64.sol) pragma solidity ^0.8.20; /** * @dev Provides a set of functions to operate with Base64 strings. */ library Base64 { /** * @dev Base64 Encoding/Decoding Table */ string internal constant _TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; /** * @dev Converts a `bytes` to its Bytes64 `string` representation. */ function encode(bytes memory data) internal pure returns (string memory) { /** * Inspired by Brecht Devos (Brechtpd) implementation - MIT licence * https://github.com/Brechtpd/base64/blob/e78d9fd951e7b0977ddca77d92dc85183770daf4/base64.sol */ if (data.length == 0) return ""; // Loads the table into memory string memory table = _TABLE; // Encoding takes 3 bytes chunks of binary data from `bytes` data parameter // and split into 4 numbers of 6 bits. // The final Base64 length should be `bytes` data length multiplied by 4/3 rounded up // - `data.length + 2` -> Round up // - `/ 3` -> Number of 3-bytes chunks // - `4 *` -> 4 characters for each chunk string memory result = new string(4 * ((data.length + 2) / 3)); /// @solidity memory-safe-assembly assembly { // Prepare the lookup table (skip the first "length" byte) let tablePtr := add(table, 1) // Prepare result pointer, jump over length let resultPtr := add(result, 0x20) let dataPtr := data let endPtr := add(data, mload(data)) // In some cases, the last iteration will read bytes after the end of the data. We cache the value, and // set it to zero to make sure no dirty bytes are read in that section. let afterPtr := add(endPtr, 0x20) let afterCache := mload(afterPtr) mstore(afterPtr, 0x00) // Run over the input, 3 bytes at a time for { } lt(dataPtr, endPtr) { } { // Advance 3 bytes dataPtr := add(dataPtr, 3) let input := mload(dataPtr) // To write each character, shift the 3 byte (24 bits) chunk // 4 times in blocks of 6 bits for each character (18, 12, 6, 0) // and apply logical AND with 0x3F to bitmask the least significant 6 bits. // Use this as an index into the lookup table, mload an entire word // so the desired character is in the least significant byte, and // mstore8 this least significant byte into the result and continue. mstore8(resultPtr, mload(add(tablePtr, and(shr(18, input), 0x3F)))) resultPtr := add(resultPtr, 1) // Advance mstore8(resultPtr, mload(add(tablePtr, and(shr(12, input), 0x3F)))) resultPtr := add(resultPtr, 1) // Advance mstore8(resultPtr, mload(add(tablePtr, and(shr(6, input), 0x3F)))) resultPtr := add(resultPtr, 1) // Advance mstore8(resultPtr, mload(add(tablePtr, and(input, 0x3F)))) resultPtr := add(resultPtr, 1) // Advance } // Reset the value that was cached mstore(afterPtr, afterCache) // When data `bytes` is not exactly 3 bytes long // it is padded with `=` characters at the end switch mod(mload(data), 3) case 1 { mstore8(sub(resultPtr, 1), 0x3d) mstore8(sub(resultPtr, 2), 0x3d) } case 2 { mstore8(sub(resultPtr, 1), 0x3d) } } return result; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol) pragma solidity ^0.8.20; /** * @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 v5.0.0) (utils/math/Math.sol) pragma solidity ^0.8.20; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { /** * @dev Muldiv operation overflow. */ error MathOverflowedMulDiv(); enum Rounding { Floor, // Toward negative infinity Ceil, // Toward positive infinity Trunc, // Toward zero Expand // Away from zero } /** * @dev Returns the addition of two unsigned integers, with an overflow flag. */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the subtraction of two unsigned integers, with an overflow flag. */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds towards infinity instead * of rounding towards zero. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { if (b == 0) { // Guarantee the same behavior as in a regular Solidity division. return a / b; } // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or * denominator == 0. * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by * Uniswap Labs also under MIT license. */ function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0 = x * y; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { // Solidity will revert if denominator == 0, unlike the div opcode on its own. // The surrounding unchecked block does not change this fact. // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic. return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. if (denominator <= prod1) { revert MathOverflowedMulDiv(); } /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. // Always >= 1. See https://cs.stackexchange.com/q/138556/92363. uint256 twos = denominator & (0 - denominator); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also // works in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded * towards zero. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (unsignedRoundsUp(rounding) && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2 of a positive value rounded towards zero. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (unsignedRoundsUp(rounding) && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10 of a positive value rounded towards zero. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10 ** 64) { value /= 10 ** 64; result += 64; } if (value >= 10 ** 32) { value /= 10 ** 32; result += 32; } if (value >= 10 ** 16) { value /= 10 ** 16; result += 16; } if (value >= 10 ** 8) { value /= 10 ** 8; result += 8; } if (value >= 10 ** 4) { value /= 10 ** 4; result += 4; } if (value >= 10 ** 2) { value /= 10 ** 2; result += 2; } if (value >= 10 ** 1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (unsignedRoundsUp(rounding) && 10 ** result < value ? 1 : 0); } } /** * @dev Return the log in base 256 of a positive value rounded towards zero. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 256, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (unsignedRoundsUp(rounding) && 1 << (result << 3) < value ? 1 : 0); } } /** * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers. */ function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) { return uint8(rounding) % 2 == 1; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/math/SignedMath.sol) pragma solidity ^0.8.20; /** * @dev Standard signed math utilities missing in the Solidity language. */ library SignedMath { /** * @dev Returns the largest of two signed numbers. */ function max(int256 a, int256 b) internal pure returns (int256) { return a > b ? a : b; } /** * @dev Returns the smallest of two signed numbers. */ function min(int256 a, int256 b) internal pure returns (int256) { return a < b ? a : b; } /** * @dev Returns the average of two signed numbers without overflow. * The result is rounded towards zero. */ function average(int256 a, int256 b) internal pure returns (int256) { // Formula from the book "Hacker's Delight" int256 x = (a & b) + ((a ^ b) >> 1); return x + (int256(uint256(x) >> 255) & (a ^ b)); } /** * @dev Returns the absolute unsigned value of a signed value. */ function abs(int256 n) internal pure returns (uint256) { unchecked { // must be unchecked in order to support `n = type(int256).min` return uint256(n >= 0 ? n : -n); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/Strings.sol) pragma solidity ^0.8.20; import {Math} from "./math/Math.sol"; import {SignedMath} from "./math/SignedMath.sol"; /** * @dev String operations. */ library Strings { bytes16 private constant HEX_DIGITS = "0123456789abcdef"; uint8 private constant ADDRESS_LENGTH = 20; /** * @dev The `value` string doesn't fit in the specified `length`. */ error StringsInsufficientHexLength(uint256 value, uint256 length); /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = Math.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), HEX_DIGITS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `int256` to its ASCII `string` decimal representation. */ function toStringSigned(int256 value) internal pure returns (string memory) { return string.concat(value < 0 ? "-" : "", toString(SignedMath.abs(value))); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, Math.log256(value) + 1); } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { uint256 localValue = value; 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_DIGITS[localValue & 0xf]; localValue >>= 4; } if (localValue != 0) { revert StringsInsufficientHexLength(value, length); } 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); } /** * @dev Returns true if the two strings are equal. */ function equal(string memory a, string memory b) internal pure returns (bool) { return bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b)); } }
interface IButcher { function _manager() external view returns (address); function allowance( address owner, address spender ) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function balanceOf(address account) external view returns (uint256); function burn(uint256 amount) external; function decimals() external view returns (uint8); function decreaseAllowance( address spender, uint256 subtractedValue ) external returns (bool); function getBuyFee() external view returns (uint256); function getSellFee() external view returns (uint256); function increaseAllowance( address spender, uint256 addedValue ) external returns (bool); function mint(address _to, uint256 _amount) external; function name() external view returns (string memory); function observer() external view returns (address); function router() external view returns (address); function setCanTrade(bool _value) external; function setEntityManager(address _managerAddress) external; function setExcludedFromFees(address _address, bool _value) external; function setFeeWallet(address _feeWallet) external; function setLaunchMode(bool _value) external; function setObserver(address _observer) external; function setObserverEnabled(bool _value) external; function setOperator(address _user, bool _value) external; function setRates( uint256 buyTax, uint256 sellTax, uint256 noEntitySellTax ) external; function setRouter(address _router) external; function setSwapTokensAtAmount(uint256 _value) external; function setSwappingEnabled(bool _value) external; function symbol() external view returns (string memory); function toggleObserver() external view returns (bool); function totalSupply() external view returns (uint256); function transfer(address to, uint256 amount) external returns (bool); function transferFrom( address from, address to, uint256 amount ) external returns (bool); }
pragma solidity >=0.5.0; interface IERC20 { event Approval(address indexed owner, address indexed spender, uint value); event Transfer(address indexed from, address indexed to, uint value); function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); function totalSupply() external view returns (uint); function balanceOf(address owner) external view returns (uint); function allowance( address owner, address spender ) external view returns (uint); function approve(address spender, uint value) external returns (bool); function transfer(address to, uint value) external returns (bool); function transferFrom( address from, address to, uint value ) external returns (bool); }
interface IRewardPool { function emitRewards ( address user, uint256 amount ) external; function setOperator ( address _user, bool _value ) external; }
{ "viaIR": true, "optimizer": { "enabled": true, "runs": 1000 }, "evmVersion": "paris", "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[],"name":"ERC721EnumerableForbiddenBatchMint","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"owner","type":"address"}],"name":"ERC721IncorrectOwner","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ERC721InsufficientApproval","type":"error"},{"inputs":[{"internalType":"address","name":"approver","type":"address"}],"name":"ERC721InvalidApprover","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"ERC721InvalidOperator","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"ERC721InvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"ERC721InvalidReceiver","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"}],"name":"ERC721InvalidSender","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ERC721NonexistentToken","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"ERC721OutOfBoundsIndex","type":"error"},{"inputs":[],"name":"InvalidInitialization","type":"error"},{"inputs":[],"name":"NotInitializing","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":"uint256","name":"_fromTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_toTokenId","type":"uint256"}],"name":"BatchMetadataUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"uint256","name":"typeId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"createdAt","type":"uint256"},{"indexed":false,"internalType":"address","name":"referrer","type":"address"}],"name":"EntityCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"rewards","type":"uint256"},{"indexed":false,"internalType":"address","name":"referrer","type":"address"}],"name":"EntitySlaughtered","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"version","type":"uint64"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"MetadataUpdate","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"},{"inputs":[{"internalType":"address","name":"to","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":[{"internalType":"uint256","name":"_entityId","type":"uint256"}],"name":"calculateRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_type","type":"uint256"},{"internalType":"string","name":"_entityName","type":"string"},{"internalType":"address","name":"_referrer","type":"address"}],"name":"createEntity","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_entityId","type":"uint256"}],"name":"getDailyReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"getEntityIdsOf","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_entityId","type":"uint256"}],"name":"getEntityInfo","outputs":[{"internalType":"string","name":"","type":"string"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_type","type":"uint256"}],"name":"getEntityTypeInfo","outputs":[{"internalType":"string","name":"","type":"string"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_entityId","type":"uint256"}],"name":"getEntityTypeName","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"butcher","type":"address"},{"internalType":"address","name":"rwPool","type":"address"},{"internalType":"address","name":"treasuryWallet","type":"address"},{"internalType":"uint256","name":"_claimFees","type":"uint256"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_i","type":"uint256"}],"name":"int2str","outputs":[{"internalType":"string","name":"_uintAsString","type":"string"}],"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":[{"internalType":"address","name":"_user","type":"address"}],"name":"isChickenOwner","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"isCowOwner","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_entityId","type":"uint256"}],"name":"isEntityValid","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"isMooDengOwner","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"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":"_entityId","type":"uint256"}],"name":"printAttributes","outputs":[{"internalType":"string","name":"","type":"string"}],"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":"uint256","name":"_type","type":"uint256"},{"internalType":"uint256","name":"_price","type":"uint256"},{"internalType":"uint256","name":"_rewardPerSecond","type":"uint256"},{"internalType":"uint256","name":"_epochTime","type":"uint256"},{"internalType":"uint256","name":"_incubationTime","type":"uint256"},{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_imageURI","type":"string"}],"name":"setEntityType","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"bool","name":"value","type":"bool"}],"name":"setOperator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"treasury","type":"address"},{"internalType":"address","name":"rewardPool","type":"address"}],"name":"setWallets","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_entityId","type":"uint256"}],"name":"slaughter","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":[{"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":[{"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"}]
Contract Creation Code
60808060405234601557613f3c908161001b8239f35b600080fdfe608080604052600436101561001357600080fd5b600090813560e01c90816301ffc9a7146129f457508063022c9a50146129ba57806306fdde03146128d5578063081812fc14612878578063095ea7b31461273657806313d821f41461271657806315132f24146126c957806318160ddd1461268c578063199eae2c1461234557806323b872dd1461232d5780632f745c591461230557806337f0107e146121b35780633d882de81461170857806342842e0e146116de5780634f6ccce71461166f57806353c7008814611635578063558a7297146115e45780636247f175146115c45780636352211e14611594578063659db2951461152f57806370a082311461150b57806395d89b41146113fe578063a22cb46514611332578063b7334a4314611294578063b88d4fde14611230578063c170190a14610cda578063c87b56dd14610a03578063cf756fdf14610331578063d3ea435014610312578063d3f6a157146102a7578063d88d200014610280578063dac2b7c514610257578063e090cad21461021d5763e985e9c51461019757600080fd5b3461021a57604036600319011261021a576001600160a01b036101fd6101bb612b2b565b6101c3612b5c565b93506001600160a01b03166000527f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab0079305602052604060002090565b9116600052602052602060ff604060002054166040519015158152f35b80fd5b503461021a57602036600319011261021a5760406020916001600160a01b03610244612b2b565b1681526007835220541515604051908152f35b503461021a57602036600319011261021a576020610276600435613b45565b6040519015158152f35b503461021a57602036600319011261021a57602061029f600435613afd565b604051908152f35b503461021a57604036600319011261021a576001600160a01b036102c9612b2b565b816102d2612b5c565b9133855260056020526102eb60ff604087205416612f65565b166001600160a01b0319600a541617600a55166001600160a01b0319600954161760095580f35b503461021a57602036600319011261021a57602061029f6004356139bf565b503461021a57608036600319011261021a5761034b612b2b565b610353612b5c565b61035b612b46565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00549160ff8360401c16159267ffffffffffffffff8116801590816109fb575b60011490816109f1575b1590816109e8575b506109c05767ffffffffffffffff1981166001177ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005583610981575b5060409384516103f98682612bba565b600781527f427574636865720000000000000000000000000000000000000000000000000060208201528551906104308783612bba565b600482527f4641524d000000000000000000000000000000000000000000000000000000006020830152610462613ead565b61046a613ead565b80519067ffffffffffffffff821161096d5781906104a87f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab007930054612ccc565b601f81116108a3575b50602090601f83116001146107e2578a926107d7575b50508160011b916000199060031b1c1916177f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab0079300555b80519067ffffffffffffffff82116107c3576105387f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab007930154612ccc565b601f8111610741575b50602090601f83116001146106905792826001600160a01b0396959387959386948c92610685575b50508160011b916000199060031b1c1916177f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab0079301555b6105a6613ead565b6105ae613ead565b166001600160a01b0319600d541617600d553387526005602052858720600160ff19825416179055166001600160a01b03196009541617600955166001600160a01b0319600a541617600a55606435600255610608575080f35b60207fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29168ff0000000000000000197ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054167ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00555160018152a180f35b015190503880610569565b7f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab007930189528189209190601f1984168a5b8181106107295750936001600160a01b039796949388969360019383899710610710575b505050811b017f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab00793015561059e565b015160001960f88460031b161c191690553880806106e3565b929360206001819287860151815501950193016106bf565b7f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab007930189527ff4bad0a69248f59680a4f2b3000328cec71a413447c96781cfe5996daa8c456e601f840160051c810191602085106107b9575b601f0160051c01905b8181106107ae5750610541565b8981556001016107a1565b9091508190610798565b602488634e487b7160e01b81526041600452fd5b0151905038806104c7565b7f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab00793008b527f37c58c799b6609234b945e882912ee9ad34948a1dfaa20a97485e1a7752bbf819250601f1984168b5b81811061088b5750908460019594939210610872575b505050811b017f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab0079300556104fc565b015160001960f88460031b161c19169055388080610845565b9293602060018192878601518155019501930161082f565b9091507f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab00793008a52601f830160051c7f37c58c799b6609234b945e882912ee9ad34948a1dfaa20a97485e1a7752bbf81019060208410610945575b90601f8493920160051c7f37c58c799b6609234b945e882912ee9ad34948a1dfaa20a97485e1a7752bbf8101905b81811061093757506104b1565b8b815584935060010161092a565b7f37c58c799b6609234b945e882912ee9ad34948a1dfaa20a97485e1a7752bbf8191506108fc565b602489634e487b7160e01b81526041600452fd5b68ffffffffffffffffff191668010000000000000001177ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0055386103e9565b6004867ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b905015386103ad565b303b1591506103a5565b85915061039b565b503461021a57602036600319011261021a57610c6e610af2610c696002610cd694610c5260043591828152600360205260036040822001548152600b602052602a6029600160408420019480845260036020526001604085200193610b1c6040610a74610a6f85613afd565b612de0565b92610a7e85613604565b9481526003602052600382822001548152600b6020522095896040519c8d9a7f7b0000000000000000000000000000000000000000000000000000000000000060208d01527f226e616d65223a2022000000000000000000000000000000000000000000000060218d0152888c0190613596565b7f3a2000000000000000000000000000000000000000000000000000000000000081520190613596565b7f222c00000000000000000000000000000000000000000000000000000000000081527f226465736372697074696f6e223a20225468697320656e746974792069732066898201527f61726d696e6720000000000000000000000000000000000000000000000000006022820152610b9d8251809360208785019101612b72565b017f2042555443484552206461696c79222c00000000000000000000000000000000838201527f2261747472696275746573223a205b00000000000000000000000000000000006039820152610bfd825180936020604885019101612b72565b01017f5d2c000000000000000000000000000000000000000000000000000000000000601f8201527f22696d616765223a22000000000000000000000000000000000000000000000060218201520190613596565b61227d60f01b815203601d19810184520182612bba565b613d1c565b610cc2603d60405180937f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c0000006020830152610cb18151809260208686019101612b72565b81010301601f198101835282612bba565b604051918291602083526020830190612b95565b0390f35b503461021a57602036600319011261021a57600435610d00610cfb82613b45565b613974565b808252600360205260ff600460408420015460081c166111ec57610d2381613bcf565b6001600160a01b0316331480156111d3575b1561116957808252600360205260408220906003820180548452600b602052600460408520018054906001820180921161115557555480611103575033835260066020526040832080546000198101919082116110ef57555b610d97816139bf565b9160058302838104600514841517156110ef5760648591046064610dbd60025487612dcd565b0433835260046020526001600160a01b036040842054161515600014610fce576001600160a01b036009541633845260046020526001600160a01b0360408520541690803b15610fb557604051634f005ce160e01b81526001600160a01b039290921660048301526024820184905284908290604490829084905af1908115610faa578491610fb9575b50506001600160a01b03600954166001600160a01b03600a541690803b15610fb557604051634f005ce160e01b81526001600160a01b039290921660048301526024820183905284908290604490829084905af1908115610faa578491610f95575b5050610eca90610ec56001600160a01b03600954169388612daa565b612daa565b90803b15610f9157604051634f005ce160e01b8152336004820152602481019290925282908290604490829084905af18015610f8657610f69575b5050907f7abd8535f8f4a6e802d48a59de8210a7cc49226b4976f2ea8f826d6dd2efd9e89260046060935b0161010061ff001982541617905533855260046020526001600160a01b036040862054169060405192835260208301526040820152a180f35b81610f7691949394612bba565b610f8257908338610f05565b8380fd5b6040513d84823e3d90fd5b8280fd5b81610f9f91612bba565b610f91578238610ea9565b6040513d86823e3d90fd5b8480fd5b81610fc391612bba565b610f91578238610e47565b90506001600160a01b03600954166001600160a01b03600a541690803b15610f8257604051634f005ce160e01b81526001600160a01b039290921660048301526024820183905283908290604490829084905af19081156110e45783916110cb575b50506110486001600160a01b03600954169186612daa565b90803b15610f9157604051634f005ce160e01b8152336004820152602481019290925282908290604490829084905af18015610f86576110b2575b5050907f7abd8535f8f4a6e802d48a59de8210a7cc49226b4976f2ea8f826d6dd2efd9e8926004606093610f30565b816110bf91949394612bba565b610f8257908338611083565b816110d591612bba565b6110e0578138611030565b5080fd5b6040513d85823e3d90fd5b602485634e487b7160e01b81526011600452fd5b6001810361112d575033835260076020526040832080546000198101919082116110ef5755610d8e565b600203610d8e5733835260086020526040832080546000198101919082116110ef5755610d8e565b602486634e487b7160e01b81526011600452fd5b608460405162461bcd60e51b815260206004820152603660248201527f427574636865723a20596f7520617265206e6f7420617574686f72697a65642060448201527f746f20706572666f726d207468697320616374696f6e000000000000000000006064820152fd5b506111e781336111e282613bcf565b613c34565b610d35565b606460405162461bcd60e51b815260206004820152601e60248201527f427574636865723a20456e7469747920697320736c61756768746572656400006044820152fd5b503461021a57608036600319011261021a5761124a612b2b565b611252612b5c565b6064359167ffffffffffffffff8311610f825736602384011215610f8257611287611291933690602481600401359101612c0e565b9160443591613802565b80f35b503461021a57602036600319011261021a576040611306916004358152600b60205220610cd660038201546004830154600284015460078501546005860154906006870154926112ef6112e960018a01612d06565b98612d06565b94604051998a996101008b526101008b0190612b95565b9660208a015260408901526060880152608087015260a086015260c085015283820360e0850152612b95565b503461021a576001600160a01b0361134936612c9d565b91169081156113d2573360009081527f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab007930560205260409020826000526020526113a18160406000209060ff801983541691151516179055565b60405190151581527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3160203392a380f35b602483837f5b08ba18000000000000000000000000000000000000000000000000000000008252600452fd5b503461021a578060031936011261021a5760405190807f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab0079301549061144082612ccc565b80855291600181169081156114e45750600114611468575b610cd684610cc281860382612bba565b7f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab007930181527ff4bad0a69248f59680a4f2b3000328cec71a413447c96781cfe5996daa8c456e939250905b8082106114ca57509091508101602001610cc282611458565b9192600181602092548385880101520191019092916114b1565b60ff191660208087019190915292151560051b85019092019250610cc29150839050611458565b503461021a57602036600319011261021a57602061029f61152a612b2b565b613784565b503461021a57602036600319011261021a576040611583916004358152600360205220600381015461156e600160ff600485015460081c169301612d06565b91604051938493606085526060850190612b95565b916020840152151560408301520390f35b503461021a57602036600319011261021a5760206115b3600435613bcf565b6001600160a01b0360405191168152f35b503461021a57602036600319011261021a57610cd6610cc2600435613604565b503461021a576112916001600160a01b036115fe36612c9d565b9190338552600560205261161860ff604087205416612f65565b1683526005602052604083209060ff801983541691151516179055565b503461021a57602036600319011261021a5760406020916001600160a01b0361165c612b2b565b1681526008835220541515604051908152f35b503461021a57602036600319011261021a57600435907f645e039705490088daad89bae25049a34f4a9072d398537b1ab2425f24cbed02548210156116c85760206116b98361353d565b90549060031b1c604051908152f35b60449163295f44f760e21b825281600452602452fd5b503461021a576112916116f036612c63565b9060405192611700602085612bba565b858452613802565b503461021a57606036600319011261021a576004359060243567ffffffffffffffff81116110e05761173e903690600401612c45565b611746612b46565b60ff83541661216f5733835260046020526001600160a01b0360408420541615612145575b838352600b60205260408320600381019081546001810180911161115557825584602060026001600160a01b03600d54169301926064845460405194859384927f23b872dd00000000000000000000000000000000000000000000000000000000845233600485015230602485015260448401525af1801561213a5761211d575b5054600d5460009550811591906001600160a01b0316601e808302908382041484171561210957813b15612105576064602489928360405195869485937f42966c680000000000000000000000000000000000000000000000000000000085520460048401525af180156120d2576120f1575b506001600160a01b03600d54166001600160a01b036009541690603c8302838104603c148517156120dd5760405163a9059cbb60e01b81526001600160a01b03939093166004840152606490046024830152602090829060449082908b905af180156120d2576120b3575b506001600160a01b03600d5416906001600160a01b03600a541692600a8202918204600a141715611d345760405163a9059cbb60e01b81526001600160a01b039390931660048401526064900460248301526020908290604490829089905af180156120a857612079575b50805490600182018092116110ef57558361202957338352600660205260408320805490600182018092116110ef57555b6001546001810180911161201557806001556040519060c0820182811067ffffffffffffffff82111761200157604052808252602082019184835260408101428152606082019088825260808301946001865260a084019489865289526003602052604089209351845560018401905180519067ffffffffffffffff8211611fed576119f28354612ccc565b601f8111611fa8575b506020908b601f8411600114611f3b579260049694928192611a5799979592611f30575b50508160011b916000199060031b1c19161790555b5160028301555160038201550192511515839060ff801983541691151516179055565b51815461ff00191690151560081b61ff00161790556001543315611f1d57611ab2816000527f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab00793026020526001600160a01b036040600020541690565b6001600160a01b0381169182159283159384611e94575b3360009081527f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab007930360205260409020600181540190558288527f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab0079302602052604088206001600160a01b0333166001600160a01b03198254161790558233837fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8b80a415611d48577f645e039705490088daad89bae25049a34f4a9072d398537b1ab2425f24cbed02548288527f645e039705490088daad89bae25049a34f4a9072d398537b1ab2425f24cbed03602052806040892055680100000000000000008110156107c35782611c01826001611c1a94017f645e039705490088daad89bae25049a34f4a9072d398537b1ab2425f24cbed025561353d565b90919082549060031b91821b91600019901b1916179055565b3303611cb6575b5050611c8a577f6c743bd101ab517cbbb3d353c33a9064238113c373ddf7e0ffea8510864a1dee92936001600160a01b0360015492611c72604051958695865260a0602087015260a0860190612b95565b9260408501524260608501521660808301520390a180f35b6024837f73c6ac6e00000000000000000000000000000000000000000000000000000000815280600452fd5b611cbf33613784565b600019810191908211611d34573387527f645e039705490088daad89bae25049a34f4a9072d398537b1ab2425f24cbed006020526040872082885260205280604088205586527f645e039705490088daad89bae25049a34f4a9072d398537b1ab2425f24cbed01602052604086205538611c21565b602487634e487b7160e01b81526011600452fd5b338114611c1a57611d5883613784565b8288527f645e039705490088daad89bae25049a34f4a9072d398537b1ab2425f24cbed016020526040882054818103611df6575b508288527f645e039705490088daad89bae25049a34f4a9072d398537b1ab2425f24cbed016020528760408120558188527f645e039705490088daad89bae25049a34f4a9072d398537b1ab2425f24cbed0060205260408820908852602052866040812055611c1a565b8289527f645e039705490088daad89bae25049a34f4a9072d398537b1ab2425f24cbed0060205260408920828a526020526040892054838a527f645e039705490088daad89bae25049a34f4a9072d398537b1ab2425f24cbed0060205260408a20828b526020528060408b205589527f645e039705490088daad89bae25049a34f4a9072d398537b1ab2425f24cbed01602052604089205538611d8c565b611ed4836000527f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab007930460205260406000206001600160a01b03198154169055565b611f10846001600160a01b03166000527f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab0079303602052604060002090565b8054600019019055611ac9565b602484633250574960e11b815280600452fd5b015190503880611a1f565b50838c52818c209190601f1984168d5b818110611f905750926001928592611a579a989660049a989610611f77575b505050811b019055611a34565b015160001960f88460031b161c19169055388080611f6a565b92936020600181928786015181550195019301611f4b565b838c5260208c20601f840160051c81019160208510611fe3575b601f0160051c01905b818110611fd857506119fb565b8c8155600101611fcb565b9091508190611fc2565b60248b634e487b7160e01b81526041600452fd5b602486634e487b7160e01b81526041600452fd5b602484634e487b7160e01b81526011600452fd5b6001840361205157338352600760205260408320805490600182018092116110ef5755611966565b6002840361196657338352600860205260408320805490600182018092116110ef5755611966565b61209a9060203d6020116120a1575b6120928183612bba565b810190613525565b5038611935565b503d612088565b6040513d87823e3d90fd5b6120cb9060203d6020116120a1576120928183612bba565b50386118ca565b6040513d89823e3d90fd5b602489634e487b7160e01b81526011600452fd5b866120fe91979297612bba565b943861185f565b8780fd5b602488634e487b7160e01b81526011600452fd5b6121359060203d6020116120a1576120928183612bba565b6117ec565b6040513d88823e3d90fd5b3383526004602052604083206001600160a01b0382166001600160a01b031982541617905561176b565b606460405162461bcd60e51b815260206004820152601b60248201527f427574636865723a20436f6e74726163742069732070617573656400000000006044820152fd5b503461021a57602036600319011261021a576121cd612b2b565b6121d681613784565b6121df81613500565b906121ed6040519283612bba565b8082526121f981613500565b602083019390601f1901368537845b8281106122545750505090604051928392602084019060208552518091526040840192915b81811061223b575050500390f35b825184528594506020938401939092019160010161222d565b61225e818361348a565b61226781613b45565b1561229c57845182101561228857600582901b850160200152600101612208565b602487634e487b7160e01b81526032600452fd5b608460405162461bcd60e51b8152602060048201526024808201527f456e746974793a20476976656e206e6f646520696420646f6573206e6f74206560448201527f78697374000000000000000000000000000000000000000000000000000000006064820152fd5b503461021a57604036600319011261021a57602061029f612324612b2b565b6024359061348a565b503461021a5761129161233f36612c63565b91612fb0565b503461021a5760e036600319011261021a5760a43567ffffffffffffffff81116110e057612377903690600401612c45565b9060c43567ffffffffffffffff81116110e057612398903690600401612c45565b33825260056020526123b060ff604084205416612f65565b60405190610100820182811067ffffffffffffffff82111761267857604052815260208101928352604081016024358152606082018381526080830184815260a0840190606435825260c0850192608435845260e086019460443586526004358852600b60205260408820965180519067ffffffffffffffff82116125a657819061243b8a54612ccc565b601f8111612628575b50602090601f83116001146125c5578b926125ba575b50508160011b916000199060031b1c19161787555b60018701985198895167ffffffffffffffff81116125a6576124918254612ccc565b601f8111612561575b506020601f82116001146124fb5781908b9c60079b9c926124f0575b50508160011b916000199060031b1c19161790555b5160028801555160038701555160048601555160058501555160068401555191015580f35b0151905038806124b6565b828b52808b209b601f1983168c5b81811061254957509160079b9c9d91846001959410612530575b505050811b0190556124cb565b015160001960f88460031b161c19169055388080612523565b838301518f556001909e019d60209384019301612509565b828b5260208b20601f830160051c8101916020841061259c575b601f0160051c01905b818110612591575061249a565b8b8155600101612584565b909150819061257b565b60248a634e487b7160e01b81526041600452fd5b01519050388061245a565b8a8c52818c209250601f1984168c5b81811061261057509084600195949392106125f7575b505050811b01875561246f565b015160001960f88460031b161c191690553880806125ea565b929360206001819287860151815501950193016125d4565b909150898b5260208b20601f840160051c8101916020851061266e575b90601f859493920160051c01905b8181106126605750612444565b8c8155849350600101612653565b9091508190612645565b602484634e487b7160e01b81526041600452fd5b503461021a578060031936011261021a5760207f645e039705490088daad89bae25049a34f4a9072d398537b1ab2425f24cbed0254604051908152f35b503461021a57602036600319011261021a57610cc260016040610cd6936004356126fa6126f582613b45565b612f1a565b81526003602052600382822001548152600b6020522001612d06565b503461021a57602036600319011261021a57610cd6610cc2600435612de0565b503461021a57604036600319011261021a57612750612b2b565b60243561275c81613bcf565b33151580612865575b80612814575b6127e85781906001600160a01b0380851691167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258680a482527f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab00793046020526001600160a01b036040832091166001600160a01b031982541617905580f35b6024847fa9fbf51f00000000000000000000000000000000000000000000000000000000815233600452fd5b50612851816001600160a01b03166000527f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab0079305602052604060002090565b338552602052604084205460ff161561276b565b50336001600160a01b0382161415612765565b503461021a57602036600319011261021a5760206115b360043561289b81613bcf565b506000527f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab00793046020526001600160a01b036040600020541690565b503461021a578060031936011261021a5760405190807f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab0079300549061291782612ccc565b80855291600181169081156114e4575060011461293e57610cd684610cc281860382612bba565b7f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab007930081527f37c58c799b6609234b945e882912ee9ad34948a1dfaa20a97485e1a7752bbf81939250905b8082106129a057509091508101602001610cc282611458565b919260018160209254838588010152019101909291612987565b503461021a57602036600319011261021a5760406020916001600160a01b036129e1612b2b565b1681526006835220541515604051908152f35b9050346110e05760203660031901126110e0576004357fffffffff000000000000000000000000000000000000000000000000000000008116809103610f9157602092507f49064906000000000000000000000000000000000000000000000000000000008114908115612a6a575b5015158152f35b7f780e9d6300000000000000000000000000000000000000000000000000000000811491508115612a9d575b5038612a63565b7f80ac58cd00000000000000000000000000000000000000000000000000000000811491508115612b01575b8115612ad7575b5038612a96565b7f01ffc9a70000000000000000000000000000000000000000000000000000000091501438612ad0565b7f5b5e139f0000000000000000000000000000000000000000000000000000000081149150612ac9565b600435906001600160a01b0382168203612b4157565b600080fd5b604435906001600160a01b0382168203612b4157565b602435906001600160a01b0382168203612b4157565b60005b838110612b855750506000910152565b8181015183820152602001612b75565b90602091612bae81518092818552858086019101612b72565b601f01601f1916010190565b90601f8019910116810190811067ffffffffffffffff821117612bdc57604052565b634e487b7160e01b600052604160045260246000fd5b67ffffffffffffffff8111612bdc57601f01601f191660200190565b929192612c1a82612bf2565b91612c286040519384612bba565b829481845281830111612b41578281602093846000960137010152565b9080601f83011215612b4157816020612c6093359101612c0e565b90565b6060906003190112612b41576004356001600160a01b0381168103612b4157906024356001600160a01b0381168103612b41579060443590565b6040906003190112612b41576004356001600160a01b0381168103612b4157906024358015158103612b415790565b90600182811c92168015612cfc575b6020831014612ce657565b634e487b7160e01b600052602260045260246000fd5b91607f1691612cdb565b9060405191826000825492612d1a84612ccc565b8084529360018116908115612d885750600114612d41575b50612d3f92500383612bba565b565b90506000929192526020600020906000915b818310612d6c575050906020612d3f9282010138612d32565b6020919350806001915483858901015201910190918492612d53565b905060209250612d3f94915060ff191682840152151560051b82010138612d32565b91908203918211612db757565b634e487b7160e01b600052601160045260246000fd5b81810292918115918404141715612db757565b908115612edd579080816000925b612ebf5750612dfc82612bf2565b91612e0a6040519384612bba565b808352601f19612e1982612bf2565b01366020850137905b818115612eb9576000198301928311612db75782600a830492600a840290848204600a1485151715612db75760ff91612e5a91612daa565b166030019060ff8211612db75785511115612ea35760f81b7fff000000000000000000000000000000000000000000000000000000000000001660001a908401601f0153612e22565b634e487b7160e01b600052603260045260246000fd5b50505090565b909290916000198114612db7576001600a9101920480939193612dee565b9050604051612eed604082612bba565b600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b15612f2157565b606460405162461bcd60e51b815260206004820152601960248201527f456e746974793a20496e76616c696420656e74697479204944000000000000006044820152fd5b15612f6c57565b606460405162461bcd60e51b815260206004820152601b60248201527f4e6f74206f70657261746f72206f6e20746865206d616e6167657200000000006044820152fd5b92916001600160a01b03821693841561347457600094613003836000527f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab00793026020526001600160a01b036040600020541690565b9033613414575b6001600160a01b038216948515801561338b575b61305a826001600160a01b03166000527f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab0079303602052604060002090565b600181540190558589527f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab007930260205260408920836001600160a01b03198254161790558583887fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8c80a41561323f577f645e039705490088daad89bae25049a34f4a9072d398537b1ab2425f24cbed02548589527f645e039705490088daad89bae25049a34f4a9072d398537b1ab2425f24cbed036020528060408a20556801000000000000000081101561096d5785611c0182600161315b94017f645e039705490088daad89bae25049a34f4a9072d398537b1ab2425f24cbed025561353d565b8186036131b3575b50506001600160a01b039293949550501680830361318057505050565b7f64283d7b0000000000000000000000000000000000000000000000000000000060005260045260245260445260646000fd5b6131bc90613784565b60001981019190821161210957876040916001600160a01b0396979899527f645e039705490088daad89bae25049a34f4a9072d398537b1ab2425f24cbed0060205281812083825260205286828220558681527f645e039705490088daad89bae25049a34f4a9072d398537b1ab2425f24cbed0160205220558594939238613163565b85821461315b5761324f83613784565b8589527f645e039705490088daad89bae25049a34f4a9072d398537b1ab2425f24cbed0160205260408920548181036132ed575b508589527f645e039705490088daad89bae25049a34f4a9072d398537b1ab2425f24cbed016020528860408120558689527f645e039705490088daad89bae25049a34f4a9072d398537b1ab2425f24cbed006020526040892090895260205287604081205561315b565b878a527f645e039705490088daad89bae25049a34f4a9072d398537b1ab2425f24cbed0060205260408a20828b5260205260408a2054888b527f645e039705490088daad89bae25049a34f4a9072d398537b1ab2425f24cbed0060205260408b20828c526020528060408c20558a527f645e039705490088daad89bae25049a34f4a9072d398537b1ab2425f24cbed0160205260408a205538613283565b6133cb866000527f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab007930460205260406000206001600160a01b03198154169055565b613407846001600160a01b03166000527f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab0079303602052604060002090565b805460001901905561301e565b61341f843384613c34565b61300a5783876001600160a01b03841661344557602491637e27328960e01b8252600452fd5b6044917f177e802f00000000000000000000000000000000000000000000000000000000825233600452602452fd5b633250574960e11b600052600060045260246000fd5b61349381613784565b8210156134df576001600160a01b03166000527f645e039705490088daad89bae25049a34f4a9072d398537b1ab2425f24cbed0060205260406000209060005260205260406000205490565b6001600160a01b039063295f44f760e21b6000521660045260245260446000fd5b67ffffffffffffffff8111612bdc5760051b60200190565b91908201809211612db757565b90816020910312612b4157518015158103612b415790565b7f645e039705490088daad89bae25049a34f4a9072d398537b1ab2425f24cbed0254811015612ea3577f645e039705490088daad89bae25049a34f4a9072d398537b1ab2425f24cbed0260005260206000200190600090565b600092918154916135a683612ccc565b92600181169081156135f157506001146135bf57505050565b909192935060005260206000206000905b8382106135dd5750500190565b6001816020925484860152019101906135d0565b60ff191683525050811515909102019150565b612c606002670de0b6b3a764000061361b846139bf565b04610c52602061363b604051936136328386612bba565b60008552612de0565b9560005260038152600360406000200154600052600b8152605260016040600020019160405197856136768a9751809285808b019101612b72565b86017f7b2274726169745f74797065223a220000000000000000000000000000000000838201527f50656e64696e6720526577617264730000000000000000000000000000000000602f8201526a1116113b30b63ab2911d1160a91b603e8201526136ea8251809385604985019101612b72565b01017f2042555443484552000000000000000000000000000000000000000000000000602982015261227d60f01b60318201527f2c7b2274726169745f74797065223a220000000000000000000000000000000060338201527f547970650000000000000000000000000000000000000000000000000000000060438201526a1116113b30b63ab2911d1160a91b60478201520190613596565b6001600160a01b038116156137d3576137cf906001600160a01b03166000527f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab0079303602052604060002090565b5490565b7f89c62b6400000000000000000000000000000000000000000000000000000000600052600060045260246000fd5b9061380e838284612fb0565b803b61381b575b50505050565b6020916138616001600160a01b03809316956040519586948594630a85bd0160e11b86523360048701521660248501526044840152608060648401526084830190612b95565b03816000865af18091600091613919575b50906138cb57503d156138c4573d61388981612bf2565b906138976040519283612bba565b81523d6000602083013e5b805190816138bf5782633250574960e11b60005260045260246000fd5b602001fd5b60606138a2565b7fffffffff00000000000000000000000000000000000000000000000000000000630a85bd0160e11b911603613905575038808080613815565b633250574960e11b60005260045260246000fd5b6020813d60201161396c575b8161393260209383612bba565b810103126110e05751907fffffffff000000000000000000000000000000000000000000000000000000008216820361021a575038613872565b3d9150613925565b1561397b57565b606460405162461bcd60e51b815260206004820152601e60248201527f427574636865723a20456e7469747920646f6573206e6f7420657869737400006044820152fd5b6139cb610cfb82613b45565b60005260036020526040600020906003820154600052600b602052600260406000209201546139fa8142612daa565b9060058401549160008315613ae9575082613a1791049142612daa565b8215613ad3578290069160009082613a3b575050506007612c609293015490612dcd565b9490929160078201549560066000930154915b808410613a6e575b50505050613a6890612c609394612dcd565b90613518565b9091929694838814613aa857613a8890613a688488612dcd565b948060011b9080820460021490151715612db75796600101929190613a4e565b94925092613a68613ac992613ac4612c609899613a6897612daa565b612dcd565b9181959438613a56565b634e487b7160e01b600052601260045260246000fd5b80634e487b7160e01b602492526012600452fd5b613b096126f582613b45565b6000526003602052600360406000200154600052600b60205260076040600020015462015180810290808204620151801490151715612db75790565b6001548111613b6557600052600360205260ff6004604060002001541690565b608460405162461bcd60e51b815260206004820152602c60248201527f456e746974793a204964206d757374206265206c6f776572207468616e20746f60448201527f74616c20656e74697469657300000000000000000000000000000000000000006064820152fd5b613c0c816000527f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab00793026020526001600160a01b036040600020541690565b906001600160a01b03821615613c20575090565b637e27328960e01b60005260045260246000fd5b906001600160a01b03168015159283613c4d5750505090565b6001600160a01b0383168214935090918315613cc7575b508215613c76575b5050388080612eb9565b6001600160a01b03919250613cbe906000527f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab00793046020526001600160a01b036040600020541690565b16143880613c6c565b613d059193506001600160a01b03166000527f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab0079305602052604060002090565b8160005260205260ff604060002054169138613c64565b90815115613e965760405191613d33606084612bba565b604083527f4142434445464748494a4b4c4d4e4f505152535455565758595a61626364656660208401527f6768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2f6040840152805160028101809111612db75760039004908160021b917f3fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff811603612db757613de4613dce83612bf2565b92613ddc6040519485612bba565b808452612bf2565b6020830190601f1901368237908081518201956020870190815192600083525b888110613e485750506003939495965052510680600114613e3557600214613e2a575090565b603d90600019015390565b50603d9081600019820153600119015390565b600360049199969901986001603f8b5182828260121c16870101518453828282600c1c16870101518385015382828260061c1687010151600285015316840101516003820153019497613e04565b9050604051613ea6602082612bba565b6000815290565b60ff7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005460401c1615613edc57565b7fd7e6bcf80000000000000000000000000000000000000000000000000000000060005260046000fdfea2646970667358221220deff5b8e6f481758aff5ea27dffc7175bccbcaedff8fa043e45ac9b16fb00d0464736f6c634300081b0033
Deployed Bytecode
0x608080604052600436101561001357600080fd5b600090813560e01c90816301ffc9a7146129f457508063022c9a50146129ba57806306fdde03146128d5578063081812fc14612878578063095ea7b31461273657806313d821f41461271657806315132f24146126c957806318160ddd1461268c578063199eae2c1461234557806323b872dd1461232d5780632f745c591461230557806337f0107e146121b35780633d882de81461170857806342842e0e146116de5780634f6ccce71461166f57806353c7008814611635578063558a7297146115e45780636247f175146115c45780636352211e14611594578063659db2951461152f57806370a082311461150b57806395d89b41146113fe578063a22cb46514611332578063b7334a4314611294578063b88d4fde14611230578063c170190a14610cda578063c87b56dd14610a03578063cf756fdf14610331578063d3ea435014610312578063d3f6a157146102a7578063d88d200014610280578063dac2b7c514610257578063e090cad21461021d5763e985e9c51461019757600080fd5b3461021a57604036600319011261021a576001600160a01b036101fd6101bb612b2b565b6101c3612b5c565b93506001600160a01b03166000527f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab0079305602052604060002090565b9116600052602052602060ff604060002054166040519015158152f35b80fd5b503461021a57602036600319011261021a5760406020916001600160a01b03610244612b2b565b1681526007835220541515604051908152f35b503461021a57602036600319011261021a576020610276600435613b45565b6040519015158152f35b503461021a57602036600319011261021a57602061029f600435613afd565b604051908152f35b503461021a57604036600319011261021a576001600160a01b036102c9612b2b565b816102d2612b5c565b9133855260056020526102eb60ff604087205416612f65565b166001600160a01b0319600a541617600a55166001600160a01b0319600954161760095580f35b503461021a57602036600319011261021a57602061029f6004356139bf565b503461021a57608036600319011261021a5761034b612b2b565b610353612b5c565b61035b612b46565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00549160ff8360401c16159267ffffffffffffffff8116801590816109fb575b60011490816109f1575b1590816109e8575b506109c05767ffffffffffffffff1981166001177ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005583610981575b5060409384516103f98682612bba565b600781527f427574636865720000000000000000000000000000000000000000000000000060208201528551906104308783612bba565b600482527f4641524d000000000000000000000000000000000000000000000000000000006020830152610462613ead565b61046a613ead565b80519067ffffffffffffffff821161096d5781906104a87f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab007930054612ccc565b601f81116108a3575b50602090601f83116001146107e2578a926107d7575b50508160011b916000199060031b1c1916177f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab0079300555b80519067ffffffffffffffff82116107c3576105387f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab007930154612ccc565b601f8111610741575b50602090601f83116001146106905792826001600160a01b0396959387959386948c92610685575b50508160011b916000199060031b1c1916177f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab0079301555b6105a6613ead565b6105ae613ead565b166001600160a01b0319600d541617600d553387526005602052858720600160ff19825416179055166001600160a01b03196009541617600955166001600160a01b0319600a541617600a55606435600255610608575080f35b60207fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29168ff0000000000000000197ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054167ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00555160018152a180f35b015190503880610569565b7f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab007930189528189209190601f1984168a5b8181106107295750936001600160a01b039796949388969360019383899710610710575b505050811b017f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab00793015561059e565b015160001960f88460031b161c191690553880806106e3565b929360206001819287860151815501950193016106bf565b7f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab007930189527ff4bad0a69248f59680a4f2b3000328cec71a413447c96781cfe5996daa8c456e601f840160051c810191602085106107b9575b601f0160051c01905b8181106107ae5750610541565b8981556001016107a1565b9091508190610798565b602488634e487b7160e01b81526041600452fd5b0151905038806104c7565b7f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab00793008b527f37c58c799b6609234b945e882912ee9ad34948a1dfaa20a97485e1a7752bbf819250601f1984168b5b81811061088b5750908460019594939210610872575b505050811b017f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab0079300556104fc565b015160001960f88460031b161c19169055388080610845565b9293602060018192878601518155019501930161082f565b9091507f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab00793008a52601f830160051c7f37c58c799b6609234b945e882912ee9ad34948a1dfaa20a97485e1a7752bbf81019060208410610945575b90601f8493920160051c7f37c58c799b6609234b945e882912ee9ad34948a1dfaa20a97485e1a7752bbf8101905b81811061093757506104b1565b8b815584935060010161092a565b7f37c58c799b6609234b945e882912ee9ad34948a1dfaa20a97485e1a7752bbf8191506108fc565b602489634e487b7160e01b81526041600452fd5b68ffffffffffffffffff191668010000000000000001177ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0055386103e9565b6004867ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b905015386103ad565b303b1591506103a5565b85915061039b565b503461021a57602036600319011261021a57610c6e610af2610c696002610cd694610c5260043591828152600360205260036040822001548152600b602052602a6029600160408420019480845260036020526001604085200193610b1c6040610a74610a6f85613afd565b612de0565b92610a7e85613604565b9481526003602052600382822001548152600b6020522095896040519c8d9a7f7b0000000000000000000000000000000000000000000000000000000000000060208d01527f226e616d65223a2022000000000000000000000000000000000000000000000060218d0152888c0190613596565b7f3a2000000000000000000000000000000000000000000000000000000000000081520190613596565b7f222c00000000000000000000000000000000000000000000000000000000000081527f226465736372697074696f6e223a20225468697320656e746974792069732066898201527f61726d696e6720000000000000000000000000000000000000000000000000006022820152610b9d8251809360208785019101612b72565b017f2042555443484552206461696c79222c00000000000000000000000000000000838201527f2261747472696275746573223a205b00000000000000000000000000000000006039820152610bfd825180936020604885019101612b72565b01017f5d2c000000000000000000000000000000000000000000000000000000000000601f8201527f22696d616765223a22000000000000000000000000000000000000000000000060218201520190613596565b61227d60f01b815203601d19810184520182612bba565b613d1c565b610cc2603d60405180937f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c0000006020830152610cb18151809260208686019101612b72565b81010301601f198101835282612bba565b604051918291602083526020830190612b95565b0390f35b503461021a57602036600319011261021a57600435610d00610cfb82613b45565b613974565b808252600360205260ff600460408420015460081c166111ec57610d2381613bcf565b6001600160a01b0316331480156111d3575b1561116957808252600360205260408220906003820180548452600b602052600460408520018054906001820180921161115557555480611103575033835260066020526040832080546000198101919082116110ef57555b610d97816139bf565b9160058302838104600514841517156110ef5760648591046064610dbd60025487612dcd565b0433835260046020526001600160a01b036040842054161515600014610fce576001600160a01b036009541633845260046020526001600160a01b0360408520541690803b15610fb557604051634f005ce160e01b81526001600160a01b039290921660048301526024820184905284908290604490829084905af1908115610faa578491610fb9575b50506001600160a01b03600954166001600160a01b03600a541690803b15610fb557604051634f005ce160e01b81526001600160a01b039290921660048301526024820183905284908290604490829084905af1908115610faa578491610f95575b5050610eca90610ec56001600160a01b03600954169388612daa565b612daa565b90803b15610f9157604051634f005ce160e01b8152336004820152602481019290925282908290604490829084905af18015610f8657610f69575b5050907f7abd8535f8f4a6e802d48a59de8210a7cc49226b4976f2ea8f826d6dd2efd9e89260046060935b0161010061ff001982541617905533855260046020526001600160a01b036040862054169060405192835260208301526040820152a180f35b81610f7691949394612bba565b610f8257908338610f05565b8380fd5b6040513d84823e3d90fd5b8280fd5b81610f9f91612bba565b610f91578238610ea9565b6040513d86823e3d90fd5b8480fd5b81610fc391612bba565b610f91578238610e47565b90506001600160a01b03600954166001600160a01b03600a541690803b15610f8257604051634f005ce160e01b81526001600160a01b039290921660048301526024820183905283908290604490829084905af19081156110e45783916110cb575b50506110486001600160a01b03600954169186612daa565b90803b15610f9157604051634f005ce160e01b8152336004820152602481019290925282908290604490829084905af18015610f86576110b2575b5050907f7abd8535f8f4a6e802d48a59de8210a7cc49226b4976f2ea8f826d6dd2efd9e8926004606093610f30565b816110bf91949394612bba565b610f8257908338611083565b816110d591612bba565b6110e0578138611030565b5080fd5b6040513d85823e3d90fd5b602485634e487b7160e01b81526011600452fd5b6001810361112d575033835260076020526040832080546000198101919082116110ef5755610d8e565b600203610d8e5733835260086020526040832080546000198101919082116110ef5755610d8e565b602486634e487b7160e01b81526011600452fd5b608460405162461bcd60e51b815260206004820152603660248201527f427574636865723a20596f7520617265206e6f7420617574686f72697a65642060448201527f746f20706572666f726d207468697320616374696f6e000000000000000000006064820152fd5b506111e781336111e282613bcf565b613c34565b610d35565b606460405162461bcd60e51b815260206004820152601e60248201527f427574636865723a20456e7469747920697320736c61756768746572656400006044820152fd5b503461021a57608036600319011261021a5761124a612b2b565b611252612b5c565b6064359167ffffffffffffffff8311610f825736602384011215610f8257611287611291933690602481600401359101612c0e565b9160443591613802565b80f35b503461021a57602036600319011261021a576040611306916004358152600b60205220610cd660038201546004830154600284015460078501546005860154906006870154926112ef6112e960018a01612d06565b98612d06565b94604051998a996101008b526101008b0190612b95565b9660208a015260408901526060880152608087015260a086015260c085015283820360e0850152612b95565b503461021a576001600160a01b0361134936612c9d565b91169081156113d2573360009081527f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab007930560205260409020826000526020526113a18160406000209060ff801983541691151516179055565b60405190151581527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3160203392a380f35b602483837f5b08ba18000000000000000000000000000000000000000000000000000000008252600452fd5b503461021a578060031936011261021a5760405190807f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab0079301549061144082612ccc565b80855291600181169081156114e45750600114611468575b610cd684610cc281860382612bba565b7f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab007930181527ff4bad0a69248f59680a4f2b3000328cec71a413447c96781cfe5996daa8c456e939250905b8082106114ca57509091508101602001610cc282611458565b9192600181602092548385880101520191019092916114b1565b60ff191660208087019190915292151560051b85019092019250610cc29150839050611458565b503461021a57602036600319011261021a57602061029f61152a612b2b565b613784565b503461021a57602036600319011261021a576040611583916004358152600360205220600381015461156e600160ff600485015460081c169301612d06565b91604051938493606085526060850190612b95565b916020840152151560408301520390f35b503461021a57602036600319011261021a5760206115b3600435613bcf565b6001600160a01b0360405191168152f35b503461021a57602036600319011261021a57610cd6610cc2600435613604565b503461021a576112916001600160a01b036115fe36612c9d565b9190338552600560205261161860ff604087205416612f65565b1683526005602052604083209060ff801983541691151516179055565b503461021a57602036600319011261021a5760406020916001600160a01b0361165c612b2b565b1681526008835220541515604051908152f35b503461021a57602036600319011261021a57600435907f645e039705490088daad89bae25049a34f4a9072d398537b1ab2425f24cbed02548210156116c85760206116b98361353d565b90549060031b1c604051908152f35b60449163295f44f760e21b825281600452602452fd5b503461021a576112916116f036612c63565b9060405192611700602085612bba565b858452613802565b503461021a57606036600319011261021a576004359060243567ffffffffffffffff81116110e05761173e903690600401612c45565b611746612b46565b60ff83541661216f5733835260046020526001600160a01b0360408420541615612145575b838352600b60205260408320600381019081546001810180911161115557825584602060026001600160a01b03600d54169301926064845460405194859384927f23b872dd00000000000000000000000000000000000000000000000000000000845233600485015230602485015260448401525af1801561213a5761211d575b5054600d5460009550811591906001600160a01b0316601e808302908382041484171561210957813b15612105576064602489928360405195869485937f42966c680000000000000000000000000000000000000000000000000000000085520460048401525af180156120d2576120f1575b506001600160a01b03600d54166001600160a01b036009541690603c8302838104603c148517156120dd5760405163a9059cbb60e01b81526001600160a01b03939093166004840152606490046024830152602090829060449082908b905af180156120d2576120b3575b506001600160a01b03600d5416906001600160a01b03600a541692600a8202918204600a141715611d345760405163a9059cbb60e01b81526001600160a01b039390931660048401526064900460248301526020908290604490829089905af180156120a857612079575b50805490600182018092116110ef57558361202957338352600660205260408320805490600182018092116110ef57555b6001546001810180911161201557806001556040519060c0820182811067ffffffffffffffff82111761200157604052808252602082019184835260408101428152606082019088825260808301946001865260a084019489865289526003602052604089209351845560018401905180519067ffffffffffffffff8211611fed576119f28354612ccc565b601f8111611fa8575b506020908b601f8411600114611f3b579260049694928192611a5799979592611f30575b50508160011b916000199060031b1c19161790555b5160028301555160038201550192511515839060ff801983541691151516179055565b51815461ff00191690151560081b61ff00161790556001543315611f1d57611ab2816000527f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab00793026020526001600160a01b036040600020541690565b6001600160a01b0381169182159283159384611e94575b3360009081527f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab007930360205260409020600181540190558288527f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab0079302602052604088206001600160a01b0333166001600160a01b03198254161790558233837fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8b80a415611d48577f645e039705490088daad89bae25049a34f4a9072d398537b1ab2425f24cbed02548288527f645e039705490088daad89bae25049a34f4a9072d398537b1ab2425f24cbed03602052806040892055680100000000000000008110156107c35782611c01826001611c1a94017f645e039705490088daad89bae25049a34f4a9072d398537b1ab2425f24cbed025561353d565b90919082549060031b91821b91600019901b1916179055565b3303611cb6575b5050611c8a577f6c743bd101ab517cbbb3d353c33a9064238113c373ddf7e0ffea8510864a1dee92936001600160a01b0360015492611c72604051958695865260a0602087015260a0860190612b95565b9260408501524260608501521660808301520390a180f35b6024837f73c6ac6e00000000000000000000000000000000000000000000000000000000815280600452fd5b611cbf33613784565b600019810191908211611d34573387527f645e039705490088daad89bae25049a34f4a9072d398537b1ab2425f24cbed006020526040872082885260205280604088205586527f645e039705490088daad89bae25049a34f4a9072d398537b1ab2425f24cbed01602052604086205538611c21565b602487634e487b7160e01b81526011600452fd5b338114611c1a57611d5883613784565b8288527f645e039705490088daad89bae25049a34f4a9072d398537b1ab2425f24cbed016020526040882054818103611df6575b508288527f645e039705490088daad89bae25049a34f4a9072d398537b1ab2425f24cbed016020528760408120558188527f645e039705490088daad89bae25049a34f4a9072d398537b1ab2425f24cbed0060205260408820908852602052866040812055611c1a565b8289527f645e039705490088daad89bae25049a34f4a9072d398537b1ab2425f24cbed0060205260408920828a526020526040892054838a527f645e039705490088daad89bae25049a34f4a9072d398537b1ab2425f24cbed0060205260408a20828b526020528060408b205589527f645e039705490088daad89bae25049a34f4a9072d398537b1ab2425f24cbed01602052604089205538611d8c565b611ed4836000527f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab007930460205260406000206001600160a01b03198154169055565b611f10846001600160a01b03166000527f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab0079303602052604060002090565b8054600019019055611ac9565b602484633250574960e11b815280600452fd5b015190503880611a1f565b50838c52818c209190601f1984168d5b818110611f905750926001928592611a579a989660049a989610611f77575b505050811b019055611a34565b015160001960f88460031b161c19169055388080611f6a565b92936020600181928786015181550195019301611f4b565b838c5260208c20601f840160051c81019160208510611fe3575b601f0160051c01905b818110611fd857506119fb565b8c8155600101611fcb565b9091508190611fc2565b60248b634e487b7160e01b81526041600452fd5b602486634e487b7160e01b81526041600452fd5b602484634e487b7160e01b81526011600452fd5b6001840361205157338352600760205260408320805490600182018092116110ef5755611966565b6002840361196657338352600860205260408320805490600182018092116110ef5755611966565b61209a9060203d6020116120a1575b6120928183612bba565b810190613525565b5038611935565b503d612088565b6040513d87823e3d90fd5b6120cb9060203d6020116120a1576120928183612bba565b50386118ca565b6040513d89823e3d90fd5b602489634e487b7160e01b81526011600452fd5b866120fe91979297612bba565b943861185f565b8780fd5b602488634e487b7160e01b81526011600452fd5b6121359060203d6020116120a1576120928183612bba565b6117ec565b6040513d88823e3d90fd5b3383526004602052604083206001600160a01b0382166001600160a01b031982541617905561176b565b606460405162461bcd60e51b815260206004820152601b60248201527f427574636865723a20436f6e74726163742069732070617573656400000000006044820152fd5b503461021a57602036600319011261021a576121cd612b2b565b6121d681613784565b6121df81613500565b906121ed6040519283612bba565b8082526121f981613500565b602083019390601f1901368537845b8281106122545750505090604051928392602084019060208552518091526040840192915b81811061223b575050500390f35b825184528594506020938401939092019160010161222d565b61225e818361348a565b61226781613b45565b1561229c57845182101561228857600582901b850160200152600101612208565b602487634e487b7160e01b81526032600452fd5b608460405162461bcd60e51b8152602060048201526024808201527f456e746974793a20476976656e206e6f646520696420646f6573206e6f74206560448201527f78697374000000000000000000000000000000000000000000000000000000006064820152fd5b503461021a57604036600319011261021a57602061029f612324612b2b565b6024359061348a565b503461021a5761129161233f36612c63565b91612fb0565b503461021a5760e036600319011261021a5760a43567ffffffffffffffff81116110e057612377903690600401612c45565b9060c43567ffffffffffffffff81116110e057612398903690600401612c45565b33825260056020526123b060ff604084205416612f65565b60405190610100820182811067ffffffffffffffff82111761267857604052815260208101928352604081016024358152606082018381526080830184815260a0840190606435825260c0850192608435845260e086019460443586526004358852600b60205260408820965180519067ffffffffffffffff82116125a657819061243b8a54612ccc565b601f8111612628575b50602090601f83116001146125c5578b926125ba575b50508160011b916000199060031b1c19161787555b60018701985198895167ffffffffffffffff81116125a6576124918254612ccc565b601f8111612561575b506020601f82116001146124fb5781908b9c60079b9c926124f0575b50508160011b916000199060031b1c19161790555b5160028801555160038701555160048601555160058501555160068401555191015580f35b0151905038806124b6565b828b52808b209b601f1983168c5b81811061254957509160079b9c9d91846001959410612530575b505050811b0190556124cb565b015160001960f88460031b161c19169055388080612523565b838301518f556001909e019d60209384019301612509565b828b5260208b20601f830160051c8101916020841061259c575b601f0160051c01905b818110612591575061249a565b8b8155600101612584565b909150819061257b565b60248a634e487b7160e01b81526041600452fd5b01519050388061245a565b8a8c52818c209250601f1984168c5b81811061261057509084600195949392106125f7575b505050811b01875561246f565b015160001960f88460031b161c191690553880806125ea565b929360206001819287860151815501950193016125d4565b909150898b5260208b20601f840160051c8101916020851061266e575b90601f859493920160051c01905b8181106126605750612444565b8c8155849350600101612653565b9091508190612645565b602484634e487b7160e01b81526041600452fd5b503461021a578060031936011261021a5760207f645e039705490088daad89bae25049a34f4a9072d398537b1ab2425f24cbed0254604051908152f35b503461021a57602036600319011261021a57610cc260016040610cd6936004356126fa6126f582613b45565b612f1a565b81526003602052600382822001548152600b6020522001612d06565b503461021a57602036600319011261021a57610cd6610cc2600435612de0565b503461021a57604036600319011261021a57612750612b2b565b60243561275c81613bcf565b33151580612865575b80612814575b6127e85781906001600160a01b0380851691167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258680a482527f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab00793046020526001600160a01b036040832091166001600160a01b031982541617905580f35b6024847fa9fbf51f00000000000000000000000000000000000000000000000000000000815233600452fd5b50612851816001600160a01b03166000527f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab0079305602052604060002090565b338552602052604084205460ff161561276b565b50336001600160a01b0382161415612765565b503461021a57602036600319011261021a5760206115b360043561289b81613bcf565b506000527f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab00793046020526001600160a01b036040600020541690565b503461021a578060031936011261021a5760405190807f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab0079300549061291782612ccc565b80855291600181169081156114e4575060011461293e57610cd684610cc281860382612bba565b7f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab007930081527f37c58c799b6609234b945e882912ee9ad34948a1dfaa20a97485e1a7752bbf81939250905b8082106129a057509091508101602001610cc282611458565b919260018160209254838588010152019101909291612987565b503461021a57602036600319011261021a5760406020916001600160a01b036129e1612b2b565b1681526006835220541515604051908152f35b9050346110e05760203660031901126110e0576004357fffffffff000000000000000000000000000000000000000000000000000000008116809103610f9157602092507f49064906000000000000000000000000000000000000000000000000000000008114908115612a6a575b5015158152f35b7f780e9d6300000000000000000000000000000000000000000000000000000000811491508115612a9d575b5038612a63565b7f80ac58cd00000000000000000000000000000000000000000000000000000000811491508115612b01575b8115612ad7575b5038612a96565b7f01ffc9a70000000000000000000000000000000000000000000000000000000091501438612ad0565b7f5b5e139f0000000000000000000000000000000000000000000000000000000081149150612ac9565b600435906001600160a01b0382168203612b4157565b600080fd5b604435906001600160a01b0382168203612b4157565b602435906001600160a01b0382168203612b4157565b60005b838110612b855750506000910152565b8181015183820152602001612b75565b90602091612bae81518092818552858086019101612b72565b601f01601f1916010190565b90601f8019910116810190811067ffffffffffffffff821117612bdc57604052565b634e487b7160e01b600052604160045260246000fd5b67ffffffffffffffff8111612bdc57601f01601f191660200190565b929192612c1a82612bf2565b91612c286040519384612bba565b829481845281830111612b41578281602093846000960137010152565b9080601f83011215612b4157816020612c6093359101612c0e565b90565b6060906003190112612b41576004356001600160a01b0381168103612b4157906024356001600160a01b0381168103612b41579060443590565b6040906003190112612b41576004356001600160a01b0381168103612b4157906024358015158103612b415790565b90600182811c92168015612cfc575b6020831014612ce657565b634e487b7160e01b600052602260045260246000fd5b91607f1691612cdb565b9060405191826000825492612d1a84612ccc565b8084529360018116908115612d885750600114612d41575b50612d3f92500383612bba565b565b90506000929192526020600020906000915b818310612d6c575050906020612d3f9282010138612d32565b6020919350806001915483858901015201910190918492612d53565b905060209250612d3f94915060ff191682840152151560051b82010138612d32565b91908203918211612db757565b634e487b7160e01b600052601160045260246000fd5b81810292918115918404141715612db757565b908115612edd579080816000925b612ebf5750612dfc82612bf2565b91612e0a6040519384612bba565b808352601f19612e1982612bf2565b01366020850137905b818115612eb9576000198301928311612db75782600a830492600a840290848204600a1485151715612db75760ff91612e5a91612daa565b166030019060ff8211612db75785511115612ea35760f81b7fff000000000000000000000000000000000000000000000000000000000000001660001a908401601f0153612e22565b634e487b7160e01b600052603260045260246000fd5b50505090565b909290916000198114612db7576001600a9101920480939193612dee565b9050604051612eed604082612bba565b600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b15612f2157565b606460405162461bcd60e51b815260206004820152601960248201527f456e746974793a20496e76616c696420656e74697479204944000000000000006044820152fd5b15612f6c57565b606460405162461bcd60e51b815260206004820152601b60248201527f4e6f74206f70657261746f72206f6e20746865206d616e6167657200000000006044820152fd5b92916001600160a01b03821693841561347457600094613003836000527f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab00793026020526001600160a01b036040600020541690565b9033613414575b6001600160a01b038216948515801561338b575b61305a826001600160a01b03166000527f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab0079303602052604060002090565b600181540190558589527f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab007930260205260408920836001600160a01b03198254161790558583887fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8c80a41561323f577f645e039705490088daad89bae25049a34f4a9072d398537b1ab2425f24cbed02548589527f645e039705490088daad89bae25049a34f4a9072d398537b1ab2425f24cbed036020528060408a20556801000000000000000081101561096d5785611c0182600161315b94017f645e039705490088daad89bae25049a34f4a9072d398537b1ab2425f24cbed025561353d565b8186036131b3575b50506001600160a01b039293949550501680830361318057505050565b7f64283d7b0000000000000000000000000000000000000000000000000000000060005260045260245260445260646000fd5b6131bc90613784565b60001981019190821161210957876040916001600160a01b0396979899527f645e039705490088daad89bae25049a34f4a9072d398537b1ab2425f24cbed0060205281812083825260205286828220558681527f645e039705490088daad89bae25049a34f4a9072d398537b1ab2425f24cbed0160205220558594939238613163565b85821461315b5761324f83613784565b8589527f645e039705490088daad89bae25049a34f4a9072d398537b1ab2425f24cbed0160205260408920548181036132ed575b508589527f645e039705490088daad89bae25049a34f4a9072d398537b1ab2425f24cbed016020528860408120558689527f645e039705490088daad89bae25049a34f4a9072d398537b1ab2425f24cbed006020526040892090895260205287604081205561315b565b878a527f645e039705490088daad89bae25049a34f4a9072d398537b1ab2425f24cbed0060205260408a20828b5260205260408a2054888b527f645e039705490088daad89bae25049a34f4a9072d398537b1ab2425f24cbed0060205260408b20828c526020528060408c20558a527f645e039705490088daad89bae25049a34f4a9072d398537b1ab2425f24cbed0160205260408a205538613283565b6133cb866000527f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab007930460205260406000206001600160a01b03198154169055565b613407846001600160a01b03166000527f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab0079303602052604060002090565b805460001901905561301e565b61341f843384613c34565b61300a5783876001600160a01b03841661344557602491637e27328960e01b8252600452fd5b6044917f177e802f00000000000000000000000000000000000000000000000000000000825233600452602452fd5b633250574960e11b600052600060045260246000fd5b61349381613784565b8210156134df576001600160a01b03166000527f645e039705490088daad89bae25049a34f4a9072d398537b1ab2425f24cbed0060205260406000209060005260205260406000205490565b6001600160a01b039063295f44f760e21b6000521660045260245260446000fd5b67ffffffffffffffff8111612bdc5760051b60200190565b91908201809211612db757565b90816020910312612b4157518015158103612b415790565b7f645e039705490088daad89bae25049a34f4a9072d398537b1ab2425f24cbed0254811015612ea3577f645e039705490088daad89bae25049a34f4a9072d398537b1ab2425f24cbed0260005260206000200190600090565b600092918154916135a683612ccc565b92600181169081156135f157506001146135bf57505050565b909192935060005260206000206000905b8382106135dd5750500190565b6001816020925484860152019101906135d0565b60ff191683525050811515909102019150565b612c606002670de0b6b3a764000061361b846139bf565b04610c52602061363b604051936136328386612bba565b60008552612de0565b9560005260038152600360406000200154600052600b8152605260016040600020019160405197856136768a9751809285808b019101612b72565b86017f7b2274726169745f74797065223a220000000000000000000000000000000000838201527f50656e64696e6720526577617264730000000000000000000000000000000000602f8201526a1116113b30b63ab2911d1160a91b603e8201526136ea8251809385604985019101612b72565b01017f2042555443484552000000000000000000000000000000000000000000000000602982015261227d60f01b60318201527f2c7b2274726169745f74797065223a220000000000000000000000000000000060338201527f547970650000000000000000000000000000000000000000000000000000000060438201526a1116113b30b63ab2911d1160a91b60478201520190613596565b6001600160a01b038116156137d3576137cf906001600160a01b03166000527f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab0079303602052604060002090565b5490565b7f89c62b6400000000000000000000000000000000000000000000000000000000600052600060045260246000fd5b9061380e838284612fb0565b803b61381b575b50505050565b6020916138616001600160a01b03809316956040519586948594630a85bd0160e11b86523360048701521660248501526044840152608060648401526084830190612b95565b03816000865af18091600091613919575b50906138cb57503d156138c4573d61388981612bf2565b906138976040519283612bba565b81523d6000602083013e5b805190816138bf5782633250574960e11b60005260045260246000fd5b602001fd5b60606138a2565b7fffffffff00000000000000000000000000000000000000000000000000000000630a85bd0160e11b911603613905575038808080613815565b633250574960e11b60005260045260246000fd5b6020813d60201161396c575b8161393260209383612bba565b810103126110e05751907fffffffff000000000000000000000000000000000000000000000000000000008216820361021a575038613872565b3d9150613925565b1561397b57565b606460405162461bcd60e51b815260206004820152601e60248201527f427574636865723a20456e7469747920646f6573206e6f7420657869737400006044820152fd5b6139cb610cfb82613b45565b60005260036020526040600020906003820154600052600b602052600260406000209201546139fa8142612daa565b9060058401549160008315613ae9575082613a1791049142612daa565b8215613ad3578290069160009082613a3b575050506007612c609293015490612dcd565b9490929160078201549560066000930154915b808410613a6e575b50505050613a6890612c609394612dcd565b90613518565b9091929694838814613aa857613a8890613a688488612dcd565b948060011b9080820460021490151715612db75796600101929190613a4e565b94925092613a68613ac992613ac4612c609899613a6897612daa565b612dcd565b9181959438613a56565b634e487b7160e01b600052601260045260246000fd5b80634e487b7160e01b602492526012600452fd5b613b096126f582613b45565b6000526003602052600360406000200154600052600b60205260076040600020015462015180810290808204620151801490151715612db75790565b6001548111613b6557600052600360205260ff6004604060002001541690565b608460405162461bcd60e51b815260206004820152602c60248201527f456e746974793a204964206d757374206265206c6f776572207468616e20746f60448201527f74616c20656e74697469657300000000000000000000000000000000000000006064820152fd5b613c0c816000527f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab00793026020526001600160a01b036040600020541690565b906001600160a01b03821615613c20575090565b637e27328960e01b60005260045260246000fd5b906001600160a01b03168015159283613c4d5750505090565b6001600160a01b0383168214935090918315613cc7575b508215613c76575b5050388080612eb9565b6001600160a01b03919250613cbe906000527f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab00793046020526001600160a01b036040600020541690565b16143880613c6c565b613d059193506001600160a01b03166000527f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab0079305602052604060002090565b8160005260205260ff604060002054169138613c64565b90815115613e965760405191613d33606084612bba565b604083527f4142434445464748494a4b4c4d4e4f505152535455565758595a61626364656660208401527f6768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2f6040840152805160028101809111612db75760039004908160021b917f3fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff811603612db757613de4613dce83612bf2565b92613ddc6040519485612bba565b808452612bf2565b6020830190601f1901368237908081518201956020870190815192600083525b888110613e485750506003939495965052510680600114613e3557600214613e2a575090565b603d90600019015390565b50603d9081600019820153600119015390565b600360049199969901986001603f8b5182828260121c16870101518453828282600c1c16870101518385015382828260061c1687010151600285015316840101516003820153019497613e04565b9050604051613ea6602082612bba565b6000815290565b60ff7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005460401c1615613edc57565b7fd7e6bcf80000000000000000000000000000000000000000000000000000000060005260046000fdfea2646970667358221220deff5b8e6f481758aff5ea27dffc7175bccbcaedff8fa043e45ac9b16fb00d0464736f6c634300081b0033
Loading...
Loading
Loading...
Loading
Loading...
Loading
Loading...
Loading
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.