Source Code
Overview
ETH Balance
0 ETH
More Info
ContractCreator
Multichain Info
N/A
Latest 6 from a total of 6 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Add Project Data | 6138982 | 166 days ago | IN | 0 ETH | 0.0000013 | ||||
Add Project Data | 6138971 | 166 days ago | IN | 0 ETH | 0.00000101 | ||||
Add Project Data | 6138954 | 166 days ago | IN | 0 ETH | 0.0000008 | ||||
Add Project Data | 6138949 | 166 days ago | IN | 0 ETH | 0.0000008 | ||||
Add Project Data | 6138929 | 166 days ago | IN | 0 ETH | 0.00000116 | ||||
Add Project Data | 6138922 | 166 days ago | IN | 0 ETH | 0.00000128 |
Latest 1 internal transaction
Advanced mode:
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
6138850 | 166 days ago | Contract Creation | 0 ETH |
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0xc728611b...89cB2F422 The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
ProjectContract
Compiler Version
v0.8.20+commit.a1b79de6
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// /$$ /$$ /$$$$$$ /$$ /$$ /$$ /$$ /$$$$$$ // | $$ | $$ /$$__ $$| $$$ | $$| $$ /$$//$$__ $$ // | $$ | $$| $$ \ $$| $$$$| $$ \ $$ /$$/| $$ \ $$ // | $$ / $$/| $$$$$$$$| $$ $$ $$ \ $$$$/ | $$$$$$$$ // \ $$ $$/ | $$__ $$| $$ $$$$ \ $$/ | $$__ $$ // \ $$$/ | $$ | $$| $$\ $$$ | $$ | $$ | $$ // \ $/ | $$ | $$| $$ \ $$ | $$ | $$ | $$ // \_/ |__/ |__/|__/ \__/ |__/ |__/ |__/ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC721/extensions/ERC721URIStorageUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/common/ERC2981Upgradeable.sol"; contract ProjectContract is Initializable, OwnableUpgradeable, ERC721Upgradeable, ERC721URIStorageUpgradeable { // Upgradeability: Initialize function with an argument for the initial owner address function initialize(address initialOwner) public initializer { __Ownable_init(initialOwner); __ERC721_init("ProjectCertificate", "PC"); __ERC721URIStorage_init(); } uint256 private projectId; // Struct to represent project data struct ProjectData { string latitude; string longitude; string projectAddress; string area; string ndvi; string carbon; string npar; string par; string kmlLink; string geoJsonLink; string projectType; string carbonCredits; string amountWorth; uint256 updatedAt; uint256 createdAt; } /************** MAPPINGS ***********/ // Mapping to store project data for each project ID mapping(uint256 => ProjectData) public projectData; // Mapping to store carbon estimation with each timestamp mapping(uint256 => string) public carbonData; // Mapping to store carbon estimation with each timestamp mapping(uint256 => string) public ndviData; /************ EVENTS ***********/ // Event to log the issuance of a certificate event CertificateIssued(address indexed owner, uint256 indexed tokenId); // Event to log the addition of project data event ProjectDataAdded(uint256 indexed projectId); // Event to log the modification of project data event ProjectDataModified(uint256 indexed projectId); // Function to add project data function addProjectData( string memory _latitude, string memory _longitude, string memory _projectAddress, string memory _area, string memory _ndvi, string memory _carbon, string memory _npar, string memory _par, string memory _kmlLink, string memory _geoJsonLink, string memory _projectType, string memory _carbonCredits, string memory _amountWorth ) external { projectId++; require(projectId > 0, "Project ID must be greater than zero"); require(projectData[projectId].createdAt == 0, "Project data already exists for this project ID"); projectData[projectId] = ProjectData( _latitude, _longitude, _projectAddress, _area, _ndvi, _carbon, _npar, _par, _kmlLink, _geoJsonLink, _projectType, _carbonCredits, _amountWorth, 0, block.timestamp ); carbonData[block.timestamp] = _carbon; ndviData[block.timestamp] = _ndvi; emit ProjectDataAdded(projectId); } // Function to edit project data (only owner) function updateProjectData( uint256 _projectId, string memory _latitude, string memory _longitude, string memory _projectAddress, string memory _area, string memory _ndvi, string memory _carbon, string memory _npar, string memory _par, string memory _kmlLink, string memory _geoJsonLink, string memory _projectType, string memory _carbonCredits, string memory _amountWorth ) external onlyOwner { require(_projectId > 0, "Project ID must be greater than zero"); require(projectData[_projectId].createdAt > 0, "Project data does not exist for this project ID"); uint256 createdAtTime = projectData[_projectId].createdAt; projectData[_projectId] = ProjectData( _latitude, _longitude, _projectAddress, _area, _ndvi, _carbon, _npar, _par, _kmlLink, _geoJsonLink, _projectType, _carbonCredits, _amountWorth, block.timestamp, createdAtTime ); carbonData[block.timestamp] = _carbon; ndviData[block.timestamp] = _ndvi; emit ProjectDataModified(_projectId); } function issueCertificate(address to, uint256 _projectId, string memory uri) public onlyOwner { uint256 tokenId = _projectId; // You can customize the tokenId based on your requirements _safeMint(to, tokenId); _setTokenURI(tokenId, uri); emit CertificateIssued(to, tokenId); } function supportsInterface(bytes4 interfaceId) public view override(ERC721Upgradeable, ERC721URIStorageUpgradeable) returns (bool) { return super.supportsInterface(interfaceId); } function tokenURI(uint256 tokenId) public view virtual override(ERC721Upgradeable, ERC721URIStorageUpgradeable) returns (string memory) { return ERC721URIStorageUpgradeable.tokenURI(tokenId); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol) pragma solidity ^0.8.20; import {ContextUpgradeable} from "../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. * * The initial owner is set to the address provided by the deployer. 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 { /// @custom:storage-location erc7201:openzeppelin.storage.Ownable struct OwnableStorage { address _owner; } // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Ownable")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant OwnableStorageLocation = 0x9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300; function _getOwnableStorage() private pure returns (OwnableStorage storage $) { assembly { $.slot := OwnableStorageLocation } } /** * @dev The caller account is not authorized to perform an operation. */ error OwnableUnauthorizedAccount(address account); /** * @dev The owner is not a valid owner account. (eg. `address(0)`) */ error OwnableInvalidOwner(address owner); event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the address provided by the deployer as the initial owner. */ function __Ownable_init(address initialOwner) internal onlyInitializing { __Ownable_init_unchained(initialOwner); } function __Ownable_init_unchained(address initialOwner) internal onlyInitializing { if (initialOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(initialOwner); } /** * @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) { OwnableStorage storage $ = _getOwnableStorage(); return $._owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { if (owner() != _msgSender()) { revert OwnableUnauthorizedAccount(_msgSender()); } } /** * @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 { if (newOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { OwnableStorage storage $ = _getOwnableStorage(); address oldOwner = $._owner; $._owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/Initializable.sol) pragma solidity ^0.8.20; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in * case an upgrade adds a module that needs to be initialized. * * For example: * * [.hljs-theme-light.nopadding] * ```solidity * contract MyToken is ERC20Upgradeable { * function initialize() initializer public { * __ERC20_init("MyToken", "MTK"); * } * } * * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable { * function initializeV2() reinitializer(2) public { * __ERC20Permit_init("MyToken"); * } * } * ``` * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. * * [CAUTION] * ==== * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() { * _disableInitializers(); * } * ``` * ==== */ abstract contract Initializable { /** * @dev Storage of the initializable contract. * * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions * when using with upgradeable contracts. * * @custom:storage-location erc7201:openzeppelin.storage.Initializable */ struct InitializableStorage { /** * @dev Indicates that the contract has been initialized. */ uint64 _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool _initializing; } // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Initializable")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant INITIALIZABLE_STORAGE = 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00; /** * @dev The contract is already initialized. */ error InvalidInitialization(); /** * @dev The contract is not initializing. */ error NotInitializing(); /** * @dev Triggered when the contract has been initialized or reinitialized. */ event Initialized(uint64 version); /** * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope, * `onlyInitializing` functions can be used to initialize parent contracts. * * Similar to `reinitializer(1)`, except that in the context of a constructor an `initializer` may be invoked any * number of times. This behavior in the constructor can be useful during testing and is not expected to be used in * production. * * Emits an {Initialized} event. */ modifier initializer() { // solhint-disable-next-line var-name-mixedcase InitializableStorage storage $ = _getInitializableStorage(); // Cache values to avoid duplicated sloads bool isTopLevelCall = !$._initializing; uint64 initialized = $._initialized; // Allowed calls: // - initialSetup: the contract is not in the initializing state and no previous version was // initialized // - construction: the contract is initialized at version 1 (no reininitialization) and the // current contract is just being deployed bool initialSetup = initialized == 0 && isTopLevelCall; bool construction = initialized == 1 && address(this).code.length == 0; if (!initialSetup && !construction) { revert InvalidInitialization(); } $._initialized = 1; if (isTopLevelCall) { $._initializing = true; } _; if (isTopLevelCall) { $._initializing = false; emit Initialized(1); } } /** * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be * used to initialize parent contracts. * * A reinitializer may be used after the original initialization step. This is essential to configure modules that * are added through upgrades and that require initialization. * * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer` * cannot be nested. If one is invoked in the context of another, execution will revert. * * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in * a contract, executing them in the right order is up to the developer or operator. * * WARNING: Setting the version to 2**64 - 1 will prevent any future reinitialization. * * Emits an {Initialized} event. */ modifier reinitializer(uint64 version) { // solhint-disable-next-line var-name-mixedcase InitializableStorage storage $ = _getInitializableStorage(); if ($._initializing || $._initialized >= version) { revert InvalidInitialization(); } $._initialized = version; $._initializing = true; _; $._initializing = false; emit Initialized(version); } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} and {reinitializer} modifiers, directly or indirectly. */ modifier onlyInitializing() { _checkInitializing(); _; } /** * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}. */ function _checkInitializing() internal view virtual { if (!_isInitializing()) { revert NotInitializing(); } } /** * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call. * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized * to any version. It is recommended to use this to lock implementation contracts that are designed to be called * through proxies. * * Emits an {Initialized} event the first time it is successfully executed. */ function _disableInitializers() internal virtual { // solhint-disable-next-line var-name-mixedcase InitializableStorage storage $ = _getInitializableStorage(); if ($._initializing) { revert InvalidInitialization(); } if ($._initialized != type(uint64).max) { $._initialized = type(uint64).max; emit Initialized(type(uint64).max); } } /** * @dev Returns the highest version that has been initialized. See {reinitializer}. */ function _getInitializedVersion() internal view returns (uint64) { return _getInitializableStorage()._initialized; } /** * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}. */ function _isInitializing() internal view returns (bool) { return _getInitializableStorage()._initializing; } /** * @dev Returns a pointer to the storage namespace. */ // solhint-disable-next-line var-name-mixedcase function _getInitializableStorage() private pure returns (InitializableStorage storage $) { assembly { $.slot := INITIALIZABLE_STORAGE } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/common/ERC2981.sol) pragma solidity ^0.8.20; import {IERC2981} from "@openzeppelin/contracts/interfaces/IERC2981.sol"; import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol"; import {ERC165Upgradeable} from "../../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. */ abstract contract ERC2981Upgradeable is Initializable, IERC2981, ERC165Upgradeable { struct RoyaltyInfo { address receiver; uint96 royaltyFraction; } /// @custom:storage-location erc7201:openzeppelin.storage.ERC2981 struct ERC2981Storage { RoyaltyInfo _defaultRoyaltyInfo; mapping(uint256 tokenId => RoyaltyInfo) _tokenRoyaltyInfo; } // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.ERC2981")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant ERC2981StorageLocation = 0xdaedc9ab023613a7caf35e703657e986ccfad7e3eb0af93a2853f8d65dd86b00; function _getERC2981Storage() private pure returns (ERC2981Storage storage $) { assembly { $.slot := ERC2981StorageLocation } } /** * @dev The default royalty set is invalid (eg. (numerator / denominator) >= 1). */ error ERC2981InvalidDefaultRoyalty(uint256 numerator, uint256 denominator); /** * @dev The default royalty receiver is invalid. */ error ERC2981InvalidDefaultRoyaltyReceiver(address receiver); /** * @dev The royalty set for an specific `tokenId` is invalid (eg. (numerator / denominator) >= 1). */ error ERC2981InvalidTokenRoyalty(uint256 tokenId, uint256 numerator, uint256 denominator); /** * @dev The royalty receiver for `tokenId` is invalid. */ error ERC2981InvalidTokenRoyaltyReceiver(uint256 tokenId, address receiver); function __ERC2981_init() internal onlyInitializing { } function __ERC2981_init_unchained() internal onlyInitializing { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC165Upgradeable) returns (bool) { return interfaceId == type(IERC2981).interfaceId || super.supportsInterface(interfaceId); } /** * @inheritdoc IERC2981 */ function royaltyInfo(uint256 tokenId, uint256 salePrice) public view virtual returns (address, uint256) { ERC2981Storage storage $ = _getERC2981Storage(); 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 { ERC2981Storage storage $ = _getERC2981Storage(); uint256 denominator = _feeDenominator(); if (feeNumerator > denominator) { // Royalty fee will exceed the sale price revert ERC2981InvalidDefaultRoyalty(feeNumerator, denominator); } if (receiver == address(0)) { revert ERC2981InvalidDefaultRoyaltyReceiver(address(0)); } $._defaultRoyaltyInfo = RoyaltyInfo(receiver, feeNumerator); } /** * @dev Removes default royalty information. */ function _deleteDefaultRoyalty() internal virtual { ERC2981Storage storage $ = _getERC2981Storage(); 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 { ERC2981Storage storage $ = _getERC2981Storage(); uint256 denominator = _feeDenominator(); if (feeNumerator > denominator) { // Royalty fee will exceed the sale price revert ERC2981InvalidTokenRoyalty(tokenId, feeNumerator, denominator); } if (receiver == address(0)) { revert ERC2981InvalidTokenRoyaltyReceiver(tokenId, address(0)); } $._tokenRoyaltyInfo[tokenId] = RoyaltyInfo(receiver, feeNumerator); } /** * @dev Resets royalty information for the token id back to the global default. */ function _resetTokenRoyalty(uint256 tokenId) internal virtual { ERC2981Storage storage $ = _getERC2981Storage(); delete $._tokenRoyaltyInfo[tokenId]; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/ERC721.sol) pragma solidity ^0.8.20; import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import {IERC721Receiver} from "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; import {IERC721Metadata} from "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol"; import {ContextUpgradeable} from "../../utils/ContextUpgradeable.sol"; import {Strings} from "@openzeppelin/contracts/utils/Strings.sol"; import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol"; import {ERC165Upgradeable} from "../../utils/introspection/ERC165Upgradeable.sol"; import {IERC721Errors} from "@openzeppelin/contracts/interfaces/draft-IERC6093.sol"; import {Initializable} from "../../proxy/utils/Initializable.sol"; /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension, but not including the Enumerable extension, which is available separately as * {ERC721Enumerable}. */ abstract contract ERC721Upgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC721, IERC721Metadata, IERC721Errors { using Strings for uint256; /// @custom:storage-location erc7201:openzeppelin.storage.ERC721 struct ERC721Storage { // Token name string _name; // Token symbol string _symbol; mapping(uint256 tokenId => address) _owners; mapping(address owner => uint256) _balances; mapping(uint256 tokenId => address) _tokenApprovals; mapping(address owner => mapping(address operator => bool)) _operatorApprovals; } // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.ERC721")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant ERC721StorageLocation = 0x80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab0079300; function _getERC721Storage() private pure returns (ERC721Storage storage $) { assembly { $.slot := ERC721StorageLocation } } /** * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. */ function __ERC721_init(string memory name_, string memory symbol_) internal onlyInitializing { __ERC721_init_unchained(name_, symbol_); } function __ERC721_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing { ERC721Storage storage $ = _getERC721Storage(); $._name = name_; $._symbol = symbol_; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165Upgradeable, IERC165) returns (bool) { return interfaceId == type(IERC721).interfaceId || interfaceId == type(IERC721Metadata).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view virtual returns (uint256) { ERC721Storage storage $ = _getERC721Storage(); if (owner == address(0)) { revert ERC721InvalidOwner(address(0)); } return $._balances[owner]; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual returns (address) { return _requireOwned(tokenId); } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual returns (string memory) { ERC721Storage storage $ = _getERC721Storage(); return $._name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual returns (string memory) { ERC721Storage storage $ = _getERC721Storage(); return $._symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual returns (string memory) { _requireOwned(tokenId); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string.concat(baseURI, tokenId.toString()) : ""; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overridden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ""; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual { _approve(to, tokenId, _msgSender()); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual returns (address) { _requireOwned(tokenId); return _getApproved(tokenId); } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual returns (bool) { ERC721Storage storage $ = _getERC721Storage(); return $._operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom(address from, address to, uint256 tokenId) public virtual { if (to == address(0)) { revert ERC721InvalidReceiver(address(0)); } // Setting an "auth" arguments enables the `_isAuthorized` check which verifies that the token exists // (from != 0). Therefore, it is not needed to verify that the return value is not 0 here. address previousOwner = _update(to, tokenId, _msgSender()); if (previousOwner != from) { revert ERC721IncorrectOwner(from, tokenId, previousOwner); } } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom(address from, address to, uint256 tokenId) public { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public virtual { transferFrom(from, to, tokenId); _checkOnERC721Received(from, to, tokenId, data); } /** * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist * * IMPORTANT: Any overrides to this function that add ownership of tokens not tracked by the * core ERC721 logic MUST be matched with the use of {_increaseBalance} to keep balances * consistent with ownership. The invariant to preserve is that for any address `a` the value returned by * `balanceOf(a)` must be equal to the number of tokens such that `_ownerOf(tokenId)` is `a`. */ function _ownerOf(uint256 tokenId) internal view virtual returns (address) { ERC721Storage storage $ = _getERC721Storage(); return $._owners[tokenId]; } /** * @dev Returns the approved address for `tokenId`. Returns 0 if `tokenId` is not minted. */ function _getApproved(uint256 tokenId) internal view virtual returns (address) { ERC721Storage storage $ = _getERC721Storage(); return $._tokenApprovals[tokenId]; } /** * @dev Returns whether `spender` is allowed to manage `owner`'s tokens, or `tokenId` in * particular (ignoring whether it is owned by `owner`). * * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this * assumption. */ function _isAuthorized(address owner, address spender, uint256 tokenId) internal view virtual returns (bool) { return spender != address(0) && (owner == spender || isApprovedForAll(owner, spender) || _getApproved(tokenId) == spender); } /** * @dev Checks if `spender` can operate on `tokenId`, assuming the provided `owner` is the actual owner. * Reverts if `spender` does not have approval from the provided `owner` for the given token or for all its assets * the `spender` for the specific `tokenId`. * * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this * assumption. */ function _checkAuthorized(address owner, address spender, uint256 tokenId) internal view virtual { if (!_isAuthorized(owner, spender, tokenId)) { if (owner == address(0)) { revert ERC721NonexistentToken(tokenId); } else { revert ERC721InsufficientApproval(spender, tokenId); } } } /** * @dev Unsafe write access to the balances, used by extensions that "mint" tokens using an {ownerOf} override. * * NOTE: the value is limited to type(uint128).max. This protect against _balance overflow. It is unrealistic that * a uint256 would ever overflow from increments when these increments are bounded to uint128 values. * * WARNING: Increasing an account's balance using this function tends to be paired with an override of the * {_ownerOf} function to resolve the ownership of the corresponding tokens so that balances and ownership * remain consistent with one another. */ function _increaseBalance(address account, uint128 value) internal virtual { ERC721Storage storage $ = _getERC721Storage(); unchecked { $._balances[account] += value; } } /** * @dev Transfers `tokenId` from its current owner to `to`, or alternatively mints (or burns) if the current owner * (or `to`) is the zero address. Returns the owner of the `tokenId` before the update. * * The `auth` argument is optional. If the value passed is non 0, then this function will check that * `auth` is either the owner of the token, or approved to operate on the token (by the owner). * * Emits a {Transfer} event. * * NOTE: If overriding this function in a way that tracks balances, see also {_increaseBalance}. */ function _update(address to, uint256 tokenId, address auth) internal virtual returns (address) { ERC721Storage storage $ = _getERC721Storage(); address from = _ownerOf(tokenId); // Perform (optional) operator check if (auth != address(0)) { _checkAuthorized(from, auth, tokenId); } // Execute the update if (from != address(0)) { // Clear approval. No need to re-authorize or emit the Approval event _approve(address(0), tokenId, address(0), false); unchecked { $._balances[from] -= 1; } } if (to != address(0)) { unchecked { $._balances[to] += 1; } } $._owners[tokenId] = to; emit Transfer(from, to, tokenId); return from; } /** * @dev Mints `tokenId` and transfers it to `to`. * * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible * * Requirements: * * - `tokenId` must not exist. * - `to` cannot be the zero address. * * Emits a {Transfer} event. */ function _mint(address to, uint256 tokenId) internal { if (to == address(0)) { revert ERC721InvalidReceiver(address(0)); } address previousOwner = _update(to, tokenId, address(0)); if (previousOwner != address(0)) { revert ERC721InvalidSender(address(0)); } } /** * @dev Mints `tokenId`, transfers it to `to` and checks for `to` acceptance. * * Requirements: * * - `tokenId` must not exist. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeMint(address to, uint256 tokenId) internal { _safeMint(to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeMint(address to, uint256 tokenId, bytes memory data) internal virtual { _mint(to, tokenId); _checkOnERC721Received(address(0), to, tokenId, data); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * This is an internal function that does not check if the sender is authorized to operate on the token. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal { address previousOwner = _update(address(0), tokenId, address(0)); if (previousOwner == address(0)) { revert ERC721NonexistentToken(tokenId); } } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer(address from, address to, uint256 tokenId) internal { if (to == address(0)) { revert ERC721InvalidReceiver(address(0)); } address previousOwner = _update(to, tokenId, address(0)); if (previousOwner == address(0)) { revert ERC721NonexistentToken(tokenId); } else if (previousOwner != from) { revert ERC721IncorrectOwner(from, tokenId, previousOwner); } } /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking that contract recipients * are aware of the ERC721 standard to prevent tokens from being forever locked. * * `data` is additional data, it has no specified format and it is sent in call to `to`. * * This internal function is like {safeTransferFrom} in the sense that it invokes * {IERC721Receiver-onERC721Received} on the receiver, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. * * Requirements: * * - `tokenId` token must exist and be owned by `from`. * - `to` cannot be the zero address. * - `from` cannot be the zero address. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeTransfer(address from, address to, uint256 tokenId) internal { _safeTransfer(from, to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeTransfer-address-address-uint256-}[`_safeTransfer`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeTransfer(address from, address to, uint256 tokenId, bytes memory data) internal virtual { _transfer(from, to, tokenId); _checkOnERC721Received(from, to, tokenId, data); } /** * @dev Approve `to` to operate on `tokenId` * * The `auth` argument is optional. If the value passed is non 0, then this function will check that `auth` is * either the owner of the token, or approved to operate on all tokens held by this owner. * * Emits an {Approval} event. * * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument. */ function _approve(address to, uint256 tokenId, address auth) internal { _approve(to, tokenId, auth, true); } /** * @dev Variant of `_approve` with an optional flag to enable or disable the {Approval} event. The event is not * emitted in the context of transfers. */ function _approve(address to, uint256 tokenId, address auth, bool emitEvent) internal virtual { ERC721Storage storage $ = _getERC721Storage(); // Avoid reading the owner unless necessary if (emitEvent || auth != address(0)) { address owner = _requireOwned(tokenId); // We do not use _isAuthorized because single-token approvals should not be able to call approve if (auth != address(0) && owner != auth && !isApprovedForAll(owner, auth)) { revert ERC721InvalidApprover(auth); } if (emitEvent) { emit Approval(owner, to, tokenId); } } $._tokenApprovals[tokenId] = to; } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Requirements: * - operator can't be the address zero. * * Emits an {ApprovalForAll} event. */ function _setApprovalForAll(address owner, address operator, bool approved) internal virtual { ERC721Storage storage $ = _getERC721Storage(); if (operator == address(0)) { revert ERC721InvalidOperator(operator); } $._operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Reverts if the `tokenId` doesn't have a current owner (it hasn't been minted, or it has been burned). * Returns the owner. * * Overrides to ownership logic should be done to {_ownerOf}. */ function _requireOwned(uint256 tokenId) internal view returns (address) { address owner = _ownerOf(tokenId); if (owner == address(0)) { revert ERC721NonexistentToken(tokenId); } return owner; } /** * @dev Private function to invoke {IERC721Receiver-onERC721Received} on a target address. This will revert if the * recipient doesn't accept the token transfer. The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param data bytes optional data to send along with the call */ function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes memory data) private { if (to.code.length > 0) { try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) { if (retval != IERC721Receiver.onERC721Received.selector) { revert ERC721InvalidReceiver(to); } } catch (bytes memory reason) { if (reason.length == 0) { revert ERC721InvalidReceiver(to); } else { /// @solidity memory-safe-assembly assembly { revert(add(32, reason), mload(reason)) } } } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/ERC721URIStorage.sol) pragma solidity ^0.8.20; import {ERC721Upgradeable} from "../ERC721Upgradeable.sol"; import {Strings} from "@openzeppelin/contracts/utils/Strings.sol"; import {IERC4906} from "@openzeppelin/contracts/interfaces/IERC4906.sol"; import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol"; import {Initializable} from "../../../proxy/utils/Initializable.sol"; /** * @dev ERC721 token with storage based token URI management. */ abstract contract ERC721URIStorageUpgradeable is Initializable, IERC4906, ERC721Upgradeable { using Strings for uint256; // Interface ID as defined in ERC-4906. This does not correspond to a traditional interface ID as ERC-4906 only // defines events and does not include any external function. bytes4 private constant ERC4906_INTERFACE_ID = bytes4(0x49064906); /// @custom:storage-location erc7201:openzeppelin.storage.ERC721URIStorage struct ERC721URIStorageStorage { // Optional mapping for token URIs mapping(uint256 tokenId => string) _tokenURIs; } // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.ERC721URIStorage")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant ERC721URIStorageStorageLocation = 0x0542a41881ee128a365a727b282c86fa859579490b9bb45aab8503648c8e7900; function _getERC721URIStorageStorage() private pure returns (ERC721URIStorageStorage storage $) { assembly { $.slot := ERC721URIStorageStorageLocation } } function __ERC721URIStorage_init() internal onlyInitializing { } function __ERC721URIStorage_init_unchained() internal onlyInitializing { } /** * @dev See {IERC165-supportsInterface} */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721Upgradeable, IERC165) returns (bool) { return interfaceId == ERC4906_INTERFACE_ID || super.supportsInterface(interfaceId); } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { ERC721URIStorageStorage storage $ = _getERC721URIStorageStorage(); _requireOwned(tokenId); string memory _tokenURI = $._tokenURIs[tokenId]; string memory base = _baseURI(); // If there is no base URI, return the token URI. if (bytes(base).length == 0) { return _tokenURI; } // If both are set, concatenate the baseURI and tokenURI (via string.concat). if (bytes(_tokenURI).length > 0) { return string.concat(base, _tokenURI); } return super.tokenURI(tokenId); } /** * @dev Sets `_tokenURI` as the tokenURI of `tokenId`. * * Emits {MetadataUpdate}. */ function _setTokenURI(uint256 tokenId, string memory _tokenURI) internal virtual { ERC721URIStorageStorage storage $ = _getERC721URIStorageStorage(); $._tokenURIs[tokenId] = _tokenURI; emit MetadataUpdate(tokenId); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol) pragma solidity ^0.8.20; import {Initializable} from "../proxy/utils/Initializable.sol"; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract ContextUpgradeable is Initializable { function __Context_init() internal onlyInitializing { } function __Context_init_unchained() internal onlyInitializing { } function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol) pragma solidity ^0.8.20; import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol"; import {Initializable} from "../../proxy/utils/Initializable.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` */ abstract contract ERC165Upgradeable is Initializable, IERC165 { function __ERC165_init() internal onlyInitializing { } function __ERC165_init_unchained() internal onlyInitializing { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC6093.sol) pragma solidity ^0.8.20; /** * @dev Standard ERC20 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC20 tokens. */ interface IERC20Errors { /** * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. * @param balance Current balance for the interacting account. * @param needed Minimum amount required to perform a transfer. */ error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC20InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC20InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers. * @param spender Address that may be allowed to operate on tokens without being their owner. * @param allowance Amount of tokens a `spender` is allowed to operate with. * @param needed Minimum amount required to perform a transfer. */ error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC20InvalidApprover(address approver); /** * @dev Indicates a failure with the `spender` to be approved. Used in approvals. * @param spender Address that may be allowed to operate on tokens without being their owner. */ error ERC20InvalidSpender(address spender); } /** * @dev Standard ERC721 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC721 tokens. */ interface IERC721Errors { /** * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in EIP-20. * Used in balance queries. * @param owner Address of the current owner of a token. */ error ERC721InvalidOwner(address owner); /** * @dev Indicates a `tokenId` whose `owner` is the zero address. * @param tokenId Identifier number of a token. */ error ERC721NonexistentToken(uint256 tokenId); /** * @dev Indicates an error related to the ownership over a particular token. Used in transfers. * @param sender Address whose tokens are being transferred. * @param tokenId Identifier number of a token. * @param owner Address of the current owner of a token. */ error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC721InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC721InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `operator`’s approval. Used in transfers. * @param operator Address that may be allowed to operate on tokens without being their owner. * @param tokenId Identifier number of a token. */ error ERC721InsufficientApproval(address operator, uint256 tokenId); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC721InvalidApprover(address approver); /** * @dev Indicates a failure with the `operator` to be approved. Used in approvals. * @param operator Address that may be allowed to operate on tokens without being their owner. */ error ERC721InvalidOperator(address operator); } /** * @dev Standard ERC1155 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC1155 tokens. */ interface IERC1155Errors { /** * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. * @param balance Current balance for the interacting account. * @param needed Minimum amount required to perform a transfer. * @param tokenId Identifier number of a token. */ error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC1155InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC1155InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `operator`’s approval. Used in transfers. * @param operator Address that may be allowed to operate on tokens without being their owner. * @param owner Address of the current owner of a token. */ error ERC1155MissingApprovalForAll(address operator, address owner); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC1155InvalidApprover(address approver); /** * @dev Indicates a failure with the `operator` to be approved. Used in approvals. * @param operator Address that may be allowed to operate on tokens without being their owner. */ error ERC1155InvalidOperator(address operator); /** * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation. * Used in batch transfers. * @param idsLength Length of the array of token identifiers * @param valuesLength Length of the array of token amounts */ error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol) pragma solidity ^0.8.20; import {IERC165} from "../utils/introspection/IERC165.sol";
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC2981.sol) pragma solidity ^0.8.20; import {IERC165} from "../utils/introspection/IERC165.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. */ interface IERC2981 is IERC165 { /** * @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 v5.0.0) (interfaces/IERC4906.sol) pragma solidity ^0.8.20; import {IERC165} from "./IERC165.sol"; import {IERC721} from "./IERC721.sol"; /// @title EIP-721 Metadata Update Extension interface IERC4906 is IERC165, IERC721 { /// @dev This event emits when the metadata of a token is changed. /// So that the third-party platforms such as NFT market could /// timely update the images and related attributes of the NFT. event MetadataUpdate(uint256 _tokenId); /// @dev This event emits when the metadata of a range of tokens is changed. /// So that the third-party platforms such as NFT market could /// timely update the images and related attributes of the NFTs. event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC721.sol) pragma solidity ^0.8.20; import {IERC721} from "../token/ERC721/IERC721.sol";
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/IERC721Metadata.sol) pragma solidity ^0.8.20; import {IERC721} from "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Metadata is IERC721 { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.20; import {IERC165} from "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon * a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external; /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or * {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon * a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom(address from, address to, uint256 tokenId) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721 * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must * understand this adds an external call which potentially creates a reentrancy vulnerability. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 tokenId) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the address zero. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.20; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721Receiver { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be * reverted. * * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/math/Math.sol) pragma solidity ^0.8.20; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { /** * @dev Muldiv operation overflow. */ error MathOverflowedMulDiv(); enum Rounding { Floor, // Toward negative infinity Ceil, // Toward positive infinity Trunc, // Toward zero Expand // Away from zero } /** * @dev Returns the addition of two unsigned integers, with an overflow flag. */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the subtraction of two unsigned integers, with an overflow flag. */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds towards infinity instead * of rounding towards zero. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { if (b == 0) { // Guarantee the same behavior as in a regular Solidity division. return a / b; } // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or * denominator == 0. * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by * Uniswap Labs also under MIT license. */ function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0 = x * y; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { // Solidity will revert if denominator == 0, unlike the div opcode on its own. // The surrounding unchecked block does not change this fact. // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic. return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. if (denominator <= prod1) { revert MathOverflowedMulDiv(); } /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. // Always >= 1. See https://cs.stackexchange.com/q/138556/92363. uint256 twos = denominator & (0 - denominator); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also // works in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded * towards zero. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (unsignedRoundsUp(rounding) && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2 of a positive value rounded towards zero. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (unsignedRoundsUp(rounding) && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10 of a positive value rounded towards zero. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10 ** 64) { value /= 10 ** 64; result += 64; } if (value >= 10 ** 32) { value /= 10 ** 32; result += 32; } if (value >= 10 ** 16) { value /= 10 ** 16; result += 16; } if (value >= 10 ** 8) { value /= 10 ** 8; result += 8; } if (value >= 10 ** 4) { value /= 10 ** 4; result += 4; } if (value >= 10 ** 2) { value /= 10 ** 2; result += 2; } if (value >= 10 ** 1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (unsignedRoundsUp(rounding) && 10 ** result < value ? 1 : 0); } } /** * @dev Return the log in base 256 of a positive value rounded towards zero. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 256, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (unsignedRoundsUp(rounding) && 1 << (result << 3) < value ? 1 : 0); } } /** * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers. */ function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) { return uint8(rounding) % 2 == 1; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/math/SignedMath.sol) pragma solidity ^0.8.20; /** * @dev Standard signed math utilities missing in the Solidity language. */ library SignedMath { /** * @dev Returns the largest of two signed numbers. */ function max(int256 a, int256 b) internal pure returns (int256) { return a > b ? a : b; } /** * @dev Returns the smallest of two signed numbers. */ function min(int256 a, int256 b) internal pure returns (int256) { return a < b ? a : b; } /** * @dev Returns the average of two signed numbers without overflow. * The result is rounded towards zero. */ function average(int256 a, int256 b) internal pure returns (int256) { // Formula from the book "Hacker's Delight" int256 x = (a & b) + ((a ^ b) >> 1); return x + (int256(uint256(x) >> 255) & (a ^ b)); } /** * @dev Returns the absolute unsigned value of a signed value. */ function abs(int256 n) internal pure returns (uint256) { unchecked { // must be unchecked in order to support `n = type(int256).min` return uint256(n >= 0 ? n : -n); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/Strings.sol) pragma solidity ^0.8.20; import {Math} from "./math/Math.sol"; import {SignedMath} from "./math/SignedMath.sol"; /** * @dev String operations. */ library Strings { bytes16 private constant HEX_DIGITS = "0123456789abcdef"; uint8 private constant ADDRESS_LENGTH = 20; /** * @dev The `value` string doesn't fit in the specified `length`. */ error StringsInsufficientHexLength(uint256 value, uint256 length); /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = Math.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), HEX_DIGITS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `int256` to its ASCII `string` decimal representation. */ function toStringSigned(int256 value) internal pure returns (string memory) { return string.concat(value < 0 ? "-" : "", toString(SignedMath.abs(value))); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, Math.log256(value) + 1); } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { uint256 localValue = value; bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = HEX_DIGITS[localValue & 0xf]; localValue >>= 4; } if (localValue != 0) { revert StringsInsufficientHexLength(value, length); } return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal * representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), ADDRESS_LENGTH); } /** * @dev Returns true if the two strings are equal. */ function equal(string memory a, string memory b) internal pure returns (bool) { return bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b)); } }
{ "metadata": { "bytecodeHash": "none" }, "optimizer": { "enabled": true, "runs": 200 }, "viaIR": true, "evmVersion": "paris", "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
[{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"owner","type":"address"}],"name":"ERC721IncorrectOwner","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ERC721InsufficientApproval","type":"error"},{"inputs":[{"internalType":"address","name":"approver","type":"address"}],"name":"ERC721InvalidApprover","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"ERC721InvalidOperator","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"ERC721InvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"ERC721InvalidReceiver","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"}],"name":"ERC721InvalidSender","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ERC721NonexistentToken","type":"error"},{"inputs":[],"name":"InvalidInitialization","type":"error"},{"inputs":[],"name":"NotInitializing","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_fromTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_toTokenId","type":"uint256"}],"name":"BatchMetadataUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"CertificateIssued","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"version","type":"uint64"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"MetadataUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"projectId","type":"uint256"}],"name":"ProjectDataAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"projectId","type":"uint256"}],"name":"ProjectDataModified","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":"string","name":"_latitude","type":"string"},{"internalType":"string","name":"_longitude","type":"string"},{"internalType":"string","name":"_projectAddress","type":"string"},{"internalType":"string","name":"_area","type":"string"},{"internalType":"string","name":"_ndvi","type":"string"},{"internalType":"string","name":"_carbon","type":"string"},{"internalType":"string","name":"_npar","type":"string"},{"internalType":"string","name":"_par","type":"string"},{"internalType":"string","name":"_kmlLink","type":"string"},{"internalType":"string","name":"_geoJsonLink","type":"string"},{"internalType":"string","name":"_projectType","type":"string"},{"internalType":"string","name":"_carbonCredits","type":"string"},{"internalType":"string","name":"_amountWorth","type":"string"}],"name":"addProjectData","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":"uint256","name":"","type":"uint256"}],"name":"carbonData","outputs":[{"internalType":"string","name":"","type":"string"}],"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":"address","name":"initialOwner","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"_projectId","type":"uint256"},{"internalType":"string","name":"uri","type":"string"}],"name":"issueCertificate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"ndviData","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":"","type":"uint256"}],"name":"projectData","outputs":[{"internalType":"string","name":"latitude","type":"string"},{"internalType":"string","name":"longitude","type":"string"},{"internalType":"string","name":"projectAddress","type":"string"},{"internalType":"string","name":"area","type":"string"},{"internalType":"string","name":"ndvi","type":"string"},{"internalType":"string","name":"carbon","type":"string"},{"internalType":"string","name":"npar","type":"string"},{"internalType":"string","name":"par","type":"string"},{"internalType":"string","name":"kmlLink","type":"string"},{"internalType":"string","name":"geoJsonLink","type":"string"},{"internalType":"string","name":"projectType","type":"string"},{"internalType":"string","name":"carbonCredits","type":"string"},{"internalType":"string","name":"amountWorth","type":"string"},{"internalType":"uint256","name":"updatedAt","type":"uint256"},{"internalType":"uint256","name":"createdAt","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"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":"tokenId","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"},{"inputs":[{"internalType":"uint256","name":"_projectId","type":"uint256"},{"internalType":"string","name":"_latitude","type":"string"},{"internalType":"string","name":"_longitude","type":"string"},{"internalType":"string","name":"_projectAddress","type":"string"},{"internalType":"string","name":"_area","type":"string"},{"internalType":"string","name":"_ndvi","type":"string"},{"internalType":"string","name":"_carbon","type":"string"},{"internalType":"string","name":"_npar","type":"string"},{"internalType":"string","name":"_par","type":"string"},{"internalType":"string","name":"_kmlLink","type":"string"},{"internalType":"string","name":"_geoJsonLink","type":"string"},{"internalType":"string","name":"_projectType","type":"string"},{"internalType":"string","name":"_carbonCredits","type":"string"},{"internalType":"string","name":"_amountWorth","type":"string"}],"name":"updateProjectData","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Deployed Bytecode
0x608080604052600436101561001357600080fd5b60003560e01c90816301ffc9a714613b745750806306fdde0314613ad1578063081812fc14613a86578063095ea7b31461399f5780630ce51f561461354d57806323b872dd146135365780633295c7fa1461350a57806342842e0e146134dc57806346b756c2146134b05780636352211e1461348057806370a082311461342b578063715018a6146133c15780638903f70c146131f95780638da5cb5b146131c357806395d89b41146130bd578063a22cb4651461301d578063a4ec511c14611bb3578063b88d4fde14611b49578063c4d66de8146116a7578063c87b56dd1461162b578063d6dab0031461019a578063e985e9c51461014c5763f2fde38b1461011c57600080fd5b3461014757602036600319011261014757610145610138613c39565b610140613e5d565b613e96565b005b600080fd5b3461014757604036600319011261014757610165613c39565b610176610170613c4f565b91613f43565b9060018060a01b0316600052602052602060ff604060002054166040519015158152f35b34610147576101a0366003190112610147576004356001600160401b038111610147576101cb903690600401613d2a565b6024356001600160401b038111610147576101ea903690600401613d2a565b6044356001600160401b03811161014757610209903690600401613d2a565b906064356001600160401b03811161014757610229903690600401613d2a565b926084356001600160401b03811161014757610249903690600401613d2a565b9260a4356001600160401b03811161014757610269903690600401613d2a565b9460c4356001600160401b03811161014757610289903690600401613d2a565b60e4356001600160401b038111610147576102a8903690600401613d2a565b610104356001600160401b038111610147576102c8903690600401613d2a565b6001600160401b036101243511610147576102e93661012435600401613d2a565b906001600160401b0361014435116101475761030b3661014435600401613d2a565b926001600160401b0361016435116101475761032d3661016435600401613d2a565b94610184356001600160401b0381116101475761034e903690600401613d2a565b96600054986000198a146116155760018a0160005561037160018b011515614324565b60018a016000526001602052600e604060002001546115b8576040519b60019b61039a8e613c65565b8d5260208d015260408c015260608b01528a60808b01528b60a08b015260c08a015260e089015261010088015261012087015261014086015261016085015261018084015260006101a0840152426101c084015201600052600160205260406000209080518051906001600160401b038211610a6c57819061041c8554613d7d565b601f8111611568575b50602090601f83116001146114fc576000926114f1575b50508160011b916000199060031b1c19161782555b60208101518051906001600160401b038211610a6c5781906104766001860154613d7d565b601f811161149e575b50602090601f831160011461142c57600092611421575b50508160011b916000199060031b1c19161760018301555b60408101518051906001600160401b038211610a6c5781906104d36002860154613d7d565b601f81116113ce575b50602090601f831160011461135c57600092611351575b50508160011b916000199060031b1c19161760028301555b60608101518051906001600160401b038211610a6c5781906105306003860154613d7d565b601f81116112fe575b50602090601f831160011461128c57600092611281575b50508160011b916000199060031b1c19161760038301555b60808101518051906001600160401b038211610a6c57819061058d6004860154613d7d565b601f811161122e575b50602090601f83116001146111bc576000926111b1575b50508160011b916000199060031b1c19161760048301555b60a08101518051906001600160401b038211610a6c5781906105ea6005860154613d7d565b601f811161115e575b50602090601f83116001146110ec576000926110e1575b50508160011b916000199060031b1c19161760058301555b60c08101518051906001600160401b038211610a6c5781906106476006860154613d7d565b601f811161108e575b50602090601f831160011461101c57600092611011575b50508160011b916000199060031b1c19161760068301555b60e08101518051906001600160401b038211610a6c5781906106a46007860154613d7d565b601f8111610fbe575b50602090601f8311600114610f4c57600092610f41575b50508160011b916000199060031b1c19161760078301555b6101008101518051906001600160401b038211610a6c5781906107026008860154613d7d565b601f8111610eee575b50602090601f8311600114610e7c57600092610e71575b50508160011b916000199060031b1c19161760088301555b6101208101518051906001600160401b038211610a6c5781906107606009860154613d7d565b601f8111610e1e575b50602090601f8311600114610dac57600092610da1575b50508160011b916000199060031b1c19161760098301555b6101408101518051906001600160401b038211610a6c5781906107be600a860154613d7d565b601f8111610d4e575b50602090601f8311600114610cdc57600092610cd1575b50508160011b916000199060031b1c191617600a8301555b6101608101518051906001600160401b038211610a6c57819061081c600b860154613d7d565b601f8111610c7e575b50602090601f8311600114610c0c57600092610c01575b50508160011b916000199060031b1c191617600b8301555b6101808101518051906001600160401b038211610a6c57610878600c850154613d7d565b601f8111610bba575b50602090601f8311600114610b44579180600e94926101c094600092610b39575b50508160011b916000199060031b1c191617600c8501555b6101a0810151600d8501550151910155426000526002602052604060002082516001600160401b038111610a6c576108f28254613d7d565b601f8111610af5575b506020601f8211600114610a8d5781929394600092610a82575b50508160011b916000199060031b1c19161790555b426000526003602052604060002081516001600160401b038111610a6c576109528254613d7d565b601f8111610a24575b50602092601f82116001146109c057928192936000926109b5575b50508160011b916000199060031b1c19161790555b6000547f9e5b02794dcafe8b0a25dff5262d30fa479342f88d7cde92ec27f0f4a50a479e600080a2005b015190508380610976565b601f198216938360005260206000209160005b868110610a0c57508360019596106109f3575b505050811b01905561098b565b015160001960f88460031b161c191690558380806109e6565b919260206001819286850151815501940192016109d3565b826000526020600020601f830160051c81019160208410610a62575b601f0160051c01905b818110610a56575061095b565b60008155600101610a49565b9091508190610a40565b634e487b7160e01b600052604160045260246000fd5b015190508480610915565b8260005260206000209060005b601f1984168110610add5750600193949583601f19811610610ac4575b505050811b01905561092a565b015160001960f88460031b161c19169055848080610ab7565b9091602060018192858a015181550193019101610a9a565b826000526020600020601f830160051c810160208410610b32575b601f830160051c82018110610b265750506108fb565b60008155600101610b10565b5080610b10565b0151905088806108a2565b90600c850160005260206000209160005b601f1985168110610ba2575092600e94926001926101c09583601f19811610610b89575b505050811b01600c8501556108ba565b015160001960f88460031b161c19169055888080610b79565b91926020600181928685015181550194019201610b55565b600c85016000526020600020601f840160051c810160208510610bfa575b601f830160051c82018110610bee575050610881565b60008155600101610bd8565b5080610bd8565b01519050868061083c565b9250600b85016000526020600020906000935b601f1984168510610c63576001945083601f19811610610c4a575b505050811b01600b830155610854565b015160001960f88460031b161c19169055868080610c3a565b81810151835560209485019460019093019290910190610c1f565b909150600b85016000526020600020601f840160051c810160208510610cca575b90849392915b601f830160051c82018110610cbb575050610825565b60008155859450600101610ca5565b5080610c9f565b0151905086806107de565b9250600a85016000526020600020906000935b601f1984168510610d33576001945083601f19811610610d1a575b505050811b01600a8301556107f6565b015160001960f88460031b161c19169055868080610d0a565b81810151835560209485019460019093019290910190610cef565b909150600a85016000526020600020601f840160051c810160208510610d9a575b90849392915b601f830160051c82018110610d8b5750506107c7565b60008155859450600101610d75565b5080610d6f565b015190508680610780565b9250600985016000526020600020906000935b601f1984168510610e03576001945083601f19811610610dea575b505050811b016009830155610798565b015160001960f88460031b161c19169055868080610dda565b81810151835560209485019460019093019290910190610dbf565b909150600985016000526020600020601f840160051c810160208510610e6a575b90849392915b601f830160051c82018110610e5b575050610769565b60008155859450600101610e45565b5080610e3f565b015190508680610722565b9250600885016000526020600020906000935b601f1984168510610ed3576001945083601f19811610610eba575b505050811b01600883015561073a565b015160001960f88460031b161c19169055868080610eaa565b81810151835560209485019460019093019290910190610e8f565b909150600885016000526020600020601f840160051c810160208510610f3a575b90849392915b601f830160051c82018110610f2b57505061070b565b60008155859450600101610f15565b5080610f0f565b0151905086806106c4565b9250600785016000526020600020906000935b601f1984168510610fa3576001945083601f19811610610f8a575b505050811b0160078301556106dc565b015160001960f88460031b161c19169055868080610f7a565b81810151835560209485019460019093019290910190610f5f565b909150600785016000526020600020601f840160051c81016020851061100a575b90849392915b601f830160051c82018110610ffb5750506106ad565b60008155859450600101610fe5565b5080610fdf565b015190508680610667565b9250600685016000526020600020906000935b601f1984168510611073576001945083601f1981161061105a575b505050811b01600683015561067f565b015160001960f88460031b161c1916905586808061104a565b8181015183556020948501946001909301929091019061102f565b909150600685016000526020600020601f840160051c8101602085106110da575b90849392915b601f830160051c820181106110cb575050610650565b600081558594506001016110b5565b50806110af565b01519050868061060a565b9250600585016000526020600020906000935b601f1984168510611143576001945083601f1981161061112a575b505050811b016005830155610622565b015160001960f88460031b161c1916905586808061111a565b818101518355602094850194600190930192909101906110ff565b909150600585016000526020600020601f840160051c8101602085106111aa575b90849392915b601f830160051c8201811061119b5750506105f3565b60008155859450600101611185565b508061117f565b0151905086806105ad565b9250600485016000526020600020906000935b601f1984168510611213576001945083601f198116106111fa575b505050811b0160048301556105c5565b015160001960f88460031b161c191690558680806111ea565b818101518355602094850194600190930192909101906111cf565b909150600485016000526020600020601f840160051c81016020851061127a575b90849392915b601f830160051c8201811061126b575050610596565b60008155859450600101611255565b508061124f565b015190508680610550565b9250600385016000526020600020906000935b601f19841685106112e3576001945083601f198116106112ca575b505050811b016003830155610568565b015160001960f88460031b161c191690558680806112ba565b8181015183556020948501946001909301929091019061129f565b909150600385016000526020600020601f840160051c81016020851061134a575b90849392915b601f830160051c8201811061133b575050610539565b60008155859450600101611325565b508061131f565b0151905086806104f3565b9250600285016000526020600020906000935b601f19841685106113b3576001945083601f1981161061139a575b505050811b01600283015561050b565b015160001960f88460031b161c1916905586808061138a565b8181015183556020948501946001909301929091019061136f565b909150600285016000526020600020601f840160051c81016020851061141a575b90849392915b601f830160051c8201811061140b5750506104dc565b600081558594506001016113f5565b50806113ef565b015190508680610496565b9250600185016000526020600020906000935b601f1984168510611483576001945083601f1981161061146a575b505050811b0160018301556104ae565b015160001960f88460031b161c1916905586808061145a565b8181015183556020948501946001909301929091019061143f565b909150600185016000526020600020601f840160051c8101602085106114ea575b90849392915b601f830160051c820181106114db57505061047f565b600081558594506001016114c5565b50806114bf565b01519050868061043c565b9250846000526020600020906000935b601f198416851061154d576001945083601f19811610611534575b505050811b018255610451565b015160001960f88460031b161c19169055868080611527565b8181015183556020948501946001909301929091019061150c565b909150846000526020600020601f840160051c8101602085106115b1575b90849392915b601f830160051c820181106115a2575050610425565b6000815585945060010161158c565b5080611586565b60405162461bcd60e51b815260206004820152602f60248201527f50726f6a656374206461746120616c72656164792065786973747320666f722060448201526e1d1a1a5cc81c1c9bda9958dd081251608a1b6064820152608490fd5b634e487b7160e01b600052601160045260246000fd5b346101475760203660031901126101475760043561164881614153565b506000527f0542a41881ee128a365a727b282c86fa859579490b9bb45aab8503648c8e79006020526116a36116806040600020613db7565b600060405161168e81613c81565b52604051918291602083526020830190613bf9565b0390f35b34610147576020366003190112610147576116c0613c39565b6000805160206143dd83398151915254906001600160401b03821680159081611b39575b6001149081611b2f575b159081611b26575b50611b145761173a9060016001600160401b03198416176000805160206143dd8339815191525560ff8360401c1615611ae7575b6117326142f5565b6101406142f5565b6040519061174782613c9c565b601282527150726f6a656374436572746966696361746560701b60208301526040519061177382613c9c565b6002825261504360f01b602083015261178a6142f5565b6117926142f5565b8251916001600160401b038311610a6c576117bb60008051602061437d83398151915254613d7d565b92601f93848111611a6f575b506020948482116001146119e3579481929394956000926119d8575b50508160011b916000199060031b1c19161760008051602061437d833981519152555b8051926001600160401b038411610a6c577f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab0079301916118438354613d7d565b828111611977575b5060209185116001146118f15760ff9491600091836118e6575b50508160011b916000199060031b1c19161790555b6118826142f5565b60401c161561188d57005b68ff0000000000000000196000805160206143dd83398151915254166000805160206143dd833981519152557fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602060405160018152a1005b015190508580611865565b90601f19851691836000527ff4bad0a69248f59680a4f2b3000328cec71a413447c96781cfe5996daa8c456e9260005b81811061195f575091600193918760ff989410611946575b505050811b01905561187a565b015160001960f88460031b161c19169055858080611939565b92936020600181928786015181550195019301611921565b836000527ff4bad0a69248f59680a4f2b3000328cec71a413447c96781cfe5996daa8c456e8380880160051c820192602089106119cf575b0160051c01905b8181106119c3575061184b565b600081556001016119b6565b925081926119af565b0151905085806117e3565b601f1982169560008051602061437d8339815191526000526000805160206143fd8339815191529160005b888110611a5757508360019596979810611a3e575b505050811b0160008051602061437d83398151915255611806565b015160001960f88460031b161c19169055858080611a23565b91926020600181928685015181550194019201611a0e565b60008051602061437d8339815191526000528480830160051c6000805160206143fd833981519152019160208410611ad1575b0160051c6000805160206143fd83398151915201905b818110611ac557506117c7565b60008155600101611ab8565b6000805160206143fd8339815191529250611aa2565b68ffffffffffffffffff19831668010000000000000001176000805160206143dd8339815191525561172a565b60405163f92ee8a960e01b8152600490fd5b905015836116f6565b303b1591506116ee565b604084901c60ff161591506116e4565b3461014757608036600319011261014757611b62613c39565b611b6a613c4f565b90604435606435926001600160401b038411610147573660238501121561014757611ba2610145943690602481600401359101613cf3565b92611bae838383613f7c565b6141ad565b34610147576101c0366003190112610147576024356001600160401b03811161014757611be4903690600401613d2a565b6044356001600160401b03811161014757611c03903690600401613d2a565b906064356001600160401b03811161014757611c23903690600401613d2a565b906084356001600160401b03811161014757611c43903690600401613d2a565b9260a4356001600160401b03811161014757611c63903690600401613d2a565b9260c4356001600160401b03811161014757611c83903690600401613d2a565b9460e4356001600160401b03811161014757611ca3903690600401613d2a565b610104356001600160401b03811161014757611cc3903690600401613d2a565b610124356001600160401b03811161014757611ce3903690600401613d2a565b610144356001600160401b03811161014757611d03903690600401613d2a565b916001600160401b03610164351161014757611d253661016435600401613d2a565b936001600160401b03610184351161014757611d473661018435600401613d2a565b956001600160401b036101a4351161014757611d69366101a435600401613d2a565b97611d72613e5d565b611d7f6004351515614324565b6004356000526001602052600e6040600020015415612fc0576004356000526001602052600e60406000200154996040519b611dba8d613c65565b8c5260208c015260408b015260608a01528960808a01528a60a08a015260c089015260e0880152610100870152610120860152610140850152610160840152610180830152426101a08301526101c0820152600435600052600160205260406000209080518051906001600160401b038211610a6c578190611e3c8554613d7d565b601f8111612f70575b50602090601f8311600114612f0457600092612ef9575b50508160011b916000199060031b1c19161782555b60208101518051906001600160401b038211610a6c578190611e966001860154613d7d565b601f8111612ea6575b50602090601f8311600114612e3457600092612e29575b50508160011b916000199060031b1c19161760018301555b60408101518051906001600160401b038211610a6c578190611ef36002860154613d7d565b601f8111612dd6575b50602090601f8311600114612d6457600092612d59575b50508160011b916000199060031b1c19161760028301555b60608101518051906001600160401b038211610a6c578190611f506003860154613d7d565b601f8111612d06575b50602090601f8311600114612c9457600092612c89575b50508160011b916000199060031b1c19161760038301555b60808101518051906001600160401b038211610a6c578190611fad6004860154613d7d565b601f8111612c36575b50602090601f8311600114612bc457600092612bb9575b50508160011b916000199060031b1c19161760048301555b60a08101518051906001600160401b038211610a6c57819061200a6005860154613d7d565b601f8111612b66575b50602090601f8311600114612af457600092612ae9575b50508160011b916000199060031b1c19161760058301555b60c08101518051906001600160401b038211610a6c5781906120676006860154613d7d565b601f8111612a96575b50602090601f8311600114612a2457600092612a19575b50508160011b916000199060031b1c19161760068301555b60e08101518051906001600160401b038211610a6c5781906120c46007860154613d7d565b601f81116129c6575b50602090601f831160011461295457600092612949575b50508160011b916000199060031b1c19161760078301555b6101008101518051906001600160401b038211610a6c5781906121226008860154613d7d565b601f81116128f6575b50602090601f831160011461288457600092612879575b50508160011b916000199060031b1c19161760088301555b6101208101518051906001600160401b038211610a6c5781906121806009860154613d7d565b601f8111612826575b50602090601f83116001146127b4576000926127a9575b50508160011b916000199060031b1c19161760098301555b6101408101518051906001600160401b038211610a6c5781906121de600a860154613d7d565b601f8111612756575b50602090601f83116001146126e4576000926126d9575b50508160011b916000199060031b1c191617600a8301555b6101608101518051906001600160401b038211610a6c57819061223c600b860154613d7d565b601f8111612686575b50602090601f831160011461261457600092612609575b50508160011b916000199060031b1c191617600b8301555b6101808101518051906001600160401b038211610a6c57612298600c850154613d7d565b601f81116125c2575b50602090601f831160011461254c579180600e94926101c094600092612541575b50508160011b916000199060031b1c191617600c8501555b6101a0810151600d8501550151910155426000526002602052604060002082516001600160401b038111610a6c576123128254613d7d565b601f81116124fd575b506020601f8211600114612497578192939460009261248c575b50508160011b916000199060031b1c19161790555b426000526003602052604060002081516001600160401b038111610a6c576123728254613d7d565b601f8111612444575b50602092601f82116001146123e057928192936000926123d5575b50508160011b916000199060031b1c19161790555b6004357f28a81071242baf4a835a741b03ae735256f6ed626b9adb7f37f10593008adf40600080a2005b015190508380612396565b601f198216938360005260206000209160005b86811061242c5750836001959610612413575b505050811b0190556123ab565b015160001960f88460031b161c19169055838080612406565b919260206001819286850151815501940192016123f3565b826000526020600020601f830160051c81019160208410612482575b601f0160051c01905b818110612476575061237b565b60008155600101612469565b9091508190612460565b015190508480612335565b601f198216908360005260206000209160005b8181106124e5575095836001959697106124cc575b505050811b01905561234a565b015160001960f88460031b161c191690558480806124bf565b9192602060018192868b0151815501940192016124aa565b826000526020600020601f830160051c81016020841061253a575b601f830160051c8201811061252e57505061231b565b60008155600101612518565b5080612518565b0151905088806122c2565b90600c850160005260206000209160005b601f19851681106125aa575092600e94926001926101c09583601f19811610612591575b505050811b01600c8501556122da565b015160001960f88460031b161c19169055888080612581565b9192602060018192868501518155019401920161255d565b600c85016000526020600020601f840160051c810160208510612602575b601f830160051c820181106125f65750506122a1565b600081556001016125e0565b50806125e0565b01519050868061225c565b9250600b85016000526020600020906000935b601f198416851061266b576001945083601f19811610612652575b505050811b01600b830155612274565b015160001960f88460031b161c19169055868080612642565b81810151835560209485019460019093019290910190612627565b909150600b85016000526020600020601f840160051c8101602085106126d2575b90849392915b601f830160051c820181106126c3575050612245565b600081558594506001016126ad565b50806126a7565b0151905086806121fe565b9250600a85016000526020600020906000935b601f198416851061273b576001945083601f19811610612722575b505050811b01600a830155612216565b015160001960f88460031b161c19169055868080612712565b818101518355602094850194600190930192909101906126f7565b909150600a85016000526020600020601f840160051c8101602085106127a2575b90849392915b601f830160051c820181106127935750506121e7565b6000815585945060010161277d565b5080612777565b0151905086806121a0565b9250600985016000526020600020906000935b601f198416851061280b576001945083601f198116106127f2575b505050811b0160098301556121b8565b015160001960f88460031b161c191690558680806127e2565b818101518355602094850194600190930192909101906127c7565b909150600985016000526020600020601f840160051c810160208510612872575b90849392915b601f830160051c82018110612863575050612189565b6000815585945060010161284d565b5080612847565b015190508680612142565b9250600885016000526020600020906000935b601f19841685106128db576001945083601f198116106128c2575b505050811b01600883015561215a565b015160001960f88460031b161c191690558680806128b2565b81810151835560209485019460019093019290910190612897565b909150600885016000526020600020601f840160051c810160208510612942575b90849392915b601f830160051c8201811061293357505061212b565b6000815585945060010161291d565b5080612917565b0151905086806120e4565b9250600785016000526020600020906000935b601f19841685106129ab576001945083601f19811610612992575b505050811b0160078301556120fc565b015160001960f88460031b161c19169055868080612982565b81810151835560209485019460019093019290910190612967565b909150600785016000526020600020601f840160051c810160208510612a12575b90849392915b601f830160051c82018110612a035750506120cd565b600081558594506001016129ed565b50806129e7565b015190508680612087565b9250600685016000526020600020906000935b601f1984168510612a7b576001945083601f19811610612a62575b505050811b01600683015561209f565b015160001960f88460031b161c19169055868080612a52565b81810151835560209485019460019093019290910190612a37565b909150600685016000526020600020601f840160051c810160208510612ae2575b90849392915b601f830160051c82018110612ad3575050612070565b60008155859450600101612abd565b5080612ab7565b01519050868061202a565b9250600585016000526020600020906000935b601f1984168510612b4b576001945083601f19811610612b32575b505050811b016005830155612042565b015160001960f88460031b161c19169055868080612b22565b81810151835560209485019460019093019290910190612b07565b909150600585016000526020600020601f840160051c810160208510612bb2575b90849392915b601f830160051c82018110612ba3575050612013565b60008155859450600101612b8d565b5080612b87565b015190508680611fcd565b9250600485016000526020600020906000935b601f1984168510612c1b576001945083601f19811610612c02575b505050811b016004830155611fe5565b015160001960f88460031b161c19169055868080612bf2565b81810151835560209485019460019093019290910190612bd7565b909150600485016000526020600020601f840160051c810160208510612c82575b90849392915b601f830160051c82018110612c73575050611fb6565b60008155859450600101612c5d565b5080612c57565b015190508680611f70565b9250600385016000526020600020906000935b601f1984168510612ceb576001945083601f19811610612cd2575b505050811b016003830155611f88565b015160001960f88460031b161c19169055868080612cc2565b81810151835560209485019460019093019290910190612ca7565b909150600385016000526020600020601f840160051c810160208510612d52575b90849392915b601f830160051c82018110612d43575050611f59565b60008155859450600101612d2d565b5080612d27565b015190508680611f13565b9250600285016000526020600020906000935b601f1984168510612dbb576001945083601f19811610612da2575b505050811b016002830155611f2b565b015160001960f88460031b161c19169055868080612d92565b81810151835560209485019460019093019290910190612d77565b909150600285016000526020600020601f840160051c810160208510612e22575b90849392915b601f830160051c82018110612e13575050611efc565b60008155859450600101612dfd565b5080612df7565b015190508680611eb6565b9250600185016000526020600020906000935b601f1984168510612e8b576001945083601f19811610612e72575b505050811b016001830155611ece565b015160001960f88460031b161c19169055868080612e62565b81810151835560209485019460019093019290910190612e47565b909150600185016000526020600020601f840160051c810160208510612ef2575b90849392915b601f830160051c82018110612ee3575050611e9f565b60008155859450600101612ecd565b5080612ec7565b015190508680611e5c565b9250846000526020600020906000935b601f1984168510612f55576001945083601f19811610612f3c575b505050811b018255611e71565b015160001960f88460031b161c19169055868080612f2f565b81810151835560209485019460019093019290910190612f14565b909150846000526020600020601f840160051c810160208510612fb9575b90849392915b601f830160051c82018110612faa575050611e45565b60008155859450600101612f94565b5080612f8e565b60405162461bcd60e51b815260206004820152602f60248201527f50726f6a656374206461746120646f6573206e6f7420657869737420666f722060448201526e1d1a1a5cc81c1c9bda9958dd081251608a1b6064820152608490fd5b3461014757604036600319011261014757613036613c39565b60243590811515809203610147576001600160a01b03169081156130a45761305d33613f43565b82600052602052604060002060ff1981541660ff83161790556040519081527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3160203392a3005b604051630b61174360e31b815260048101839052602490fd5b346101475760003660031901126101475760405160007f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab007930180546130ff81613d7d565b80855291600191808316908115613199575060011461313d575b6116a38561312981870382613cb7565b604051918291602083526020830190613bf9565b600090815292507ff4bad0a69248f59680a4f2b3000328cec71a413447c96781cfe5996daa8c456e5b828410613181575050508101602001613129826116a3613119565b80546020858701810191909152909301928101613166565b8695506116a39693506020925061312994915060ff191682840152151560051b8201019293613119565b346101475760003660031901126101475760008051602061439d833981519152546040516001600160a01b039091168152602090f35b34610147576020366003190112610147576004356000526001602052604060002061322381613db7565b9061323060018201613db7565b9061323d60028201613db7565b61324960038301613db7565b61325560048401613db7565b61326160058501613db7565b61326d60068601613db7565b61327960078701613db7565b61328560088801613db7565b9061329260098901613db7565b9261329f600a8a01613db7565b946132ac600b8b01613db7565b966132b9600c8c01613db7565b98600d8c01549b600e01549a6040519e8f9e8f916101e080845283016132de91613bf9565b82810360208401526132ef91613bf9565b90808203906040015261330191613bf9565b8d810360608f015261331291613bf9565b8c810360808e015261332391613bf9565b8b810360a08d015261333491613bf9565b8a810360c08c015261334591613bf9565b89810360e08b015261335691613bf9565b8881036101008a015261336891613bf9565b87810361012089015261337a91613bf9565b86810361014088015261338c91613bf9565b85810361016087015261339e91613bf9565b8481036101808601526133b091613bf9565b916101a08401526101c08301520390f35b34610147576000366003190112610147576133da613e5d565b60008051602061439d83398151915280546001600160a01b031981169091556000906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b3461014757602036600319011261014757613444613c39565b6001600160a01b038116156134675761345e602091613f0a565b54604051908152f35b6040516322718ad960e21b815260006004820152602490fd5b3461014757602036600319011261014757602061349e600435614153565b6040516001600160a01b039091168152f35b346101475760203660031901126101475760043560005260036020526116a36131296040600020613db7565b34610147576101456134ed36613d48565b90604051926134fb84613c81565b60008452611bae838383613f7c565b346101475760203660031901126101475760043560005260026020526116a36131296040600020613db7565b346101475761014561354736613d48565b91613f7c565b3461014757606036600319011261014757613566613c39565b6024908135906001600160401b03906044358281116101475761358d903690600401613d2a565b93613596613e5d565b604051926135a384613c81565b600084526001600160a01b0383811694909390851561398757866000527f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab0079302916020958387526040600020541688888215159283613948575b61360485613f0a565b96600197888154019055836000528a526040600020826bffffffffffffffffffffffff60a01b8254161790557fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a4613930573b613813575b50856000527f0542a41881ee128a365a727b282c86fa859579490b9bb45aab8503648c8e7900845260406000209287519283116137ff57506136a18354613d7d565b601f81116137b6575b508396601f83116001146137335782917ff8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce79697988392600094613728575b50501b916000199060031b1c19161790555b604051848152a17ffec61b9ec0e29047dbeea981617649d79f187d172cfd492695a3d0bfee28883e600080a3005b0151925089806136e8565b601f9291921982169784600052856000209160005b8a81106137a15750837ff8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce798999a10613788575b505050811b0190556136fa565b015160001960f88460031b161c1916905587808061377b565b81830151845592850192918701918701613748565b8360005284600020601f840160051c8101918685106137f5575b601f0160051c019082905b8281106137e95750506136aa565b600081550182906137db565b90915081906137d0565b634e487b7160e01b60009081526041600452fd5b9261385385829996979895604051809381926000630a85bd0160e11b97888552336004860152840152896044840152608060648401526084830190613bf9565b038160008c5af1600091816138f0575b506138bd578888883d156138b6573d61387b81613cd8565b906138896040519283613cb7565b81523d60008383013e5b805191826138b35750505060405190633250574960e11b82526004820152fd5b01fd5b6060613893565b9497939695946001600160e01b031916036138d8578761365f565b604051633250574960e11b8152600481018690528390fd5b9091508781813d8311613929575b6139088183613cb7565b8101031261014757516001600160e01b03198116810361014757908a613863565b503d6138fe565b6040516339e3563760e11b8152600060048201528590fd5b60008381526000805160206143bd8339815191526020526040902080546001600160a01b031916905561397a81613f0a565b80546000190190556135fb565b604051633250574960e11b8152600060048201528490fd5b34610147576040366003190112610147576139b8613c39565b6024356139c481614153565b33151580613a73575b80613a53575b613a3b576001600160a01b039283169282918491167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600080a460009081526000805160206143bd8339815191526020526040902080546001600160a01b0319169091179055005b60405163a9fbf51f60e01b8152336004820152602490fd5b50613a5d81613f43565b3360005260205260ff60406000205416156139d3565b506001600160a01b0381163314156139cd565b3461014757602036600319011261014757600435613aa381614153565b506000526000805160206143bd833981519152602052602060018060a01b0360406000205416604051908152f35b3461014757600036600319011261014757604051600060008051602061437d8339815191528054613b0181613d7d565b808552916001918083169081156131995750600114613b2a576116a38561312981870382613cb7565b600090815292506000805160206143fd8339815191525b828410613b5c575050508101602001613129826116a3613119565b80546020858701810191909152909301928101613b41565b34610147576020366003190112610147576004359063ffffffff60e01b821680920361014757602091632483248360e11b8114908115613bb6575b5015158152f35b6380ac58cd60e01b811491508115613be8575b8115613bd7575b5083613baf565b6301ffc9a760e01b14905083613bd0565b635b5e139f60e01b81149150613bc9565b919082519283825260005b848110613c25575050826000602080949584010152601f8019910116010190565b602081830181015184830182015201613c04565b600435906001600160a01b038216820361014757565b602435906001600160a01b038216820361014757565b6101e081019081106001600160401b03821117610a6c57604052565b602081019081106001600160401b03821117610a6c57604052565b604081019081106001600160401b03821117610a6c57604052565b90601f801991011681019081106001600160401b03821117610a6c57604052565b6001600160401b038111610a6c57601f01601f191660200190565b929192613cff82613cd8565b91613d0d6040519384613cb7565b829481845281830111610147578281602093846000960137010152565b9080601f8301121561014757816020613d4593359101613cf3565b90565b6060906003190112610147576001600160a01b0390600435828116810361014757916024359081168103610147579060443590565b90600182811c92168015613dad575b6020831014613d9757565b634e487b7160e01b600052602260045260246000fd5b91607f1691613d8c565b9060405191826000825492613dcb84613d7d565b908184526001948581169081600014613e3a5750600114613df7575b5050613df592500383613cb7565b565b9093915060005260209081600020936000915b818310613e22575050613df593508201013880613de7565b85548884018501529485019487945091830191613e0a565b915050613df594506020925060ff191682840152151560051b8201013880613de7565b60008051602061439d833981519152546001600160a01b03163303613e7e57565b60405163118cdaa760e01b8152336004820152602490fd5b6001600160a01b03908116908115613ef15760008051602061439d83398151915280546001600160a01b031981168417909155167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3565b604051631e4fbdf760e01b815260006004820152602490fd5b6001600160a01b031660009081527f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab00793036020526040902090565b6001600160a01b031660009081527f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab00793056020526040902090565b6001600160a01b038281169391841561413a57826000958187527f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab0079302958660205260409785898220541697889233151580614094575b50906140037fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef93928561405557613f0a565b8054600101905585825260205289812080546001600160a01b0319168517905580a416928383036140345750505050565b6064945051926364283d7b60e01b8452600484015260248301526044820152fd5b60008881526000805160206143bd8339815191526020526040902080546001600160a01b031916905561408786613f0a565b8054600019019055613f0a565b91935091939450806140eb575b156140b25791879187949338613fd1565b8887896140cf576024915190637e27328960e01b82526004820152fd5b604491519063177e802f60e01b82523360048301526024820152fd5b50338814801561411e575b806140a157508683526000805160206143bd83398151915260205233868a85205416146140a1565b5061412888613f43565b33845260205260ff89842054166140f6565b604051633250574960e11b815260006004820152602490fd5b60008181527f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab007930260205260409020546001600160a01b0316908115614195575090565b60249060405190637e27328960e01b82526004820152fd5b813b6141ba575b50505050565b604051630a85bd0160e11b8082523360048301526001600160a01b03928316602483015260448201949094526080606482015260209592909116939092908390614208906084830190613bf9565b039285816000958187895af18491816142b1575b5061427c575050503d600014614274573d61423681613cd8565b906142446040519283613cb7565b81528091843d92013e5b8051928361426f57604051633250574960e11b815260048101849052602490fd5b019050fd5b50606061424e565b919450915063ffffffff60e01b16036142995750388080806141b4565b60249060405190633250574960e11b82526004820152fd5b9091508681813d83116142ee575b6142c98183613cb7565b810103126142ea57516001600160e01b0319811681036142ea57903861421c565b8480fd5b503d6142bf565b60ff6000805160206143dd8339815191525460401c161561431257565b604051631afcd79f60e31b8152600490fd5b1561432b57565b60405162461bcd60e51b8152602060048201526024808201527f50726f6a656374204944206d7573742062652067726561746572207468616e206044820152637a65726f60e01b6064820152608490fdfe80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab00793009016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab0079304f0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0037c58c799b6609234b945e882912ee9ad34948a1dfaa20a97485e1a7752bbf81a164736f6c6343000814000a
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
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.