Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
CryptoAgents
Compiler Version
v0.8.22+commit.4fc1097e
Optimization Enabled:
Yes with 200000 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import {ERC2981Upgradeable} from "@openzeppelin/contracts-upgradeable/token/common/ERC2981Upgradeable.sol"; import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import {EAI721Intelligence, ERC721Upgradeable, Initializable} from "../extensions/EAI721Intelligence.sol"; import {EAI721Identity, IOnchainArtData} from "../extensions/EAI721Identity.sol"; import {EAI721Monetization} from "../extensions/EAI721Monetization.sol"; import {EAI721Tokenization} from "../extensions/EAI721Tokenization.sol"; import {Rating} from "../utils/Rating.sol"; import {Errors} from "../libs/helpers/Errors.sol"; contract CryptoAgents is Initializable, OwnableUpgradeable, EAI721Intelligence, EAI721Identity, EAI721Monetization, EAI721Tokenization, ERC2981Upgradeable, Rating { // --- Constants --- uint256 private constant TOKEN_SUPPLY_LIMIT = 10000; // -- errors -- error Unauthenticated(); error InvalidTokenId(); // -- modifiers -- modifier onlyAgentOwner(uint256 agentId) override(EAI721Intelligence, EAI721Tokenization, EAI721Monetization) { if (msg.sender != ownerOf(agentId)) revert Unauthenticated(); _; } // -- events -- event AdminAllowed(address indexed admin, bool allowed); event AgentDataAddressChanged(address indexed newAddr); // -- state variables -- // admins mapping(address => bool) private _admins; modifier onlyAdmin() { require(_admins[msg.sender], Errors.ONLY_ADMIN_ALLOWED); _; } function initialize( string memory name_, string memory symbol_, address defaultRoyaltyReceiver_ ) public initializer { __Ownable_init(); __ERC721_init(name_, symbol_); __EAI721Intelligence_init(); __EAI721Identity_init(); __Rating_init(100); __EAI721Monetization_init(); __EAI721Tokenization_init(); __ERC2981_init(); _setDefaultRoyalty(defaultRoyaltyReceiver_, 500); } function allowAdmin(address newAdm, bool allow) external onlyOwner { require(newAdm != address(0), Errors.INV_ADD); _admins[newAdm] = allow; emit AdminAllowed(newAdm, allow); } function isAdmin(address admin) external view returns (bool) { return _admins[admin]; } function changeAgentDataAddress(address newAddr) external onlyOwner { require(newAddr != address(0), Errors.INV_ADD); _setAgentDataAddr(newAddr); emit AgentDataAddressChanged(newAddr); } //@EAI721Identity function mint( uint256 tokenId, address to, uint256 dna, uint256[6] memory traits ) external virtual onlyAdmin { if (tokenId == 0 || tokenId > TOKEN_SUPPLY_LIMIT) revert InvalidTokenId(); _mint(tokenId, to, dna, traits); } function tokenURI( uint256 agentId ) public view override(ERC721Upgradeable, EAI721Identity) returns (string memory) { return EAI721Identity.tokenURI(agentId); } function agentAttributes( uint256 agentId ) external view returns (string memory) { return IOnchainArtData(agentDataAddr()).agentAttributes(agentId); } function agentImageSvg( uint256 agentId ) external view returns (string memory) { return IOnchainArtData(agentDataAddr()).agentImageSvg(agentId); } function agentImage(uint256 agentId) external view returns (bytes memory) { return IOnchainArtData(agentDataAddr()).agentImage(agentId); } function setDefaultRoyalty( address newRoyaltyReceiver, uint96 feeNumerator ) external onlyAdmin { _setDefaultRoyalty(newRoyaltyReceiver, feeNumerator); } function deleteDefaultRoyalty() external onlyAdmin { _deleteDefaultRoyalty(); } function setTokenRoyalty( uint256 tokenId, address newRoyaltyReceiver, uint96 feeNumerator ) external onlyAdmin { _setTokenRoyalty(tokenId, newRoyaltyReceiver, feeNumerator); } function resetTokenRoyalty(uint256 tokenId) external onlyAdmin { _resetTokenRoyalty(tokenId); } function supportsInterface( bytes4 interfaceId ) public view override(ERC721Upgradeable, ERC2981Upgradeable) returns (bool) { return ERC721Upgradeable.supportsInterface(interfaceId) || ERC2981Upgradeable.supportsInterface(interfaceId); } uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import {Initializable} from "../proxy/utils/Initializable.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ function __Ownable_init() internal onlyInitializing { __Ownable_init_unchained(); } function __Ownable_init_unchained() internal onlyInitializing { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC2981.sol) pragma solidity ^0.8.0; import "../utils/introspection/IERC165Upgradeable.sol"; /** * @dev Interface for the NFT Royalty Standard. * * A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal * support for royalty payments across all NFT marketplaces and ecosystem participants. * * _Available since v4.5._ */ interface IERC2981Upgradeable is IERC165Upgradeable { /** * @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of * exchange. The royalty amount is denominated and should be paid in that same unit of exchange. */ function royaltyInfo( uint256 tokenId, uint256 salePrice ) external view returns (address receiver, uint256 royaltyAmount); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol) pragma solidity ^0.8.2; import "../../utils/AddressUpgradeable.sol"; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in * case an upgrade adds a module that needs to be initialized. * * For example: * * [.hljs-theme-light.nopadding] * ```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 Indicates that the contract has been initialized. * @custom:oz-retyped-from bool */ uint8 private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Triggered when the contract has been initialized or reinitialized. */ event Initialized(uint8 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 functions marked with `initializer` can be nested in the context of a * constructor. * * Emits an {Initialized} event. */ modifier initializer() { bool isTopLevelCall = !_initializing; require( (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1), "Initializable: contract is already initialized" ); _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 255 will prevent any future reinitialization. * * Emits an {Initialized} event. */ modifier reinitializer(uint8 version) { require(!_initializing && _initialized < version, "Initializable: contract is already initialized"); _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() { require(_initializing, "Initializable: contract is not initializing"); _; } /** * @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 { require(!_initializing, "Initializable: contract is initializing"); if (_initialized != type(uint8).max) { _initialized = type(uint8).max; emit Initialized(type(uint8).max); } } /** * @dev Returns the highest version that has been initialized. See {reinitializer}. */ function _getInitializedVersion() internal view returns (uint8) { return _initialized; } /** * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}. */ function _isInitializing() internal view returns (bool) { return _initializing; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/common/ERC2981.sol) pragma solidity ^0.8.0; import "../../interfaces/IERC2981Upgradeable.sol"; import "../../utils/introspection/ERC165Upgradeable.sol"; import {Initializable} from "../../proxy/utils/Initializable.sol"; /** * @dev Implementation of the NFT Royalty Standard, a standardized way to retrieve royalty payment information. * * Royalty information can be specified globally for all token ids via {_setDefaultRoyalty}, and/or individually for * specific token ids via {_setTokenRoyalty}. The latter takes precedence over the first. * * Royalty is specified as a fraction of sale price. {_feeDenominator} is overridable but defaults to 10000, meaning the * fee is specified in basis points by default. * * IMPORTANT: ERC-2981 only specifies a way to signal royalty information and does not enforce its payment. See * https://eips.ethereum.org/EIPS/eip-2981#optional-royalty-payments[Rationale] in the EIP. Marketplaces are expected to * voluntarily pay royalties together with sales, but note that this standard is not yet widely supported. * * _Available since v4.5._ */ abstract contract ERC2981Upgradeable is Initializable, IERC2981Upgradeable, ERC165Upgradeable { struct RoyaltyInfo { address receiver; uint96 royaltyFraction; } RoyaltyInfo private _defaultRoyaltyInfo; mapping(uint256 => RoyaltyInfo) private _tokenRoyaltyInfo; function __ERC2981_init() internal onlyInitializing { } function __ERC2981_init_unchained() internal onlyInitializing { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165Upgradeable, ERC165Upgradeable) returns (bool) { return interfaceId == type(IERC2981Upgradeable).interfaceId || super.supportsInterface(interfaceId); } /** * @inheritdoc IERC2981Upgradeable */ function royaltyInfo(uint256 tokenId, uint256 salePrice) public view virtual override returns (address, uint256) { RoyaltyInfo memory royalty = _tokenRoyaltyInfo[tokenId]; if (royalty.receiver == address(0)) { royalty = _defaultRoyaltyInfo; } uint256 royaltyAmount = (salePrice * royalty.royaltyFraction) / _feeDenominator(); return (royalty.receiver, royaltyAmount); } /** * @dev The denominator with which to interpret the fee set in {_setTokenRoyalty} and {_setDefaultRoyalty} as a * fraction of the sale price. Defaults to 10000 so fees are expressed in basis points, but may be customized by an * override. */ function _feeDenominator() internal pure virtual returns (uint96) { return 10000; } /** * @dev Sets the royalty information that all ids in this contract will default to. * * Requirements: * * - `receiver` cannot be the zero address. * - `feeNumerator` cannot be greater than the fee denominator. */ function _setDefaultRoyalty(address receiver, uint96 feeNumerator) internal virtual { require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice"); require(receiver != address(0), "ERC2981: invalid receiver"); _defaultRoyaltyInfo = RoyaltyInfo(receiver, feeNumerator); } /** * @dev Removes default royalty information. */ function _deleteDefaultRoyalty() internal virtual { delete _defaultRoyaltyInfo; } /** * @dev Sets the royalty information for a specific token id, overriding the global default. * * Requirements: * * - `receiver` cannot be the zero address. * - `feeNumerator` cannot be greater than the fee denominator. */ function _setTokenRoyalty(uint256 tokenId, address receiver, uint96 feeNumerator) internal virtual { require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice"); require(receiver != address(0), "ERC2981: Invalid parameters"); _tokenRoyaltyInfo[tokenId] = RoyaltyInfo(receiver, feeNumerator); } /** * @dev Resets royalty information for the token id back to the global default. */ function _resetTokenRoyalty(uint256 tokenId) internal virtual { delete _tokenRoyaltyInfo[tokenId]; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[48] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/ERC721.sol) pragma solidity ^0.8.0; import "./IERC721Upgradeable.sol"; import "./IERC721ReceiverUpgradeable.sol"; import "./extensions/IERC721MetadataUpgradeable.sol"; import "../../utils/AddressUpgradeable.sol"; import "../../utils/ContextUpgradeable.sol"; import "../../utils/StringsUpgradeable.sol"; import "../../utils/introspection/ERC165Upgradeable.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}. */ contract ERC721Upgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC721Upgradeable, IERC721MetadataUpgradeable { using AddressUpgradeable for address; using StringsUpgradeable for uint256; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to owner address mapping(uint256 => address) private _owners; // Mapping owner address to token count mapping(address => uint256) private _balances; // Mapping from token ID to approved address mapping(uint256 => address) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; /** * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. */ 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 { _name = name_; _symbol = symbol_; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165Upgradeable, IERC165Upgradeable) returns (bool) { return interfaceId == type(IERC721Upgradeable).interfaceId || interfaceId == type(IERC721MetadataUpgradeable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view virtual override returns (uint256) { require(owner != address(0), "ERC721: address zero is not a valid owner"); return _balances[owner]; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { address owner = _ownerOf(tokenId); require(owner != address(0), "ERC721: invalid token ID"); return owner; } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { _requireMinted(tokenId); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : ""; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overridden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ""; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual override { address owner = ERC721Upgradeable.ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require( _msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721: approve caller is not token owner or approved for all" ); _approve(to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { _requireMinted(tokenId); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom(address from, address to, uint256 tokenId) public virtual override { //solhint-disable-next-line max-line-length require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner or approved"); _transfer(from, to, tokenId); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom(address from, address to, uint256 tokenId) public virtual override { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public virtual override { require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner or approved"); _safeTransfer(from, to, tokenId, data); } /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * `data` is additional data, it has no specified format and it is sent in call to `to`. * * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeTransfer(address from, address to, uint256 tokenId, bytes memory data) internal virtual { _transfer(from, to, tokenId); require(_checkOnERC721Received(from, to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer"); } /** * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist */ function _ownerOf(uint256 tokenId) internal view virtual returns (address) { return _owners[tokenId]; } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted (`_mint`), * and stop existing when they are burned (`_burn`). */ function _exists(uint256 tokenId) internal view virtual returns (bool) { return _ownerOf(tokenId) != address(0); } /** * @dev Returns whether `spender` is allowed to manage `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) { address owner = ERC721Upgradeable.ownerOf(tokenId); return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender); } /** * @dev Safely mints `tokenId` and transfers it to `to`. * * Requirements: * * - `tokenId` must not exist. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeMint(address to, uint256 tokenId) internal virtual { _safeMint(to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeMint(address to, uint256 tokenId, bytes memory data) internal virtual { _mint(to, tokenId); require( _checkOnERC721Received(address(0), to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer" ); } /** * @dev Mints `tokenId` and transfers it to `to`. * * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible * * Requirements: * * - `tokenId` must not exist. * - `to` cannot be the zero address. * * Emits a {Transfer} event. */ function _mint(address to, uint256 tokenId) internal virtual { require(to != address(0), "ERC721: mint to the zero address"); require(!_exists(tokenId), "ERC721: token already minted"); _beforeTokenTransfer(address(0), to, tokenId, 1); // Check that tokenId was not minted by `_beforeTokenTransfer` hook require(!_exists(tokenId), "ERC721: token already minted"); unchecked { // Will not overflow unless all 2**256 token ids are minted to the same owner. // Given that tokens are minted one by one, it is impossible in practice that // this ever happens. Might change if we allow batch minting. // The ERC fails to describe this case. _balances[to] += 1; } _owners[tokenId] = to; emit Transfer(address(0), to, tokenId); _afterTokenTransfer(address(0), to, tokenId, 1); } /** * @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 virtual { address owner = ERC721Upgradeable.ownerOf(tokenId); _beforeTokenTransfer(owner, address(0), tokenId, 1); // Update ownership in case tokenId was transferred by `_beforeTokenTransfer` hook owner = ERC721Upgradeable.ownerOf(tokenId); // Clear approvals delete _tokenApprovals[tokenId]; unchecked { // Cannot overflow, as that would require more tokens to be burned/transferred // out than the owner initially received through minting and transferring in. _balances[owner] -= 1; } delete _owners[tokenId]; emit Transfer(owner, address(0), tokenId); _afterTokenTransfer(owner, address(0), tokenId, 1); } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer(address from, address to, uint256 tokenId) internal virtual { require(ERC721Upgradeable.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner"); require(to != address(0), "ERC721: transfer to the zero address"); _beforeTokenTransfer(from, to, tokenId, 1); // Check that tokenId was not transferred by `_beforeTokenTransfer` hook require(ERC721Upgradeable.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner"); // Clear approvals from the previous owner delete _tokenApprovals[tokenId]; unchecked { // `_balances[from]` cannot overflow for the same reason as described in `_burn`: // `from`'s balance is the number of token held, which is at least one before the current // transfer. // `_balances[to]` could overflow in the conditions described in `_mint`. That would require // all 2**256 token ids to be minted, which in practice is impossible. _balances[from] -= 1; _balances[to] += 1; } _owners[tokenId] = to; emit Transfer(from, to, tokenId); _afterTokenTransfer(from, to, tokenId, 1); } /** * @dev Approve `to` to operate on `tokenId` * * Emits an {Approval} event. */ function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ERC721Upgradeable.ownerOf(tokenId), to, tokenId); } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Emits an {ApprovalForAll} event. */ function _setApprovalForAll(address owner, address operator, bool approved) internal virtual { require(owner != operator, "ERC721: approve to caller"); _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Reverts if the `tokenId` has not been minted yet. */ function _requireMinted(uint256 tokenId) internal view virtual { require(_exists(tokenId), "ERC721: invalid token ID"); } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. * The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ function _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory data ) private returns (bool) { if (to.isContract()) { try IERC721ReceiverUpgradeable(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) { return retval == IERC721ReceiverUpgradeable.onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert("ERC721: transfer to non ERC721Receiver implementer"); } else { /// @solidity memory-safe-assembly assembly { revert(add(32, reason), mload(reason)) } } } } else { return true; } } /** * @dev Hook that is called before any token transfer. This includes minting and burning. If {ERC721Consecutive} is * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s tokens will be transferred to `to`. * - When `from` is zero, the tokens will be minted for `to`. * - When `to` is zero, ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * - `batchSize` is non-zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer(address from, address to, uint256 firstTokenId, uint256 batchSize) internal virtual {} /** * @dev Hook that is called after any token transfer. This includes minting and burning. If {ERC721Consecutive} is * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s tokens were transferred to `to`. * - When `from` is zero, the tokens were minted for `to`. * - When `to` is zero, ``from``'s tokens were burned. * - `from` and `to` are never both zero. * - `batchSize` is non-zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer(address from, address to, uint256 firstTokenId, uint256 batchSize) internal virtual {} /** * @dev Unsafe write access to the balances, used by extensions that "mint" tokens using an {ownerOf} override. * * WARNING: Anyone calling this MUST ensure that the balances remain consistent with the ownership. The invariant * being 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`. */ // solhint-disable-next-line func-name-mixedcase function __unsafe_increaseBalance(address account, uint256 amount) internal { _balances[account] += amount; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[44] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol) pragma solidity ^0.8.0; import "../IERC721Upgradeable.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721MetadataUpgradeable is IERC721Upgradeable { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721ReceiverUpgradeable { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165Upgradeable.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721Upgradeable is IERC165Upgradeable { /** * @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 caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library AddressUpgradeable { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * * Furthermore, `isContract` will also return true if the target contract within * the same transaction is already scheduled for destruction by `SELFDESTRUCT`, * which only has an effect at the end of a transaction. * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.4) (utils/Context.sol) pragma solidity ^0.8.0; 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; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165Upgradeable.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); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165Upgradeable is Initializable, IERC165Upgradeable { function __ERC165_init() internal onlyInitializing { } function __ERC165_init_unchained() internal onlyInitializing { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165Upgradeable).interfaceId; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165Upgradeable { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library MathUpgradeable { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @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 up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (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; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) 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. require(denominator > prod1, "Math: mulDiv overflow"); /////////////////////////////////////////////// // 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. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); 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 (rounding == Rounding.Up && 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 down. * * 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 + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * 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 + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * 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 + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * 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 + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol) pragma solidity ^0.8.0; /** * @dev Standard signed math utilities missing in the Solidity language. */ library SignedMathUpgradeable { /** * @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 v4.9.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "./math/MathUpgradeable.sol"; import "./math/SignedMathUpgradeable.sol"; /** * @dev String operations. */ library StringsUpgradeable { bytes16 private constant _SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = MathUpgradeable.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), _SYMBOLS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `int256` to its ASCII `string` decimal representation. */ function toString(int256 value) internal pure returns (string memory) { return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMathUpgradeable.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, MathUpgradeable.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) { 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] = _SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } /** * @dev Returns true if the two strings are equal. */ function equal(string memory a, string memory b) internal pure returns (bool) { return keccak256(bytes(a)) == keccak256(bytes(b)); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import {ERC721Upgradeable, Initializable} from "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol"; import {IOnchainArtData} from "../interfaces/IOnchainArtData.sol"; abstract contract EAI721Identity is Initializable, ERC721Upgradeable { // --- State Variables --- address private _agentDataAddr; // --- Errors --- error InvalidAddr(); error NotExist(); error Existed(); // initialization function __EAI721Identity_init() internal onlyInitializing { __EAI721Identity_init_unchained(); } function __EAI721Identity_init_unchained() internal onlyInitializing {} function _setAgentDataAddr(address newAgentDataAddr) internal virtual { _agentDataAddr = newAgentDataAddr; } function agentDataAddr() public view virtual returns (address) { return _agentDataAddr; } function _mint( uint256 tokenId, address to, uint256 dna, uint256[6] memory traits ) internal virtual { if (to == address(0) || _agentDataAddr == address(0)) revert InvalidAddr(); if (_exists(tokenId)) revert Existed(); _safeMint(to, tokenId); IOnchainArtData agentDataContract = IOnchainArtData(_agentDataAddr); agentDataContract.mintAgent(tokenId); agentDataContract.unlockRenderAgent(tokenId, dna, traits); } // {IEAI721-tokenURI} function tokenURI( uint256 tokenId ) public view virtual override returns (string memory result) { if (!_exists(tokenId)) revert NotExist(); IOnchainArtData agentDataContract = IOnchainArtData(_agentDataAddr); result = agentDataContract.tokenURI(tokenId); } /** * @dev This empty reserved space is put in place to allow future versions to add new */ uint256[44] private __gap; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import {ERC721Upgradeable, Initializable} from "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol"; import {IEAI721Intelligence} from "../interfaces/IEAI721Intelligence.sol"; import "../libs/helpers/File.sol"; abstract contract EAI721Intelligence is Initializable, ERC721Upgradeable, IEAI721Intelligence { using {read} for IFileStore.File; // --- Constants --- uint256 private constant TOKEN_LIMIT = 10000; bytes32 private constant IPFS_SIG = keccak256(bytes("ipfs")); // --- Storage --- mapping(uint256 agentId => string) private _codeLanguage; // e.g., "python", "javascript"... mapping(uint256 agentId => uint16) private _currentVersion; mapping(uint256 agentId => string) private _name; mapping(bytes32 digest => bool) private _usedDigests; mapping(uint256 agentId => mapping(uint256 version => uint256)) private _pointersNum; mapping(uint256 agentId => mapping(uint256 version => mapping(uint256 => CodePointer))) private _codePointers; mapping(uint256 agentId => mapping(uint256 version => uint256[])) private _depsAgents; // --- Modifiers --- modifier checkVersion(uint256 agentId, uint16 version) virtual { _validateVersion(agentId, version); _; } modifier onlyAgentOwner(uint256 agentId) virtual { if (msg.sender != ownerOf(agentId)) revert EAI721IntelligenceAuth(); _; } // --- Initialization --- function __EAI721Intelligence_init() internal onlyInitializing {} function __EAI721Intelligence_init_unchained() internal onlyInitializing {} // --- Functions --- // {IEAI721AgentAbility-setAgentName} function setAgentName( uint256 agentId, string calldata name ) public virtual onlyAgentOwner(agentId) { _name[agentId] = name; } // {IEAI721AgentAbility-agentName} function agentName( uint256 agentId ) public virtual view returns (string memory) { return _name[agentId]; } // {IEAI721AgentAbility-publishAgentCode} function publishAgentCode( uint256 agentId, string calldata codeLanguageIn, CodePointer[] calldata pointersIn, uint256[] calldata depsAgentsIn ) public virtual onlyAgentOwner(agentId) returns (uint16) { return _publishAgentCode(agentId, codeLanguageIn, pointersIn, depsAgentsIn); } function _publishAgentCode( uint256 agentId, string calldata codeLanguageIn, CodePointer[] calldata pointersIn, uint256[] calldata depsAgentsIn ) internal virtual returns (uint16) { if (pointersIn.length == 0) revert InvalidData(); _codeLanguage[agentId] = codeLanguageIn; uint16 version = _bumpVersion(agentId); uint256 pLen = pointersIn.length; for (uint256 i = 0; i < pLen; i++) { if (bytes(pointersIn[i].fileName).length == 0) { revert InvalidData(); } _addNewCodePointer(agentId, version, pointersIn[i]); } uint256 depsLen = depsAgentsIn.length; for (uint256 i = 0; i < depsLen; i++) { if (depsAgentsIn[i] == 0 || depsAgentsIn[i] > TOKEN_LIMIT) { revert InvalidDependency(); } _depsAgents[agentId][version].push(depsAgentsIn[i]); } return version; } function _bumpVersion(uint256 agentId) private returns (uint16) { return ++_currentVersion[agentId]; } function _addNewCodePointer( uint256 agentId, uint16 version, CodePointer calldata pointer ) internal virtual { uint256 pNum = _pointersNumber(agentId, version); _codePointers[agentId][version][pNum] = pointer; emit CodePointerCreated(agentId, version, pNum, pointer); _pointersNum[agentId][version]++; } // {IEAI721AgentAbility-depsAgents} function depsAgents( uint256 agentId, uint16 version ) public virtual view checkVersion(agentId, version) returns (uint256[] memory) { return _depsAgents[agentId][version]; } // {IEAI721AgentAbility-agentCode} function agentCode( uint256 agentId, uint16 version ) public virtual view checkVersion(agentId, version) returns (string memory code) { uint256 len = _pointersNumber(agentId, version); string memory libsCode = ""; string memory mainScripts = ""; for (uint256 pIdx = 0; pIdx < len; pIdx++) { CodePointer memory p = _codePointers[agentId][version][pIdx]; string memory codeChunk = _codeByPointer(p); if (p.fileType == FileType.LIBRARY) { libsCode = _concatStrings(libsCode, codeChunk); } else if (p.fileType == FileType.MAIN_SCRIPT) { mainScripts = _concatStrings(mainScripts, codeChunk); } } if (bytes(libsCode).length == 0 && bytes(mainScripts).length == 0) return ""; return _concatStrings(libsCode, mainScripts); } function _concatStrings( string memory a, string memory b ) internal virtual pure returns (string memory) { return string(abi.encodePacked(a, "\n", b)); } function _codeByPointer( CodePointer memory p ) internal virtual view returns (string memory logic) { if (keccak256(bytes(_storageMode(p))) == IPFS_SIG) { logic = p.fileName; // return the IPFS hash } else { logic = IFileStore(p.retrieveAddress).getFile(p.fileName).read(); } } function _storageMode( CodePointer memory p ) internal virtual view returns (string memory) { if (p.retrieveAddress != address(0)) { return "fs"; } return "ipfs"; } function _pointersNumber( uint256 agentId, uint16 version ) internal virtual view returns (uint256) { return _pointersNum[agentId][version]; } // {IEAI721AgentAbility-currentVersion} function currentVersion(uint256 agentId) public virtual view returns (uint16) { return _currentVersion[agentId]; } function _validateVersion(uint256 agentId, uint16 version) internal virtual view { if (version > _currentVersion[agentId]) { revert InvalidVersion(); } } // {IEAI721AgentAbility-codeLanguage} function codeLanguage( uint256 agentId ) public virtual view returns (string memory) { return _codeLanguage[agentId]; } /** * @dev This empty reserved space is put in place to allow future versions to add new */ uint256[44] private __gap; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import {ERC721Upgradeable} from "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol"; import {IEAI721Monetization} from "../interfaces/IEAI721Monetization.sol"; abstract contract EAI721Monetization is ERC721Upgradeable, IEAI721Monetization { // --- Modifiers --- modifier onlyAgentOwner(uint256 agentId) virtual { if (msg.sender != ownerOf(agentId)) revert EAI721MonetizationAuth(); _; } // --- State Variables --- // agentId => subscription fee mapping(uint256 => uint256) private _subscriptionFees; // initialization function __EAI721Monetization_init() internal onlyInitializing {} function __EAI721Monetization_init_unchained() internal onlyInitializing {} // {IEAI721Monetization-subscriptionFee} function subscriptionFee(uint256 agentId) public virtual view returns (uint256) { return _subscriptionFees[agentId]; } // {IEAI721Monetization-setSubscriptionFee} function setSubscriptionFee(uint256 agentId, uint256 fee) public virtual onlyAgentOwner(agentId) { _subscriptionFees[agentId] = fee; emit SubscriptionFeeUpdated(agentId, fee); } /** * @dev This empty reserved space is put in place to allow future versions to add new */ uint256[44] private __gap; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import {ERC721Upgradeable, Initializable} from "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol"; import {IEAI721Tokenization} from "../interfaces/IEAI721Tokenization.sol"; abstract contract EAI721Tokenization is Initializable, ERC721Upgradeable, IEAI721Tokenization { // agentId => AI token address mapping(uint256 => address) private _aiTokens; modifier onlyAgentOwner(uint256 agentId) virtual { if (msg.sender != ownerOf(agentId)) revert EAI721TokenizationAuth(); _; } // --- Initialization --- function __EAI721Tokenization_init() internal onlyInitializing { } function __EAI721Tokenization_init_unchained() internal onlyInitializing { } // {IEAI721Tokenization-setAITokenAddress} function setAITokenAddress(uint256 agentId, address newAIToken) public virtual onlyAgentOwner(agentId) { if (newAIToken == address(0)) revert InvalidAddress(); _aiTokens[agentId] = newAIToken; emit AITokenAddressUpdated(agentId, newAIToken); } // {IEAI721Tokenization-aiToken} function aiToken(uint256 agentId) public virtual view returns (address) { return _aiTokens[agentId]; } /** * @dev This empty reserved space is put in place to allow future versions to add new */ uint256[44] private __gap; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface IEAI721Intelligence { // --- Enums --- enum FileType { LIBRARY, MAIN_SCRIPT } // --- Structs --- struct CodePointer { address retrieveAddress; FileType fileType; string fileName; } // --- Events --- event CodePointerCreated( uint256 indexed agentId, uint256 indexed version, uint256 indexed pIndex, CodePointer newPointer ); // --- Errors --- error EAI721IntelligenceAuth(); error DigestAlreadyUsed(); error InvalidData(); error InvalidDependency(); error InvalidVersion(); /** * @dev Updates the name of a specific agent. * @param agentId The unique identifier of the agent. * @param name The new name to assign to the agent. */ function setAgentName(uint256 agentId, string calldata name) external; /** * @dev Retrieves the name of a specific agent. * @param agentId The unique identifier of the agent. * @return The name of the agent. */ function agentName(uint256 agentId) external view returns (string memory); /** * @dev Publishes the code for a specific agent. * @param agentId The unique identifier of the agent. * @param codeLanguage The programming language of the code. * @param pointers An array of code pointers for the agent. * @param depsAgents An array of dependent agent IDs. * @return The version number of the published code. */ function publishAgentCode( uint256 agentId, string calldata codeLanguage, CodePointer[] calldata pointers, uint256[] calldata depsAgents ) external returns (uint16); /** * @dev Retrieves the dependent agent IDs for a specific agent and version. * @param agentId The unique identifier of the agent. * @param version The version number of the agent's code. * @return An array of dependent agent IDs. */ function depsAgents(uint256 agentId, uint16 version) external view returns (uint256[] memory); /** * @dev Retrieves the code of a specific agent for a given version. * @param agentId The unique identifier of the agent. * @param version The version number of the agent's code. * @return code The code of the agent. */ function agentCode(uint256 agentId, uint16 version) external view returns (string memory code); /** * @dev Retrieves the current version of a specific agent's code. * @param agentId The unique identifier of the agent. * @return The current version number of the agent's code. */ function currentVersion(uint256 agentId) external view returns (uint16); /** * @dev Retrieves the programming language of a specific agent's code. * @param agentId The unique identifier of the agent. * @return The programming language of the agent's code. */ function codeLanguage(uint256 agentId) external view returns (string memory); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface IEAI721Monetization { // --- Errors --- error EAI721MonetizationAuth(); // --- Events --- event SubscriptionFeeUpdated(uint256 indexed agentId, uint256 fee); /** * @dev Retrieves the subscription fee for a specific agent. * @param agentId The ID of the agent. * @return The subscription fee associated with the given agent. */ function subscriptionFee(uint256 agentId) external view returns (uint256); /** * @dev Sets the subscription fee for a specific agent. * @param agentId The ID of the agent. * @param fee The subscription fee to be set for the agent. */ function setSubscriptionFee(uint256 agentId, uint256 fee) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface IEAI721Tokenization { // --- Errors --- error EAI721TokenizationAuth(); error InvalidAddress(); // --- Events --- event AITokenAddressUpdated(uint256 indexed agentId, address indexed newAIToken); /** * @dev The AI token associated with a specific agent. * @param agentId The ID of the agent. * @return The address of the AI token for the given agent. */ function aiToken(uint256 agentId) external view returns (address); /** * @dev Updates the AI token address for a specific agent. * @param agentId The ID of the agent. * @param newAIToken The new AI token address to be set for the agent. */ function setAITokenAddress(uint256 agentId, address newAIToken) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.22; /// @title EthFS FileStore interface /// @notice Specifies a content-addressable onchain file store interface IFileStore { /** * @title EthFS File * @notice A representation of an onchain file, composed of slices of contract bytecode and utilities to construct the file contents from those slices. * @dev For best gas efficiency, it's recommended using `File.read()` as close to the output returned by the contract call as possible. Lots of gas is consumed every time a large data blob is passed between functions. */ /** * @dev Represents a reference to a slice of bytecode in a contract */ struct BytecodeSlice { address pointer; uint32 start; uint32 end; } /** * @dev Represents a file composed of one or more bytecode slices */ struct File { // Total length of file contents (sum of all slice sizes). Useful when you want to use DynamicBuffer to build the file contents from the slices. uint256 size; BytecodeSlice[] slices; } event Deployed(); /** * @dev Emitted when a new file is created * @param indexedFilename The indexed filename for easier finding by filename in logs * @param pointer The pointer address of the file * @param filename The name of the file * @param size The total size of the file * @param metadata Additional metadata of the file, only emitted for use in offchain indexers */ event FileCreated( string indexed indexedFilename, address indexed pointer, string filename, uint256 size, bytes metadata ); /** * @dev Error thrown when a requested file is not found * @param filename The name of the file requested */ error FileNotFound(string filename); /** * @dev Error thrown when a filename already exists * @param filename The name of the file attempted to be created */ error FilenameExists(string filename); /** * @dev Error thrown when attempting to create an empty file */ error FileEmpty(); /** * @dev Error thrown when a provided slice for a file is empty * @param pointer The contract address where the bytecode lives * @param start The byte offset to start the slice (inclusive) * @param end The byte offset to end the slice (exclusive) */ error SliceEmpty(address pointer, uint32 start, uint32 end); /** * @dev Error thrown when the provided pointer's bytecode does not have the expected STOP opcode prefix from SSTORE2 * @param pointer The SSTORE2 pointer address */ error InvalidPointer(address pointer); /** * @notice Returns the address of the CREATE2 deterministic deployer used by this FileStore * @return The address of the CREATE2 deterministic deployer */ function deployer() external view returns (address); /** * @notice Retrieves the pointer address of a file by its filename * @param filename The name of the file * @return pointer The pointer address of the file */ function files( string memory filename ) external view returns (address pointer); /** * @notice Checks if a file exists for a given filename * @param filename The name of the file to check * @return True if the file exists, false otherwise */ function fileExists(string memory filename) external view returns (bool); /** * @notice Retrieves the pointer address for a given filename * @param filename The name of the file * @return pointer The pointer address of the file */ function getPointer( string memory filename ) external view returns (address pointer); /** * @notice Retrieves a file by its filename * @param filename The name of the file * @return file The file associated with the filename */ function getFile( string memory filename ) external view returns (File memory file); /** * @notice Creates a new file with the provided file contents * @dev This is a convenience method to simplify small file uploads. It's recommended to use `createFileFromPointers` or `createFileFromSlices` for larger files. This particular method splits `contents` into 24575-byte chunks before storing them via SSTORE2. * @param filename The name of the new file * @param contents The contents of the file * @return pointer The pointer address of the new file * @return file The newly created file */ function createFile( string memory filename, string memory contents ) external returns (address pointer, File memory file); /** * @notice Creates a new file with the provided file contents and file metadata * @dev This is a convenience method to simplify small file uploads. It's recommended to use `createFileFromPointers` or `createFileFromSlices` for larger files. This particular method splits `contents` into 24575-byte chunks before storing them via SSTORE2. * @param filename The name of the new file * @param contents The contents of the file * @param metadata Additional file metadata, usually a JSON-encoded string, for offchain indexers * @return pointer The pointer address of the new file * @return file The newly created file */ function createFile( string memory filename, string memory contents, bytes memory metadata ) external returns (address pointer, File memory file); /** * @notice Creates a new file where its content is composed of the provided string chunks * @dev This is a convenience method to simplify small and nuanced file uploads. It's recommended to use `createFileFromPointers` or `createFileFromSlices` for larger files. This particular will store each chunk separately via SSTORE2. For best gas efficiency, each chunk should be as large as possible (up to the contract size limit) and at least 32 bytes. * @param filename The name of the new file * @param chunks The string chunks composing the file * @return pointer The pointer address of the new file * @return file The newly created file */ function createFileFromChunks( string memory filename, string[] memory chunks ) external returns (address pointer, File memory file); /** * @notice Creates a new file with the provided string chunks and file metadata * @dev This is a convenience method to simplify small and nuanced file uploads. It's recommended to use `createFileFromPointers` or `createFileFromSlices` for larger files. This particular will store each chunk separately via SSTORE2. For best gas efficiency, each chunk should be as large as possible (up to the contract size limit) and at least 32 bytes. * @param filename The name of the new file * @param chunks The string chunks composing the file * @param metadata Additional file metadata, usually a JSON-encoded string, for offchain indexers * @return pointer The pointer address of the new file * @return file The newly created file */ function createFileFromChunks( string memory filename, string[] memory chunks, bytes memory metadata ) external returns (address pointer, File memory file); /** * @notice Creates a new file where its content is composed of the provided SSTORE2 pointers * @param filename The name of the new file * @param pointers The SSTORE2 pointers composing the file * @return pointer The pointer address of the new file * @return file The newly created file */ function createFileFromPointers( string memory filename, address[] memory pointers ) external returns (address pointer, File memory file); /** * @notice Creates a new file with the provided SSTORE2 pointers and file metadata * @param filename The name of the new file * @param pointers The SSTORE2 pointers composing the file * @param metadata Additional file metadata, usually a JSON-encoded string, for offchain indexers * @return pointer The pointer address of the new file * @return file The newly created file */ function createFileFromPointers( string memory filename, address[] memory pointers, bytes memory metadata ) external returns (address pointer, File memory file); /** * @notice Creates a new file where its content is composed of the provided bytecode slices * @param filename The name of the new file * @param slices The bytecode slices composing the file * @return pointer The pointer address of the new file * @return file The newly created file */ function createFileFromSlices( string memory filename, BytecodeSlice[] memory slices ) external returns (address pointer, File memory file); /** * @notice Creates a new file with the provided bytecode slices and file metadata * @param filename The name of the new file * @param slices The bytecode slices composing the file * @param metadata Additional file metadata, usually a JSON-encoded string, for offchain indexers * @return pointer The pointer address of the new file * @return file The newly created file */ function createFileFromSlices( string memory filename, BytecodeSlice[] memory slices, bytes memory metadata ) external returns (address pointer, File memory file); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.12; interface IOnchainArtData { /** * @notice Returns the metadata URI for a given token ID. * @param tokenId The ID of the token to query. * @return result The metadata URI as a string. */ function tokenURI( uint256 tokenId ) external view returns (string memory result); /** * @notice Mints a new agent with the specified token ID. * @param tokenId The ID of the token to mint. */ function mintAgent(uint256 tokenId) external; /** * @notice Unlocks the render agent for a given token, setting its DNA and traits. * @param tokenId The ID of the token to unlock. * @param dna The DNA value to assign to the agent. * @param traits An array of 5 trait values to assign to the agent. */ function unlockRenderAgent( uint256 tokenId, uint256 dna, uint256[6] memory traits ) external; /** * @notice Returns the attributes of an agent. * @param agentId The ID of the agent to query. * @return result The attributes of the agent as a string. */ function agentAttributes( uint256 agentId ) external view returns (string memory result); /** * @notice Returns the SVG image of an agent in svg format. * @param agentId The ID of the agent to query. * @return result The SVG image of the agent as a string. */ function agentImageSvg( uint256 agentId ) external view returns (string memory result); /** * @notice Returns the image of an agent in bytes format. * @param agentId The ID of the agent to query. * @return result The image of the agent as a bytes. */ function agentImage( uint256 agentId ) external view returns (bytes memory result); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.20; interface IRating { // --- Events --- event Rated( address indexed user, uint256 indexed agentId, uint8 indexed stars, uint256 newTotalStarsSum, uint256 newTotalRatingCount ); // --- Custom Errors --- error RatingOutOfRange(uint8 stars); // --- State-Changing Functions --- function rateStar(uint256 agentId, uint8 stars) external; // --- View functions --- function ratingScore(uint256 agentId) external view returns (uint256); function ratingCount(uint256 agentId) external view returns (uint256); function ratingMultiplier() external view returns (uint256); }
// SPDX-License-Identifier: agpl-3.0 pragma solidity ^0.8.12; library Errors { enum ReturnCode { SUCCESS, FAILED } string public constant SUCCESS = "0"; // common errors string public constant INV_ADD = "100"; string public constant ONLY_ADMIN_ALLOWED = "101"; string public constant ONLY_CREATOR = "102"; string public constant ONLY_DEPLOYER = "103"; string public constant ONLY_AGENT_CONTRACT = "104"; string public constant INVALID_ITEM_TYPE = "105"; string public constant ITEM_NOT_EXIST = "106"; // validation error string public constant MISSING_NAME = "200"; string public constant INV_FEE_PROJECT = "201"; string public constant INV_PROJECT = "202"; string public constant REACH_MAX = "203"; string public constant INV_PARAMS = "204"; string public constant TOO_HIGH = "205"; string public constant TOKEN_HAS_SEED = "206"; string public constant ZERO_SEED = "207"; string public constant OPENING_SCHEDULE = "208"; string public constant INV_TOKEN = "209"; string public constant FORBIDDEN_TRANSFER_PROJECT = "210"; string public constant ONLY_GENERATIVE_PROJECT = "211"; // validator market error string public constant INVALID_ERC721_OWNER = "300"; string public constant ERC_721_NOT_APPROVED = "301"; string public constant OFFERING_CLOSED = "302"; string public constant VALUE_INVALID = "303"; string public constant ERC20_BALANCE_INVALID = "304"; string public constant ERC20_NOT_APPROVED = "305"; string public constant TRANSFER_FAIL = "306"; string public constant ERC_20_NOT_ALLOW = "307"; string public constant ZERO_PRICE = "308"; string public constant ZERO_DURATION = "309"; // GEN Token string public constant POA_INVALID_TOKEN = "400"; string public constant TEAM_VESTING_ERROR_ADDR = "401"; string public constant DAO_VESTING_ERROR_ADDR = "402"; string public constant VESTING_TIME_LOCK = "403"; string public constant VESTING_REMAIN = "404"; string public constant CONTRACT_SEALED = "500"; string public constant TOKEN_ID_NOT_UNLOCKED = "501"; // agent not really minted on AI agent contract -> still in queue because not reach threadhold string public constant TOKEN_ID_UNLOCKED = "502"; string public constant USED_PAIRs = "503"; string public constant TOKEN_ID_NOT_EXISTED = "504"; string public constant WEIGHT_OUT = "505"; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.22; import {IFileStore} from "../../interfaces/IFileStore.sol"; /** * @dev Error thrown when a slice is out of the bounds of the contract's bytecode */ error SliceOutOfBounds( address pointer, uint32 codeSize, uint32 sliceStart, uint32 sliceEnd ); /** * @notice Reads the contents of a file by concatenating its slices * @param file The file to read * @return contents The concatenated contents of the file */ function read(IFileStore.File memory file) view returns (string memory contents) { IFileStore.BytecodeSlice[] memory slices = file.slices; bytes4 sliceOutOfBoundsSelector = SliceOutOfBounds.selector; assembly { let len := mload(slices) let size := 0x20 contents := mload(0x40) let slice let pointer let start let end let codeSize for { let i := 0 } lt(i, len) { i := add(i, 1) } { slice := mload(add(slices, add(0x20, mul(i, 0x20)))) pointer := mload(slice) start := mload(add(slice, 0x20)) end := mload(add(slice, 0x40)) codeSize := extcodesize(pointer) if gt(end, codeSize) { mstore(0x00, sliceOutOfBoundsSelector) mstore(0x04, pointer) mstore(0x24, codeSize) mstore(0x44, start) mstore(0x64, end) revert(0x00, 0x84) } extcodecopy(pointer, add(contents, size), start, sub(end, start)) size := add(size, sub(end, start)) } // update contents size mstore(contents, sub(size, 0x20)) // store contents mstore(0x40, add(contents, and(add(size, 0x1f), not(0x1f)))) } } /** * @notice Reads the contents of a file without reverting on unreadable/invalid slices. Skips any slices that are out of bounds or invalid. Useful if you are composing contract bytecode where a contract can still selfdestruct (which would result in an invalid slice) and want to avoid reverts but still output potentially "corrupted" file contents (due to missing data). * @param file The file to read * @return contents The concatenated contents of the file, skipping invalid slices */ function readUnchecked(IFileStore.File memory file) view returns (string memory contents) { IFileStore.BytecodeSlice[] memory slices = file.slices; assembly { let len := mload(slices) let size := 0x20 contents := mload(0x40) let slice let pointer let start let end let codeSize for { let i := 0 } lt(i, len) { i := add(i, 1) } { slice := mload(add(slices, add(0x20, mul(i, 0x20)))) pointer := mload(slice) start := mload(add(slice, 0x20)) end := mload(add(slice, 0x40)) codeSize := extcodesize(pointer) if lt(end, codeSize) { extcodecopy( pointer, add(contents, size), start, sub(end, start) ) size := add(size, sub(end, start)) } } // update contents size mstore(contents, sub(size, 0x20)) // store contents mstore(0x40, add(contents, and(add(size, 0x1f), not(0x1f)))) } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.20; import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import {IRating} from "../interfaces/IRating.sol"; abstract contract Rating is Initializable, IRating { // --- Constants --- uint8 private constant MAX_RATING = 5; uint8 private constant MIN_RATING = 1; // --- Storage --- uint256 private _ratingMultiplier; mapping(uint256 agentId => uint256) private _totalStars; mapping(uint256 agentId => uint256) private _totalRatingCount; // --- Initialization --- function __Rating_init( uint256 ratingMultiplier_ ) internal onlyInitializing { __Rating_init_unchained(ratingMultiplier_); } function __Rating_init_unchained( uint256 ratingMultiplier_ ) internal onlyInitializing { _ratingMultiplier = ratingMultiplier_; } // --- Functions --- function rateStar(uint256 agentId, uint8 stars) external virtual { if (stars < MIN_RATING || stars > MAX_RATING) { revert RatingOutOfRange(stars); } // Add new rating _totalStars[agentId] += stars; _totalRatingCount[agentId]++; emit Rated( msg.sender, agentId, stars, _totalStars[agentId], _totalRatingCount[agentId] ); } function ratingScore( uint256 agentId ) external view virtual returns (uint256) { if (_totalRatingCount[agentId] == 0) { return 0; } // Multiply by 100 for 2 decimal places // 451 means 4.51 return (_totalStars[agentId] * _ratingMultiplier) / _totalRatingCount[agentId]; } function ratingMultiplier() external view virtual returns (uint256) { return _ratingMultiplier; } function ratingCount( uint256 agentId ) external view virtual returns (uint256) { return _totalRatingCount[agentId]; } /** * @dev This empty reserved space is put in place to allow future versions to add new */ uint256[10] private __gap; }
{ "optimizer": { "enabled": true, "runs": 200000 }, "viaIR": true, "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":"DigestAlreadyUsed","type":"error"},{"inputs":[],"name":"EAI721IntelligenceAuth","type":"error"},{"inputs":[],"name":"EAI721MonetizationAuth","type":"error"},{"inputs":[],"name":"EAI721TokenizationAuth","type":"error"},{"inputs":[],"name":"Existed","type":"error"},{"inputs":[],"name":"InvalidAddr","type":"error"},{"inputs":[],"name":"InvalidAddress","type":"error"},{"inputs":[],"name":"InvalidData","type":"error"},{"inputs":[],"name":"InvalidDependency","type":"error"},{"inputs":[],"name":"InvalidTokenId","type":"error"},{"inputs":[],"name":"InvalidVersion","type":"error"},{"inputs":[],"name":"NotExist","type":"error"},{"inputs":[{"internalType":"uint8","name":"stars","type":"uint8"}],"name":"RatingOutOfRange","type":"error"},{"inputs":[],"name":"Unauthenticated","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"agentId","type":"uint256"},{"indexed":true,"internalType":"address","name":"newAIToken","type":"address"}],"name":"AITokenAddressUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"admin","type":"address"},{"indexed":false,"internalType":"bool","name":"allowed","type":"bool"}],"name":"AdminAllowed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newAddr","type":"address"}],"name":"AgentDataAddressChanged","type":"event"},{"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":true,"internalType":"uint256","name":"agentId","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"version","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"pIndex","type":"uint256"},{"components":[{"internalType":"address","name":"retrieveAddress","type":"address"},{"internalType":"enum IEAI721Intelligence.FileType","name":"fileType","type":"uint8"},{"internalType":"string","name":"fileName","type":"string"}],"indexed":false,"internalType":"struct IEAI721Intelligence.CodePointer","name":"newPointer","type":"tuple"}],"name":"CodePointerCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"agentId","type":"uint256"},{"indexed":true,"internalType":"uint8","name":"stars","type":"uint8"},{"indexed":false,"internalType":"uint256","name":"newTotalStarsSum","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newTotalRatingCount","type":"uint256"}],"name":"Rated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"agentId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"fee","type":"uint256"}],"name":"SubscriptionFeeUpdated","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":"uint256","name":"agentId","type":"uint256"}],"name":"agentAttributes","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"agentId","type":"uint256"},{"internalType":"uint16","name":"version","type":"uint16"}],"name":"agentCode","outputs":[{"internalType":"string","name":"code","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"agentDataAddr","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"agentId","type":"uint256"}],"name":"agentImage","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"agentId","type":"uint256"}],"name":"agentImageSvg","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"agentId","type":"uint256"}],"name":"agentName","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"agentId","type":"uint256"}],"name":"aiToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newAdm","type":"address"},{"internalType":"bool","name":"allow","type":"bool"}],"name":"allowAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"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":"address","name":"newAddr","type":"address"}],"name":"changeAgentDataAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"agentId","type":"uint256"}],"name":"codeLanguage","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"agentId","type":"uint256"}],"name":"currentVersion","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"deleteDefaultRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"agentId","type":"uint256"},{"internalType":"uint16","name":"version","type":"uint16"}],"name":"depsAgents","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"},{"internalType":"address","name":"defaultRoyaltyReceiver_","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"admin","type":"address"}],"name":"isAdmin","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"dna","type":"uint256"},{"internalType":"uint256[6]","name":"traits","type":"uint256[6]"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"agentId","type":"uint256"},{"internalType":"string","name":"codeLanguageIn","type":"string"},{"components":[{"internalType":"address","name":"retrieveAddress","type":"address"},{"internalType":"enum IEAI721Intelligence.FileType","name":"fileType","type":"uint8"},{"internalType":"string","name":"fileName","type":"string"}],"internalType":"struct IEAI721Intelligence.CodePointer[]","name":"pointersIn","type":"tuple[]"},{"internalType":"uint256[]","name":"depsAgentsIn","type":"uint256[]"}],"name":"publishAgentCode","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"agentId","type":"uint256"},{"internalType":"uint8","name":"stars","type":"uint8"}],"name":"rateStar","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"agentId","type":"uint256"}],"name":"ratingCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ratingMultiplier","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"agentId","type":"uint256"}],"name":"ratingScore","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"resetTokenRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"","type":"address"},{"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":"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":"uint256","name":"agentId","type":"uint256"},{"internalType":"address","name":"newAIToken","type":"address"}],"name":"setAITokenAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"agentId","type":"uint256"},{"internalType":"string","name":"name","type":"string"}],"name":"setAgentName","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":"address","name":"newRoyaltyReceiver","type":"address"},{"internalType":"uint96","name":"feeNumerator","type":"uint96"}],"name":"setDefaultRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"agentId","type":"uint256"},{"internalType":"uint256","name":"fee","type":"uint256"}],"name":"setSubscriptionFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"newRoyaltyReceiver","type":"address"},{"internalType":"uint96","name":"feeNumerator","type":"uint96"}],"name":"setTokenRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"agentId","type":"uint256"}],"name":"subscriptionFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","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":"agentId","type":"uint256"}],"name":"tokenURI","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":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
6080806040523461001657614c9f908161001c8239f35b600080fdfe6080604052600436101561001257600080fd5b60003560e01c806301ffc9a7146102e7578063037b9564146102e257806304634d8d146102dd57806306fdde03146102d8578063077f224a146102d3578063081812fc146102ce578063089853b9146102c9578063095ea7b3146102c45780630c975765146102bf57806313a9fa01146102ba57806314d17aa2146102b55780631ebf0c57146102b057806323b872dd146102ab57806324aab9ef146102a657806324d7806c146102a15780632a55205a1461029c5780632dad7dd11461029757806333a89c401461029257806342842e0e1461028d5780634527924d14610288578063497d8690146102835780634bf607f81461027e5780635944c753146102795780635c215526146102745780636352211e1461026f57806370a082311461026a578063715018a6146102655780637fa7e04d146102605780638396b4cb1461025b5780638a616bc0146102565780638da5cb5b14610251578063926a3d041461024c57806395d89b4114610247578063a22cb46514610242578063aa1b103f1461023d578063b0fd6b9114610238578063b88d4fde14610233578063c87b56dd1461022e578063d3c129fd14610229578063d82f3bc114610224578063df072e601461021f578063e11c07311461021a578063e985e9c514610215578063f2fde38b146102105763f959fb6b1461020b57600080fd5b6126e8565b6125fc565b61255a565b6124b4565b612477565b6123b5565b6122a4565b612181565b6120fb565b611ff9565b611fa5565b611e7f565b611db9565b611d22565b611cd0565b611c6f565b611c2b565b611a53565b6119b4565b6118b7565b61187b565b6117be565b61161f565b6115d1565b6115ad565b611351565b6112ca565b61127f565b611235565b61114c565b6110dd565b61101f565b610fb7565b610ee5565b610e84565b610dd2565b610d41565b610bd1565b610b73565b610b19565b61097b565b6106c2565b6104e3565b610458565b61031b565b7fffffffff0000000000000000000000000000000000000000000000000000000081160361031657565b600080fd5b346103165760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103165760207fffffffff00000000000000000000000000000000000000000000000000000000600435610379816102ec565b167f80ac58cd0000000000000000000000000000000000000000000000000000000081148015610424575b80156103fb575b809181156103c0575b50506040519015158152f35b7f2a55205a0000000000000000000000000000000000000000000000000000000014915081156103f3575b5038806103b4565b9050386103eb565b507f01ffc9a70000000000000000000000000000000000000000000000000000000081146103ab565b507f5b5e139f0000000000000000000000000000000000000000000000000000000081146103a4565b600091031261031657565b346103165760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261031657602073ffffffffffffffffffffffffffffffffffffffff60fc5416604051908152f35b73ffffffffffffffffffffffffffffffffffffffff81160361031657565b604435906bffffffffffffffffffffffff8216820361031657565b346103165760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103165760043561051e816104aa565b602435906bffffffffffffffffffffffff82168092036103165773ffffffffffffffffffffffffffffffffffffffff90336000526101c260205261057260ff6040600020541661056c612842565b9061287b565b61058061271084111561367d565b1680156105ea576105e891604051916105988361084b565b825260208201527fffffffffffffffffffffffff0000000000000000000000000000000000000000602073ffffffffffffffffffffffffffffffffffffffff83511692015160a01b161761018355565b005b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152fd5b60005b83811061065b5750506000910152565b818101518382015260200161064b565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f6020936106a781518092818752878088019101610648565b0116010190565b9060206106bf92818152019061066b565b90565b34610316576000807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126107e457604051908060975490610704826128c1565b808552916020916001918281169081156107995750600114610741575b61073d866107318188038261089f565b604051918291826106ae565b0390f35b9350609784527f354a83ed9988f79f6038d4c7a7dadbad8af32f4ad6df893e0e5807a1b1944ff95b838510610786575050505081016020016107318261073d38610721565b8054868601840152938201938101610769565b87965061073d979450602093506107319592507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0091501682840152151560051b820101929338610721565b80fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60c0810190811067ffffffffffffffff82111761083257604052565b6107e7565b67ffffffffffffffff811161083257604052565b6040810190811067ffffffffffffffff82111761083257604052565b6060810190811067ffffffffffffffff82111761083257604052565b6020810190811067ffffffffffffffff82111761083257604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111761083257604052565b604051906108ed8261084b565b565b67ffffffffffffffff811161083257601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b929192610935826108ef565b91610943604051938461089f565b829481845281830111610316578281602093846000960137010152565b9080601f83011215610316578160206106bf93359101610929565b346103165760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103165767ffffffffffffffff600435818111610316576109cb903690600401610960565b90602435908111610316576109e7610a53913690600401610960565b604435906109f4826104aa565b60005493610a1960ff8660081c161580968197610b0b575b8115610aeb575b506129d6565b84610a4a60017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff006000541617600055565b610ab557612a61565b610a5957005b610a867fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff60005416600055565b604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb384740249890602090a1005b610ae66101007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff6000541617600055565b612a61565b303b15915081610afd575b5038610a13565b6001915060ff161438610af6565b600160ff8216109150610a0c565b346103165760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610316576020610b55600435612c32565b73ffffffffffffffffffffffffffffffffffffffff60405191168152f35b346103165760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103165760043560005260cb60205261073d610bbd6040600020612914565b60405191829160208352602083019061066b565b346103165760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261031657600435610c0c816104aa565b602435610c18816132a2565b9173ffffffffffffffffffffffffffffffffffffffff8084168091831614610cbd576105e893610c52913314908115610c57575b50612c8e565b613849565b610cb79150610cb090610c8b339173ffffffffffffffffffffffffffffffffffffffff16600052609c602052604060002090565b9073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b5460ff1690565b38610c4c565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560448201527f72000000000000000000000000000000000000000000000000000000000000006064820152fd5b346103165760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610316576004356000526101b76020526020604060002054604051908152f35b7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc604091011261031657600435610dc2816104aa565b9060243580151581036103165790565b346103165773ffffffffffffffffffffffffffffffffffffffff7f685d83364dd5f42d4015c2ae1e1b18ae8f9acfcc03b27d04093b04505518b0eb6020610e1836610d8c565b9390610e226138e5565b1692610e37610e2f612d19565b85151561287b565b836000526101c28252610e798160406000209060ff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0083541691151516179055565b6040519015158152a2005b346103165760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261031657600435600052610156602052602073ffffffffffffffffffffffffffffffffffffffff60406000205416604051908152f35b34610316576101207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261031657602435610f21816104aa565b366083121561031657604051610f3681610816565b8091610124368111610316576064935b818510610f5d576105e88460443585600435612d52565b8435815260209485019401610f46565b7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc606091011261031657600435610fa3816104aa565b90602435610fb0816104aa565b9060443590565b34610316576105e8610fc836610f6d565b91610fdb610fd684336139a4565b612f94565b613aca565b7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc6040910112610316576004359060243561ffff811681036103165790565b346103165761102d36610fe0565b6110378183613cdb565b600091825261105d60209160cf8352604084209061ffff16600052602052604060002090565b60405192838383549182815201908193835284832090835b8181106110c9575050508461108b91038561089f565b60405193838594850191818652518092526040850193925b8281106110b257505050500390f35b8351855286955093810193928101926001016110a3565b825484529286019260019283019201611075565b346103165760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103165773ffffffffffffffffffffffffffffffffffffffff60043561112d816104aa565b166000526101c2602052602060ff604060002054166040519015158152f35b346103165760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610316576004356000526101846020526040600020604051906111998261084b565b549073ffffffffffffffffffffffffffffffffffffffff908183169283825260a01c60208201529115611225575b6111f06111e86bffffffffffffffffffffffff602085015116602435613082565b612710900490565b91511661073d604051928392836020909392919373ffffffffffffffffffffffffffffffffffffffff60408201951681520152565b905061122f61301f565b906111c7565b346103165760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103165760043560005260c960205261073d610bbd6040600020612914565b346103165760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610316576004356000526101296020526020604060002054604051908152f35b34610316576105e86112db36610f6d565b90604051926112e984610883565b600084526135e0565b9181601f840112156103165782359167ffffffffffffffff8311610316576020838186019501011161031657565b9181601f840112156103165782359167ffffffffffffffff8311610316576020808501948460051b01011161031657565b346103165760807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261031657600480359067ffffffffffffffff90602435828111610316576113a690369083016112f2565b9093604435848111610316576113bf9036908501611320565b94606435908111610316576113d79036908601611320565b93909673ffffffffffffffffffffffffffffffffffffffff6113f8856132a2565b16330361158457861561155b57906114239161141e8560005260c9602052604060002090565b61340b565b61142c8261443c565b9460005b8181106114f35750505060005b8281106114535760405161ffff86168152602090f35b61145e818488613de6565b351580156114dd575b6114b4576001906114ae61149c876114898660005260cf602052604060002090565b9061ffff16600052602052604060002090565b6114a783878b613de6565b3590613df6565b0161143d565b836040517fce62d641000000000000000000000000000000000000000000000000000000008152fd5b506127106114ec828589613de6565b3511611467565b6114fe818385613d50565b61150d60409182810190613d95565b90501561153357508061152d6115266001938587613d50565b898761457e565b01611430565b8690517f5cb045db000000000000000000000000000000000000000000000000000000008152fd5b856040517f5cb045db000000000000000000000000000000000000000000000000000000008152fd5b856040517fc8759c17000000000000000000000000000000000000000000000000000000008152fd5b346103165761073d610bbd6115c136610fe0565b906115cc8282613cdb565b613126565b346103165760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103165760043560005260ca602052602061ffff60406000205416604051908152f35b346103165760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103165760243561165a816104aa565b6116626104c8565b90336000526101c260205261168160ff6040600020541661056c612842565b61169d6127106bffffffffffffffffffffffff8416111561367d565b73ffffffffffffffffffffffffffffffffffffffff811615611760576116fc6105e8926116e76116cb6108e0565b73ffffffffffffffffffffffffffffffffffffffff9094168452565b6bffffffffffffffffffffffff166020830152565b611713600435600052610184602052604060002090565b815160209092015160a01b7fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff909216919091179055565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f455243323938313a20496e76616c696420706172616d657465727300000000006044820152fd5b346103165760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103165773ffffffffffffffffffffffffffffffffffffffff60043561180e816104aa565b6118166138e5565b1661182a611822612d19565b82151561287b565b807fffffffffffffffffffffffff000000000000000000000000000000000000000060fc54161760fc557fd6a336d7b9f51bbf5f601ef8d939f71652fcba126ae9c154337cc61390d12fe2600080a2005b346103165760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610316576020610b556004356132a2565b346103165760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103165773ffffffffffffffffffffffffffffffffffffffff600435611907816104aa565b16801561193057600052609a60205261073d604060002054604051918291829190602083019252565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f74206120766160448201527f6c6964206f776e657200000000000000000000000000000000000000000000006064820152fd5b34610316576000807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126107e4576119ec6138e5565b8073ffffffffffffffffffffffffffffffffffffffff6033547fffffffffffffffffffffffff00000000000000000000000000000000000000008116603355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b346103165760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103165767ffffffffffffffff60043560243582811161031657611aa69036906004016112f2565b73ffffffffffffffffffffffffffffffffffffffff611ac7849593956132a2565b163303611c0157600092835260209360cb6020526040842092821161083257611afa82611af485546128c1565b856133b5565b8394601f8311600114611b59575083948291611b49949592611b4e575b50507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8260011b9260031b1c19161790565b905580f35b013590503880611b17565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0831695611b8d85600052602060002090565b9286905b888210611be957505083600195969710611bb1575b505050811b01905580f35b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88560031b161c19910135169055388080611ba6565b80600184968294958701358155019501920190611b91565b60046040517fc8759c17000000000000000000000000000000000000000000000000000000008152fd5b346103165760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610316576020611c67600435613527565b604051908152f35b346103165760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103165760003381526101c2602052611cbc60ff60408320541661056c612842565b600435815261018460205280604081205580f35b346103165760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261031657602073ffffffffffffffffffffffffffffffffffffffff60335416604051908152f35b346103165760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103165760043560243573ffffffffffffffffffffffffffffffffffffffff611d75836132a2565b163303611c015760207f07e3a4d85d160f72847c3129e39355a05016071b8be1dda09245ed9f42a18a3f9183600052610129825280604060002055604051908152a2005b34610316576000807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126107e457604051908060985490611dfb826128c1565b808552916020916001918281169081156107995750600114611e275761073d866107318188038261089f565b9350609884527f2237a976fa961f5921fd19f2b03c925c725d77b20ce8f790c19709c03de4d8145b838510611e6c575050505081016020016107318261073d38610721565b8054868601840152938201938101611e4f565b3461031657611e8d36610d8c565b73ffffffffffffffffffffffffffffffffffffffff821691823314611f475781611ee7611f179233600052609c60205260406000209073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b9060ff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0083541691151516179055565b60405190151581527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3160203392a3005b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152fd5b34610316576000807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126107e4573381526101c2602052611ff160ff60408320541661056c612842565b806101835580f35b346103165760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103165773ffffffffffffffffffffffffffffffffffffffff60fc541660405180917fb0fd6b91000000000000000000000000000000000000000000000000000000008252600435600483015281602460009384935afa9081156120f6578091612097575b6040518061073d84826106ae565b90503d8082843e6120a8818461089f565b8201916020818403126120f25780519067ffffffffffffffff82116120ee57019082601f830112156107e4575061073d918160206120e89351910161359f565b38612089565b8280fd5b5080fd5b6135d4565b346103165760807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261031657600435612136816104aa565b602435612142816104aa565b6064359167ffffffffffffffff83116103165736602384011215610316576121776105e8933690602481600401359101610929565b91604435916135e0565b346103165760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610316576004356121e081600052609960205273ffffffffffffffffffffffffffffffffffffffff60406000205416151590565b1561227a5760fc546040517fc87b56dd00000000000000000000000000000000000000000000000000000000815260048101929092526000908290602490829073ffffffffffffffffffffffffffffffffffffffff165afa80156120f65761073d91600091612257575b50604051918291826106ae565b61227491503d806000833e61226c818361089f565b81019061360c565b3861224a565b60046040517fad5679e1000000000000000000000000000000000000000000000000000000008152fd5b346103165760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610316576024356004356122e2826104aa565b73ffffffffffffffffffffffffffffffffffffffff80612301836132a2565b163303611c0157821690811561238b57612364600093828552610156602052604085209073ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffff0000000000000000000000000000000000000000825416179055565b7f874bb36ddecf74125f4a144af1242d590f1ee92c9ef77b5918b429d99b6b87898380a380f35b60046040517fe6c4247b000000000000000000000000000000000000000000000000000000008152fd5b346103165760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610316576024600073ffffffffffffffffffffffffffffffffffffffff60fc5416604051928380927fd82f3bc100000000000000000000000000000000000000000000000000000000825260043560048301525afa80156120f65761073d9160009161245c575b5060405191829160208352602083019061066b565b61247191503d806000833e61226c818361089f565b38612447565b346103165760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103165760206101b554604051908152f35b346103165760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610316576024600073ffffffffffffffffffffffffffffffffffffffff60fc5416604051928380927fe11c073100000000000000000000000000000000000000000000000000000000825260043560048301525afa80156120f65761073d9160009161245c575060405191829160208352602083019061066b565b346103165760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261031657602060ff6125f060043561259c816104aa565b73ffffffffffffffffffffffffffffffffffffffff602435916125be836104aa565b16600052609c845260406000209073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b54166040519015158152f35b346103165760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261031657600435612637816104aa565b61263f6138e5565b73ffffffffffffffffffffffffffffffffffffffff811615612664576105e890614095565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152fd5b346103165760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610316576004356024359060ff82169182810361031657600183108015612825575b6127eb575061274f816000526101b6602052604060002090565b61275a838254613643565b9055612771816000526101b7602052604060002090565b61277b8154613650565b9055612792816000526101b6602052604060002090565b547f2d9600f4bfd258d9c38953999f0305cc917a1b0222237da84f9101b63169f0316127e66127cc846000526101b7602052604060002090565b546040805194855260208501919091523393918291820190565b0390a4005b6040517f3e44328e00000000000000000000000000000000000000000000000000000000815260ff919091166004820152602490fd5b0390fd5b5060058311612735565b6040519061283c82610883565b60008252565b6040519061284f8261084b565b600382527f31303100000000000000000000000000000000000000000000000000000000006020830152565b156128835750565b612821906040519182917f08c379a000000000000000000000000000000000000000000000000000000000835260206004840152602483019061066b565b90600182811c9216801561290a575b60208310146128db57565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b91607f16916128d0565b90604051918260008254612927816128c1565b908184526020946001916001811690816000146129955750600114612956575b5050506108ed9250038361089f565b600090815285812095935091905b81831061297d5750506108ed9350820101388080612947565b85548884018501529485019487945091830191612964565b9150506108ed9593507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0091501682840152151560051b820101388080612947565b156129dd57565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152fd5b929190612a7e60ff60005460081c16612a7981613777565b613777565b612a8733614095565b612a9c60ff60005460081c16612a7981613777565b835167ffffffffffffffff811161083257612ac181612abc6097546128c1565b6132d1565b602080601f8311600114612b60575081612b209392612b18926108ed9798600092612b555750507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8260011b9260031b1c19161790565b60975561418e565b612b28613802565b612b30613813565b612b3861382c565b612b40613802565b612b48613802565b612b50613802565b613708565b015190503880611b17565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0831696612bb160976000527f354a83ed9988f79f6038d4c7a7dadbad8af32f4ad6df893e0e5807a1b1944ff990565b926000905b898210612c1a575050918391600193612b2096956108ed999a10612be3575b505050811b0160975561418e565b01517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88460031b161c19169055388080612bd5565b80600185968294968601518155019501930190612bb6565b612c67612c6282600052609960205273ffffffffffffffffffffffffffffffffffffffff60406000205416151590565b61323d565b600052609b60205273ffffffffffffffffffffffffffffffffffffffff6040600020541690565b15612c9557565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c0000006064820152fd5b60405190612d268261084b565b600382527f31303000000000000000000000000000000000000000000000000000000000006020830152565b9392906000923384526101c2602052604091612d7660ff848720541661056c612842565b86158015612f89575b612f605773ffffffffffffffffffffffffffffffffffffffff8116158015612f37575b612f0e57612dd387600052609960205273ffffffffffffffffffffffffffffffffffffffff60406000205416151590565b612ee55786612de1916142cc565b612e1f612e06612e0660fc5473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1690565b91823b15612ece5780517fe59c633900000000000000000000000000000000000000000000000000000000815260048101889052858160248183885af180156120f657612ed2575b50823b15612ece57612eaa9596859151968795869485937f3fff0f9600000000000000000000000000000000000000000000000000000000855260048501613964565b03925af180156120f657612ebb5750565b80612ec86108ed92610837565b8061044d565b8480fd5b80612ec8612edf92610837565b38612e67565b600483517fe6d06c9f000000000000000000000000000000000000000000000000000000008152fd5b600483517fe481c269000000000000000000000000000000000000000000000000000000008152fd5b50612f5a612e0660fc5473ffffffffffffffffffffffffffffffffffffffff1690565b15612da2565b600483517f3f6cc768000000000000000000000000000000000000000000000000000000008152fd5b506127108711612d7f565b15612f9b57565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201527f72206f7220617070726f766564000000000000000000000000000000000000006064820152fd5b6040519061302c8261084b565b6101835473ffffffffffffffffffffffffffffffffffffffff8116835260a01c6020830152565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8181029291811591840414171561309557565b613053565b600211156130a457565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b906040516130e081610867565b809260ff815473ffffffffffffffffffffffffffffffffffffffff8116845260a01c169060028210156130a457600161312191604093602086015201612914565b910152565b9061313f816114898460005260cd602052604060002090565b549161314961282f565b9261315261282f565b926000925b82841061318b575050505081511580613182575b613178576106bf9161402c565b50506106bf61282f565b5080511561316b565b909192946131c26131bd876131ae866114898760005260ce602052604060002090565b90600052602052604060002090565b6130d3565b9060206131ce83613f5b565b920180516131db8161309a565b6131e48161309a565b61320057506001916131f59161402c565b955b01929190613157565b60019097929197516132118161309a565b61321a8161309a565b14613229575b506001906131f7565b613236906001929661402c565b9490613220565b1561324457565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e20494400000000000000006044820152fd5b600052609960205273ffffffffffffffffffffffffffffffffffffffff604060002054166106bf81151561323d565b601f81116132dd575050565b60009060976000527f354a83ed9988f79f6038d4c7a7dadbad8af32f4ad6df893e0e5807a1b1944ff9906020601f850160051c83019410613339575b601f0160051c01915b82811061332e57505050565b818155600101613322565b9092508290613319565b601f811161334f575050565b60009060986000527f2237a976fa961f5921fd19f2b03c925c725d77b20ce8f790c19709c03de4d814906020601f850160051c830194106133ab575b601f0160051c01915b8281106133a057505050565b818155600101613394565b909250829061338b565b90601f81116133c357505050565b6000916000526020600020906020601f850160051c83019410613401575b601f0160051c01915b8281106133f657505050565b8181556001016133ea565b90925082906133e1565b90929167ffffffffffffffff8111610832576134318161342b84546128c1565b846133b5565b6000601f821160011461348357819061347f939495600092611b4e5750507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8260011b9260031b1c19161790565b9055565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08216946134b684600052602060002090565b91805b87811061350f5750836001959697106134d7575b505050811b019055565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88560031b161c199101351690553880806134cd565b909260206001819286860135815501940191016134b9565b6000908082526101b78060205260408320541561359a576101b660205261355660408420546101b55490613082565b918352602052604082205491821561356d57500490565b807f4e487b7100000000000000000000000000000000000000000000000000000000602492526012600452fd5b505090565b909291926135ac816108ef565b916135ba604051938461089f565b8294828452828201116103165760206108ed930190610648565b6040513d6000823e3d90fd5b916108ed9391613607936135f7610fd684336139a4565b613602838383613aca565b614b9a565b614102565b6020818303126103165780519067ffffffffffffffff821161031657019080601f830112156103165781516106bf9260200161359f565b9190820180921161309557565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146130955760010190565b1561368457565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c2065786365656460448201527f2073616c655072696365000000000000000000000000000000000000000000006064820152fd5b73ffffffffffffffffffffffffffffffffffffffff1680156105ea576040516108ed916137348261084b565b8082526101f460209092019190915273ffffffffffffffffffffffffffffffffffffffff167501f400000000000000000000000000000000000000001761018355565b1561377e57565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152fd5b6108ed60ff60005460081c16613777565b61382460ff60005460081c16613777565b6108ed613802565b61384160ff60005460081c16612a7981613777565b60646101b555565b81600052609b60205261389b8160406000209073ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffff0000000000000000000000000000000000000000825416179055565b73ffffffffffffffffffffffffffffffffffffffff806138ba846132a2565b169116907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600080a4565b73ffffffffffffffffffffffffffffffffffffffff60335416330361390657565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b604090949392919461010081019581526020926020820152016000905b6006821061398f5750505050565b82806001928651815201940191019092613981565b73ffffffffffffffffffffffffffffffffffffffff806139c3846132a2565b1692818316928484149485156139f9575b505083156139e3575b50505090565b6139ef91929350612c32565b16143880806139dd565b60ff92955090613a3591600052609c60205260406000209073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b54169238806139d4565b15613a4657565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201527f6f776e65720000000000000000000000000000000000000000000000000000006064820152fd5b613afb90613ad7846132a2565b73ffffffffffffffffffffffffffffffffffffffff82811693909182168414613a3f565b8316928315613c5857613b86613c3192613b2185613b1b612e068a6132a2565b14613a3f565b613b60613b3888600052609b602052604060002090565b7fffffffffffffffffffffffff00000000000000000000000000000000000000008154169055565b73ffffffffffffffffffffffffffffffffffffffff16600052609a602052604060002090565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8154019055613bd68173ffffffffffffffffffffffffffffffffffffffff16600052609a602052604060002090565b60018154019055613bf1856000526099602052604060002090565b9073ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffff0000000000000000000000000000000000000000825416179055565b7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a4565b60846040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152fd5b60005260ca60205261ffff8060406000205416911611613cf757565b60046040517fa9146eeb000000000000000000000000000000000000000000000000000000008152fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9190811015613d905760051b810135907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa181360301821215610316570190565b613d21565b9035907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe181360301821215610316570180359067ffffffffffffffff82116103165760200191813603831361031657565b9190811015613d905760051b0190565b805490680100000000000000008210156108325760018201808255821015613d905760005260206000200155565b60405190613e318261084b565b600482527f69706673000000000000000000000000000000000000000000000000000000006020830152565b519063ffffffff8216820361031657565b906020808383031261031657825167ffffffffffffffff93848211610316570192604092838582031261031657835194613ea78661084b565b80518652838101519083821161031657019080601f8301121561031657815192831161083257845194613edf858560051b018761089f565b8386528486019185606080960285010193818511610316578601925b848410613f0e5750505050505082015290565b8584830312610316578686918451613f2581610867565b8651613f30816104aa565b8152613f3d838801613e5d565b83820152613f4c868801613e5d565b86820152815201930192613efb565b613f648161484a565b60208151910120613f73613e24565b6020815191012014600014613f89576040015190565b6000816040613fb5612e06612e06613fed965173ffffffffffffffffffffffffffffffffffffffff1690565b9101519060405180809581947fe0876aa8000000000000000000000000000000000000000000000000000000008352600483016106ae565b03915afa80156120f6576106bf91600091614009575b506148a6565b61402691503d806000833e61401e818361089f565b810190613e6e565b38614003565b60216106bf91604051938161404b869351809260208087019101610648565b82017f0a0000000000000000000000000000000000000000000000000000000000000060208201526140868251809360208785019101610648565b0103600181018452018261089f565b6033549073ffffffffffffffffffffffffffffffffffffffff80911691827fffffffffffffffffffffffff0000000000000000000000000000000000000000821617603355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3565b1561410957565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608490fd5b90815167ffffffffffffffff8111610832576141b4816141af6098546128c1565b613343565b602080601f8311600114614208575081906142039394600092612b555750507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8260011b9260031b1c19161790565b609855565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe083169461425960986000527f2237a976fa961f5921fd19f2b03c925c725d77b20ce8f790c19709c03de4d81490565b926000905b8782106142b457505083600195961061427d575b505050811b01609855565b01517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88460031b161c19169055388080614272565b8060018596829496860151815501950193019061425e565b906040516142d981610883565b6000815273ffffffffffffffffffffffffffffffffffffffff83169182156143de576108ed93816136079461433a61433483600052609960205273ffffffffffffffffffffffffffffffffffffffff60406000205416151590565b15614c04565b61436a61433483600052609960205273ffffffffffffffffffffffffffffffffffffffff60406000205416151590565b6143948373ffffffffffffffffffffffffffffffffffffffff16600052609a602052604060002090565b600181540190556143b383613bf1846000526099602052604060002090565b60007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8180a4614a2e565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602060248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152fd5b60005260ca602052604060002080549061ffff918281168381146130955760017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00009101938416911617905590565b6002111561031657565b601f82602094937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0938186528686013760008582860101520116010190565b906020825273ffffffffffffffffffffffffffffffffffffffff81356144f8816104aa565b166020830152602081013561450c8161448a565b60028110156130a457604083015260408101357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18236030181121561031657016020813591019067ffffffffffffffff8111610316578036038213610316576080836060806106bf9601520191614494565b9091600090828252602060cd81526145a785604085209061ffff16600052602052604060002090565b549284815260ce82526145cb86604083209061ffff16600052602052604060002090565b8482528252604081209161462484356145e3816104aa565b849073ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffff0000000000000000000000000000000000000000825416179055565b808401356146318161448a565b600281101561481d577fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff74ff000000000000000000000000000000000000000085549260a01b1691161783556001809301926146906040860186613d95565b93909167ffffffffffffffff8511610832576146b6856146b088546128c1565b886133b5565b8193601f8611600114614764575050928061148997959361470f9361475a9b9a989692611b4e5750507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8260011b9260031b1c19161790565b90555b827f7d6847ad3150238df54d0cf4d353519cb481fa067b6ca73ddf4f21e2bd9151bb6040518061474761ffff8a1695826144d3565b0390a460005260cd602052604060002090565b61347f8154613650565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe086959395169161479b88600052602060002090565b95915b8383106148065750505092600192859261475a9b9a98966114899a9896106147ce575b505050811b019055614712565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88560031b161c199101351690553880806147c1565b85850135875595860195938101939181019161479e565b6024837f4e487b710000000000000000000000000000000000000000000000000000000081526021600452fd5b5173ffffffffffffffffffffffffffffffffffffffff1661486d576106bf613e24565b6040516148798161084b565b600281527f6673000000000000000000000000000000000000000000000000000000000000602082015290565b906020809201518051906020916040805195600080945b8486106148fc57505050505050601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe091828101855201168201604052565b909192939495838760051b8301015180518686830151920151813b80821161493d575082849392600195938e930394859301903c01960194939291906148bd565b9260849387937f86d14d89000000000000000000000000000000000000000000000000000000008552600452602452604452606452fd5b9081602091031261031657516106bf816102ec565b6106bf939273ffffffffffffffffffffffffffffffffffffffff608093168252600060208301526040820152816060820152019061066b565b90926106bf949360809373ffffffffffffffffffffffffffffffffffffffff80921684521660208301526040820152816060820152019061066b565b3d15614a29573d90614a0f826108ef565b91614a1d604051938461089f565b82523d6000602084013e565b606090565b909190803b15614b9257614a8e60209173ffffffffffffffffffffffffffffffffffffffff9360006040519586809581947f150b7a02000000000000000000000000000000000000000000000000000000009a8b84523360048501614989565b0393165af160009181614b61575b50614b3b57614aa96149fe565b80519081614b36576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608490fd5b602001fd5b7fffffffff00000000000000000000000000000000000000000000000000000000161490565b614b8491925060203d602011614b8b575b614b7c818361089f565b810190614974565b9038614a9c565b503d614b72565b505050600190565b92909190823b15614bfb57614a8e92602092600073ffffffffffffffffffffffffffffffffffffffff6040518097819682957f150b7a02000000000000000000000000000000000000000000000000000000009b8c855233600486016149c2565b50505050600190565b15614c0b57565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152fdfea26469706673582212207045bb256afbd742ee151dc3ca7b213d5651b3371dfe5e5909c0598cedde1d0864736f6c63430008160033
Deployed Bytecode
0x6080604052600436101561001257600080fd5b60003560e01c806301ffc9a7146102e7578063037b9564146102e257806304634d8d146102dd57806306fdde03146102d8578063077f224a146102d3578063081812fc146102ce578063089853b9146102c9578063095ea7b3146102c45780630c975765146102bf57806313a9fa01146102ba57806314d17aa2146102b55780631ebf0c57146102b057806323b872dd146102ab57806324aab9ef146102a657806324d7806c146102a15780632a55205a1461029c5780632dad7dd11461029757806333a89c401461029257806342842e0e1461028d5780634527924d14610288578063497d8690146102835780634bf607f81461027e5780635944c753146102795780635c215526146102745780636352211e1461026f57806370a082311461026a578063715018a6146102655780637fa7e04d146102605780638396b4cb1461025b5780638a616bc0146102565780638da5cb5b14610251578063926a3d041461024c57806395d89b4114610247578063a22cb46514610242578063aa1b103f1461023d578063b0fd6b9114610238578063b88d4fde14610233578063c87b56dd1461022e578063d3c129fd14610229578063d82f3bc114610224578063df072e601461021f578063e11c07311461021a578063e985e9c514610215578063f2fde38b146102105763f959fb6b1461020b57600080fd5b6126e8565b6125fc565b61255a565b6124b4565b612477565b6123b5565b6122a4565b612181565b6120fb565b611ff9565b611fa5565b611e7f565b611db9565b611d22565b611cd0565b611c6f565b611c2b565b611a53565b6119b4565b6118b7565b61187b565b6117be565b61161f565b6115d1565b6115ad565b611351565b6112ca565b61127f565b611235565b61114c565b6110dd565b61101f565b610fb7565b610ee5565b610e84565b610dd2565b610d41565b610bd1565b610b73565b610b19565b61097b565b6106c2565b6104e3565b610458565b61031b565b7fffffffff0000000000000000000000000000000000000000000000000000000081160361031657565b600080fd5b346103165760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103165760207fffffffff00000000000000000000000000000000000000000000000000000000600435610379816102ec565b167f80ac58cd0000000000000000000000000000000000000000000000000000000081148015610424575b80156103fb575b809181156103c0575b50506040519015158152f35b7f2a55205a0000000000000000000000000000000000000000000000000000000014915081156103f3575b5038806103b4565b9050386103eb565b507f01ffc9a70000000000000000000000000000000000000000000000000000000081146103ab565b507f5b5e139f0000000000000000000000000000000000000000000000000000000081146103a4565b600091031261031657565b346103165760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261031657602073ffffffffffffffffffffffffffffffffffffffff60fc5416604051908152f35b73ffffffffffffffffffffffffffffffffffffffff81160361031657565b604435906bffffffffffffffffffffffff8216820361031657565b346103165760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103165760043561051e816104aa565b602435906bffffffffffffffffffffffff82168092036103165773ffffffffffffffffffffffffffffffffffffffff90336000526101c260205261057260ff6040600020541661056c612842565b9061287b565b61058061271084111561367d565b1680156105ea576105e891604051916105988361084b565b825260208201527fffffffffffffffffffffffff0000000000000000000000000000000000000000602073ffffffffffffffffffffffffffffffffffffffff83511692015160a01b161761018355565b005b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152fd5b60005b83811061065b5750506000910152565b818101518382015260200161064b565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f6020936106a781518092818752878088019101610648565b0116010190565b9060206106bf92818152019061066b565b90565b34610316576000807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126107e457604051908060975490610704826128c1565b808552916020916001918281169081156107995750600114610741575b61073d866107318188038261089f565b604051918291826106ae565b0390f35b9350609784527f354a83ed9988f79f6038d4c7a7dadbad8af32f4ad6df893e0e5807a1b1944ff95b838510610786575050505081016020016107318261073d38610721565b8054868601840152938201938101610769565b87965061073d979450602093506107319592507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0091501682840152151560051b820101929338610721565b80fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60c0810190811067ffffffffffffffff82111761083257604052565b6107e7565b67ffffffffffffffff811161083257604052565b6040810190811067ffffffffffffffff82111761083257604052565b6060810190811067ffffffffffffffff82111761083257604052565b6020810190811067ffffffffffffffff82111761083257604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111761083257604052565b604051906108ed8261084b565b565b67ffffffffffffffff811161083257601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b929192610935826108ef565b91610943604051938461089f565b829481845281830111610316578281602093846000960137010152565b9080601f83011215610316578160206106bf93359101610929565b346103165760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103165767ffffffffffffffff600435818111610316576109cb903690600401610960565b90602435908111610316576109e7610a53913690600401610960565b604435906109f4826104aa565b60005493610a1960ff8660081c161580968197610b0b575b8115610aeb575b506129d6565b84610a4a60017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff006000541617600055565b610ab557612a61565b610a5957005b610a867fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff60005416600055565b604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb384740249890602090a1005b610ae66101007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff6000541617600055565b612a61565b303b15915081610afd575b5038610a13565b6001915060ff161438610af6565b600160ff8216109150610a0c565b346103165760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610316576020610b55600435612c32565b73ffffffffffffffffffffffffffffffffffffffff60405191168152f35b346103165760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103165760043560005260cb60205261073d610bbd6040600020612914565b60405191829160208352602083019061066b565b346103165760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261031657600435610c0c816104aa565b602435610c18816132a2565b9173ffffffffffffffffffffffffffffffffffffffff8084168091831614610cbd576105e893610c52913314908115610c57575b50612c8e565b613849565b610cb79150610cb090610c8b339173ffffffffffffffffffffffffffffffffffffffff16600052609c602052604060002090565b9073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b5460ff1690565b38610c4c565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560448201527f72000000000000000000000000000000000000000000000000000000000000006064820152fd5b346103165760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610316576004356000526101b76020526020604060002054604051908152f35b7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc604091011261031657600435610dc2816104aa565b9060243580151581036103165790565b346103165773ffffffffffffffffffffffffffffffffffffffff7f685d83364dd5f42d4015c2ae1e1b18ae8f9acfcc03b27d04093b04505518b0eb6020610e1836610d8c565b9390610e226138e5565b1692610e37610e2f612d19565b85151561287b565b836000526101c28252610e798160406000209060ff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0083541691151516179055565b6040519015158152a2005b346103165760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261031657600435600052610156602052602073ffffffffffffffffffffffffffffffffffffffff60406000205416604051908152f35b34610316576101207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261031657602435610f21816104aa565b366083121561031657604051610f3681610816565b8091610124368111610316576064935b818510610f5d576105e88460443585600435612d52565b8435815260209485019401610f46565b7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc606091011261031657600435610fa3816104aa565b90602435610fb0816104aa565b9060443590565b34610316576105e8610fc836610f6d565b91610fdb610fd684336139a4565b612f94565b613aca565b7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc6040910112610316576004359060243561ffff811681036103165790565b346103165761102d36610fe0565b6110378183613cdb565b600091825261105d60209160cf8352604084209061ffff16600052602052604060002090565b60405192838383549182815201908193835284832090835b8181106110c9575050508461108b91038561089f565b60405193838594850191818652518092526040850193925b8281106110b257505050500390f35b8351855286955093810193928101926001016110a3565b825484529286019260019283019201611075565b346103165760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103165773ffffffffffffffffffffffffffffffffffffffff60043561112d816104aa565b166000526101c2602052602060ff604060002054166040519015158152f35b346103165760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610316576004356000526101846020526040600020604051906111998261084b565b549073ffffffffffffffffffffffffffffffffffffffff908183169283825260a01c60208201529115611225575b6111f06111e86bffffffffffffffffffffffff602085015116602435613082565b612710900490565b91511661073d604051928392836020909392919373ffffffffffffffffffffffffffffffffffffffff60408201951681520152565b905061122f61301f565b906111c7565b346103165760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103165760043560005260c960205261073d610bbd6040600020612914565b346103165760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610316576004356000526101296020526020604060002054604051908152f35b34610316576105e86112db36610f6d565b90604051926112e984610883565b600084526135e0565b9181601f840112156103165782359167ffffffffffffffff8311610316576020838186019501011161031657565b9181601f840112156103165782359167ffffffffffffffff8311610316576020808501948460051b01011161031657565b346103165760807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261031657600480359067ffffffffffffffff90602435828111610316576113a690369083016112f2565b9093604435848111610316576113bf9036908501611320565b94606435908111610316576113d79036908601611320565b93909673ffffffffffffffffffffffffffffffffffffffff6113f8856132a2565b16330361158457861561155b57906114239161141e8560005260c9602052604060002090565b61340b565b61142c8261443c565b9460005b8181106114f35750505060005b8281106114535760405161ffff86168152602090f35b61145e818488613de6565b351580156114dd575b6114b4576001906114ae61149c876114898660005260cf602052604060002090565b9061ffff16600052602052604060002090565b6114a783878b613de6565b3590613df6565b0161143d565b836040517fce62d641000000000000000000000000000000000000000000000000000000008152fd5b506127106114ec828589613de6565b3511611467565b6114fe818385613d50565b61150d60409182810190613d95565b90501561153357508061152d6115266001938587613d50565b898761457e565b01611430565b8690517f5cb045db000000000000000000000000000000000000000000000000000000008152fd5b856040517f5cb045db000000000000000000000000000000000000000000000000000000008152fd5b856040517fc8759c17000000000000000000000000000000000000000000000000000000008152fd5b346103165761073d610bbd6115c136610fe0565b906115cc8282613cdb565b613126565b346103165760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103165760043560005260ca602052602061ffff60406000205416604051908152f35b346103165760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103165760243561165a816104aa565b6116626104c8565b90336000526101c260205261168160ff6040600020541661056c612842565b61169d6127106bffffffffffffffffffffffff8416111561367d565b73ffffffffffffffffffffffffffffffffffffffff811615611760576116fc6105e8926116e76116cb6108e0565b73ffffffffffffffffffffffffffffffffffffffff9094168452565b6bffffffffffffffffffffffff166020830152565b611713600435600052610184602052604060002090565b815160209092015160a01b7fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff909216919091179055565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f455243323938313a20496e76616c696420706172616d657465727300000000006044820152fd5b346103165760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103165773ffffffffffffffffffffffffffffffffffffffff60043561180e816104aa565b6118166138e5565b1661182a611822612d19565b82151561287b565b807fffffffffffffffffffffffff000000000000000000000000000000000000000060fc54161760fc557fd6a336d7b9f51bbf5f601ef8d939f71652fcba126ae9c154337cc61390d12fe2600080a2005b346103165760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610316576020610b556004356132a2565b346103165760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103165773ffffffffffffffffffffffffffffffffffffffff600435611907816104aa565b16801561193057600052609a60205261073d604060002054604051918291829190602083019252565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f74206120766160448201527f6c6964206f776e657200000000000000000000000000000000000000000000006064820152fd5b34610316576000807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126107e4576119ec6138e5565b8073ffffffffffffffffffffffffffffffffffffffff6033547fffffffffffffffffffffffff00000000000000000000000000000000000000008116603355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b346103165760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103165767ffffffffffffffff60043560243582811161031657611aa69036906004016112f2565b73ffffffffffffffffffffffffffffffffffffffff611ac7849593956132a2565b163303611c0157600092835260209360cb6020526040842092821161083257611afa82611af485546128c1565b856133b5565b8394601f8311600114611b59575083948291611b49949592611b4e575b50507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8260011b9260031b1c19161790565b905580f35b013590503880611b17565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0831695611b8d85600052602060002090565b9286905b888210611be957505083600195969710611bb1575b505050811b01905580f35b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88560031b161c19910135169055388080611ba6565b80600184968294958701358155019501920190611b91565b60046040517fc8759c17000000000000000000000000000000000000000000000000000000008152fd5b346103165760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610316576020611c67600435613527565b604051908152f35b346103165760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103165760003381526101c2602052611cbc60ff60408320541661056c612842565b600435815261018460205280604081205580f35b346103165760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261031657602073ffffffffffffffffffffffffffffffffffffffff60335416604051908152f35b346103165760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103165760043560243573ffffffffffffffffffffffffffffffffffffffff611d75836132a2565b163303611c015760207f07e3a4d85d160f72847c3129e39355a05016071b8be1dda09245ed9f42a18a3f9183600052610129825280604060002055604051908152a2005b34610316576000807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126107e457604051908060985490611dfb826128c1565b808552916020916001918281169081156107995750600114611e275761073d866107318188038261089f565b9350609884527f2237a976fa961f5921fd19f2b03c925c725d77b20ce8f790c19709c03de4d8145b838510611e6c575050505081016020016107318261073d38610721565b8054868601840152938201938101611e4f565b3461031657611e8d36610d8c565b73ffffffffffffffffffffffffffffffffffffffff821691823314611f475781611ee7611f179233600052609c60205260406000209073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b9060ff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0083541691151516179055565b60405190151581527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3160203392a3005b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152fd5b34610316576000807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126107e4573381526101c2602052611ff160ff60408320541661056c612842565b806101835580f35b346103165760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103165773ffffffffffffffffffffffffffffffffffffffff60fc541660405180917fb0fd6b91000000000000000000000000000000000000000000000000000000008252600435600483015281602460009384935afa9081156120f6578091612097575b6040518061073d84826106ae565b90503d8082843e6120a8818461089f565b8201916020818403126120f25780519067ffffffffffffffff82116120ee57019082601f830112156107e4575061073d918160206120e89351910161359f565b38612089565b8280fd5b5080fd5b6135d4565b346103165760807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261031657600435612136816104aa565b602435612142816104aa565b6064359167ffffffffffffffff83116103165736602384011215610316576121776105e8933690602481600401359101610929565b91604435916135e0565b346103165760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610316576004356121e081600052609960205273ffffffffffffffffffffffffffffffffffffffff60406000205416151590565b1561227a5760fc546040517fc87b56dd00000000000000000000000000000000000000000000000000000000815260048101929092526000908290602490829073ffffffffffffffffffffffffffffffffffffffff165afa80156120f65761073d91600091612257575b50604051918291826106ae565b61227491503d806000833e61226c818361089f565b81019061360c565b3861224a565b60046040517fad5679e1000000000000000000000000000000000000000000000000000000008152fd5b346103165760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610316576024356004356122e2826104aa565b73ffffffffffffffffffffffffffffffffffffffff80612301836132a2565b163303611c0157821690811561238b57612364600093828552610156602052604085209073ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffff0000000000000000000000000000000000000000825416179055565b7f874bb36ddecf74125f4a144af1242d590f1ee92c9ef77b5918b429d99b6b87898380a380f35b60046040517fe6c4247b000000000000000000000000000000000000000000000000000000008152fd5b346103165760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610316576024600073ffffffffffffffffffffffffffffffffffffffff60fc5416604051928380927fd82f3bc100000000000000000000000000000000000000000000000000000000825260043560048301525afa80156120f65761073d9160009161245c575b5060405191829160208352602083019061066b565b61247191503d806000833e61226c818361089f565b38612447565b346103165760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103165760206101b554604051908152f35b346103165760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610316576024600073ffffffffffffffffffffffffffffffffffffffff60fc5416604051928380927fe11c073100000000000000000000000000000000000000000000000000000000825260043560048301525afa80156120f65761073d9160009161245c575060405191829160208352602083019061066b565b346103165760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261031657602060ff6125f060043561259c816104aa565b73ffffffffffffffffffffffffffffffffffffffff602435916125be836104aa565b16600052609c845260406000209073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b54166040519015158152f35b346103165760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261031657600435612637816104aa565b61263f6138e5565b73ffffffffffffffffffffffffffffffffffffffff811615612664576105e890614095565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152fd5b346103165760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610316576004356024359060ff82169182810361031657600183108015612825575b6127eb575061274f816000526101b6602052604060002090565b61275a838254613643565b9055612771816000526101b7602052604060002090565b61277b8154613650565b9055612792816000526101b6602052604060002090565b547f2d9600f4bfd258d9c38953999f0305cc917a1b0222237da84f9101b63169f0316127e66127cc846000526101b7602052604060002090565b546040805194855260208501919091523393918291820190565b0390a4005b6040517f3e44328e00000000000000000000000000000000000000000000000000000000815260ff919091166004820152602490fd5b0390fd5b5060058311612735565b6040519061283c82610883565b60008252565b6040519061284f8261084b565b600382527f31303100000000000000000000000000000000000000000000000000000000006020830152565b156128835750565b612821906040519182917f08c379a000000000000000000000000000000000000000000000000000000000835260206004840152602483019061066b565b90600182811c9216801561290a575b60208310146128db57565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b91607f16916128d0565b90604051918260008254612927816128c1565b908184526020946001916001811690816000146129955750600114612956575b5050506108ed9250038361089f565b600090815285812095935091905b81831061297d5750506108ed9350820101388080612947565b85548884018501529485019487945091830191612964565b9150506108ed9593507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0091501682840152151560051b820101388080612947565b156129dd57565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152fd5b929190612a7e60ff60005460081c16612a7981613777565b613777565b612a8733614095565b612a9c60ff60005460081c16612a7981613777565b835167ffffffffffffffff811161083257612ac181612abc6097546128c1565b6132d1565b602080601f8311600114612b60575081612b209392612b18926108ed9798600092612b555750507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8260011b9260031b1c19161790565b60975561418e565b612b28613802565b612b30613813565b612b3861382c565b612b40613802565b612b48613802565b612b50613802565b613708565b015190503880611b17565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0831696612bb160976000527f354a83ed9988f79f6038d4c7a7dadbad8af32f4ad6df893e0e5807a1b1944ff990565b926000905b898210612c1a575050918391600193612b2096956108ed999a10612be3575b505050811b0160975561418e565b01517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88460031b161c19169055388080612bd5565b80600185968294968601518155019501930190612bb6565b612c67612c6282600052609960205273ffffffffffffffffffffffffffffffffffffffff60406000205416151590565b61323d565b600052609b60205273ffffffffffffffffffffffffffffffffffffffff6040600020541690565b15612c9557565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c0000006064820152fd5b60405190612d268261084b565b600382527f31303000000000000000000000000000000000000000000000000000000000006020830152565b9392906000923384526101c2602052604091612d7660ff848720541661056c612842565b86158015612f89575b612f605773ffffffffffffffffffffffffffffffffffffffff8116158015612f37575b612f0e57612dd387600052609960205273ffffffffffffffffffffffffffffffffffffffff60406000205416151590565b612ee55786612de1916142cc565b612e1f612e06612e0660fc5473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1690565b91823b15612ece5780517fe59c633900000000000000000000000000000000000000000000000000000000815260048101889052858160248183885af180156120f657612ed2575b50823b15612ece57612eaa9596859151968795869485937f3fff0f9600000000000000000000000000000000000000000000000000000000855260048501613964565b03925af180156120f657612ebb5750565b80612ec86108ed92610837565b8061044d565b8480fd5b80612ec8612edf92610837565b38612e67565b600483517fe6d06c9f000000000000000000000000000000000000000000000000000000008152fd5b600483517fe481c269000000000000000000000000000000000000000000000000000000008152fd5b50612f5a612e0660fc5473ffffffffffffffffffffffffffffffffffffffff1690565b15612da2565b600483517f3f6cc768000000000000000000000000000000000000000000000000000000008152fd5b506127108711612d7f565b15612f9b57565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201527f72206f7220617070726f766564000000000000000000000000000000000000006064820152fd5b6040519061302c8261084b565b6101835473ffffffffffffffffffffffffffffffffffffffff8116835260a01c6020830152565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8181029291811591840414171561309557565b613053565b600211156130a457565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b906040516130e081610867565b809260ff815473ffffffffffffffffffffffffffffffffffffffff8116845260a01c169060028210156130a457600161312191604093602086015201612914565b910152565b9061313f816114898460005260cd602052604060002090565b549161314961282f565b9261315261282f565b926000925b82841061318b575050505081511580613182575b613178576106bf9161402c565b50506106bf61282f565b5080511561316b565b909192946131c26131bd876131ae866114898760005260ce602052604060002090565b90600052602052604060002090565b6130d3565b9060206131ce83613f5b565b920180516131db8161309a565b6131e48161309a565b61320057506001916131f59161402c565b955b01929190613157565b60019097929197516132118161309a565b61321a8161309a565b14613229575b506001906131f7565b613236906001929661402c565b9490613220565b1561324457565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e20494400000000000000006044820152fd5b600052609960205273ffffffffffffffffffffffffffffffffffffffff604060002054166106bf81151561323d565b601f81116132dd575050565b60009060976000527f354a83ed9988f79f6038d4c7a7dadbad8af32f4ad6df893e0e5807a1b1944ff9906020601f850160051c83019410613339575b601f0160051c01915b82811061332e57505050565b818155600101613322565b9092508290613319565b601f811161334f575050565b60009060986000527f2237a976fa961f5921fd19f2b03c925c725d77b20ce8f790c19709c03de4d814906020601f850160051c830194106133ab575b601f0160051c01915b8281106133a057505050565b818155600101613394565b909250829061338b565b90601f81116133c357505050565b6000916000526020600020906020601f850160051c83019410613401575b601f0160051c01915b8281106133f657505050565b8181556001016133ea565b90925082906133e1565b90929167ffffffffffffffff8111610832576134318161342b84546128c1565b846133b5565b6000601f821160011461348357819061347f939495600092611b4e5750507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8260011b9260031b1c19161790565b9055565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08216946134b684600052602060002090565b91805b87811061350f5750836001959697106134d7575b505050811b019055565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88560031b161c199101351690553880806134cd565b909260206001819286860135815501940191016134b9565b6000908082526101b78060205260408320541561359a576101b660205261355660408420546101b55490613082565b918352602052604082205491821561356d57500490565b807f4e487b7100000000000000000000000000000000000000000000000000000000602492526012600452fd5b505090565b909291926135ac816108ef565b916135ba604051938461089f565b8294828452828201116103165760206108ed930190610648565b6040513d6000823e3d90fd5b916108ed9391613607936135f7610fd684336139a4565b613602838383613aca565b614b9a565b614102565b6020818303126103165780519067ffffffffffffffff821161031657019080601f830112156103165781516106bf9260200161359f565b9190820180921161309557565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146130955760010190565b1561368457565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c2065786365656460448201527f2073616c655072696365000000000000000000000000000000000000000000006064820152fd5b73ffffffffffffffffffffffffffffffffffffffff1680156105ea576040516108ed916137348261084b565b8082526101f460209092019190915273ffffffffffffffffffffffffffffffffffffffff167501f400000000000000000000000000000000000000001761018355565b1561377e57565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152fd5b6108ed60ff60005460081c16613777565b61382460ff60005460081c16613777565b6108ed613802565b61384160ff60005460081c16612a7981613777565b60646101b555565b81600052609b60205261389b8160406000209073ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffff0000000000000000000000000000000000000000825416179055565b73ffffffffffffffffffffffffffffffffffffffff806138ba846132a2565b169116907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600080a4565b73ffffffffffffffffffffffffffffffffffffffff60335416330361390657565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b604090949392919461010081019581526020926020820152016000905b6006821061398f5750505050565b82806001928651815201940191019092613981565b73ffffffffffffffffffffffffffffffffffffffff806139c3846132a2565b1692818316928484149485156139f9575b505083156139e3575b50505090565b6139ef91929350612c32565b16143880806139dd565b60ff92955090613a3591600052609c60205260406000209073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b54169238806139d4565b15613a4657565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201527f6f776e65720000000000000000000000000000000000000000000000000000006064820152fd5b613afb90613ad7846132a2565b73ffffffffffffffffffffffffffffffffffffffff82811693909182168414613a3f565b8316928315613c5857613b86613c3192613b2185613b1b612e068a6132a2565b14613a3f565b613b60613b3888600052609b602052604060002090565b7fffffffffffffffffffffffff00000000000000000000000000000000000000008154169055565b73ffffffffffffffffffffffffffffffffffffffff16600052609a602052604060002090565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8154019055613bd68173ffffffffffffffffffffffffffffffffffffffff16600052609a602052604060002090565b60018154019055613bf1856000526099602052604060002090565b9073ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffff0000000000000000000000000000000000000000825416179055565b7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a4565b60846040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152fd5b60005260ca60205261ffff8060406000205416911611613cf757565b60046040517fa9146eeb000000000000000000000000000000000000000000000000000000008152fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9190811015613d905760051b810135907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa181360301821215610316570190565b613d21565b9035907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe181360301821215610316570180359067ffffffffffffffff82116103165760200191813603831361031657565b9190811015613d905760051b0190565b805490680100000000000000008210156108325760018201808255821015613d905760005260206000200155565b60405190613e318261084b565b600482527f69706673000000000000000000000000000000000000000000000000000000006020830152565b519063ffffffff8216820361031657565b906020808383031261031657825167ffffffffffffffff93848211610316570192604092838582031261031657835194613ea78661084b565b80518652838101519083821161031657019080601f8301121561031657815192831161083257845194613edf858560051b018761089f565b8386528486019185606080960285010193818511610316578601925b848410613f0e5750505050505082015290565b8584830312610316578686918451613f2581610867565b8651613f30816104aa565b8152613f3d838801613e5d565b83820152613f4c868801613e5d565b86820152815201930192613efb565b613f648161484a565b60208151910120613f73613e24565b6020815191012014600014613f89576040015190565b6000816040613fb5612e06612e06613fed965173ffffffffffffffffffffffffffffffffffffffff1690565b9101519060405180809581947fe0876aa8000000000000000000000000000000000000000000000000000000008352600483016106ae565b03915afa80156120f6576106bf91600091614009575b506148a6565b61402691503d806000833e61401e818361089f565b810190613e6e565b38614003565b60216106bf91604051938161404b869351809260208087019101610648565b82017f0a0000000000000000000000000000000000000000000000000000000000000060208201526140868251809360208785019101610648565b0103600181018452018261089f565b6033549073ffffffffffffffffffffffffffffffffffffffff80911691827fffffffffffffffffffffffff0000000000000000000000000000000000000000821617603355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3565b1561410957565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608490fd5b90815167ffffffffffffffff8111610832576141b4816141af6098546128c1565b613343565b602080601f8311600114614208575081906142039394600092612b555750507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8260011b9260031b1c19161790565b609855565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe083169461425960986000527f2237a976fa961f5921fd19f2b03c925c725d77b20ce8f790c19709c03de4d81490565b926000905b8782106142b457505083600195961061427d575b505050811b01609855565b01517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88460031b161c19169055388080614272565b8060018596829496860151815501950193019061425e565b906040516142d981610883565b6000815273ffffffffffffffffffffffffffffffffffffffff83169182156143de576108ed93816136079461433a61433483600052609960205273ffffffffffffffffffffffffffffffffffffffff60406000205416151590565b15614c04565b61436a61433483600052609960205273ffffffffffffffffffffffffffffffffffffffff60406000205416151590565b6143948373ffffffffffffffffffffffffffffffffffffffff16600052609a602052604060002090565b600181540190556143b383613bf1846000526099602052604060002090565b60007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8180a4614a2e565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602060248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152fd5b60005260ca602052604060002080549061ffff918281168381146130955760017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00009101938416911617905590565b6002111561031657565b601f82602094937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0938186528686013760008582860101520116010190565b906020825273ffffffffffffffffffffffffffffffffffffffff81356144f8816104aa565b166020830152602081013561450c8161448a565b60028110156130a457604083015260408101357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18236030181121561031657016020813591019067ffffffffffffffff8111610316578036038213610316576080836060806106bf9601520191614494565b9091600090828252602060cd81526145a785604085209061ffff16600052602052604060002090565b549284815260ce82526145cb86604083209061ffff16600052602052604060002090565b8482528252604081209161462484356145e3816104aa565b849073ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffff0000000000000000000000000000000000000000825416179055565b808401356146318161448a565b600281101561481d577fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff74ff000000000000000000000000000000000000000085549260a01b1691161783556001809301926146906040860186613d95565b93909167ffffffffffffffff8511610832576146b6856146b088546128c1565b886133b5565b8193601f8611600114614764575050928061148997959361470f9361475a9b9a989692611b4e5750507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8260011b9260031b1c19161790565b90555b827f7d6847ad3150238df54d0cf4d353519cb481fa067b6ca73ddf4f21e2bd9151bb6040518061474761ffff8a1695826144d3565b0390a460005260cd602052604060002090565b61347f8154613650565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe086959395169161479b88600052602060002090565b95915b8383106148065750505092600192859261475a9b9a98966114899a9896106147ce575b505050811b019055614712565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88560031b161c199101351690553880806147c1565b85850135875595860195938101939181019161479e565b6024837f4e487b710000000000000000000000000000000000000000000000000000000081526021600452fd5b5173ffffffffffffffffffffffffffffffffffffffff1661486d576106bf613e24565b6040516148798161084b565b600281527f6673000000000000000000000000000000000000000000000000000000000000602082015290565b906020809201518051906020916040805195600080945b8486106148fc57505050505050601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe091828101855201168201604052565b909192939495838760051b8301015180518686830151920151813b80821161493d575082849392600195938e930394859301903c01960194939291906148bd565b9260849387937f86d14d89000000000000000000000000000000000000000000000000000000008552600452602452604452606452fd5b9081602091031261031657516106bf816102ec565b6106bf939273ffffffffffffffffffffffffffffffffffffffff608093168252600060208301526040820152816060820152019061066b565b90926106bf949360809373ffffffffffffffffffffffffffffffffffffffff80921684521660208301526040820152816060820152019061066b565b3d15614a29573d90614a0f826108ef565b91614a1d604051938461089f565b82523d6000602084013e565b606090565b909190803b15614b9257614a8e60209173ffffffffffffffffffffffffffffffffffffffff9360006040519586809581947f150b7a02000000000000000000000000000000000000000000000000000000009a8b84523360048501614989565b0393165af160009181614b61575b50614b3b57614aa96149fe565b80519081614b36576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608490fd5b602001fd5b7fffffffff00000000000000000000000000000000000000000000000000000000161490565b614b8491925060203d602011614b8b575b614b7c818361089f565b810190614974565b9038614a9c565b503d614b72565b505050600190565b92909190823b15614bfb57614a8e92602092600073ffffffffffffffffffffffffffffffffffffffff6040518097819682957f150b7a02000000000000000000000000000000000000000000000000000000009b8c855233600486016149c2565b50505050600190565b15614c0b57565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152fdfea26469706673582212207045bb256afbd742ee151dc3ca7b213d5651b3371dfe5e5909c0598cedde1d0864736f6c63430008160033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 34 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.