Contract Overview
My Name Tag:
Not Available, login to update
[ Download CSV Export ]
Latest 25 internal transaction
[ Download CSV Export ]
Contract Name:
Crowdsale
Compiler Version
v0.8.9+commit.e5eed63a
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.2; import "@openzeppelin/contracts/access/AccessControl.sol"; import "./CarbonCreature.sol"; import "./Holder.sol"; contract Crowdsale is AccessControl { address public carbonCreatureAddress; // wallet addresses for beneficiary parties address payable public charitiesBeneficiary; address payable public carbonOffsetBeneficiary; address payable public ccFundBeneficiary; address payable public metaCarbonBeneficiary; address payable public extraBeneficiary; // distribution Percentile for beneficiary parties uint8 public charitiesPercentile; uint8 public carbonOffsetPercentile; uint8 public ccFundPercentile; uint8 public metaCarbonPercentile; uint8 public extraPercentile; bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); bytes32 public constant HOLDER_ADMIN_ROLE = keccak256("HOLDER_ADMIN_ROLE"); bool public isEnabled = false; uint256 public basePrice; uint256 public totalSupply; uint256 public maxSupply; bool public isWhitelistRequired; // mapping for whitelist mapping(address => bool) private _whitelist; /// Either public sale or private sale should be enabled. error SaleIsNotEnabled(); /** * @dev Emitted when `account` is added to `Whitelist`. * * `sender` is the account that originated the contract call. */ event AddedToWhitelist(address indexed account, address indexed sender); /** * @dev Emitted when `account` is removed from `Whitelist`. * * `sender` is the account that originated the contract call. */ event RemovedFromWhitelist(address indexed account, address indexed sender); /** * @dev Emitted when `tokenId` token is gave away to `to`. */ event GiveAway(address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `tokenId` token is purchased by `to` for `price`. */ event Purchased(address indexed to, uint256 indexed tokenId, uint256 indexed price); /** * @dev Emitted when `amount` of tokens is purchased by `to` for `totalPrice`. */ event PurchasedWithBidPrice(address indexed to, uint256 indexed amount, uint256 indexed totalPrice); /** * @dev Emitted when `tokenId` token is purchased by `email`, minted to `to` Holder Contract */ event MintedToHolder(address indexed to, uint256 indexed tokenId, string indexed email); /** * @dev Emitted when `tokenId` token is transferred to `to`. */ event TransferFromHolder(address indexed to, uint256 indexed tokenId, string indexed email); constructor(address nftAddress) { carbonCreatureAddress = nftAddress; _setupRole(DEFAULT_ADMIN_ROLE, msg.sender); _setupRole(MINTER_ROLE, msg.sender); _setupRole(HOLDER_ADMIN_ROLE, msg.sender); } function giveAway(address beneficiary, uint256 amount) external onlyRole(MINTER_ROLE) { for (uint256 i = 0; i < amount; i++) { uint256 tokenId = CarbonCreature(carbonCreatureAddress).safeMint(beneficiary); emit GiveAway(beneficiary, tokenId); } } /** * Create holder contract and mint token to the holder contract. */ function mintToHolder(string memory email) external onlyRole(HOLDER_ADMIN_ROLE) { Holder holder = new Holder(carbonCreatureAddress, email); uint256 tokenId = CarbonCreature(carbonCreatureAddress).safeMint(address(holder)); holder.approve(); emit MintedToHolder(address(holder), tokenId, email); } /** * transfer token from Holder Contract to the user. */ function transferFromHolder(address from, address to) external onlyRole(HOLDER_ADMIN_ROLE) { Holder(from).transfer(to); emit TransferFromHolder(to, Holder(from).tokenId(), Holder(from).email()); } /** * Paid mint function for and public sale. accepts ETH for price. mint quantity tokens if the user paid enough eth. * If the user paid more, returns rest of value. */ function buyWithBidPrice(uint amount) public payable { require(isEnabled, "Sale is disabled"); require((totalSupply + amount) < maxSupply, "Total Supply is already reached"); require((isWhitelistRequired && _whitelist[msg.sender] == true) || isWhitelistRequired == false, "whitelist is required, sender must be added in whitelist"); require(amount > 0, "amount is zero"); require(msg.value >= basePrice * amount, "Not enough ETH sent"); for (uint i = 0; i < amount; i++) { CarbonCreature(carbonCreatureAddress).safeMint(msg.sender); } totalSupply += amount; _forwardFunds(msg.value); emit PurchasedWithBidPrice(msg.sender, amount, msg.value); } /** * Paid mint function for and public sale. accepts ETH for price. mint quantity tokens if the user paid enough eth. * If the user paid more, returns rest of value. */ function buy() public payable { require(isEnabled, "Sale is disabled"); require(totalSupply < maxSupply, "Total Supply is already reached"); require((isWhitelistRequired && _whitelist[msg.sender] == true) || isWhitelistRequired == false, "whitelist is required, sender must be added in whitelist"); require(msg.value >= basePrice, "Not enough ETH sent"); uint256 tokenId = CarbonCreature(carbonCreatureAddress).safeMint(msg.sender); totalSupply++; uint256 remaining = msg.value - basePrice; _forwardFunds(basePrice); if (remaining > 0) { _sendViaCall(payable(msg.sender), remaining); } emit Purchased(msg.sender, tokenId, basePrice); // revert SaleIsNotEnabled(); } /** * Fallback function is called when msg.data is not empty */ fallback() external payable { buy(); } /** * Fallback function is called when msg.data is empty */ receive() external payable { buy(); } function _forwardFunds(uint256 amount) private { require(charitiesPercentile + carbonOffsetPercentile + ccFundPercentile + metaCarbonPercentile + extraPercentile == 100, "Sum of percentile should be 100"); uint256 value = amount * charitiesPercentile / 100; uint256 remaining = amount - value; if (value > 0) { require(charitiesBeneficiary != address(0), "Charities wallet is not set"); _sendViaCall(charitiesBeneficiary, value); } value = amount * carbonOffsetPercentile / 100; if (value > 0) { require(carbonOffsetBeneficiary != address(0), "CarbonOffset wallet is not set"); _sendViaCall(carbonOffsetBeneficiary, value); remaining -= value; } value = amount * ccFundPercentile / 100; if (value > 0) { require(ccFundBeneficiary != address(0), "ccFund wallet is not set"); _sendViaCall(ccFundBeneficiary, value); remaining -= value; } value = amount * extraPercentile / 100; if (value > 0) { require(extraBeneficiary != address(0), "extra wallet is not set"); _sendViaCall(extraBeneficiary, value); remaining -= value; } // no need to calculate, just send all remaining funds to Meta Carbon Wallet if (remaining > 0) { require(metaCarbonBeneficiary != address(0), "metaCarbon wallet is not set"); _sendViaCall(metaCarbonBeneficiary, remaining); } } function _sendViaCall(address payable _to, uint256 value) private { // Call returns a boolean value indicating success or failure. // This is the current recommended method to use. (bool sent, ) = _to.call{value: value}(""); require(sent, "Failed to send Ether"); } function setCharitiesBeneficiary(address payable account) external onlyRole(MINTER_ROLE) { require(account != address(0), "zero address cannot be used"); charitiesBeneficiary = account; } function setCarbonOffsetBeneficiary(address payable account) external onlyRole(MINTER_ROLE) { require(account != address(0), "zero address cannot be used"); carbonOffsetBeneficiary = account; } function setCCFundBeneficiary(address payable account) external onlyRole(MINTER_ROLE) { require(account != address(0), "zero address cannot be used"); ccFundBeneficiary = account; } function setMetaCarbonBeneficiary(address payable account) external onlyRole(MINTER_ROLE) { require(account != address(0), "zero address cannot be used"); metaCarbonBeneficiary = account; } function setExtraBeneficiary(address payable account) external onlyRole(MINTER_ROLE) { require(account != address(0), "zero address cannot be used"); extraBeneficiary = account; } function setDistributionPercentile( uint8 charities, uint8 carbonOffset, uint8 ccFund, uint8 metaCarbon, uint8 extra ) external onlyRole(MINTER_ROLE) { require(charities + carbonOffset + ccFund + metaCarbon + extra == 100, "Sum of percentile should be 100"); charitiesPercentile = charities; carbonOffsetPercentile = carbonOffset; ccFundPercentile = ccFund; metaCarbonPercentile = metaCarbon; extraPercentile = extra; } function setSaleStatus(bool status) external onlyRole(MINTER_ROLE) { isEnabled = status; } /** * @dev Throws if called when is disabled. */ modifier onlyWhenSaleIsOff() { require(isEnabled == false, "Sale is enabled"); _; } function setBasePrice(uint256 _price) external onlyRole(MINTER_ROLE) onlyWhenSaleIsOff { basePrice = _price; } function setMaxSupply(uint256 _maxSupply) external onlyRole(MINTER_ROLE) onlyWhenSaleIsOff { require(_maxSupply > 0, "maxSupply must be greater than zero"); maxSupply = _maxSupply; totalSupply = 0; } function addToWhitelist(address account) external onlyRole(MINTER_ROLE) { _whitelist[account] = true; emit AddedToWhitelist(account, _msgSender()); } function removeFromWhitelist(address account) external onlyRole(MINTER_ROLE) { delete _whitelist[account]; emit RemovedFromWhitelist(account, _msgSender()); } function enableWhitelist(bool enabled) external onlyRole(MINTER_ROLE) { isWhitelistRequired = enabled; } function isWhitelisted(address account) public view returns (bool) { return _whitelist[account]; } // for emergency withdrawing when funds are remaining in smart contract function withdraw(address payable to) external onlyRole(DEFAULT_ADMIN_ROLE) { _sendViaCall(to, address(this).balance); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import {SafeMath} from "@openzeppelin/contracts/utils/math/SafeMath.sol"; import {EIP712Base} from "./EIP712Base.sol"; contract NativeMetaTransaction is EIP712Base { using SafeMath for uint256; bytes32 private constant META_TRANSACTION_TYPEHASH = keccak256( bytes( "MetaTransaction(uint256 nonce,address from,bytes functionSignature)" ) ); event MetaTransactionExecuted( address userAddress, address payable relayerAddress, bytes functionSignature ); mapping(address => uint256) nonces; /* * Meta transaction structure. * No point of including value field here as if user is doing value transfer then he has the funds to pay for gas * He should call the desired function directly in that case. */ struct MetaTransaction { uint256 nonce; address from; bytes functionSignature; } function executeMetaTransaction( address userAddress, bytes memory functionSignature, bytes32 sigR, bytes32 sigS, uint8 sigV ) public payable returns (bytes memory) { MetaTransaction memory metaTx = MetaTransaction({ nonce: nonces[userAddress], from: userAddress, functionSignature: functionSignature }); require( verify(userAddress, metaTx, sigR, sigS, sigV), "Signer and signature do not match" ); // increase nonce for user (to avoid re-use) nonces[userAddress] = nonces[userAddress].add(1); emit MetaTransactionExecuted( userAddress, payable(msg.sender), functionSignature ); // Append userAddress and relayer address at the end to extract it from calling context (bool success, bytes memory returnData) = address(this).call( abi.encodePacked(functionSignature, userAddress) ); require(success, "Function call not successful"); return returnData; } function hashMetaTransaction(MetaTransaction memory metaTx) internal pure returns (bytes32) { return keccak256( abi.encode( META_TRANSACTION_TYPEHASH, metaTx.nonce, metaTx.from, keccak256(metaTx.functionSignature) ) ); } function getNonce(address user) public view returns (uint256 nonce) { nonce = nonces[user]; } function verify( address signer, MetaTransaction memory metaTx, bytes32 sigR, bytes32 sigS, uint8 sigV ) internal view returns (bool) { require(signer != address(0), "NativeMetaTransaction: INVALID_SIGNER"); return signer == ecrecover( toTypedMessageHash(hashMetaTransaction(metaTx)), sigV, sigR, sigS ); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; contract Initializable { bool inited = false; modifier initializer() { require(!inited, "already inited"); _; inited = true; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import {Initializable} from "./Initializable.sol"; contract EIP712Base is Initializable { struct EIP712Domain { string name; string version; address verifyingContract; bytes32 salt; } string constant public ERC712_VERSION = "1"; bytes32 internal constant EIP712_DOMAIN_TYPEHASH = keccak256( bytes( "EIP712Domain(string name,string version,address verifyingContract,bytes32 salt)" ) ); bytes32 internal domainSeperator; // supposed to be called once while initializing. // one of the contracts that inherits this contract follows proxy pattern // so it is not possible to do this in a constructor function _initializeEIP712( string memory name ) internal initializer { _setDomainSeperator(name); } function _setDomainSeperator(string memory name) internal { domainSeperator = keccak256( abi.encode( EIP712_DOMAIN_TYPEHASH, keccak256(bytes(name)), keccak256(bytes(ERC712_VERSION)), address(this), bytes32(getChainId()) ) ); } function getDomainSeperator() public view returns (bytes32) { return domainSeperator; } function getChainId() public view returns (uint256) { uint256 id; assembly { id := chainid() } return id; } /** * Accept message hash and returns hash message in EIP712 compatible form * So that it can be used to recover signer from signature signed using EIP712 formatted data * https://eips.ethereum.org/EIPS/eip-712 * "\\x19" makes the encoding deterministic * "\\x01" is the version byte to make it compatible to EIP-191 */ function toTypedMessageHash(bytes32 messageHash) internal view returns (bytes32) { return keccak256( abi.encodePacked("\x19\x01", getDomainSeperator(), messageHash) ); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; abstract contract ContextMixin { function msgSender() internal view returns (address payable sender) { if (msg.sender == address(this)) { bytes memory array = msg.data; uint256 index = msg.data.length; assembly { // Load the 32 bytes word from memory with the address on the lower 20 bytes, and mask those. sender := and( mload(add(array, index)), 0xffffffffffffffffffffffffffffffffffffffff ) } } else { sender = payable(msg.sender); } return sender; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.2; import "./Crowdsale.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; contract Holder is IERC721Receiver { address public crowdsale; address public carbonCreature; string public email; uint256 public tokenId; constructor(address _nft, string memory _email) { carbonCreature = _nft; crowdsale = msg.sender; email = _email; } function approve() external { require( msg.sender == crowdsale, "Only Carbon Creature Crowdsale contract can execute" ); IERC721(carbonCreature).approve(crowdsale, tokenId); } function transfer(address _to) external { require(msg.sender == crowdsale, "Only Carbon Creature Crowdsale contract can execute"); IERC721(carbonCreature).safeTransferFrom(address(this), _to, tokenId); } /** * @dev See {IERC721Receiver-onERC721Received}. Accepts Carbon Creature NFT token transfers. * * Always returns `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address _operator, address _from, uint256 _tokenId, bytes calldata _data ) external virtual override returns (bytes4) { require(_operator == crowdsale, "Only accept Carbon Creature NFT Crowdsale"); tokenId = _tokenId; return this.onERC721Received.selector; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.2; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "./common/meta-transactions/ContentMixin.sol"; import "./common/meta-transactions/NativeMetaTransaction.sol"; contract CarbonCreature is ContextMixin, ERC721, ERC721Enumerable, ERC721URIStorage, NativeMetaTransaction, Ownable, AccessControl { using Counters for Counters.Counter; uint16 public CREATURE_MAX_SUPPLY = 8888; bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); bytes32 public constant METADATA_ROLE = keccak256("METADATA_ROLE"); Counters.Counter private _tokenIdCounter; // Base Token URI string private _baseTokenURI; constructor() ERC721("Carbon Creature", "CC") { _initializeEIP712("Carbon Creature"); _setupRole(DEFAULT_ADMIN_ROLE, msg.sender); _setupRole(MINTER_ROLE, msg.sender); _setupRole(METADATA_ROLE, msg.sender); } function safeMint(address to) external onlyRole(MINTER_ROLE) returns (uint256) { require(totalSupply() < CREATURE_MAX_SUPPLY, "Total Supply is reached to Creature Max Supply"); _safeMint(to, _tokenIdCounter.current()); _tokenIdCounter.increment(); return _tokenIdCounter.current() - 1; } function setBaseTokenURI(string memory uri) external onlyRole(METADATA_ROLE) { _baseTokenURI = uri; } function baseTokenURI() public view returns (string memory) { return _baseURI(); } /** * @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 overriden in child contracts. */ function _baseURI() override internal view returns (string memory) { return _baseTokenURI; } /** * @dev Sets `_tokenURI` as the tokenURI of `tokenId`. * */ function setTokenURI(uint256 tokenId, string memory _tokenURI) external onlyRole(METADATA_ROLE) { _setTokenURI(tokenId, _tokenURI); } /** * Override isApprovedForAll to whitelist user's OpenSea proxy accounts to enable gas-less listings. */ function isApprovedForAll(address owner, address operator) override public view returns (bool) { // Mainnet: if OpenSea's ERC721 Proxy Address is detected, auto-return true if (operator == address(0x58807baD0B376efc12F5AD86aAc70E78ed67deaE)) { return true; } // // Mumbai Testnet: if OpenSea's ERC721 Proxy Address is detected, auto-return true // if (operator == address(0xff7Ca10aF37178BdD056628eF42fD7F799fAc77c)) { // return true; // } // // ETH: Whitelist OpenSea proxy contract for easy trading. // ProxyRegistry proxyRegistry = ProxyRegistry(proxyRegistryAddress); // if (address(proxyRegistry.proxies(owner)) == operator) { // return true; // } return super.isApprovedForAll(owner, operator); } /** * This is used instead of msg.sender as transactions won't be sent by the original token owner, but by OpenSea. */ function _msgSender() internal override view returns (address sender) { return ContextMixin.msgSender(); } // The following functions are overrides required by Solidity. function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal override(ERC721, ERC721Enumerable) { super._beforeTokenTransfer(from, to, tokenId); } function _burn(uint256 tokenId) internal override(ERC721, ERC721URIStorage) { super._burn(tokenId); } function tokenURI(uint256 tokenId) public view override(ERC721, ERC721URIStorage) returns (string memory) { return super.tokenURI(tokenId); } function supportsInterface(bytes4 interfaceId) public view override(ERC721, ERC721Enumerable, AccessControl) returns (bool) { return super.supportsInterface(interfaceId); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; // CAUTION // This version of SafeMath should only be used with Solidity 0.8 or later, // because it relies on the compiler's built in overflow checks. /** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler * now has built in overflow checking. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ 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 substraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ 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. * * _Available since v3.4._ */ 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. * * _Available since v3.4._ */ 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. * * _Available since v3.4._ */ 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 addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { return a + b; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { return a * b; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b <= a, errorMessage); return a - b; } } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a / b; } } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a % b; } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } }
pragma solidity ^0.8.0; /** * @title Counters * @author Matt Condon (@shrugs) * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number * of elements in a mapping, issuing ERC721 ids, or counting request ids. * * Include with `using Counters for Counters.Counter;` */ library Counters { struct Counter { // This variable should never be directly accessed by users of the library: interactions must be restricted to // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add // this feature: see https://github.com/ethereum/solidity/issues/4637 uint256 _value; // default: 0 } function current(Counter storage counter) internal view returns (uint256) { return counter._value; } function increment(Counter storage counter) internal { unchecked { counter._value += 1; } } function decrement(Counter storage counter) internal { uint256 value = counter._value; require(value > 0, "Counter: decrement overflow"); unchecked { counter._value = value - 1; } } function reset(Counter storage counter) internal { counter._value = 0; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Metadata is IERC721 { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Enumerable is IERC721 { /** * @dev Returns the total amount of tokens stored by the contract. */ function totalSupply() external view returns (uint256); /** * @dev Returns a token ID owned by `owner` at a given `index` of its token list. * Use along with {balanceOf} to enumerate all of ``owner``'s tokens. */ function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId); /** * @dev Returns a token ID at a given `index` of all the tokens stored by the contract. * Use along with {totalSupply} to enumerate all tokens. */ function tokenByIndex(uint256 index) external view returns (uint256); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../ERC721.sol"; /** * @dev ERC721 token with storage based token URI management. */ abstract contract ERC721URIStorage is ERC721 { using Strings for uint256; // Optional mapping for token URIs mapping(uint256 => string) private _tokenURIs; /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { require(_exists(tokenId), "ERC721URIStorage: URI query for nonexistent token"); 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 abi.encodePacked). if (bytes(_tokenURI).length > 0) { return string(abi.encodePacked(base, _tokenURI)); } return super.tokenURI(tokenId); } /** * @dev Sets `_tokenURI` as the tokenURI of `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _setTokenURI(uint256 tokenId, string memory _tokenURI) internal virtual { require(_exists(tokenId), "ERC721URIStorage: URI set of nonexistent token"); _tokenURIs[tokenId] = _tokenURI; } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual override { super._burn(tokenId); if (bytes(_tokenURIs[tokenId]).length != 0) { delete _tokenURIs[tokenId]; } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../ERC721.sol"; import "./IERC721Enumerable.sol"; /** * @dev This implements an optional extension of {ERC721} defined in the EIP that adds * enumerability of all the token ids in the contract as well as all token ids owned by each * account. */ abstract contract ERC721Enumerable is ERC721, IERC721Enumerable { // Mapping from owner to list of owned token IDs mapping(address => mapping(uint256 => uint256)) private _ownedTokens; // Mapping from token ID to index of the owner tokens list mapping(uint256 => uint256) private _ownedTokensIndex; // Array with all token ids, used for enumeration uint256[] private _allTokens; // Mapping from token id to position in the allTokens array mapping(uint256 => uint256) private _allTokensIndex; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) { return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}. */ function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) { require(index < ERC721.balanceOf(owner), "ERC721Enumerable: owner index out of bounds"); return _ownedTokens[owner][index]; } /** * @dev See {IERC721Enumerable-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _allTokens.length; } /** * @dev See {IERC721Enumerable-tokenByIndex}. */ function tokenByIndex(uint256 index) public view virtual override returns (uint256) { require(index < ERC721Enumerable.totalSupply(), "ERC721Enumerable: global index out of bounds"); return _allTokens[index]; } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``from``'s `tokenId` will be burned. * - `from` cannot be the zero address. * - `to` cannot be the zero address. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual override { super._beforeTokenTransfer(from, to, tokenId); if (from == address(0)) { _addTokenToAllTokensEnumeration(tokenId); } else if (from != to) { _removeTokenFromOwnerEnumeration(from, tokenId); } if (to == address(0)) { _removeTokenFromAllTokensEnumeration(tokenId); } else if (to != from) { _addTokenToOwnerEnumeration(to, tokenId); } } /** * @dev Private function to add a token to this extension's ownership-tracking data structures. * @param to address representing the new owner of the given token ID * @param tokenId uint256 ID of the token to be added to the tokens list of the given address */ function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private { uint256 length = ERC721.balanceOf(to); _ownedTokens[to][length] = tokenId; _ownedTokensIndex[tokenId] = length; } /** * @dev Private function to add a token to this extension's token tracking data structures. * @param tokenId uint256 ID of the token to be added to the tokens list */ function _addTokenToAllTokensEnumeration(uint256 tokenId) private { _allTokensIndex[tokenId] = _allTokens.length; _allTokens.push(tokenId); } /** * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for * gas optimizations e.g. when performing a transfer operation (avoiding double writes). * This has O(1) time complexity, but alters the order of the _ownedTokens array. * @param from address representing the previous owner of the given token ID * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address */ function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private { // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = ERC721.balanceOf(from) - 1; uint256 tokenIndex = _ownedTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary if (tokenIndex != lastTokenIndex) { uint256 lastTokenId = _ownedTokens[from][lastTokenIndex]; _ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index } // This also deletes the contents at the last position of the array delete _ownedTokensIndex[tokenId]; delete _ownedTokens[from][lastTokenIndex]; } /** * @dev Private function to remove a token from this extension's token tracking data structures. * This has O(1) time complexity, but alters the order of the _allTokens array. * @param tokenId uint256 ID of the token to be removed from the tokens list */ function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private { // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = _allTokens.length - 1; uint256 tokenIndex = _allTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding // an 'if' statement (like in _removeTokenFromOwnerEnumeration) uint256 lastTokenId = _allTokens[lastTokenIndex]; _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index // This also deletes the contents at the last position of the array delete _allTokensIndex[tokenId]; _allTokens.pop(); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721Receiver { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`, 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 be have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns 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); /** * @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; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IERC721.sol"; import "./IERC721Receiver.sol"; import "./extensions/IERC721Metadata.sol"; import "../../utils/Address.sol"; import "../../utils/Context.sol"; import "../../utils/Strings.sol"; import "../../utils/introspection/ERC165.sol"; /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension, but not including the Enumerable extension, which is available separately as * {ERC721Enumerable}. */ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings for uint256; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to owner address mapping(uint256 => address) private _owners; // Mapping owner address to token count mapping(address => uint256) private _balances; // Mapping from token ID to approved address mapping(uint256 => address) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; /** * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC721).interfaceId || interfaceId == type(IERC721Metadata).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view virtual override returns (uint256) { require(owner != address(0), "ERC721: balance query for the zero address"); return _balances[owner]; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { address owner = _owners[tokenId]; require(owner != address(0), "ERC721: owner query for nonexistent token"); return owner; } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token"); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : ""; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overriden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ""; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual override { address owner = ERC721.ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require( _msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721: approve caller is not owner nor approved for all" ); _approve(to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { require(_exists(tokenId), "ERC721: approved query for nonexistent token"); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { require(operator != _msgSender(), "ERC721: approve to caller"); _operatorApprovals[_msgSender()][operator] = approved; emit ApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom( address from, address to, uint256 tokenId ) public virtual override { //solhint-disable-next-line max-line-length require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved"); _transfer(from, to, tokenId); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public virtual override { require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved"); _safeTransfer(from, to, tokenId, _data); } /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * `_data` is additional data, it has no specified format and it is sent in call to `to`. * * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeTransfer( address from, address to, uint256 tokenId, bytes memory _data ) internal virtual { _transfer(from, to, tokenId); require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer"); } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted (`_mint`), * and stop existing when they are burned (`_burn`). */ function _exists(uint256 tokenId) internal view virtual returns (bool) { return _owners[tokenId] != address(0); } /** * @dev Returns whether `spender` is allowed to manage `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) { require(_exists(tokenId), "ERC721: operator query for nonexistent token"); address owner = ERC721.ownerOf(tokenId); return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender)); } /** * @dev Safely mints `tokenId` and transfers it to `to`. * * Requirements: * * - `tokenId` must not exist. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeMint(address to, uint256 tokenId) internal virtual { _safeMint(to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeMint( address to, uint256 tokenId, bytes memory _data ) internal virtual { _mint(to, tokenId); require( _checkOnERC721Received(address(0), to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer" ); } /** * @dev Mints `tokenId` and transfers it to `to`. * * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible * * Requirements: * * - `tokenId` must not exist. * - `to` cannot be the zero address. * * Emits a {Transfer} event. */ function _mint(address to, uint256 tokenId) internal virtual { require(to != address(0), "ERC721: mint to the zero address"); require(!_exists(tokenId), "ERC721: token already minted"); _beforeTokenTransfer(address(0), to, tokenId); _balances[to] += 1; _owners[tokenId] = to; emit Transfer(address(0), to, tokenId); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual { address owner = ERC721.ownerOf(tokenId); _beforeTokenTransfer(owner, address(0), tokenId); // Clear approvals _approve(address(0), tokenId); _balances[owner] -= 1; delete _owners[tokenId]; emit Transfer(owner, address(0), tokenId); } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer( address from, address to, uint256 tokenId ) internal virtual { require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer of token that is not own"); require(to != address(0), "ERC721: transfer to the zero address"); _beforeTokenTransfer(from, to, tokenId); // Clear approvals from the previous owner _approve(address(0), tokenId); _balances[from] -= 1; _balances[to] += 1; _owners[tokenId] = to; emit Transfer(from, to, tokenId); } /** * @dev Approve `to` to operate on `tokenId` * * Emits a {Approval} event. */ function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ERC721.ownerOf(tokenId), to, tokenId); } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. * The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param _data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ function _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { if (to.isContract()) { try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) { return retval == IERC721Receiver.onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert("ERC721: transfer to non ERC721Receiver implementer"); } else { assembly { revert(add(32, reason), mload(reason)) } } } } else { return true; } } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``from``'s `tokenId` will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual {} }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _setOwner(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _setOwner(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _setOwner(newOwner); } function _setOwner(address newOwner) private { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControl { /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. * * _Available since v3.1._ */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call, an admin role * bearer except when using {AccessControl-_setupRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) external view returns (bool); /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {AccessControl-_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) external view returns (bytes32); /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) external; /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) external; /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IAccessControl.sol"; import "../utils/Context.sol"; import "../utils/Strings.sol"; import "../utils/introspection/ERC165.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for those cases see * {AccessControlEnumerable}. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ``` * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ``` * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. */ abstract contract AccessControl is Context, IAccessControl, ERC165 { struct RoleData { mapping(address => bool) members; bytes32 adminRole; } mapping(bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Modifier that checks that an account has a specific role. Reverts * with a standardized message including the required role. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ * * _Available since v4.1._ */ modifier onlyRole(bytes32 role) { _checkRole(role, _msgSender()); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view override returns (bool) { return _roles[role].members[account]; } /** * @dev Revert with a standard message if `account` is missing `role`. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ */ function _checkRole(bytes32 role, address account) internal view { if (!hasRole(role, account)) { revert( string( abi.encodePacked( "AccessControl: account ", Strings.toHexString(uint160(account), 20), " is missing role ", Strings.toHexString(uint256(role), 32) ) ) ); } } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view override returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) public virtual override { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. Note that unlike {grantRole}, this function doesn't perform any * checks on the calling account. * * [WARNING] * ==== * This function should only be called from the constructor when setting * up the initial roles for the system. * * Using this function in any other way is effectively circumventing the admin * system imposed by {AccessControl}. * ==== */ function _setupRole(bytes32 role, address account) internal virtual { _grantRole(role, account); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { bytes32 previousAdminRole = getRoleAdmin(role); _roles[role].adminRole = adminRole; emit RoleAdminChanged(role, previousAdminRole, adminRole); } function _grantRole(bytes32 role, address account) private { if (!hasRole(role, account)) { _roles[role].members[account] = true; emit RoleGranted(role, account, _msgSender()); } } function _revokeRole(bytes32 role, address account) private { if (hasRole(role, account)) { _roles[role].members[account] = false; emit RoleRevoked(role, account, _msgSender()); } } }
{ "remappings": [], "optimizer": { "enabled": true, "runs": 200 }, "evmVersion": "london", "libraries": {}, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"nftAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"SaleIsNotEnabled","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"AddedToWhitelist","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"GiveAway","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"string","name":"email","type":"string"}],"name":"MintedToHolder","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"price","type":"uint256"}],"name":"Purchased","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"totalPrice","type":"uint256"}],"name":"PurchasedWithBidPrice","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RemovedFromWhitelist","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"string","name":"email","type":"string"}],"name":"TransferFromHolder","type":"event"},{"stateMutability":"payable","type":"fallback"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"HOLDER_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"addToWhitelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"basePrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"buy","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"buyWithBidPrice","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"carbonCreatureAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"carbonOffsetBeneficiary","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"carbonOffsetPercentile","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ccFundBeneficiary","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ccFundPercentile","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"charitiesBeneficiary","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"charitiesPercentile","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"enabled","type":"bool"}],"name":"enableWhitelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"extraBeneficiary","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"extraPercentile","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"beneficiary","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"giveAway","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isWhitelistRequired","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"isWhitelisted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"metaCarbonBeneficiary","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"metaCarbonPercentile","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"email","type":"string"}],"name":"mintToHolder","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"removeFromWhitelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_price","type":"uint256"}],"name":"setBasePrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"account","type":"address"}],"name":"setCCFundBeneficiary","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"account","type":"address"}],"name":"setCarbonOffsetBeneficiary","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"account","type":"address"}],"name":"setCharitiesBeneficiary","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"charities","type":"uint8"},{"internalType":"uint8","name":"carbonOffset","type":"uint8"},{"internalType":"uint8","name":"ccFund","type":"uint8"},{"internalType":"uint8","name":"metaCarbon","type":"uint8"},{"internalType":"uint8","name":"extra","type":"uint8"}],"name":"setDistributionPercentile","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"account","type":"address"}],"name":"setExtraBeneficiary","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxSupply","type":"uint256"}],"name":"setMaxSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"account","type":"address"}],"name":"setMetaCarbonBeneficiary","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"status","type":"bool"}],"name":"setSaleStatus","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":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"}],"name":"transferFromHolder","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"to","type":"address"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
60806040526006805460ff60c81b191690553480156200001e57600080fd5b506040516200315938038062003159833981016040819052620000419162000178565b600180546001600160a01b0319166001600160a01b03831617905562000069600033620000c8565b620000957f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a633620000c8565b620000c17fc240a3dda20910d2c5fb87b5a8871da98e280d1fbc9a603cc0f975750b9a9e7333620000c8565b50620001aa565b620000d48282620000d8565b5050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16620000d4576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055620001343390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000602082840312156200018b57600080fd5b81516001600160a01b0381168114620001a357600080fd5b9392505050565b612f9f80620001ba6000396000f3fe608060405260043610620002a75760003560e01c8063a217fddf1162000163578063d539139311620000c7578063ddd5edb61162000085578063ddd5edb61462000830578063de4b32621462000866578063e32d22f1146200088b578063e43252d714620008ad578063e996b7b714620008d2578063fceecb8714620008f557620002b9565b8063d5391393146200078d578063d547741f14620007b2578063d5abeb0114620007d7578063d897833e14620007ef578063dd2a7be8146200081457620002b9565b8063c19016ec1162000121578063c19016ec14620006c4578063c3cae29d14620006e7578063c709b28e1462000709578063c7876ea4146200072b578063ca8001441462000743578063d42173d7146200076857620002b9565b8063a217fddf1462000641578063a6f2ae3a14620002b9578063a7629a401462000658578063a90fd772146200067d578063a922c3d414620006a257620002b9565b806351cff8d9116200020b5780636f8b44b011620001c95780636f8b44b014620005505780637720aa3514620005755780637f44b53114620005b057806380d1b70914620005d55780638ab1d68114620005f757806391d14854146200061c57620002b9565b806351cff8d9146200048a578063544a3f1214620004af57806359e52ef514620004d45780635a50d7f7146200050a5780636aa633b6146200052d57620002b9565b8063248a9ca31162000265578063248a9ca314620003855780632f2ff15d14620003b957806336568abe14620003de5780633af32abf146200040357806345ea9508146200044057806346e1d41e146200046557620002b9565b806301ffc9a714620002c3578063040b658314620002fd5780630d4a28d614620003225780630fd7f168146200033957806318160ddd146200035e57620002b9565b36620002b957620002b762000918565b005b620002b762000918565b348015620002d057600080fd5b50620002e8620002e236600462002149565b62000b61565b60405190151581526020015b60405180910390f35b3480156200030a57600080fd5b50620002b76200031c36600462002175565b62000b99565b620002b76200033336600462002199565b62000bc9565b3480156200034657600080fd5b50620002b762000358366004620021cc565b62000e63565b3480156200036b57600080fd5b506200037660085481565b604051908152602001620002f4565b3480156200039257600080fd5b5062000376620003a436600462002199565b60009081526020819052604090206001015490565b348015620003c657600080fd5b50620002b7620003d8366004620021ec565b62000ecb565b348015620003eb57600080fd5b50620002b7620003fd366004620021ec565b62000efa565b3480156200041057600080fd5b50620002e862000422366004620021cc565b6001600160a01b03166000908152600b602052604090205460ff1690565b3480156200044d57600080fd5b50620002b76200045f36600462002236565b62000f7c565b3480156200047257600080fd5b50620002b762000484366004620021cc565b62001094565b3480156200049757600080fd5b50620002b7620004a9366004620021cc565b620010fc565b348015620004bc57600080fd5b50620002b7620004ce366004620021cc565b62001116565b348015620004e157600080fd5b50600654620004f790600160b81b900460ff1681565b60405160ff9091168152602001620002f4565b3480156200051757600080fd5b50600654620004f790600160b01b900460ff1681565b3480156200053a57600080fd5b50600654620002e890600160c81b900460ff1681565b3480156200055d57600080fd5b50620002b76200056f36600462002199565b6200117e565b3480156200058257600080fd5b5060055462000597906001600160a01b031681565b6040516001600160a01b039091168152602001620002f4565b348015620005bd57600080fd5b50620002b7620005cf366004620022a6565b62001251565b348015620005e257600080fd5b5060035462000597906001600160a01b031681565b3480156200060457600080fd5b50620002b762000616366004620021cc565b62001419565b3480156200062957600080fd5b50620002e86200063b366004620021ec565b62001481565b3480156200064e57600080fd5b5062000376600081565b3480156200066557600080fd5b50620002b7620006773660046200234e565b620014aa565b3480156200068a57600080fd5b50620002b76200069c366004620021cc565b62001655565b348015620006af57600080fd5b5060015462000597906001600160a01b031681565b348015620006d157600080fd5b50600654620004f790600160a01b900460ff1681565b348015620006f457600080fd5b5060025462000597906001600160a01b031681565b3480156200071657600080fd5b5060045462000597906001600160a01b031681565b3480156200073857600080fd5b506200037660075481565b3480156200075057600080fd5b50620002b762000762366004620023d6565b620016bd565b3480156200077557600080fd5b50620002b762000787366004620021cc565b620017be565b3480156200079a57600080fd5b506200037660008051602062002f4a83398151915281565b348015620007bf57600080fd5b50620002b7620007d1366004620021ec565b62001826565b348015620007e457600080fd5b506200037660095481565b348015620007fc57600080fd5b50620002b76200080e36600462002175565b62001850565b3480156200082157600080fd5b50600a54620002e89060ff1681565b3480156200083d57600080fd5b50620003767fc240a3dda20910d2c5fb87b5a8871da98e280d1fbc9a603cc0f975750b9a9e7381565b3480156200087357600080fd5b50620002b76200088536600462002199565b6200188b565b3480156200089857600080fd5b5060065462000597906001600160a01b031681565b348015620008ba57600080fd5b50620002b7620008cc366004620021cc565b620018fb565b348015620008df57600080fd5b50600654620004f790600160a81b900460ff1681565b3480156200090257600080fd5b50600654620004f790600160c01b900460ff1681565b600654600160c81b900460ff166200096a5760405162461bcd60e51b815260206004820152601060248201526f14d85b19481a5cc8191a5cd8589b195960821b60448201526064015b60405180910390fd5b60095460085410620009bf5760405162461bcd60e51b815260206004820152601f60248201527f546f74616c20537570706c7920697320616c7265616479207265616368656400604482015260640162000961565b600a5460ff168015620009e65750336000908152600b602052604090205460ff1615156001145b80620009f55750600a5460ff16155b62000a145760405162461bcd60e51b8152600401620009619062002405565b60075434101562000a5e5760405162461bcd60e51b8152602060048201526013602482015272139bdd08195b9bdd59da08115512081cd95b9d606a1b604482015260640162000961565b6001546040516340d097c360e01b81523360048201526000916001600160a01b0316906340d097c390602401602060405180830381600087803b15801562000aa557600080fd5b505af115801562000aba573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000ae0919062002462565b60088054919250600062000af48362002492565b919050555060006007543462000b0b9190620024b0565b905062000b1a60075462001985565b801562000b2d5762000b2d338262001d7d565b600754604051839033907ff761777482b4b40d2bcc0d050cfba6829900a2d8b3484bd0244ec0feeb3db50490600090a45050565b60006001600160e01b03198216637965db0b60e01b148062000b9357506301ffc9a760e01b6001600160e01b03198316145b92915050565b60008051602062002f4a83398151915262000bb5813362001e1b565b50600a805460ff1916911515919091179055565b600654600160c81b900460ff1662000c175760405162461bcd60e51b815260206004820152601060248201526f14d85b19481a5cc8191a5cd8589b195960821b604482015260640162000961565b6009548160085462000c2a9190620024ca565b1062000c795760405162461bcd60e51b815260206004820152601f60248201527f546f74616c20537570706c7920697320616c7265616479207265616368656400604482015260640162000961565b600a5460ff16801562000ca05750336000908152600b602052604090205460ff1615156001145b8062000caf5750600a5460ff16155b62000cce5760405162461bcd60e51b8152600401620009619062002405565b6000811162000d115760405162461bcd60e51b815260206004820152600e60248201526d616d6f756e74206973207a65726f60901b604482015260640162000961565b8060075462000d219190620024e5565b34101562000d685760405162461bcd60e51b8152602060048201526013602482015272139bdd08195b9bdd59da08115512081cd95b9d606a1b604482015260640162000961565b60005b8181101562000e0b576001546040516340d097c360e01b81523360048201526001600160a01b03909116906340d097c390602401602060405180830381600087803b15801562000dba57600080fd5b505af115801562000dcf573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000df5919062002462565b508062000e028162002492565b91505062000d6b565b50806008600082825462000e209190620024ca565b9091555062000e3190503462001985565b6040513490829033907f4ed6cb115d9c87bb444f35f59086189ee56e7b3b7450d853cea12904cccb913b90600090a450565b60008051602062002f4a83398151915262000e7f813362001e1b565b6001600160a01b03821662000ea85760405162461bcd60e51b8152600401620009619062002507565b50600280546001600160a01b0319166001600160a01b0392909216919091179055565b60008281526020819052604090206001015462000ee9813362001e1b565b62000ef5838362001e8a565b505050565b6001600160a01b038116331462000f6c5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b606482015260840162000961565b62000f78828262001f12565b5050565b60008051602062002f4a83398151915262000f98813362001e1b565b81838562000fa7888a6200253e565b62000fb391906200253e565b62000fbf91906200253e565b62000fcb91906200253e565b60ff166064146200101f5760405162461bcd60e51b815260206004820152601f60248201527f53756d206f662070657263656e74696c652073686f756c642062652031303000604482015260640162000961565b506006805461ffff60a01b1916600160a01b60ff9788160260ff60a81b191617600160a81b958716959095029490941761ffff60b01b1916600160b01b9386169390930260ff60b81b191692909217600160b81b918516919091021760ff60c01b1916600160c01b9190931602919091179055565b60008051602062002f4a833981519152620010b0813362001e1b565b6001600160a01b038216620010d95760405162461bcd60e51b8152600401620009619062002507565b50600380546001600160a01b0319166001600160a01b0392909216919091179055565b60006200110a813362001e1b565b62000f78824762001d7d565b60008051602062002f4a83398151915262001132813362001e1b565b6001600160a01b0382166200115b5760405162461bcd60e51b8152600401620009619062002507565b50600480546001600160a01b0319166001600160a01b0392909216919091179055565b60008051602062002f4a8339815191526200119a813362001e1b565b600654600160c81b900460ff1615620011e85760405162461bcd60e51b815260206004820152600f60248201526e14d85b19481a5cc8195b98589b1959608a1b604482015260640162000961565b60008211620012465760405162461bcd60e51b815260206004820152602360248201527f6d6178537570706c79206d7573742062652067726561746572207468616e207a60448201526265726f60e81b606482015260840162000961565b506009556000600855565b7fc240a3dda20910d2c5fb87b5a8871da98e280d1fbc9a603cc0f975750b9a9e736200127e813362001e1b565b6040516301a6952360e41b81526001600160a01b038381166004830152841690631a69523090602401600060405180830381600087803b158015620012c257600080fd5b505af1158015620012d7573d6000803e3d6000fd5b50505050826001600160a01b031663820e93f56040518163ffffffff1660e01b815260040160006040518083038186803b1580156200131557600080fd5b505afa1580156200132a573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262001354919081019062002595565b60405162001363919062002615565b6040518091039020836001600160a01b03166317d70f7c6040518163ffffffff1660e01b815260040160206040518083038186803b158015620013a557600080fd5b505afa158015620013ba573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620013e0919062002462565b6040516001600160a01b038516907fcdd185cbb2c1b14c38ac51e5fb133b84e0fbe0e6685f475ed7696078431357b390600090a4505050565b60008051602062002f4a83398151915262001435813362001e1b565b6001600160a01b0382166000818152600b6020526040808220805460ff19169055513392917fd288ab5da2e1f37cf384a1565a3f905ad289b092fbdd31950dbbfef148c04f8891a35050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b7fc240a3dda20910d2c5fb87b5a8871da98e280d1fbc9a603cc0f975750b9a9e73620014d7813362001e1b565b6001546040516000916001600160a01b0316908490620014f7906200213b565b6200150492919062002661565b604051809103906000f08015801562001521573d6000803e3d6000fd5b506001546040516340d097c360e01b81526001600160a01b038084166004830152929350600092909116906340d097c390602401602060405180830381600087803b1580156200157057600080fd5b505af115801562001585573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620015ab919062002462565b9050816001600160a01b03166312424e3f6040518163ffffffff1660e01b8152600401600060405180830381600087803b158015620015e957600080fd5b505af1158015620015fe573d6000803e3d6000fd5b505050508360405162001612919062002615565b6040519081900381209082906001600160a01b038516907f61875f917abfc8bf63539ad00cb9750b61877556badabdf12b69628b17db52aa90600090a450505050565b60008051602062002f4a83398151915262001671813362001e1b565b6001600160a01b0382166200169a5760405162461bcd60e51b8152600401620009619062002507565b50600680546001600160a01b0319166001600160a01b0392909216919091179055565b60008051602062002f4a833981519152620016d9813362001e1b565b60005b82811015620017b8576001546040516340d097c360e01b81526001600160a01b03868116600483015260009216906340d097c390602401602060405180830381600087803b1580156200172e57600080fd5b505af115801562001743573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062001769919062002462565b905080856001600160a01b03167fe08e9d066634006283658128ec91f58d444719d7a07d49f72924da4352ff94ad60405160405180910390a35080620017af8162002492565b915050620016dc565b50505050565b60008051602062002f4a833981519152620017da813362001e1b565b6001600160a01b038216620018035760405162461bcd60e51b8152600401620009619062002507565b50600580546001600160a01b0319166001600160a01b0392909216919091179055565b60008281526020819052604090206001015462001844813362001e1b565b62000ef5838362001f12565b60008051602062002f4a8339815191526200186c813362001e1b565b5060068054911515600160c81b0260ff60c81b19909216919091179055565b60008051602062002f4a833981519152620018a7813362001e1b565b600654600160c81b900460ff1615620018f55760405162461bcd60e51b815260206004820152600f60248201526e14d85b19481a5cc8195b98589b1959608a1b604482015260640162000961565b50600755565b60008051602062002f4a83398151915262001917813362001e1b565b6001600160a01b0382166000908152600b60205260409020805460ff19166001179055620019423390565b6001600160a01b0316826001600160a01b03167f0c4b48e75a1f7ab0a9a2f786b5d6c1f7789020403bff177fb54d46edb89ccc0060405160405180910390a35050565b60065460ff600160c01b8204811691600160b81b8104821691600160b01b8204811691620019c591600160a81b8204811691600160a01b9004166200253e565b620019d191906200253e565b620019dd91906200253e565b620019e991906200253e565b60ff1660641462001a3d5760405162461bcd60e51b815260206004820152601f60248201527f53756d206f662070657263656e74696c652073686f756c642062652031303000604482015260640162000961565b60065460009060649062001a5c90600160a01b900460ff1684620024e5565b62001a6891906200268f565b9050600062001a788284620024b0565b9050811562001af3576002546001600160a01b031662001adb5760405162461bcd60e51b815260206004820152601b60248201527f4368617269746965732077616c6c6574206973206e6f74207365740000000000604482015260640162000961565b60025462001af3906001600160a01b03168362001d7d565b60065460649062001b0f90600160a81b900460ff1685620024e5565b62001b1b91906200268f565b9150811562001ba5576003546001600160a01b031662001b7e5760405162461bcd60e51b815260206004820152601e60248201527f436172626f6e4f66667365742077616c6c6574206973206e6f74207365740000604482015260640162000961565b60035462001b96906001600160a01b03168362001d7d565b62001ba28282620024b0565b90505b60065460649062001bc190600160b01b900460ff1685620024e5565b62001bcd91906200268f565b9150811562001c57576004546001600160a01b031662001c305760405162461bcd60e51b815260206004820152601860248201527f636346756e642077616c6c6574206973206e6f74207365740000000000000000604482015260640162000961565b60045462001c48906001600160a01b03168362001d7d565b62001c548282620024b0565b90505b60065460649062001c7390600160c01b900460ff1685620024e5565b62001c7f91906200268f565b9150811562001d09576006546001600160a01b031662001ce25760405162461bcd60e51b815260206004820152601760248201527f65787472612077616c6c6574206973206e6f7420736574000000000000000000604482015260640162000961565b60065462001cfa906001600160a01b03168362001d7d565b62001d068282620024b0565b90505b801562000ef5576005546001600160a01b031662001d6a5760405162461bcd60e51b815260206004820152601c60248201527f6d657461436172626f6e2077616c6c6574206973206e6f742073657400000000604482015260640162000961565b60055462000ef5906001600160a01b0316825b6000826001600160a01b03168260405160006040518083038185875af1925050503d806000811462001dcc576040519150601f19603f3d011682016040523d82523d6000602084013e62001dd1565b606091505b505090508062000ef55760405162461bcd60e51b81526020600482015260146024820152732330b4b632b2103a379039b2b7321022ba3432b960611b604482015260640162000961565b62001e27828262001481565b62000f785762001e42816001600160a01b0316601462001f7a565b62001e4f83602062001f7a565b60405160200162001e62929190620026b2565b60408051601f198184030181529082905262461bcd60e51b825262000961916004016200272b565b62001e96828262001481565b62000f78576000828152602081815260408083206001600160a01b03851684529091529020805460ff1916600117905562001ece3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b62001f1e828262001481565b1562000f78576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6060600062001f8b836002620024e5565b62001f98906002620024ca565b67ffffffffffffffff81111562001fb35762001fb3620022d9565b6040519080825280601f01601f19166020018201604052801562001fde576020820181803683370190505b509050600360fc1b8160008151811062001ffc5762001ffc62002740565b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106200202e576200202e62002740565b60200101906001600160f81b031916908160001a905350600062002054846002620024e5565b62002061906001620024ca565b90505b6001811115620020e3576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811062002099576200209962002740565b1a60f81b828281518110620020b257620020b262002740565b60200101906001600160f81b031916908160001a90535060049490941c93620020db8162002756565b905062002064565b508315620021345760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640162000961565b9392505050565b6107d9806200277183390190565b6000602082840312156200215c57600080fd5b81356001600160e01b0319811681146200213457600080fd5b6000602082840312156200218857600080fd5b813580151581146200213457600080fd5b600060208284031215620021ac57600080fd5b5035919050565b6001600160a01b0381168114620021c957600080fd5b50565b600060208284031215620021df57600080fd5b81356200213481620021b3565b600080604083850312156200220057600080fd5b8235915060208301356200221481620021b3565b809150509250929050565b803560ff811681146200223157600080fd5b919050565b600080600080600060a086880312156200224f57600080fd5b6200225a866200221f565b94506200226a602087016200221f565b93506200227a604087016200221f565b92506200228a606087016200221f565b91506200229a608087016200221f565b90509295509295909350565b60008060408385031215620022ba57600080fd5b8235620022c781620021b3565b915060208301356200221481620021b3565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff811182821017156200231b576200231b620022d9565b604052919050565b600067ffffffffffffffff821115620023405762002340620022d9565b50601f01601f191660200190565b6000602082840312156200236157600080fd5b813567ffffffffffffffff8111156200237957600080fd5b8201601f810184136200238b57600080fd5b8035620023a26200239c8262002323565b620022ef565b818152856020838501011115620023b857600080fd5b81602084016020830137600091810160200191909152949350505050565b60008060408385031215620023ea57600080fd5b8235620023f781620021b3565b946020939093013593505050565b60208082526039908201527f77686974656c6973742069732072657175697265642c2073656e646572206d7560408201527f737420626520616464656420696e202077686974656c69737400000000000000606082015260800190565b6000602082840312156200247557600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b6000600019821415620024a957620024a96200247c565b5060010190565b600082821015620024c557620024c56200247c565b500390565b60008219821115620024e057620024e06200247c565b500190565b60008160001904831182151516156200250257620025026200247c565b500290565b6020808252601b908201527f7a65726f20616464726573732063616e6e6f7420626520757365640000000000604082015260600190565b600060ff821660ff84168060ff038211156200255e576200255e6200247c565b019392505050565b60005b838110156200258357818101518382015260200162002569565b83811115620017b85750506000910152565b600060208284031215620025a857600080fd5b815167ffffffffffffffff811115620025c057600080fd5b8201601f81018413620025d257600080fd5b8051620025e36200239c8262002323565b818152856020838501011115620025f957600080fd5b6200260c82602083016020860162002566565b95945050505050565b600082516200262981846020870162002566565b9190910192915050565b600081518084526200264d81602086016020860162002566565b601f01601f19169290920160200192915050565b6001600160a01b0383168152604060208201819052600090620026879083018462002633565b949350505050565b600082620026ad57634e487b7160e01b600052601260045260246000fd5b500490565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351620026ec81601785016020880162002566565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516200271f81602884016020880162002566565b01602801949350505050565b60208152600062002134602083018462002633565b634e487b7160e01b600052603260045260246000fd5b6000816200276857620027686200247c565b50600019019056fe608060405234801561001057600080fd5b506040516107d93803806107d983398101604081905261002f91610122565b600180546001600160a01b0384166001600160a01b0319918216179091556000805490911633179055805161006b906002906020840190610073565b50505061024f565b82805461007f90610214565b90600052602060002090601f0160209004810192826100a157600085556100e7565b82601f106100ba57805160ff19168380011785556100e7565b828001600101855582156100e7579182015b828111156100e75782518255916020019190600101906100cc565b506100f39291506100f7565b5090565b5b808211156100f357600081556001016100f8565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561013557600080fd5b82516001600160a01b038116811461014c57600080fd5b602084810151919350906001600160401b038082111561016b57600080fd5b818601915086601f83011261017f57600080fd5b8151818111156101915761019161010c565b604051601f8201601f19908116603f011681019083821181831017156101b9576101b961010c565b8160405282815289868487010111156101d157600080fd5b600093505b828410156101f357848401860151818501870152928501926101d6565b828411156102045760008684830101525b8096505050505050509250929050565b600181811c9082168061022857607f821691505b6020821081141561024957634e487b7160e01b600052602260045260246000fd5b50919050565b61057b8061025e6000396000f3fe608060405234801561001057600080fd5b506004361061007d5760003560e01c80631a6952301161005b5780631a695230146100d457806346c9fdf7146100e7578063820e93f5146101125780639c1e03a01461012757600080fd5b806312424e3f14610082578063150b7a021461008c57806317d70f7c146100bd575b600080fd5b61008a61013a565b005b61009f61009a3660046103a5565b6101db565b6040516001600160e01b031990911681526020015b60405180910390f35b6100c660035481565b6040519081526020016100b4565b61008a6100e2366004610440565b61025f565b6001546100fa906001600160a01b031681565b6040516001600160a01b0390911681526020016100b4565b61011a6102fb565b6040516100b49190610462565b6000546100fa906001600160a01b031681565b6000546001600160a01b0316331461016d5760405162461bcd60e51b8152600401610164906104b7565b60405180910390fd5b60015460005460035460405163095ea7b360e01b81526001600160a01b039283166004820152602481019190915291169063095ea7b390604401600060405180830381600087803b1580156101c157600080fd5b505af11580156101d5573d6000803e3d6000fd5b50505050565b600080546001600160a01b0387811691161461024b5760405162461bcd60e51b815260206004820152602960248201527f4f6e6c792061636365707420436172626f6e204372656174757265204e46542060448201526843726f776473616c6560b81b6064820152608401610164565b50505060035550630a85bd0160e11b919050565b6000546001600160a01b031633146102895760405162461bcd60e51b8152600401610164906104b7565b600154600354604051632142170760e11b81523060048201526001600160a01b03848116602483015260448201929092529116906342842e0e90606401600060405180830381600087803b1580156102e057600080fd5b505af11580156102f4573d6000803e3d6000fd5b5050505050565b600280546103089061050a565b80601f01602080910402602001604051908101604052809291908181526020018280546103349061050a565b80156103815780601f1061035657610100808354040283529160200191610381565b820191906000526020600020905b81548152906001019060200180831161036457829003601f168201915b505050505081565b80356001600160a01b03811681146103a057600080fd5b919050565b6000806000806000608086880312156103bd57600080fd5b6103c686610389565b94506103d460208701610389565b935060408601359250606086013567ffffffffffffffff808211156103f857600080fd5b818801915088601f83011261040c57600080fd5b81358181111561041b57600080fd5b89602082850101111561042d57600080fd5b9699959850939650602001949392505050565b60006020828403121561045257600080fd5b61045b82610389565b9392505050565b600060208083528351808285015260005b8181101561048f57858101830151858201604001528201610473565b818111156104a1576000604083870101525b50601f01601f1916929092016040019392505050565b60208082526033908201527f4f6e6c7920436172626f6e2043726561747572652043726f776473616c6520636040820152726f6e74726163742063616e206578656375746560681b606082015260800190565b600181811c9082168061051e57607f821691505b6020821081141561053f57634e487b7160e01b600052602260045260246000fd5b5091905056fea264697066735822122098d70913680eba26fb4a9b04a7b11bb5c0f550fed617195afac1ca3a3f573b6664736f6c634300080900339f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6a2646970667358221220e48aff96ec8cf2450d98f0b14a3d4de21a04ce9fa74209aa50f47b6bf423723564736f6c63430008090033000000000000000000000000983086e89e8ba6cd4a285f735b8fc5ae206fc334
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000983086e89e8ba6cd4a285f735b8fc5ae206fc334
-----Decoded View---------------
Arg [0] : nftAddress (address): 0x983086e89e8ba6cd4a285f735b8fc5ae206fc334
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000983086e89e8ba6cd4a285f735b8fc5ae206fc334
Age | Block | Fee Address | BC Fee Address | Voting Power | Jailed | Incoming |
---|
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.