Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00Latest 25 from a total of 52 transactions
| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Withdraw | 14305327 | 1474 days ago | IN | 0 ETH | 0.00769602 | ||||
| Buy | 14071529 | 1511 days ago | IN | 0.105 ETH | 0.0211528 | ||||
| Buy | 14047182 | 1514 days ago | IN | 0.105 ETH | 0.03456425 | ||||
| Buy | 14043993 | 1515 days ago | IN | 0.035 ETH | 0.01991751 | ||||
| Buy | 14042990 | 1515 days ago | IN | 0.07 ETH | 0.01644915 | ||||
| Buy | 14042086 | 1515 days ago | IN | 0.07 ETH | 0.0181531 | ||||
| Buy | 14041425 | 1515 days ago | IN | 0.07 ETH | 0.01869655 | ||||
| Buy | 14041403 | 1515 days ago | IN | 0.35 ETH | 0.05392734 | ||||
| Gift | 14035516 | 1516 days ago | IN | 0 ETH | 0.09751771 | ||||
| Gift | 14035069 | 1516 days ago | IN | 0 ETH | 0.05239326 | ||||
| Buy | 14029606 | 1517 days ago | IN | 0.105 ETH | 0.02042037 | ||||
| Buy | 14029101 | 1517 days ago | IN | 0.07 ETH | 0.02793202 | ||||
| Buy | 14028910 | 1517 days ago | IN | 0.07 ETH | 0.01647157 | ||||
| Buy | 14028910 | 1517 days ago | IN | 0.035 ETH | 0.013414 | ||||
| Buy | 14028156 | 1517 days ago | IN | 0.035 ETH | 0.0172238 | ||||
| Buy | 14027821 | 1517 days ago | IN | 0.035 ETH | 0.01613446 | ||||
| Buy | 14027734 | 1517 days ago | IN | 0.07 ETH | 0.01911666 | ||||
| Buy | 14026957 | 1517 days ago | IN | 0.105 ETH | 0.02708882 | ||||
| Buy | 14026731 | 1517 days ago | IN | 0.14 ETH | 0.03582078 | ||||
| Buy | 14026712 | 1517 days ago | IN | 0.175 ETH | 0.03527018 | ||||
| Buy | 14026701 | 1517 days ago | IN | 0.35 ETH | 0.05714418 | ||||
| Buy | 14026522 | 1517 days ago | IN | 0.14 ETH | 0.03501945 | ||||
| Buy | 14026413 | 1517 days ago | IN | 0.105 ETH | 0.02571647 | ||||
| Buy | 14025978 | 1518 days ago | IN | 0.105 ETH | 0.03179701 | ||||
| Buy | 14025386 | 1518 days ago | IN | 0.105 ETH | 0.05143699 |
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
SlimeSale
Compiler Version
v0.8.4+commit.c7e474f2
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.0;
import "./SlimeStore.sol";
contract SlimeSale is SlimeStore {
uint256 public constant _PRICE = 0.035 ether;
address[] artists= [0x98DF27017715583caC388E87bfDf084Fd5B43E41];
uint256 public constant _WITHDRAW_RATE=60;
uint public constant _MAX_MINT=6666;
constructor(address _producer) SlimeStore(_producer) {}
function getPrice() internal pure override returns (uint256) {
return _PRICE;
}
function getArtistAddresses()
internal
view
override
returns (address[] memory)
{
return artists;
}
function getWithdrawRate() internal pure override returns (uint256){
return _WITHDRAW_RATE;
}
function getMaxMint() internal pure override returns (uint256){
return _MAX_MINT;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "./SlimeProducer.sol";
abstract contract SlimeStore is Ownable {
using Strings for uint256;
using SafeMath for uint256;
using ECDSA for bytes32;
address private _signer_address;
SlimeProducer private _slime_producer;
mapping(string => bool) private _usedNonces;
address[] private _founderAddresses = [
0x97081ceB16f5Af465122e87b8FA39ab8BCeB5A94,
0x15Ed267ad25527DF43CAD5669f84Db5a584d0C40,
0x6B42eECb761DDc75aaFF2B3EcA75052caD4db299,
0x84f3978072f139f4887983aB70E3CEeF14Df356C
];
uint256 public totalMinted;
bool public saleLive=true;
constructor(address producer) {
_slime_producer = SlimeProducer(producer);
}
function getProducer() internal view returns (SlimeProducer) {
return _slime_producer;
}
function getPrice() internal pure virtual returns (uint256);
function getArtistAddresses() internal view virtual returns (address[] memory);
function getWithdrawRate() internal pure virtual returns (uint256);
function getMaxMint() internal pure virtual returns (uint256);
function setSignerAddress(address addr) external onlyOwner {
_signer_address = addr;
}
function getSignerAddress() public view returns (address) {
return _signer_address;
}
function safeMint(address to, uint256 qty) internal {
SlimeProducer producer = getProducer();
require(
totalMinted.add(qty) < producer.maxSupply(),
"exceeds maximum supply"
);
totalMinted = totalMinted + qty;
for (uint256 i = 0; i < qty; i++) {
producer.proxyMint(to);
}
}
function hashTransaction(
address sender,
uint256 qty,
string memory nonce
) private pure returns (bytes32) {
bytes32 hash = keccak256(
abi.encodePacked(
"\x19Ethereum Signed Message:\n32",
keccak256(abi.encodePacked(sender, qty, nonce))
)
);
return hash;
}
function buy(
bytes32 hash,
bytes memory signature,
string memory nonce,
uint256 tokenQuantity
) external payable {
require(saleLive, "Sale Not Active");
require(getSignerAddress() != address(0x0), "Signer Not Yet Set");
require(
getSignerAddress() == hash.recover(signature),
"Direct Minting Disallowed"
);
require(!_usedNonces[nonce], "Invalid Nonce");
require(
hashTransaction(msg.sender, tokenQuantity, nonce) == hash,
"Signature Failed"
);
require(totalMinted.add(tokenQuantity) < getMaxMint(), "Out of Stock");
require(
getPrice().mul(tokenQuantity) <= msg.value,
"Insufficient Funds"
);
_usedNonces[nonce] = true;
safeMint(msg.sender, tokenQuantity);
}
function gift(address[] calldata receivers, uint256 tokenQuantity) external onlyOwner {
require(totalMinted.add(tokenQuantity.mul(receivers.length)) <= getMaxMint(), "Out of Stock");
for (uint256 i = 0; i < receivers.length; i++) {
safeMint(receivers[i], tokenQuantity);
}
}
function withdraw() external onlyOwner {
address[] memory artists = getArtistAddresses();
uint256 share= address(this).balance.mul(getWithdrawRate()).div(100).div(_founderAddresses.length +artists.length);
for (uint i = 0; i < _founderAddresses.length; i++) {
payable(_founderAddresses[i]).transfer(share);
}
for (uint i = 0; i < artists.length; i++) {
payable(artists[i]).transfer(share);
}
//in case of remainder, sent to owner
if (address(this).balance>0){
payable(msg.sender).transfer(address(this).balance);
}
}
function toggleSaleStatus() external onlyOwner {
saleLive = !saleLive;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
/*===== Opensea related definitions =====*/
contract OwnableDelegateProxy {}
/**
* Used to delegate ownership of a contract to another address, to save on unneeded transactions to approve contract use for users
*/
contract ProxyRegistry {
mapping(address => OwnableDelegateProxy) public proxies;
}
abstract contract SlimeProducer is
ERC721,
ERC721Burnable,
Ownable
{
using Strings for uint256;
using Counters for Counters.Counter;
/* ===== Opensea related variables ===== */
address public proxyRegistryAddress=0xa5409ec958C83C3f309868babACA7c86DCB077c1;
bool public openseaActive = true;
Counters.Counter private _tokenIdCounter;
/*===== Minting related variables=====*/
mapping(address => bool) public proxyMinters;
mapping(uint256 => uint256) public mintTimes;
/*===== URI related variables=====*/
/* since we will be uploading to ipfs and revealing in batches,
we need different baseURI for different token id ranges */
struct RangedURI {
uint256 lastId;
string uri;
}
RangedURI[] public _rangedURIs;
/* before we reveal, we will be storing the metadata on a temporary server, which will be defined here */
string public defaultBaseURI ="https://www.goopyslimes.online/metadata/";
/* track the last revealed tokenId so everything after it will use default Base URI */
uint256 public lastRevealedId;
constructor(
string memory name,
string memory symbol
) ERC721(name, symbol) {
_tokenIdCounter.increment();
}
/*====== Owner only functions ====== */
function setOpenseaActive(bool active) external onlyOwner {
openseaActive=active;
}
function setProxyMinter(address contractAddr, bool enabled)
external
onlyOwner
{
proxyMinters[contractAddr] = enabled;
}
function addRangeURI(uint256 lastId, string memory uri) external onlyOwner {
require(lastId <= totalSupply(),"Id Range exceeded");
require(lastId > lastRevealedId, "Range URI already Set");
lastRevealedId = lastId;
_rangedURIs.push(RangedURI(lastId, uri));
}
function removeLastRangeURI() external onlyOwner {
require( _rangedURIs.length >0, "No Range URI Set");
_rangedURIs.pop();
if (_rangedURIs.length>0){
lastRevealedId=_rangedURIs[_rangedURIs.length].lastId;
} else {
lastRevealedId=0;
}
}
function setDefaultBaseURI(string memory baseURI) external onlyOwner {
defaultBaseURI = baseURI;
}
/*===== URI generation ====== */
function _baseURI(uint256 tokenId)
internal
view
virtual
returns (string memory)
{
require(_exists(tokenId), "Non Existing TokenId");
if (tokenId > lastRevealedId) return defaultBaseURI;
for (uint256 i = 0; i < _rangedURIs.length; i++) {
if (tokenId <= _rangedURIs[i].lastId) {
return _rangedURIs[i].uri;
}
}
/* impossible case, added for completeness */
return "";
}
function totalSupply() public view returns (uint256) {
return _tokenIdCounter.current()-1;
}
function tokensOwned(address owner) public view returns (uint256[] memory tokenIds){
uint256 bal = balanceOf(owner);
uint256[] memory ids = new uint256[](bal);
uint256 idx=0;
for (uint256 i=1;i<=totalSupply();i++){
if (ownerOf(i)==owner){
ids[idx++]=i;
}
}
return ids;
}
function tokenURI(uint256 tokenId)
public
view
override
returns (string memory)
{
return string(abi.encodePacked(_baseURI(tokenId), tokenId.toString()));
}
/*===== Minting related functions =====*/
/* only allow proxy minters to mint and ensure the max supply is not exceeded if defined */
function proxyMint(address to) external returns (uint256) {
require(proxyMinters[msg.sender] == true, "Unauthorized Minting");
require(
this.maxSupply() == 0 || totalSupply() < this.maxSupply(),
"Max supply exceeded"
);
uint256 tokenId=_tokenIdCounter.current();
_safeMint(to,tokenId );
_tokenIdCounter.increment();
mintTimes[tokenId] = block.timestamp;
return tokenId;
}
/* tracking of minting time for reward computation purposes */
function getCreationTime(uint256 tokenId) public view returns (uint256) {
require(_exists(tokenId), "Non Existing Token");
return mintTimes[tokenId];
}
/**
* 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)
{
// Whitelist OpenSea proxy contract for easy trading.
ProxyRegistry proxyRegistry = ProxyRegistry(proxyRegistryAddress);
if (openseaActive && address(proxyRegistry.proxies(owner)) == operator) {
return true;
}
return super.isApprovedForAll(owner, operator);
}
/*===== virtual function =====*/
function maxSupply() external pure virtual returns (uint256);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev 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 {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/cryptography/ECDSA.sol)
pragma solidity ^0.8.0;
import "../Strings.sol";
/**
* @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
*
* These functions can be used to verify that a message was signed by the holder
* of the private keys of a given address.
*/
library ECDSA {
enum RecoverError {
NoError,
InvalidSignature,
InvalidSignatureLength,
InvalidSignatureS,
InvalidSignatureV
}
function _throwError(RecoverError error) private pure {
if (error == RecoverError.NoError) {
return; // no error: do nothing
} else if (error == RecoverError.InvalidSignature) {
revert("ECDSA: invalid signature");
} else if (error == RecoverError.InvalidSignatureLength) {
revert("ECDSA: invalid signature length");
} else if (error == RecoverError.InvalidSignatureS) {
revert("ECDSA: invalid signature 's' value");
} else if (error == RecoverError.InvalidSignatureV) {
revert("ECDSA: invalid signature 'v' value");
}
}
/**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature` or error string. This address can then be used for verification purposes.
*
* The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
* this function rejects them by requiring the `s` value to be in the lower
* half order, and the `v` value to be either 27 or 28.
*
* IMPORTANT: `hash` _must_ be the result of a hash operation for the
* verification to be secure: it is possible to craft signatures that
* recover to arbitrary addresses for non-hashed data. A safe way to ensure
* this is by receiving a hash of the original message (which may otherwise
* be too long), and then calling {toEthSignedMessageHash} on it.
*
* Documentation for signature generation:
* - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
* - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
*
* _Available since v4.3._
*/
function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
// Check the signature length
// - case 65: r,s,v signature (standard)
// - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._
if (signature.length == 65) {
bytes32 r;
bytes32 s;
uint8 v;
// ecrecover takes the signature parameters, and the only way to get them
// currently is to use assembly.
assembly {
r := mload(add(signature, 0x20))
s := mload(add(signature, 0x40))
v := byte(0, mload(add(signature, 0x60)))
}
return tryRecover(hash, v, r, s);
} else if (signature.length == 64) {
bytes32 r;
bytes32 vs;
// ecrecover takes the signature parameters, and the only way to get them
// currently is to use assembly.
assembly {
r := mload(add(signature, 0x20))
vs := mload(add(signature, 0x40))
}
return tryRecover(hash, r, vs);
} else {
return (address(0), RecoverError.InvalidSignatureLength);
}
}
/**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature`. This address can then be used for verification purposes.
*
* The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
* this function rejects them by requiring the `s` value to be in the lower
* half order, and the `v` value to be either 27 or 28.
*
* IMPORTANT: `hash` _must_ be the result of a hash operation for the
* verification to be secure: it is possible to craft signatures that
* recover to arbitrary addresses for non-hashed data. A safe way to ensure
* this is by receiving a hash of the original message (which may otherwise
* be too long), and then calling {toEthSignedMessageHash} on it.
*/
function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
(address recovered, RecoverError error) = tryRecover(hash, signature);
_throwError(error);
return recovered;
}
/**
* @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
*
* See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
*
* _Available since v4.3._
*/
function tryRecover(
bytes32 hash,
bytes32 r,
bytes32 vs
) internal pure returns (address, RecoverError) {
bytes32 s;
uint8 v;
assembly {
s := and(vs, 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff)
v := add(shr(255, vs), 27)
}
return tryRecover(hash, v, r, s);
}
/**
* @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
*
* _Available since v4.2._
*/
function recover(
bytes32 hash,
bytes32 r,
bytes32 vs
) internal pure returns (address) {
(address recovered, RecoverError error) = tryRecover(hash, r, vs);
_throwError(error);
return recovered;
}
/**
* @dev Overload of {ECDSA-tryRecover} that receives the `v`,
* `r` and `s` signature fields separately.
*
* _Available since v4.3._
*/
function tryRecover(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
) internal pure returns (address, RecoverError) {
// EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
// unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
// the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most
// signatures from current libraries generate a unique signature with an s-value in the lower half order.
//
// If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
// with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
// vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
// these malleable signatures as well.
if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
return (address(0), RecoverError.InvalidSignatureS);
}
if (v != 27 && v != 28) {
return (address(0), RecoverError.InvalidSignatureV);
}
// If the signature is valid (and not malleable), return the signer address
address signer = ecrecover(hash, v, r, s);
if (signer == address(0)) {
return (address(0), RecoverError.InvalidSignature);
}
return (signer, RecoverError.NoError);
}
/**
* @dev Overload of {ECDSA-recover} that receives the `v`,
* `r` and `s` signature fields separately.
*/
function recover(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
) internal pure returns (address) {
(address recovered, RecoverError error) = tryRecover(hash, v, r, s);
_throwError(error);
return recovered;
}
/**
* @dev Returns an Ethereum Signed Message, created from a `hash`. This
* produces hash corresponding to the one signed with the
* https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
* JSON-RPC method as part of EIP-191.
*
* See {recover}.
*/
function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
// 32 is the length in bytes of hash,
// enforced by the type signature above
return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
}
/**
* @dev Returns an Ethereum Signed Message, created from `s`. This
* produces hash corresponding to the one signed with the
* https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
* JSON-RPC method as part of EIP-191.
*
* See {recover}.
*/
function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {
return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s));
}
/**
* @dev Returns an Ethereum Signed Typed Data, created from a
* `domainSeparator` and a `structHash`. This produces hash corresponding
* to the one signed with the
* https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]
* JSON-RPC method as part of EIP-712.
*
* See {recover}.
*/
function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {
return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)
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);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/math/SafeMath.sol)
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 generally not needed starting with Solidity 0.8, since 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
// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)
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
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/ERC721Burnable.sol)
pragma solidity ^0.8.0;
import "../ERC721.sol";
import "../../../utils/Context.sol";
/**
* @title ERC721 Burnable Token
* @dev ERC721 Token that can be irreversibly burned (destroyed).
*/
abstract contract ERC721Burnable is Context, ERC721 {
/**
* @dev Burns `tokenId`. See {ERC721-_burn}.
*
* Requirements:
*
* - The caller must own `tokenId` or be an approved operator.
*/
function burn(uint256 tokenId) public virtual {
//solhint-disable-next-line max-line-length
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721Burnable: caller is not owner nor approved");
_burn(tokenId);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/ERC721.sol)
pragma solidity ^0.8.0;
import "./IERC721.sol";
import "./IERC721Receiver.sol";
import "./extensions/IERC721Metadata.sol";
import "../../utils/Address.sol";
import "../../utils/Context.sol";
import "../../utils/Strings.sol";
import "../../utils/introspection/ERC165.sol";
/**
* @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
* the Metadata extension, but not including the Enumerable extension, which is available separately as
* {ERC721Enumerable}.
*/
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
using Strings for uint256;
// Token name
string private _name;
// Token symbol
string private _symbol;
// Mapping from token ID to owner address
mapping(uint256 => address) private _owners;
// Mapping owner address to token count
mapping(address => uint256) private _balances;
// Mapping from token ID to approved address
mapping(uint256 => address) private _tokenApprovals;
// Mapping from owner to operator approvals
mapping(address => mapping(address => bool)) private _operatorApprovals;
/**
* @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
*/
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
return
interfaceId == type(IERC721).interfaceId ||
interfaceId == type(IERC721Metadata).interfaceId ||
super.supportsInterface(interfaceId);
}
/**
* @dev See {IERC721-balanceOf}.
*/
function balanceOf(address owner) public view virtual override returns (uint256) {
require(owner != address(0), "ERC721: 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 {
_setApprovalForAll(_msgSender(), operator, approved);
}
/**
* @dev See {IERC721-isApprovedForAll}.
*/
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
return _operatorApprovals[owner][operator];
}
/**
* @dev See {IERC721-transferFrom}.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
//solhint-disable-next-line max-line-length
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: 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 Approve `operator` to operate on all of `owner` tokens
*
* Emits a {ApprovalForAll} event.
*/
function _setApprovalForAll(
address owner,
address operator,
bool approved
) internal virtual {
require(owner != operator, "ERC721: approve to caller");
_operatorApprovals[owner][operator] = approved;
emit ApprovalForAll(owner, operator, approved);
}
/**
* @dev 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
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)
pragma solidity ^0.8.0;
import "./IERC165.sol";
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Address.sol)
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
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)
pragma solidity ^0.8.0;
import "../IERC721.sol";
/**
* @title ERC-721 Non-Fungible Token Standard, optional metadata extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Metadata is IERC721 {
/**
* @dev Returns the token collection name.
*/
function name() external view returns (string memory);
/**
* @dev Returns the token collection symbol.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
*/
function tokenURI(uint256 tokenId) external view returns (string memory);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721Receiver.sol)
pragma solidity ^0.8.0;
/**
* @title ERC721 token receiver interface
* @dev Interface for any contract that wants to support safeTransfers
* from ERC721 asset contracts.
*/
interface IERC721Receiver {
/**
* @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
* by `operator` from `from`, this function is called.
*
* It must return its Solidity selector to confirm the token transfer.
* If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
*
* The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`.
*/
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721.sol)
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721 is IERC165 {
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, 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
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}{
"optimizer": {
"enabled": true,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_producer","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"_MAX_MINT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_PRICE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_WITHDRAW_RATE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"hash","type":"bytes32"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"string","name":"nonce","type":"string"},{"internalType":"uint256","name":"tokenQuantity","type":"uint256"}],"name":"buy","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"getSignerAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"receivers","type":"address[]"},{"internalType":"uint256","name":"tokenQuantity","type":"uint256"}],"name":"gift","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"saleLive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"setSignerAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"toggleSaleStatus","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"totalMinted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
6101006040527397081ceb16f5af465122e87b8fa39ab8bceb5a9460809081527315ed267ad25527df43cad5669f84db5a584d0c4060a052736b42eecb761ddc75aaff2b3eca75052cad4db29960c0527384f3978072f139f4887983ab70e3ceef14df356c60e0526200007690600490816200016c565b506006805460ff1916600190811790915560408051602081019091527398df27017715583cac388e87bfdf084fd5b43e418152620000b891600791906200016c565b50348015620000c657600080fd5b506040516200151038038062001510833981016040819052620000e991620001ed565b80620000f5336200011c565b600280546001600160a01b0319166001600160a01b0392909216919091179055506200021d565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b828054828255906000526020600020908101928215620001c4579160200282015b82811115620001c457825182546001600160a01b0319166001600160a01b039091161782556020909201916001909101906200018d565b50620001d2929150620001d6565b5090565b5b80821115620001d25760008155600101620001d7565b600060208284031215620001ff578081fd5b81516001600160a01b038116811462000216578182fd5b9392505050565b6112e3806200022d6000396000f3fe6080604052600436106100dd5760003560e01c80639ec70f191161007f578063e081b78111610059578063e081b78114610204578063eeda5f8c1461022e578063f2fde38b14610244578063fc96f3601461026457600080fd5b80639ec70f19146101bb578063a2309ff8146101ce578063c0f4af70146101e457600080fd5b80633ccfd60b116100bb5780633ccfd60b14610150578063715018a6146101655780637c39ea7b1461017a5780638da5cb5b1461019d57600080fd5b8063046dc166146100e2578063049c5c49146101045780631a296e0214610119575b600080fd5b3480156100ee57600080fd5b506101026100fd366004611012565b61027f565b005b34801561011057600080fd5b506101026102d4565b34801561012557600080fd5b506001546001600160a01b03165b6040516001600160a01b0390911681526020015b60405180910390f35b34801561015c57600080fd5b50610102610312565b34801561017157600080fd5b506101026104ae565b34801561018657600080fd5b5061018f603c81565b604051908152602001610147565b3480156101a957600080fd5b506000546001600160a01b0316610133565b6101026101c93660046110af565b6104e4565b3480156101da57600080fd5b5061018f60055481565b3480156101f057600080fd5b506101026101ff366004611039565b610792565b34801561021057600080fd5b5060065461021e9060ff1681565b6040519015158152602001610147565b34801561023a57600080fd5b5061018f611a0a81565b34801561025057600080fd5b5061010261025f366004611012565b61086d565b34801561027057600080fd5b5061018f667c58508723800081565b6000546001600160a01b031633146102b25760405162461bcd60e51b81526004016102a9906111da565b60405180910390fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146102fe5760405162461bcd60e51b81526004016102a9906111da565b6006805460ff19811660ff90911615179055565b6000546001600160a01b0316331461033c5760405162461bcd60e51b81526004016102a9906111da565b6000610346610908565b80516004549192506000916103729161035e9161120f565b61036c60648147603c61096a565b9061097d565b905060005b6004548110156103f557600481815481106103a257634e487b7160e01b600052603260045260246000fd5b60009182526020822001546040516001600160a01b039091169184156108fc02918591818181858888f193505050501580156103e2573d6000803e3d6000fd5b50806103ed81611266565b915050610377565b5060005b82518110156104755782818151811061042257634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b03166108fc839081150290604051600060405180830381858888f19350505050158015610462573d6000803e3d6000fd5b508061046d81611266565b9150506103f9565b5047156104aa5760405133904780156108fc02916000818181858888f193505050501580156104a8573d6000803e3d6000fd5b505b5050565b6000546001600160a01b031633146104d85760405162461bcd60e51b81526004016102a9906111da565b6104e26000610989565b565b60065460ff166105285760405162461bcd60e51b815260206004820152600f60248201526e53616c65204e6f742041637469766560881b60448201526064016102a9565b600061053c6001546001600160a01b031690565b6001600160a01b031614156105885760405162461bcd60e51b815260206004820152601260248201527114da59db995c88139bdd0816595d0814d95d60721b60448201526064016102a9565b61059284846109d9565b6001600160a01b03166105ad6001546001600160a01b031690565b6001600160a01b0316146106035760405162461bcd60e51b815260206004820152601960248201527f446972656374204d696e74696e6720446973616c6c6f7765640000000000000060448201526064016102a9565b60038260405161061391906111ce565b9081526040519081900360200190205460ff16156106635760405162461bcd60e51b815260206004820152600d60248201526c496e76616c6964204e6f6e636560981b60448201526064016102a9565b8361066f3383856109fd565b146106af5760405162461bcd60e51b815260206004820152601060248201526f14da59db985d1d5c994811985a5b195960821b60448201526064016102a9565b611a0a6005546106bf9083610a7f565b106106fb5760405162461bcd60e51b815260206004820152600c60248201526b4f7574206f662053746f636b60a01b60448201526064016102a9565b3461070d667c5850872380008361096a565b11156107505760405162461bcd60e51b8152602060048201526012602482015271496e73756666696369656e742046756e647360701b60448201526064016102a9565b600160038360405161076291906111ce565b908152604051908190036020019020805491151560ff1990921691909117905561078c3382610a8b565b50505050565b6000546001600160a01b031633146107bc5760405162461bcd60e51b81526004016102a9906111da565b611a0a6107d56107cc838561096a565b60055490610a7f565b11156108125760405162461bcd60e51b815260206004820152600c60248201526b4f7574206f662053746f636b60a01b60448201526064016102a9565b60005b8281101561078c5761085b84848381811061084057634e487b7160e01b600052603260045260246000fd5b90506020020160208101906108559190611012565b83610a8b565b8061086581611266565b915050610815565b6000546001600160a01b031633146108975760405162461bcd60e51b81526004016102a9906111da565b6001600160a01b0381166108fc5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016102a9565b61090581610989565b50565b6060600780548060200260200160405190810160405280929190818152602001828054801561096057602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610942575b5050505050905090565b60006109768284611247565b9392505050565b60006109768284611227565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60008060006109e88585610c0f565b915091506109f581610c7f565b509392505050565b600080848484604051602001610a159392919061119b565b60408051601f198184030181529082905280516020918201207f19457468657265756d205369676e6564204d6573736167653a0a33320000000091830191909152603c820152605c0160408051808303601f19018152919052805160209091012095945050505050565b6000610976828461120f565b6000610a9f6002546001600160a01b031690565b9050806001600160a01b031663d5abeb016040518163ffffffff1660e01b815260040160206040518083038186803b158015610ada57600080fd5b505afa158015610aee573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b12919061114a565b600554610b1f9084610a7f565b10610b655760405162461bcd60e51b815260206004820152601660248201527565786365656473206d6178696d756d20737570706c7960501b60448201526064016102a9565b81600554610b73919061120f565b60055560005b8281101561078c5760405163dd47a6f760e01b81526001600160a01b03858116600483015283169063dd47a6f790602401602060405180830381600087803b158015610bc457600080fd5b505af1158015610bd8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bfc919061114a565b5080610c0781611266565b915050610b79565b600080825160411415610c465760208301516040840151606085015160001a610c3a87828585610e80565b94509450505050610c78565b825160401415610c705760208301516040840151610c65868383610f6d565b935093505050610c78565b506000905060025b9250929050565b6000816004811115610ca157634e487b7160e01b600052602160045260246000fd5b1415610caa5750565b6001816004811115610ccc57634e487b7160e01b600052602160045260246000fd5b1415610d1a5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016102a9565b6002816004811115610d3c57634e487b7160e01b600052602160045260246000fd5b1415610d8a5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016102a9565b6003816004811115610dac57634e487b7160e01b600052602160045260246000fd5b1415610e055760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b60648201526084016102a9565b6004816004811115610e2757634e487b7160e01b600052602160045260246000fd5b14156109055760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b60648201526084016102a9565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115610eb75750600090506003610f64565b8460ff16601b14158015610ecf57508460ff16601c14155b15610ee05750600090506004610f64565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015610f34573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610f5d57600060019250925050610f64565b9150600090505b94509492505050565b6000806001600160ff1b03831660ff84901c601b01610f8e87828885610e80565b935093505050935093915050565b600067ffffffffffffffff80841115610fb757610fb7611297565b604051601f8501601f19908116603f01168101908282118183101715610fdf57610fdf611297565b81604052809350858152868686011115610ff857600080fd5b858560208301376000602087830101525050509392505050565b600060208284031215611023578081fd5b81356001600160a01b0381168114610976578182fd5b60008060006040848603121561104d578182fd5b833567ffffffffffffffff80821115611064578384fd5b818601915086601f830112611077578384fd5b813581811115611085578485fd5b8760208260051b8501011115611099578485fd5b6020928301989097509590910135949350505050565b600080600080608085870312156110c4578081fd5b84359350602085013567ffffffffffffffff808211156110e2578283fd5b818701915087601f8301126110f5578283fd5b61110488833560208501610f9c565b94506040870135915080821115611119578283fd5b508501601f8101871361112a578182fd5b61113987823560208401610f9c565b949793965093946060013593505050565b60006020828403121561115b578081fd5b5051919050565b60008151815b818110156111825760208185018101518683015201611168565b818111156111905782828601525b509290920192915050565b6bffffffffffffffffffffffff198460601b16815282601482015260006111c56034830184611162565b95945050505050565b60006109768284611162565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000821982111561122257611222611281565b500190565b60008261124257634e487b7160e01b81526012600452602481fd5b500490565b600081600019048311821515161561126157611261611281565b500290565b600060001982141561127a5761127a611281565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fdfea26469706673582212202480b88fdc6597978eb9ecf3e8cbbc884beb7299b258df17c509248d92431d5564736f6c63430008040033000000000000000000000000ded05bb7e96cd329f027f57dc3b20b986aadc128
Deployed Bytecode
0x6080604052600436106100dd5760003560e01c80639ec70f191161007f578063e081b78111610059578063e081b78114610204578063eeda5f8c1461022e578063f2fde38b14610244578063fc96f3601461026457600080fd5b80639ec70f19146101bb578063a2309ff8146101ce578063c0f4af70146101e457600080fd5b80633ccfd60b116100bb5780633ccfd60b14610150578063715018a6146101655780637c39ea7b1461017a5780638da5cb5b1461019d57600080fd5b8063046dc166146100e2578063049c5c49146101045780631a296e0214610119575b600080fd5b3480156100ee57600080fd5b506101026100fd366004611012565b61027f565b005b34801561011057600080fd5b506101026102d4565b34801561012557600080fd5b506001546001600160a01b03165b6040516001600160a01b0390911681526020015b60405180910390f35b34801561015c57600080fd5b50610102610312565b34801561017157600080fd5b506101026104ae565b34801561018657600080fd5b5061018f603c81565b604051908152602001610147565b3480156101a957600080fd5b506000546001600160a01b0316610133565b6101026101c93660046110af565b6104e4565b3480156101da57600080fd5b5061018f60055481565b3480156101f057600080fd5b506101026101ff366004611039565b610792565b34801561021057600080fd5b5060065461021e9060ff1681565b6040519015158152602001610147565b34801561023a57600080fd5b5061018f611a0a81565b34801561025057600080fd5b5061010261025f366004611012565b61086d565b34801561027057600080fd5b5061018f667c58508723800081565b6000546001600160a01b031633146102b25760405162461bcd60e51b81526004016102a9906111da565b60405180910390fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146102fe5760405162461bcd60e51b81526004016102a9906111da565b6006805460ff19811660ff90911615179055565b6000546001600160a01b0316331461033c5760405162461bcd60e51b81526004016102a9906111da565b6000610346610908565b80516004549192506000916103729161035e9161120f565b61036c60648147603c61096a565b9061097d565b905060005b6004548110156103f557600481815481106103a257634e487b7160e01b600052603260045260246000fd5b60009182526020822001546040516001600160a01b039091169184156108fc02918591818181858888f193505050501580156103e2573d6000803e3d6000fd5b50806103ed81611266565b915050610377565b5060005b82518110156104755782818151811061042257634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b03166108fc839081150290604051600060405180830381858888f19350505050158015610462573d6000803e3d6000fd5b508061046d81611266565b9150506103f9565b5047156104aa5760405133904780156108fc02916000818181858888f193505050501580156104a8573d6000803e3d6000fd5b505b5050565b6000546001600160a01b031633146104d85760405162461bcd60e51b81526004016102a9906111da565b6104e26000610989565b565b60065460ff166105285760405162461bcd60e51b815260206004820152600f60248201526e53616c65204e6f742041637469766560881b60448201526064016102a9565b600061053c6001546001600160a01b031690565b6001600160a01b031614156105885760405162461bcd60e51b815260206004820152601260248201527114da59db995c88139bdd0816595d0814d95d60721b60448201526064016102a9565b61059284846109d9565b6001600160a01b03166105ad6001546001600160a01b031690565b6001600160a01b0316146106035760405162461bcd60e51b815260206004820152601960248201527f446972656374204d696e74696e6720446973616c6c6f7765640000000000000060448201526064016102a9565b60038260405161061391906111ce565b9081526040519081900360200190205460ff16156106635760405162461bcd60e51b815260206004820152600d60248201526c496e76616c6964204e6f6e636560981b60448201526064016102a9565b8361066f3383856109fd565b146106af5760405162461bcd60e51b815260206004820152601060248201526f14da59db985d1d5c994811985a5b195960821b60448201526064016102a9565b611a0a6005546106bf9083610a7f565b106106fb5760405162461bcd60e51b815260206004820152600c60248201526b4f7574206f662053746f636b60a01b60448201526064016102a9565b3461070d667c5850872380008361096a565b11156107505760405162461bcd60e51b8152602060048201526012602482015271496e73756666696369656e742046756e647360701b60448201526064016102a9565b600160038360405161076291906111ce565b908152604051908190036020019020805491151560ff1990921691909117905561078c3382610a8b565b50505050565b6000546001600160a01b031633146107bc5760405162461bcd60e51b81526004016102a9906111da565b611a0a6107d56107cc838561096a565b60055490610a7f565b11156108125760405162461bcd60e51b815260206004820152600c60248201526b4f7574206f662053746f636b60a01b60448201526064016102a9565b60005b8281101561078c5761085b84848381811061084057634e487b7160e01b600052603260045260246000fd5b90506020020160208101906108559190611012565b83610a8b565b8061086581611266565b915050610815565b6000546001600160a01b031633146108975760405162461bcd60e51b81526004016102a9906111da565b6001600160a01b0381166108fc5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016102a9565b61090581610989565b50565b6060600780548060200260200160405190810160405280929190818152602001828054801561096057602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610942575b5050505050905090565b60006109768284611247565b9392505050565b60006109768284611227565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60008060006109e88585610c0f565b915091506109f581610c7f565b509392505050565b600080848484604051602001610a159392919061119b565b60408051601f198184030181529082905280516020918201207f19457468657265756d205369676e6564204d6573736167653a0a33320000000091830191909152603c820152605c0160408051808303601f19018152919052805160209091012095945050505050565b6000610976828461120f565b6000610a9f6002546001600160a01b031690565b9050806001600160a01b031663d5abeb016040518163ffffffff1660e01b815260040160206040518083038186803b158015610ada57600080fd5b505afa158015610aee573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b12919061114a565b600554610b1f9084610a7f565b10610b655760405162461bcd60e51b815260206004820152601660248201527565786365656473206d6178696d756d20737570706c7960501b60448201526064016102a9565b81600554610b73919061120f565b60055560005b8281101561078c5760405163dd47a6f760e01b81526001600160a01b03858116600483015283169063dd47a6f790602401602060405180830381600087803b158015610bc457600080fd5b505af1158015610bd8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bfc919061114a565b5080610c0781611266565b915050610b79565b600080825160411415610c465760208301516040840151606085015160001a610c3a87828585610e80565b94509450505050610c78565b825160401415610c705760208301516040840151610c65868383610f6d565b935093505050610c78565b506000905060025b9250929050565b6000816004811115610ca157634e487b7160e01b600052602160045260246000fd5b1415610caa5750565b6001816004811115610ccc57634e487b7160e01b600052602160045260246000fd5b1415610d1a5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016102a9565b6002816004811115610d3c57634e487b7160e01b600052602160045260246000fd5b1415610d8a5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016102a9565b6003816004811115610dac57634e487b7160e01b600052602160045260246000fd5b1415610e055760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b60648201526084016102a9565b6004816004811115610e2757634e487b7160e01b600052602160045260246000fd5b14156109055760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b60648201526084016102a9565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115610eb75750600090506003610f64565b8460ff16601b14158015610ecf57508460ff16601c14155b15610ee05750600090506004610f64565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015610f34573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610f5d57600060019250925050610f64565b9150600090505b94509492505050565b6000806001600160ff1b03831660ff84901c601b01610f8e87828885610e80565b935093505050935093915050565b600067ffffffffffffffff80841115610fb757610fb7611297565b604051601f8501601f19908116603f01168101908282118183101715610fdf57610fdf611297565b81604052809350858152868686011115610ff857600080fd5b858560208301376000602087830101525050509392505050565b600060208284031215611023578081fd5b81356001600160a01b0381168114610976578182fd5b60008060006040848603121561104d578182fd5b833567ffffffffffffffff80821115611064578384fd5b818601915086601f830112611077578384fd5b813581811115611085578485fd5b8760208260051b8501011115611099578485fd5b6020928301989097509590910135949350505050565b600080600080608085870312156110c4578081fd5b84359350602085013567ffffffffffffffff808211156110e2578283fd5b818701915087601f8301126110f5578283fd5b61110488833560208501610f9c565b94506040870135915080821115611119578283fd5b508501601f8101871361112a578182fd5b61113987823560208401610f9c565b949793965093946060013593505050565b60006020828403121561115b578081fd5b5051919050565b60008151815b818110156111825760208185018101518683015201611168565b818111156111905782828601525b509290920192915050565b6bffffffffffffffffffffffff198460601b16815282601482015260006111c56034830184611162565b95945050505050565b60006109768284611162565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000821982111561122257611222611281565b500190565b60008261124257634e487b7160e01b81526012600452602481fd5b500490565b600081600019048311821515161561126157611261611281565b500290565b600060001982141561127a5761127a611281565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fdfea26469706673582212202480b88fdc6597978eb9ecf3e8cbbc884beb7299b258df17c509248d92431d5564736f6c63430008040033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000ded05bb7e96cd329f027f57dc3b20b986aadc128
-----Decoded View---------------
Arg [0] : _producer (address): 0xDEd05bb7E96CD329F027f57Dc3B20b986aadC128
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000ded05bb7e96cd329f027f57dc3b20b986aadc128
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 33 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.