编译器
0.8.17+commit.8df45f5f
文件 1 的 20:Address.sol
pragma solidity ^0.8.1;
library Address {
function isContract(address account) internal view returns (bool) {
return account.code.length > 0;
}
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");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
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");
}
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);
}
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
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);
}
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
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);
}
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
if (returndata.length > 0) {
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
文件 2 的 20:Context.sol
pragma solidity ^0.8.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
文件 3 的 20:DogeUnleashedMemeverse.sol
pragma solidity ^0.8.17;
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Supply.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/common/ERC2981.sol";
import "operator-filter-registry/src/RevokableOperatorFilterer.sol";
contract DogeUnleashedMemeverse is
ERC1155Supply,
Ownable,
Pausable,
ReentrancyGuard,
ERC2981,
RevokableOperatorFilterer
{
using ECDSA for bytes32;
address constant DEFAULT_SUBSCRIPTION =
address(0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6);
address private presaleSignerAddress =
0x8121aC16FAC005E49c3a364e0771990A1CA706A3;
address public royaltyAddress = 0xdBC3B772A84136aFfc28F5EFE3094Ba351586d51;
address[] public paperAddresses = [
0xf3DB642663231887E2Ff3501da6E3247D8634A6D,
0x5e01a33C75931aD0A91A12Ee016Be8D61b24ADEB,
0x9E733848061e4966c4a920d5b99a123459670aEe,
0x7754B94345BCE520f8dd4F6a5642567603e90E10
];
address[] public payoutAddresses = [
0xdBC3B772A84136aFfc28F5EFE3094Ba351586d51
];
bool public allMetadataFrozen = false;
bool public payoutAddressesFrozen;
mapping(address => mapping(uint256 => uint256))
public tokensMintedByAddress;
mapping(uint256 => bool) public tokenMetadataFrozen;
mapping(uint256 => bool) public tokenMintingPermanentlyDisabled;
mapping(uint256 => bool) public tokenPresaleSaleActive;
mapping(uint256 => bool) public tokenPublicSaleActive;
mapping(uint256 => bool) public tokenUsePresaleTimes;
mapping(uint256 => bool) public tokenUsePublicSaleTimes;
mapping(uint256 => string) public tokenURI;
mapping(uint256 => uint256) public tokenMaxSupply;
mapping(uint256 => uint256) public tokenPresaleMaxSupply;
mapping(uint256 => uint256) public tokenPresaleMintsPerAddress;
mapping(uint256 => uint256) public tokenPresalePrice;
mapping(uint256 => uint256) public tokenPresaleSaleEndTime;
mapping(uint256 => uint256) public tokenPresaleSaleStartTime;
mapping(uint256 => uint256) public tokenPublicMintsPerAddress;
mapping(uint256 => uint256) public tokenPublicPrice;
mapping(uint256 => uint256) public tokenPublicSaleEndTime;
mapping(uint256 => uint256) public tokenPublicSaleStartTime;
string public name = "Doge Unleashed Memeverse";
string public symbol = "DUM";
uint256[] public payoutBasisPoints = [10000];
uint96 public royaltyFee = 500;
constructor()
ERC1155(
"ipfs://bafybeicfyww34a7ngmck4gjbor4j6i4dn66yjoqmj36htwc4m7khevkdzm/{id}"
)
RevokableOperatorFilterer(
0x000000000000AAeB6D7670E522A718067333cd4E,
DEFAULT_SUBSCRIPTION,
true
)
{
_setDefaultRoyalty(royaltyAddress, royaltyFee);
tokenMaxSupply[1] = 100000;
tokenPublicPrice[1] = 0.05 ether;
tokenPublicMintsPerAddress[1] = 100000;
tokenMaxSupply[2] = 500;
tokenPublicPrice[2] = 0.5 ether;
tokenPublicMintsPerAddress[2] = 500;
tokenMaxSupply[3] = 100;
tokenPublicPrice[3] = 2.5 ether;
tokenPublicMintsPerAddress[3] = 100;
tokenMaxSupply[4] = 25;
tokenPublicPrice[4] = 5 ether;
tokenPublicMintsPerAddress[4] = 25;
require(
payoutAddresses.length == payoutBasisPoints.length,
"PAYOUT_ARRAYS_NOT_SAME_LENGTH"
);
uint256 totalPayoutBasisPoints = 0;
for (uint256 i = 0; i < payoutBasisPoints.length; i++) {
totalPayoutBasisPoints += payoutBasisPoints[i];
}
require(
totalPayoutBasisPoints == 10000,
"TOTAL_BASIS_POINTS_MUST_BE_10000"
);
}
modifier originalUser() {
require(tx.origin == msg.sender, "CANNOT_CALL_FROM_CONTRACT");
_;
}
function uri(
uint256 _tokenId
) public view override returns (string memory) {
if (bytes(tokenURI[_tokenId]).length == 0) {
return super.uri(_tokenId);
}
return tokenURI[_tokenId];
}
function setURI(
uint256 _tokenId,
string calldata _newTokenURI
) external onlyOwner {
require(
!allMetadataFrozen && !tokenMetadataFrozen[_tokenId],
"METADATA_HAS_BEEN_FROZEN"
);
tokenURI[_tokenId] = _newTokenURI;
}
function setGlobalURI(string calldata _newTokenURI) external onlyOwner {
require(!allMetadataFrozen, "METADATA_HAS_BEEN_FROZEN");
_setURI(_newTokenURI);
}
function freezeTokenMetadata(uint256 _tokenId) external onlyOwner {
require(
!tokenMetadataFrozen[_tokenId],
"METADATA_HAS_ALREADY_BEEN_FROZEN"
);
tokenMetadataFrozen[_tokenId] = true;
}
function freezeAllMetadata() external onlyOwner {
require(!allMetadataFrozen, "METADATA_HAS_ALREADY_BEEN_FROZEN");
allMetadataFrozen = true;
}
function reduceMaxSupply(
uint256 _tokenId,
uint256 _newMaxSupply
) external onlyOwner {
require(
tokenMaxSupply[_tokenId] == 0 ||
_newMaxSupply < tokenMaxSupply[_tokenId],
"NEW_MAX_SUPPLY_TOO_HIGH"
);
require(
_newMaxSupply >= totalSupply(_tokenId),
"SUPPLY_LOWER_THAN_MINTED_TOKENS"
);
tokenMaxSupply[_tokenId] = _newMaxSupply;
}
function permanentlyDisableTokenMinting(
uint256 _tokenId
) external onlyOwner {
tokenMintingPermanentlyDisabled[_tokenId] = true;
}
function setRoyaltyFee(uint96 _feeNumerator) external onlyOwner {
royaltyFee = _feeNumerator;
_setDefaultRoyalty(royaltyAddress, royaltyFee);
}
function setRoyaltyAddress(address _royaltyAddress) external onlyOwner {
royaltyAddress = _royaltyAddress;
_setDefaultRoyalty(royaltyAddress, royaltyFee);
}
function pause() external onlyOwner {
_pause();
}
function unpause() external onlyOwner {
_unpause();
}
function supportsInterface(
bytes4 _interfaceId
) public view override(ERC1155, ERC2981) returns (bool) {
return super.supportsInterface(_interfaceId);
}
function giftTokens(
uint256 _tokenId,
address[] calldata _receivers,
uint256[] calldata _mintNumber
) external onlyOwner {
require(
!tokenMintingPermanentlyDisabled[_tokenId],
"MINTING_PERMANENTLY_DISABLED"
);
uint256 totalMint = 0;
for (uint256 i = 0; i < _mintNumber.length; i++) {
totalMint += _mintNumber[i];
}
require(
tokenMaxSupply[_tokenId] == 0 ||
totalSupply(_tokenId) + totalMint <= tokenMaxSupply[_tokenId],
"MINT_TOO_LARGE"
);
for (uint256 i = 0; i < _receivers.length; i++) {
_mint(_receivers[i], _tokenId, _mintNumber[i], "");
}
}
function setTokenPublicSaleState(
uint256 _tokenId,
bool _saleActiveState
) external onlyOwner {
require(
tokenPublicSaleActive[_tokenId] != _saleActiveState,
"NEW_STATE_IDENTICAL_TO_OLD_STATE"
);
tokenPublicSaleActive[_tokenId] = _saleActiveState;
}
function setTokenPublicPrice(
uint256 _tokenId,
uint256 _publicPrice
) external onlyOwner {
tokenPublicPrice[_tokenId] = _publicPrice;
}
function setTokenPublicMintsAllowedPerAddress(
uint256 _tokenId,
uint256 _mintsAllowed
) external onlyOwner {
tokenPublicMintsPerAddress[_tokenId] = _mintsAllowed;
}
function setTokenPublicSaleStartTime(
uint256 _tokenId,
uint256 _publicSaleStartTime
) external onlyOwner {
require(_publicSaleStartTime > block.timestamp, "TIME_IN_PAST");
tokenPublicSaleStartTime[_tokenId] = _publicSaleStartTime;
}
function setTokenPublicSaleEndTime(
uint256 _tokenId,
uint256 _publicSaleEndTime
) external onlyOwner {
require(_publicSaleEndTime > block.timestamp, "TIME_IN_PAST");
tokenPublicSaleEndTime[_tokenId] = _publicSaleEndTime;
}
function setTokenUsePublicSaleTimes(
uint256 _tokenId,
bool _usePublicSaleTimes
) external onlyOwner {
require(
tokenUsePublicSaleTimes[_tokenId] != _usePublicSaleTimes,
"NEW_STATE_IDENTICAL_TO_OLD_STATE"
);
tokenUsePublicSaleTimes[_tokenId] = _usePublicSaleTimes;
}
function tokenPublicSaleTimeIsActive(
uint256 _tokenId
) public view returns (bool) {
if (tokenUsePublicSaleTimes[_tokenId] == false) {
return true;
}
return
block.timestamp >= tokenPublicSaleStartTime[_tokenId] &&
block.timestamp <= tokenPublicSaleEndTime[_tokenId];
}
function mintToken(
uint256 _tokenId,
uint256 _numTokens
) external payable originalUser nonReentrant {
require(tokenPublicSaleActive[_tokenId], "PUBLIC_SALE_IS_NOT_ACTIVE");
require(
tokenPublicSaleTimeIsActive(_tokenId),
"PUBLIC_SALE_TIME_IS_NOT_ACTIVE"
);
require(
tokenPublicMintsPerAddress[_tokenId] == 0 ||
tokensMintedByAddress[msg.sender][_tokenId] + _numTokens <=
tokenPublicMintsPerAddress[_tokenId],
"MAX_MINTS_FOR_ADDRESS_EXCEEDED"
);
require(
tokenMaxSupply[_tokenId] == 0 ||
totalSupply(_tokenId) + _numTokens <= tokenMaxSupply[_tokenId],
"MAX_SUPPLY_EXCEEDED"
);
require(
msg.value == tokenPublicPrice[_tokenId] * _numTokens,
"PAYMENT_INCORRECT"
);
require(
!tokenMintingPermanentlyDisabled[_tokenId],
"MINTING_PERMANENTLY_DISABLED"
);
tokensMintedByAddress[msg.sender][_tokenId] += _numTokens;
_mint(msg.sender, _tokenId, _numTokens, "");
if (
tokenMaxSupply[_tokenId] != 0 &&
totalSupply(_tokenId) >= tokenMaxSupply[_tokenId]
) {
tokenPublicSaleActive[_tokenId] = false;
}
}
function creditCardMint(
uint256 _tokenId,
uint256 _numTokens,
address _to
) external payable originalUser nonReentrant {
bool authorized = false;
for (uint256 i = 0; i < paperAddresses.length; i++) {
if (msg.sender == paperAddresses[i]) {
authorized = true;
break;
}
}
require(authorized, "NOT_AUTHORIZED_ADDRESS");
require(tokenPublicSaleActive[_tokenId], "PUBLIC_SALE_IS_NOT_ACTIVE");
require(
tokenPublicSaleTimeIsActive(_tokenId),
"PUBLIC_SALE_TIME_IS_NOT_ACTIVE"
);
require(
tokenPublicMintsPerAddress[_tokenId] == 0 ||
tokensMintedByAddress[_to][_tokenId] + _numTokens <=
tokenPublicMintsPerAddress[_tokenId],
"MAX_MINTS_FOR_ADDRESS_EXCEEDED"
);
require(
tokenMaxSupply[_tokenId] == 0 ||
totalSupply(_tokenId) + _numTokens <= tokenMaxSupply[_tokenId],
"MAX_SUPPLY_EXCEEDED"
);
require(
msg.value == tokenPublicPrice[_tokenId] * _numTokens,
"PAYMENT_INCORRECT"
);
require(
!tokenMintingPermanentlyDisabled[_tokenId],
"MINTING_PERMANENTLY_DISABLED"
);
tokensMintedByAddress[_to][_tokenId] += _numTokens;
_mint(_to, _tokenId, _numTokens, "");
if (
tokenMaxSupply[_tokenId] != 0 &&
totalSupply(_tokenId) >= tokenMaxSupply[_tokenId]
) {
tokenPublicSaleActive[_tokenId] = false;
}
}
function setPresaleSignerAddress(
address _presaleSignerAddress
) external onlyOwner {
require(_presaleSignerAddress != address(0));
presaleSignerAddress = _presaleSignerAddress;
}
function setTokenPresaleState(
uint256 _tokenId,
bool _saleActiveState
) external onlyOwner {
require(
tokenPresaleSaleActive[_tokenId] != _saleActiveState,
"NEW_STATE_IDENTICAL_TO_OLD_STATE"
);
tokenPresaleSaleActive[_tokenId] = _saleActiveState;
}
function setTokenPresalePrice(
uint256 _tokenId,
uint256 _presalePrice
) external onlyOwner {
tokenPresalePrice[_tokenId] = _presalePrice;
}
function setTokenPresaleMintsAllowedPerAddress(
uint256 _tokenId,
uint256 _mintsAllowed
) external onlyOwner {
tokenPresaleMintsPerAddress[_tokenId] = _mintsAllowed;
}
function reducePresaleMaxSupply(
uint256 _tokenId,
uint256 _newPresaleMaxSupply
) external onlyOwner {
require(
tokenPresaleMaxSupply[_tokenId] == 0 ||
_newPresaleMaxSupply < tokenPresaleMaxSupply[_tokenId],
"NEW_MAX_SUPPLY_TOO_HIGH"
);
tokenPresaleMaxSupply[_tokenId] = _newPresaleMaxSupply;
}
function setTokenPresaleStartTime(
uint256 _tokenId,
uint256 _presaleStartTime
) external onlyOwner {
require(_presaleStartTime > block.timestamp, "TIME_IN_PAST");
tokenPresaleSaleStartTime[_tokenId] = _presaleStartTime;
}
function setTokenPresaleEndTime(
uint256 _tokenId,
uint256 _presaleEndTime
) external onlyOwner {
require(_presaleEndTime > block.timestamp, "TIME_IN_PAST");
tokenPresaleSaleEndTime[_tokenId] = _presaleEndTime;
}
function setTokenUsePresaleTimes(
uint256 _tokenId,
bool _usePresaleTimes
) external onlyOwner {
require(
tokenUsePresaleTimes[_tokenId] != _usePresaleTimes,
"NEW_STATE_IDENTICAL_TO_OLD_STATE"
);
tokenUsePresaleTimes[_tokenId] = _usePresaleTimes;
}
function tokenPresaleTimeIsActive(
uint256 _tokenId
) public view returns (bool) {
if (tokenUsePresaleTimes[_tokenId] == false) {
return true;
}
return
block.timestamp >= tokenPresaleSaleStartTime[_tokenId] &&
block.timestamp <= tokenPresaleSaleEndTime[_tokenId];
}
function verifySignerAddress(
bytes32 _messageHash,
bytes calldata _signature
) private view returns (bool) {
return
presaleSignerAddress ==
_messageHash.toEthSignedMessageHash().recover(_signature);
}
function presaleMint(
bytes32 _messageHash,
bytes calldata _signature,
uint256 _tokenId,
uint256 _numTokens,
uint256 _maximumAllowedMints
) external payable originalUser nonReentrant {
require(tokenPresaleSaleActive[_tokenId], "PRESALE_IS_NOT_ACTIVE");
require(
tokenPresaleTimeIsActive(_tokenId),
"PRESALE_TIME_IS_NOT_ACTIVE"
);
require(
!tokenMintingPermanentlyDisabled[_tokenId],
"MINTING_PERMANENTLY_DISABLED"
);
require(
tokenPresaleMintsPerAddress[_tokenId] == 0 ||
tokensMintedByAddress[msg.sender][_tokenId] + _numTokens <=
tokenPresaleMintsPerAddress[_tokenId],
"MAX_MINTS_PER_ADDRESS_EXCEEDED"
);
require(
_maximumAllowedMints == 0 ||
tokensMintedByAddress[msg.sender][_tokenId] + _numTokens <=
_maximumAllowedMints,
"MAX_MINTS_EXCEEDED"
);
require(
tokenPresaleMaxSupply[_tokenId] == 0 ||
totalSupply(_tokenId) + _numTokens <=
tokenPresaleMaxSupply[_tokenId],
"MAX_SUPPLY_EXCEEDED"
);
require(
msg.value == tokenPresalePrice[_tokenId] * _numTokens,
"PAYMENT_INCORRECT"
);
require(
keccak256(abi.encode(msg.sender, _maximumAllowedMints, _tokenId)) ==
_messageHash,
"MESSAGE_INVALID"
);
require(
verifySignerAddress(_messageHash, _signature),
"SIGNATURE_VALIDATION_FAILED"
);
tokensMintedByAddress[msg.sender][_tokenId] += _numTokens;
_mint(msg.sender, _tokenId, _numTokens, "");
if (
tokenPresaleMaxSupply[_tokenId] != 0 &&
totalSupply(_tokenId) >= tokenPresaleMaxSupply[_tokenId]
) {
tokenPresaleSaleActive[_tokenId] = false;
}
}
function freezePayoutAddresses() external onlyOwner {
require(!payoutAddressesFrozen, "PAYOUT_ADDRESSES_ALREADY_FROZEN");
payoutAddressesFrozen = true;
}
function updatePayoutAddressesAndBasisPoints(
address[] calldata _payoutAddresses,
uint256[] calldata _payoutBasisPoints
) external onlyOwner {
require(!payoutAddressesFrozen, "PAYOUT_ADDRESSES_FROZEN");
require(
_payoutAddresses.length == _payoutBasisPoints.length,
"ARRAY_LENGTHS_MUST_MATCH"
);
uint256 totalBasisPoints = 0;
for (uint i = 0; i < _payoutBasisPoints.length; i++) {
totalBasisPoints += _payoutBasisPoints[i];
}
require(totalBasisPoints == 10000, "TOTAL_BASIS_POINTS_MUST_BE_10000");
payoutAddresses = _payoutAddresses;
payoutBasisPoints = _payoutBasisPoints;
}
function withdraw() external onlyOwner nonReentrant {
require(address(this).balance > 0, "CONTRACT_HAS_NO_BALANCE");
require(payoutAddresses.length > 0, "NO_PAYOUT_ADDRESSES");
uint256 balance = address(this).balance;
for (uint i = 0; i < payoutAddresses.length; i++) {
uint256 amount = (balance * payoutBasisPoints[i]) / 10000;
(bool success, ) = payoutAddresses[i].call{value: amount}("");
require(success, "Transfer failed.");
}
}
function setApprovalForAll(
address operator,
bool approved
) public override onlyAllowedOperatorApproval(operator) {
super.setApprovalForAll(operator, approved);
}
function _beforeTokenTransfer(
address operator,
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal override whenNotPaused {
super._beforeTokenTransfer(operator, from, to, ids, amounts, data);
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
uint256 amount,
bytes memory data
) public override onlyAllowedOperator(from) {
require(amount > 0, "AMOUNT_CANNOT_BE_ZERO");
super.safeTransferFrom(from, to, tokenId, amount, data);
}
function safeBatchTransferFrom(
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) public virtual override onlyAllowedOperator(from) {
super.safeBatchTransferFrom(from, to, ids, amounts, data);
}
function owner()
public
view
virtual
override(Ownable, UpdatableOperatorFilterer)
returns (address)
{
return Ownable.owner();
}
}
文件 4 的 20:ECDSA.sol
pragma solidity ^0.8.0;
import "../Strings.sol";
library ECDSA {
enum RecoverError {
NoError,
InvalidSignature,
InvalidSignatureLength,
InvalidSignatureS,
InvalidSignatureV
}
function _throwError(RecoverError error) private pure {
if (error == RecoverError.NoError) {
return;
} 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");
}
}
function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
if (signature.length == 65) {
bytes32 r;
bytes32 s;
uint8 v;
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 {
return (address(0), RecoverError.InvalidSignatureLength);
}
}
function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
(address recovered, RecoverError error) = tryRecover(hash, signature);
_throwError(error);
return recovered;
}
function tryRecover(
bytes32 hash,
bytes32 r,
bytes32 vs
) internal pure returns (address, RecoverError) {
bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
uint8 v = uint8((uint256(vs) >> 255) + 27);
return tryRecover(hash, v, r, s);
}
function recover(
bytes32 hash,
bytes32 r,
bytes32 vs
) internal pure returns (address) {
(address recovered, RecoverError error) = tryRecover(hash, r, vs);
_throwError(error);
return recovered;
}
function tryRecover(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
) internal pure returns (address, RecoverError) {
if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
return (address(0), RecoverError.InvalidSignatureS);
}
if (v != 27 && v != 28) {
return (address(0), RecoverError.InvalidSignatureV);
}
address signer = ecrecover(hash, v, r, s);
if (signer == address(0)) {
return (address(0), RecoverError.InvalidSignature);
}
return (signer, RecoverError.NoError);
}
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;
}
function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
}
function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {
return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s));
}
function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {
return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
}
}
文件 5 的 20:ERC1155.sol
pragma solidity ^0.8.0;
import "./IERC1155.sol";
import "./IERC1155Receiver.sol";
import "./extensions/IERC1155MetadataURI.sol";
import "../../utils/Address.sol";
import "../../utils/Context.sol";
import "../../utils/introspection/ERC165.sol";
contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {
using Address for address;
mapping(uint256 => mapping(address => uint256)) private _balances;
mapping(address => mapping(address => bool)) private _operatorApprovals;
string private _uri;
constructor(string memory uri_) {
_setURI(uri_);
}
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
return
interfaceId == type(IERC1155).interfaceId ||
interfaceId == type(IERC1155MetadataURI).interfaceId ||
super.supportsInterface(interfaceId);
}
function uri(uint256) public view virtual override returns (string memory) {
return _uri;
}
function balanceOf(address account, uint256 id) public view virtual override returns (uint256) {
require(account != address(0), "ERC1155: address zero is not a valid owner");
return _balances[id][account];
}
function balanceOfBatch(address[] memory accounts, uint256[] memory ids)
public
view
virtual
override
returns (uint256[] memory)
{
require(accounts.length == ids.length, "ERC1155: accounts and ids length mismatch");
uint256[] memory batchBalances = new uint256[](accounts.length);
for (uint256 i = 0; i < accounts.length; ++i) {
batchBalances[i] = balanceOf(accounts[i], ids[i]);
}
return batchBalances;
}
function setApprovalForAll(address operator, bool approved) public virtual override {
_setApprovalForAll(_msgSender(), operator, approved);
}
function isApprovedForAll(address account, address operator) public view virtual override returns (bool) {
return _operatorApprovals[account][operator];
}
function safeTransferFrom(
address from,
address to,
uint256 id,
uint256 amount,
bytes memory data
) public virtual override {
require(
from == _msgSender() || isApprovedForAll(from, _msgSender()),
"ERC1155: caller is not token owner nor approved"
);
_safeTransferFrom(from, to, id, amount, data);
}
function safeBatchTransferFrom(
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) public virtual override {
require(
from == _msgSender() || isApprovedForAll(from, _msgSender()),
"ERC1155: caller is not token owner nor approved"
);
_safeBatchTransferFrom(from, to, ids, amounts, data);
}
function _safeTransferFrom(
address from,
address to,
uint256 id,
uint256 amount,
bytes memory data
) internal virtual {
require(to != address(0), "ERC1155: transfer to the zero address");
address operator = _msgSender();
uint256[] memory ids = _asSingletonArray(id);
uint256[] memory amounts = _asSingletonArray(amount);
_beforeTokenTransfer(operator, from, to, ids, amounts, data);
uint256 fromBalance = _balances[id][from];
require(fromBalance >= amount, "ERC1155: insufficient balance for transfer");
unchecked {
_balances[id][from] = fromBalance - amount;
}
_balances[id][to] += amount;
emit TransferSingle(operator, from, to, id, amount);
_afterTokenTransfer(operator, from, to, ids, amounts, data);
_doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data);
}
function _safeBatchTransferFrom(
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual {
require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");
require(to != address(0), "ERC1155: transfer to the zero address");
address operator = _msgSender();
_beforeTokenTransfer(operator, from, to, ids, amounts, data);
for (uint256 i = 0; i < ids.length; ++i) {
uint256 id = ids[i];
uint256 amount = amounts[i];
uint256 fromBalance = _balances[id][from];
require(fromBalance >= amount, "ERC1155: insufficient balance for transfer");
unchecked {
_balances[id][from] = fromBalance - amount;
}
_balances[id][to] += amount;
}
emit TransferBatch(operator, from, to, ids, amounts);
_afterTokenTransfer(operator, from, to, ids, amounts, data);
_doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data);
}
function _setURI(string memory newuri) internal virtual {
_uri = newuri;
}
function _mint(
address to,
uint256 id,
uint256 amount,
bytes memory data
) internal virtual {
require(to != address(0), "ERC1155: mint to the zero address");
address operator = _msgSender();
uint256[] memory ids = _asSingletonArray(id);
uint256[] memory amounts = _asSingletonArray(amount);
_beforeTokenTransfer(operator, address(0), to, ids, amounts, data);
_balances[id][to] += amount;
emit TransferSingle(operator, address(0), to, id, amount);
_afterTokenTransfer(operator, address(0), to, ids, amounts, data);
_doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data);
}
function _mintBatch(
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual {
require(to != address(0), "ERC1155: mint to the zero address");
require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");
address operator = _msgSender();
_beforeTokenTransfer(operator, address(0), to, ids, amounts, data);
for (uint256 i = 0; i < ids.length; i++) {
_balances[ids[i]][to] += amounts[i];
}
emit TransferBatch(operator, address(0), to, ids, amounts);
_afterTokenTransfer(operator, address(0), to, ids, amounts, data);
_doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data);
}
function _burn(
address from,
uint256 id,
uint256 amount
) internal virtual {
require(from != address(0), "ERC1155: burn from the zero address");
address operator = _msgSender();
uint256[] memory ids = _asSingletonArray(id);
uint256[] memory amounts = _asSingletonArray(amount);
_beforeTokenTransfer(operator, from, address(0), ids, amounts, "");
uint256 fromBalance = _balances[id][from];
require(fromBalance >= amount, "ERC1155: burn amount exceeds balance");
unchecked {
_balances[id][from] = fromBalance - amount;
}
emit TransferSingle(operator, from, address(0), id, amount);
_afterTokenTransfer(operator, from, address(0), ids, amounts, "");
}
function _burnBatch(
address from,
uint256[] memory ids,
uint256[] memory amounts
) internal virtual {
require(from != address(0), "ERC1155: burn from the zero address");
require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");
address operator = _msgSender();
_beforeTokenTransfer(operator, from, address(0), ids, amounts, "");
for (uint256 i = 0; i < ids.length; i++) {
uint256 id = ids[i];
uint256 amount = amounts[i];
uint256 fromBalance = _balances[id][from];
require(fromBalance >= amount, "ERC1155: burn amount exceeds balance");
unchecked {
_balances[id][from] = fromBalance - amount;
}
}
emit TransferBatch(operator, from, address(0), ids, amounts);
_afterTokenTransfer(operator, from, address(0), ids, amounts, "");
}
function _setApprovalForAll(
address owner,
address operator,
bool approved
) internal virtual {
require(owner != operator, "ERC1155: setting approval status for self");
_operatorApprovals[owner][operator] = approved;
emit ApprovalForAll(owner, operator, approved);
}
function _beforeTokenTransfer(
address operator,
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual {}
function _afterTokenTransfer(
address operator,
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual {}
function _doSafeTransferAcceptanceCheck(
address operator,
address from,
address to,
uint256 id,
uint256 amount,
bytes memory data
) private {
if (to.isContract()) {
try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) {
if (response != IERC1155Receiver.onERC1155Received.selector) {
revert("ERC1155: ERC1155Receiver rejected tokens");
}
} catch Error(string memory reason) {
revert(reason);
} catch {
revert("ERC1155: transfer to non ERC1155Receiver implementer");
}
}
}
function _doSafeBatchTransferAcceptanceCheck(
address operator,
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) private {
if (to.isContract()) {
try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns (
bytes4 response
) {
if (response != IERC1155Receiver.onERC1155BatchReceived.selector) {
revert("ERC1155: ERC1155Receiver rejected tokens");
}
} catch Error(string memory reason) {
revert(reason);
} catch {
revert("ERC1155: transfer to non ERC1155Receiver implementer");
}
}
}
function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) {
uint256[] memory array = new uint256[](1);
array[0] = element;
return array;
}
}
文件 6 的 20:ERC1155Supply.sol
pragma solidity ^0.8.0;
import "../ERC1155.sol";
abstract contract ERC1155Supply is ERC1155 {
mapping(uint256 => uint256) private _totalSupply;
function totalSupply(uint256 id) public view virtual returns (uint256) {
return _totalSupply[id];
}
function exists(uint256 id) public view virtual returns (bool) {
return ERC1155Supply.totalSupply(id) > 0;
}
function _beforeTokenTransfer(
address operator,
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual override {
super._beforeTokenTransfer(operator, from, to, ids, amounts, data);
if (from == address(0)) {
for (uint256 i = 0; i < ids.length; ++i) {
_totalSupply[ids[i]] += amounts[i];
}
}
if (to == address(0)) {
for (uint256 i = 0; i < ids.length; ++i) {
uint256 id = ids[i];
uint256 amount = amounts[i];
uint256 supply = _totalSupply[id];
require(supply >= amount, "ERC1155: burn amount exceeds totalSupply");
unchecked {
_totalSupply[id] = supply - amount;
}
}
}
}
}
文件 7 的 20:ERC165.sol
pragma solidity ^0.8.0;
import "./IERC165.sol";
abstract contract ERC165 is IERC165 {
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}
文件 8 的 20:ERC2981.sol
pragma solidity ^0.8.0;
import "../../interfaces/IERC2981.sol";
import "../../utils/introspection/ERC165.sol";
abstract contract ERC2981 is IERC2981, ERC165 {
struct RoyaltyInfo {
address receiver;
uint96 royaltyFraction;
}
RoyaltyInfo private _defaultRoyaltyInfo;
mapping(uint256 => RoyaltyInfo) private _tokenRoyaltyInfo;
function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC165) returns (bool) {
return interfaceId == type(IERC2981).interfaceId || super.supportsInterface(interfaceId);
}
function royaltyInfo(uint256 _tokenId, uint256 _salePrice) public view virtual override returns (address, uint256) {
RoyaltyInfo memory royalty = _tokenRoyaltyInfo[_tokenId];
if (royalty.receiver == address(0)) {
royalty = _defaultRoyaltyInfo;
}
uint256 royaltyAmount = (_salePrice * royalty.royaltyFraction) / _feeDenominator();
return (royalty.receiver, royaltyAmount);
}
function _feeDenominator() internal pure virtual returns (uint96) {
return 10000;
}
function _setDefaultRoyalty(address receiver, uint96 feeNumerator) internal virtual {
require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice");
require(receiver != address(0), "ERC2981: invalid receiver");
_defaultRoyaltyInfo = RoyaltyInfo(receiver, feeNumerator);
}
function _deleteDefaultRoyalty() internal virtual {
delete _defaultRoyaltyInfo;
}
function _setTokenRoyalty(
uint256 tokenId,
address receiver,
uint96 feeNumerator
) internal virtual {
require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice");
require(receiver != address(0), "ERC2981: Invalid parameters");
_tokenRoyaltyInfo[tokenId] = RoyaltyInfo(receiver, feeNumerator);
}
function _resetTokenRoyalty(uint256 tokenId) internal virtual {
delete _tokenRoyaltyInfo[tokenId];
}
}
文件 9 的 20:IERC1155.sol
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
interface IERC1155 is IERC165 {
event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);
event TransferBatch(
address indexed operator,
address indexed from,
address indexed to,
uint256[] ids,
uint256[] values
);
event ApprovalForAll(address indexed account, address indexed operator, bool approved);
event URI(string value, uint256 indexed id);
function balanceOf(address account, uint256 id) external view returns (uint256);
function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)
external
view
returns (uint256[] memory);
function setApprovalForAll(address operator, bool approved) external;
function isApprovedForAll(address account, address operator) external view returns (bool);
function safeTransferFrom(
address from,
address to,
uint256 id,
uint256 amount,
bytes calldata data
) external;
function safeBatchTransferFrom(
address from,
address to,
uint256[] calldata ids,
uint256[] calldata amounts,
bytes calldata data
) external;
}
文件 10 的 20:IERC1155MetadataURI.sol
pragma solidity ^0.8.0;
import "../IERC1155.sol";
interface IERC1155MetadataURI is IERC1155 {
function uri(uint256 id) external view returns (string memory);
}
文件 11 的 20:IERC1155Receiver.sol
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
interface IERC1155Receiver is IERC165 {
function onERC1155Received(
address operator,
address from,
uint256 id,
uint256 value,
bytes calldata data
) external returns (bytes4);
function onERC1155BatchReceived(
address operator,
address from,
uint256[] calldata ids,
uint256[] calldata values,
bytes calldata data
) external returns (bytes4);
}
文件 12 的 20:IERC165.sol
pragma solidity ^0.8.0;
interface IERC165 {
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
文件 13 的 20:IERC2981.sol
pragma solidity ^0.8.0;
import "../utils/introspection/IERC165.sol";
interface IERC2981 is IERC165 {
function royaltyInfo(uint256 tokenId, uint256 salePrice)
external
view
returns (address receiver, uint256 royaltyAmount);
}
文件 14 的 20:IOperatorFilterRegistry.sol
pragma solidity ^0.8.13;
interface IOperatorFilterRegistry {
function isOperatorAllowed(address registrant, address operator) external view returns (bool);
function register(address registrant) external;
function registerAndSubscribe(address registrant, address subscription) external;
function registerAndCopyEntries(address registrant, address registrantToCopy) external;
function unregister(address addr) external;
function updateOperator(address registrant, address operator, bool filtered) external;
function updateOperators(address registrant, address[] calldata operators, bool filtered) external;
function updateCodeHash(address registrant, bytes32 codehash, bool filtered) external;
function updateCodeHashes(address registrant, bytes32[] calldata codeHashes, bool filtered) external;
function subscribe(address registrant, address registrantToSubscribe) external;
function unsubscribe(address registrant, bool copyExistingEntries) external;
function subscriptionOf(address addr) external returns (address registrant);
function subscribers(address registrant) external returns (address[] memory);
function subscriberAt(address registrant, uint256 index) external returns (address);
function copyEntriesOf(address registrant, address registrantToCopy) external;
function isOperatorFiltered(address registrant, address operator) external returns (bool);
function isCodeHashOfFiltered(address registrant, address operatorWithCode) external returns (bool);
function isCodeHashFiltered(address registrant, bytes32 codeHash) external returns (bool);
function filteredOperators(address addr) external returns (address[] memory);
function filteredCodeHashes(address addr) external returns (bytes32[] memory);
function filteredOperatorAt(address registrant, uint256 index) external returns (address);
function filteredCodeHashAt(address registrant, uint256 index) external returns (bytes32);
function isRegistered(address addr) external returns (bool);
function codeHashOf(address addr) external returns (bytes32);
}
文件 15 的 20:Ownable.sol
pragma solidity ^0.8.0;
import "../utils/Context.sol";
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
_transferOwnership(_msgSender());
}
modifier onlyOwner() {
_checkOwner();
_;
}
function owner() public view virtual returns (address) {
return _owner;
}
function _checkOwner() internal view virtual {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
文件 16 的 20:Pausable.sol
pragma solidity ^0.8.0;
import "../utils/Context.sol";
abstract contract Pausable is Context {
event Paused(address account);
event Unpaused(address account);
bool private _paused;
constructor() {
_paused = false;
}
modifier whenNotPaused() {
_requireNotPaused();
_;
}
modifier whenPaused() {
_requirePaused();
_;
}
function paused() public view virtual returns (bool) {
return _paused;
}
function _requireNotPaused() internal view virtual {
require(!paused(), "Pausable: paused");
}
function _requirePaused() internal view virtual {
require(paused(), "Pausable: not paused");
}
function _pause() internal virtual whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
function _unpause() internal virtual whenPaused {
_paused = false;
emit Unpaused(_msgSender());
}
}
文件 17 的 20:ReentrancyGuard.sol
pragma solidity ^0.8.0;
abstract contract ReentrancyGuard {
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
modifier nonReentrant() {
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
_status = _ENTERED;
_;
_status = _NOT_ENTERED;
}
}
文件 18 的 20:RevokableOperatorFilterer.sol
pragma solidity ^0.8.13;
import {UpdatableOperatorFilterer} from "./UpdatableOperatorFilterer.sol";
import {IOperatorFilterRegistry} from "./IOperatorFilterRegistry.sol";
abstract contract RevokableOperatorFilterer is UpdatableOperatorFilterer {
error RegistryHasBeenRevoked();
error InitialRegistryAddressCannotBeZeroAddress();
bool public isOperatorFilterRegistryRevoked;
constructor(address _registry, address subscriptionOrRegistrantToCopy, bool subscribe)
UpdatableOperatorFilterer(_registry, subscriptionOrRegistrantToCopy, subscribe)
{
if (_registry == address(0)) {
revert InitialRegistryAddressCannotBeZeroAddress();
}
}
function _checkFilterOperator(address operator) internal view virtual override {
if (address(operatorFilterRegistry) != address(0)) {
super._checkFilterOperator(operator);
}
}
function updateOperatorFilterRegistryAddress(address newRegistry) public override {
if (msg.sender != owner()) {
revert OnlyOwner();
}
if (isOperatorFilterRegistryRevoked) {
revert RegistryHasBeenRevoked();
}
operatorFilterRegistry = IOperatorFilterRegistry(newRegistry);
}
function revokeOperatorFilterRegistry() public {
if (msg.sender != owner()) {
revert OnlyOwner();
}
if (isOperatorFilterRegistryRevoked) {
revert RegistryHasBeenRevoked();
}
operatorFilterRegistry = IOperatorFilterRegistry(address(0));
isOperatorFilterRegistryRevoked = true;
}
}
文件 19 的 20:Strings.sol
pragma solidity ^0.8.0;
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
uint8 private constant _ADDRESS_LENGTH = 20;
function toString(uint256 value) internal pure returns (string memory) {
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);
}
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);
}
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);
}
function toHexString(address addr) internal pure returns (string memory) {
return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
}
}
文件 20 的 20:UpdatableOperatorFilterer.sol
pragma solidity ^0.8.13;
import {IOperatorFilterRegistry} from "./IOperatorFilterRegistry.sol";
abstract contract UpdatableOperatorFilterer {
error OperatorNotAllowed(address operator);
error OnlyOwner();
IOperatorFilterRegistry public operatorFilterRegistry;
constructor(address _registry, address subscriptionOrRegistrantToCopy, bool subscribe) {
IOperatorFilterRegistry registry = IOperatorFilterRegistry(_registry);
operatorFilterRegistry = registry;
if (address(registry).code.length > 0) {
if (subscribe) {
registry.registerAndSubscribe(address(this), subscriptionOrRegistrantToCopy);
} else {
if (subscriptionOrRegistrantToCopy != address(0)) {
registry.registerAndCopyEntries(address(this), subscriptionOrRegistrantToCopy);
} else {
registry.register(address(this));
}
}
}
}
modifier onlyAllowedOperator(address from) virtual {
if (from != msg.sender) {
_checkFilterOperator(msg.sender);
}
_;
}
modifier onlyAllowedOperatorApproval(address operator) virtual {
_checkFilterOperator(operator);
_;
}
function updateOperatorFilterRegistryAddress(address newRegistry) public virtual {
if (msg.sender != owner()) {
revert OnlyOwner();
}
operatorFilterRegistry = IOperatorFilterRegistry(newRegistry);
}
function owner() public view virtual returns (address);
function _checkFilterOperator(address operator) internal view virtual {
IOperatorFilterRegistry registry = operatorFilterRegistry;
if (address(registry) != address(0) && address(registry).code.length > 0) {
if (!registry.isOperatorAllowed(address(this), operator)) {
revert OperatorNotAllowed(operator);
}
}
}
}
{
"compilationTarget": {
"DogeUnleashedMemeverse.sol": "DogeUnleashedMemeverse"
},
"evmVersion": "london",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": true,
"runs": 200
},
"remappings": []
}
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"InitialRegistryAddressCannotBeZeroAddress","type":"error"},{"inputs":[],"name":"OnlyOwner","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"OperatorNotAllowed","type":"error"},{"inputs":[],"name":"RegistryHasBeenRevoked","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"TransferBatch","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"TransferSingle","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"value","type":"string"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"URI","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"allMetadataFrozen","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts","type":"address[]"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"name":"balanceOfBatch","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_numTokens","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"creditCardMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"exists","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"freezeAllMetadata","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"freezePayoutAddresses","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"freezeTokenMetadata","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"address[]","name":"_receivers","type":"address[]"},{"internalType":"uint256[]","name":"_mintNumber","type":"uint256[]"}],"name":"giftTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isOperatorFilterRegistryRevoked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_numTokens","type":"uint256"}],"name":"mintToken","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"operatorFilterRegistry","outputs":[{"internalType":"contract IOperatorFilterRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"paperAddresses","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"payoutAddresses","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"payoutAddressesFrozen","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"payoutBasisPoints","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"permanentlyDisableTokenMinting","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_messageHash","type":"bytes32"},{"internalType":"bytes","name":"_signature","type":"bytes"},{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_numTokens","type":"uint256"},{"internalType":"uint256","name":"_maximumAllowedMints","type":"uint256"}],"name":"presaleMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_newMaxSupply","type":"uint256"}],"name":"reduceMaxSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_newPresaleMaxSupply","type":"uint256"}],"name":"reducePresaleMaxSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"revokeOperatorFilterRegistry","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"royaltyAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"royaltyFee","outputs":[{"internalType":"uint96","name":"","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeBatchTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_newTokenURI","type":"string"}],"name":"setGlobalURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_presaleSignerAddress","type":"address"}],"name":"setPresaleSignerAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_royaltyAddress","type":"address"}],"name":"setRoyaltyAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint96","name":"_feeNumerator","type":"uint96"}],"name":"setRoyaltyFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_presaleEndTime","type":"uint256"}],"name":"setTokenPresaleEndTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_mintsAllowed","type":"uint256"}],"name":"setTokenPresaleMintsAllowedPerAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_presalePrice","type":"uint256"}],"name":"setTokenPresalePrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_presaleStartTime","type":"uint256"}],"name":"setTokenPresaleStartTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"bool","name":"_saleActiveState","type":"bool"}],"name":"setTokenPresaleState","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_mintsAllowed","type":"uint256"}],"name":"setTokenPublicMintsAllowedPerAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_publicPrice","type":"uint256"}],"name":"setTokenPublicPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_publicSaleEndTime","type":"uint256"}],"name":"setTokenPublicSaleEndTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_publicSaleStartTime","type":"uint256"}],"name":"setTokenPublicSaleStartTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"bool","name":"_saleActiveState","type":"bool"}],"name":"setTokenPublicSaleState","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"bool","name":"_usePresaleTimes","type":"bool"}],"name":"setTokenUsePresaleTimes","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"bool","name":"_usePublicSaleTimes","type":"bool"}],"name":"setTokenUsePublicSaleTimes","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"string","name":"_newTokenURI","type":"string"}],"name":"setURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"_interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenMaxSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenMetadataFrozen","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenMintingPermanentlyDisabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenPresaleMaxSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenPresaleMintsPerAddress","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenPresalePrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenPresaleSaleActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenPresaleSaleEndTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenPresaleSaleStartTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"tokenPresaleTimeIsActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenPublicMintsPerAddress","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenPublicPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenPublicSaleActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenPublicSaleEndTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenPublicSaleStartTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"tokenPublicSaleTimeIsActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenUsePresaleTimes","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenUsePublicSaleTimes","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokensMintedByAddress","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"totalSupply","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":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newRegistry","type":"address"}],"name":"updateOperatorFilterRegistryAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_payoutAddresses","type":"address[]"},{"internalType":"uint256[]","name":"_payoutBasisPoints","type":"uint256[]"}],"name":"updatePayoutAddressesAndBasisPoints","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]