|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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); |
|
} |
|
} |
|
} |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
pragma solidity ^0.8.0; |
|
|
|
|
|
|
|
|
|
|
|
|
|
interface IERC721Receiver { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function onERC721Received( |
|
address operator, |
|
address from, |
|
uint256 tokenId, |
|
bytes calldata data |
|
) external returns (bytes4); |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
pragma solidity ^0.8.0; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
interface IERC165 { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function supportsInterface(bytes4 interfaceId) external view returns (bool); |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
pragma solidity ^0.8.0; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
abstract contract ERC165 is IERC165 { |
|
|
|
|
|
|
|
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { |
|
return interfaceId == type(IERC165).interfaceId; |
|
} |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
pragma solidity ^0.8.0; |
|
|
|
|
|
|
|
|
|
|
|
interface IERC721 is IERC165 { |
|
|
|
|
|
|
|
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); |
|
|
|
|
|
|
|
|
|
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); |
|
|
|
|
|
|
|
|
|
event ApprovalForAll(address indexed owner, address indexed operator, bool approved); |
|
|
|
|
|
|
|
|
|
function balanceOf(address owner) external view returns (uint256 balance); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function ownerOf(uint256 tokenId) external view returns (address owner); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function safeTransferFrom( |
|
address from, |
|
address to, |
|
uint256 tokenId |
|
) external; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function transferFrom( |
|
address from, |
|
address to, |
|
uint256 tokenId |
|
) external; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function approve(address to, uint256 tokenId) external; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function getApproved(uint256 tokenId) external view returns (address operator); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function setApprovalForAll(address operator, bool _approved) external; |
|
|
|
|
|
|
|
|
|
|
|
|
|
function isApprovedForAll(address owner, address operator) external view returns (bool); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function safeTransferFrom( |
|
address from, |
|
address to, |
|
uint256 tokenId, |
|
bytes calldata data |
|
) external; |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
pragma solidity ^0.8.0; |
|
|
|
|
|
|
|
|
|
|
|
|
|
interface IERC721Enumerable is IERC721 { |
|
|
|
|
|
|
|
function totalSupply() external view returns (uint256); |
|
|
|
|
|
|
|
|
|
|
|
function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256); |
|
|
|
|
|
|
|
|
|
|
|
function tokenByIndex(uint256 index) external view returns (uint256); |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
pragma solidity ^0.8.0; |
|
|
|
|
|
|
|
|
|
|
|
|
|
interface IERC721Metadata is IERC721 { |
|
|
|
|
|
|
|
function name() external view returns (string memory); |
|
|
|
|
|
|
|
|
|
function symbol() external view returns (string memory); |
|
|
|
|
|
|
|
|
|
function tokenURI(uint256 tokenId) external view returns (string memory); |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
pragma solidity ^0.8.0; |
|
|
|
|
|
|
|
|
|
library Strings { |
|
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; |
|
|
|
|
|
|
|
|
|
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); |
|
} |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
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; |
|
} |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
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; |
|
} |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
pragma solidity ^0.8.0; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
abstract contract Ownable is Context { |
|
address private _owner; |
|
|
|
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); |
|
|
|
|
|
|
|
|
|
constructor() { |
|
_transferOwnership(_msgSender()); |
|
} |
|
|
|
|
|
|
|
|
|
function owner() public view virtual returns (address) { |
|
return _owner; |
|
} |
|
|
|
|
|
|
|
|
|
function _onlyOwner() private view { |
|
require(owner() == _msgSender(), "Ownable: caller is not the owner"); |
|
} |
|
|
|
modifier onlyOwner() { |
|
_onlyOwner(); |
|
_; |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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); |
|
} |
|
} |
|
|
|
|
|
pragma solidity ^0.8.9; |
|
|
|
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 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); |
|
} |
|
|
|
|
|
pragma solidity ^0.8.9; |
|
|
|
abstract contract OperatorFilterer { |
|
error OperatorNotAllowed(address operator); |
|
|
|
IOperatorFilterRegistry constant operatorFilterRegistry = |
|
IOperatorFilterRegistry(0x000000000000AAeB6D7670E522A718067333cd4E); |
|
|
|
constructor(address subscriptionOrRegistrantToCopy, bool subscribe) { |
|
|
|
|
|
|
|
if (address(operatorFilterRegistry).code.length > 0) { |
|
if (subscribe) { |
|
operatorFilterRegistry.registerAndSubscribe(address(this), subscriptionOrRegistrantToCopy); |
|
} else { |
|
if (subscriptionOrRegistrantToCopy != address(0)) { |
|
operatorFilterRegistry.registerAndCopyEntries(address(this), subscriptionOrRegistrantToCopy); |
|
} else { |
|
operatorFilterRegistry.register(address(this)); |
|
} |
|
} |
|
} |
|
} |
|
|
|
function _onlyAllowedOperator(address from) private view { |
|
if ( |
|
!( |
|
operatorFilterRegistry.isOperatorAllowed(address(this), msg.sender) |
|
&& operatorFilterRegistry.isOperatorAllowed(address(this), from) |
|
) |
|
) { |
|
revert OperatorNotAllowed(msg.sender); |
|
} |
|
} |
|
|
|
modifier onlyAllowedOperator(address from) virtual { |
|
|
|
if (address(operatorFilterRegistry).code.length > 0) { |
|
|
|
|
|
|
|
if (from == msg.sender) { |
|
_; |
|
return; |
|
} |
|
_onlyAllowedOperator(from); |
|
} |
|
_; |
|
} |
|
|
|
modifier onlyAllowedOperatorApproval(address operator) virtual { |
|
_checkFilterOperator(operator); |
|
_; |
|
} |
|
|
|
function _checkFilterOperator(address operator) internal view virtual { |
|
|
|
if (address(operatorFilterRegistry).code.length > 0) { |
|
if (!operatorFilterRegistry.isOperatorAllowed(address(this), operator)) { |
|
revert OperatorNotAllowed(operator); |
|
} |
|
} |
|
} |
|
} |
|
|
|
|
|
|
|
|
|
|
|
error TransactionCapExceeded(); |
|
error PublicMintingClosed(); |
|
error ExcessiveOwnedMints(); |
|
error MintZeroQuantity(); |
|
error InvalidPayment(); |
|
error CapExceeded(); |
|
error IsAlreadyUnveiled(); |
|
error ValueCannotBeZero(); |
|
error CannotBeNullAddress(); |
|
error NoStateChange(); |
|
|
|
error PublicMintClosed(); |
|
error AllowlistMintClosed(); |
|
|
|
error AddressNotAllowlisted(); |
|
error AllowlistDropTimeHasNotPassed(); |
|
error PublicDropTimeHasNotPassed(); |
|
error DropTimeNotInFuture(); |
|
|
|
error OnlyERC20MintingEnabled(); |
|
error ERC20TokenNotApproved(); |
|
error ERC20InsufficientBalance(); |
|
error ERC20InsufficientAllowance(); |
|
error ERC20TransferFailed(); |
|
|
|
error ClaimModeDisabled(); |
|
error IneligibleRedemptionContract(); |
|
error TokenAlreadyRedeemed(); |
|
error InvalidOwnerForRedemption(); |
|
error InvalidApprovalForRedemption(); |
|
|
|
error ERC721RestrictedApprovalAddressRestricted(); |
|
|
|
|
|
|
|
|
|
error InvalidTeamAddress(); |
|
error DuplicateTeamAddress(); |
|
pragma solidity ^0.8.0; |
|
|
|
|
|
|
|
|
|
|
|
|
|
abstract contract Teams is Ownable{ |
|
mapping (address => bool) internal team; |
|
|
|
|
|
|
|
|
|
|
|
function addToTeam(address _address) public onlyOwner { |
|
if(_address == address(0)) revert InvalidTeamAddress(); |
|
if(inTeam(_address)) revert DuplicateTeamAddress(); |
|
|
|
team[_address] = true; |
|
} |
|
|
|
|
|
|
|
|
|
|
|
function removeFromTeam(address _address) public onlyOwner { |
|
if(_address == address(0)) revert InvalidTeamAddress(); |
|
if(!inTeam(_address)) revert InvalidTeamAddress(); |
|
|
|
team[_address] = false; |
|
} |
|
|
|
|
|
|
|
|
|
|
|
function inTeam(address _address) |
|
public |
|
view |
|
returns (bool) |
|
{ |
|
if(_address == address(0)) revert InvalidTeamAddress(); |
|
return team[_address] == true; |
|
} |
|
|
|
|
|
|
|
|
|
function _onlyTeamOrOwner() private view { |
|
bool _isOwner = owner() == _msgSender(); |
|
bool _isTeam = inTeam(_msgSender()); |
|
require(_isOwner || _isTeam, "Team: caller is not the owner or in Team."); |
|
} |
|
|
|
modifier onlyTeamOrOwner() { |
|
_onlyTeamOrOwner(); |
|
_; |
|
} |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
contract ERC721A is |
|
Context, |
|
ERC165, |
|
IERC721, |
|
IERC721Metadata, |
|
IERC721Enumerable, |
|
Teams |
|
, OperatorFilterer |
|
{ |
|
using Address for address; |
|
using Strings for uint256; |
|
|
|
struct TokenOwnership { |
|
address addr; |
|
uint64 startTimestamp; |
|
} |
|
|
|
struct AddressData { |
|
uint128 balance; |
|
uint128 numberMinted; |
|
} |
|
|
|
uint256 private currentIndex; |
|
|
|
uint256 public immutable collectionSize; |
|
uint256 public maxBatchSize; |
|
|
|
|
|
string private _name; |
|
|
|
|
|
string private _symbol; |
|
|
|
|
|
|
|
mapping(uint256 => TokenOwnership) private _ownerships; |
|
|
|
|
|
mapping(address => AddressData) private _addressData; |
|
|
|
|
|
mapping(uint256 => address) private _tokenApprovals; |
|
|
|
|
|
mapping(address => mapping(address => bool)) private _operatorApprovals; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mapping(address => bool) public restrictedApprovalAddresses; |
|
|
|
|
|
|
|
|
|
|
|
|
|
constructor( |
|
string memory name_, |
|
string memory symbol_, |
|
uint256 maxBatchSize_, |
|
uint256 collectionSize_ |
|
) OperatorFilterer(0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6, true) { |
|
require( |
|
collectionSize_ > 0, |
|
"ERC721A: collection must have a nonzero supply" |
|
); |
|
require(maxBatchSize_ > 0, "ERC721A: max batch size must be nonzero"); |
|
_name = name_; |
|
_symbol = symbol_; |
|
maxBatchSize = maxBatchSize_; |
|
collectionSize = collectionSize_; |
|
currentIndex = _startTokenId(); |
|
} |
|
|
|
|
|
|
|
|
|
function _startTokenId() internal view virtual returns (uint256) { |
|
return 1; |
|
} |
|
|
|
|
|
|
|
|
|
function totalSupply() public view override returns (uint256) { |
|
return _totalMinted(); |
|
} |
|
|
|
function currentTokenId() public view returns (uint256) { |
|
return _totalMinted(); |
|
} |
|
|
|
function getNextTokenId() public view returns (uint256) { |
|
return _totalMinted() + 1; |
|
} |
|
|
|
|
|
|
|
|
|
function _totalMinted() internal view returns (uint256) { |
|
unchecked { |
|
return currentIndex - _startTokenId(); |
|
} |
|
} |
|
|
|
|
|
|
|
|
|
function tokenByIndex(uint256 index) public view override returns (uint256) { |
|
require(index < totalSupply(), "ERC721A: global index out of bounds"); |
|
return index; |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
function tokenOfOwnerByIndex(address owner, uint256 index) |
|
public |
|
view |
|
override |
|
returns (uint256) |
|
{ |
|
require(index < balanceOf(owner), "ERC721A: owner index out of bounds"); |
|
uint256 numMintedSoFar = totalSupply(); |
|
uint256 tokenIdsIdx = 0; |
|
address currOwnershipAddr = address(0); |
|
for (uint256 i = 0; i < numMintedSoFar; i++) { |
|
TokenOwnership memory ownership = _ownerships[i]; |
|
if (ownership.addr != address(0)) { |
|
currOwnershipAddr = ownership.addr; |
|
} |
|
if (currOwnershipAddr == owner) { |
|
if (tokenIdsIdx == index) { |
|
return i; |
|
} |
|
tokenIdsIdx++; |
|
} |
|
} |
|
revert("ERC721A: unable to get token of owner by index"); |
|
} |
|
|
|
|
|
|
|
|
|
function supportsInterface(bytes4 interfaceId) |
|
public |
|
view |
|
virtual |
|
override(ERC165, IERC165) |
|
returns (bool) |
|
{ |
|
return |
|
interfaceId == type(IERC721).interfaceId || |
|
interfaceId == type(IERC721Metadata).interfaceId || |
|
interfaceId == type(IERC721Enumerable).interfaceId || |
|
super.supportsInterface(interfaceId); |
|
} |
|
|
|
|
|
|
|
|
|
function balanceOf(address owner) public view override returns (uint256) { |
|
require(owner != address(0), "ERC721A: balance query for the zero address"); |
|
return uint256(_addressData[owner].balance); |
|
} |
|
|
|
function _numberMinted(address owner) internal view returns (uint256) { |
|
require( |
|
owner != address(0), |
|
"ERC721A: number minted query for the zero address" |
|
); |
|
return uint256(_addressData[owner].numberMinted); |
|
} |
|
|
|
function ownershipOf(uint256 tokenId) |
|
internal |
|
view |
|
returns (TokenOwnership memory) |
|
{ |
|
uint256 curr = tokenId; |
|
|
|
unchecked { |
|
if (_startTokenId() <= curr && curr < currentIndex) { |
|
TokenOwnership memory ownership = _ownerships[curr]; |
|
if (ownership.addr != address(0)) { |
|
return ownership; |
|
} |
|
|
|
|
|
|
|
|
|
|
|
while (true) { |
|
curr--; |
|
ownership = _ownerships[curr]; |
|
if (ownership.addr != address(0)) { |
|
return ownership; |
|
} |
|
} |
|
} |
|
} |
|
|
|
revert("ERC721A: unable to determine the owner of token"); |
|
} |
|
|
|
|
|
|
|
|
|
function ownerOf(uint256 tokenId) public view override returns (address) { |
|
return ownershipOf(tokenId).addr; |
|
} |
|
|
|
|
|
|
|
|
|
function name() public view virtual override returns (string memory) { |
|
return _name; |
|
} |
|
|
|
|
|
|
|
|
|
function symbol() public view virtual override returns (string memory) { |
|
return _symbol; |
|
} |
|
|
|
|
|
|
|
|
|
function tokenURI(uint256 tokenId) |
|
public |
|
view |
|
virtual |
|
override |
|
returns (string memory) |
|
{ |
|
string memory baseURI = _baseURI(); |
|
string memory extension = _baseURIExtension(); |
|
return |
|
bytes(baseURI).length > 0 |
|
? string(abi.encodePacked(baseURI, tokenId.toString(), extension)) |
|
: ""; |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
function _baseURI() internal view virtual returns (string memory) { |
|
return ""; |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
function _baseURIExtension() internal view virtual returns (string memory) { |
|
return ""; |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function setApprovalRestriction(address _address, bool _isRestricted) public onlyTeamOrOwner { |
|
restrictedApprovalAddresses[_address] = _isRestricted; |
|
} |
|
|
|
|
|
|
|
|
|
function approve(address to, uint256 tokenId) public override onlyAllowedOperatorApproval(to) { |
|
address owner = ERC721A.ownerOf(tokenId); |
|
require(to != owner, "ERC721A: approval to current owner"); |
|
if(restrictedApprovalAddresses[to]) revert ERC721RestrictedApprovalAddressRestricted(); |
|
|
|
require( |
|
_msgSender() == owner || isApprovedForAll(owner, _msgSender()), |
|
"ERC721A: approve caller is not owner nor approved for all" |
|
); |
|
|
|
_approve(to, tokenId, owner); |
|
} |
|
|
|
|
|
|
|
|
|
function getApproved(uint256 tokenId) public view override returns (address) { |
|
require(_exists(tokenId), "ERC721A: approved query for nonexistent token"); |
|
|
|
return _tokenApprovals[tokenId]; |
|
} |
|
|
|
|
|
|
|
|
|
function setApprovalForAll(address operator, bool approved) public override onlyAllowedOperatorApproval(operator) { |
|
require(operator != _msgSender(), "ERC721A: approve to caller"); |
|
if(restrictedApprovalAddresses[operator]) revert ERC721RestrictedApprovalAddressRestricted(); |
|
|
|
_operatorApprovals[_msgSender()][operator] = approved; |
|
emit ApprovalForAll(_msgSender(), operator, approved); |
|
} |
|
|
|
|
|
|
|
|
|
function isApprovedForAll(address owner, address operator) |
|
public |
|
view |
|
virtual |
|
override |
|
returns (bool) |
|
{ |
|
return _operatorApprovals[owner][operator]; |
|
} |
|
|
|
|
|
|
|
|
|
function transferFrom( |
|
address from, |
|
address to, |
|
uint256 tokenId |
|
) public override onlyAllowedOperator(from) { |
|
_transfer(from, to, tokenId); |
|
} |
|
|
|
|
|
|
|
|
|
function safeTransferFrom( |
|
address from, |
|
address to, |
|
uint256 tokenId |
|
) public override onlyAllowedOperator(from) { |
|
safeTransferFrom(from, to, tokenId, ""); |
|
} |
|
|
|
|
|
|
|
|
|
function safeTransferFrom( |
|
address from, |
|
address to, |
|
uint256 tokenId, |
|
bytes memory _data |
|
) public override onlyAllowedOperator(from) { |
|
_transfer(from, to, tokenId); |
|
require( |
|
_checkOnERC721Received(from, to, tokenId, _data), |
|
"ERC721A: transfer to non ERC721Receiver implementer" |
|
); |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function _exists(uint256 tokenId) internal view returns (bool) { |
|
return _startTokenId() <= tokenId && tokenId < currentIndex; |
|
} |
|
|
|
function _safeMint(address to, uint256 quantity, bool isAdminMint) internal { |
|
_safeMint(to, quantity, isAdminMint, ""); |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function _safeMint( |
|
address to, |
|
uint256 quantity, |
|
bool isAdminMint, |
|
bytes memory _data |
|
) internal { |
|
uint256 startTokenId = currentIndex; |
|
require(to != address(0), "ERC721A: mint to the zero address"); |
|
|
|
require(!_exists(startTokenId), "ERC721A: token already minted"); |
|
|
|
|
|
if (isAdminMint == false) { |
|
require(quantity <= maxBatchSize, "ERC721A: quantity to mint too high"); |
|
} |
|
|
|
_beforeTokenTransfers(address(0), to, startTokenId, quantity); |
|
|
|
AddressData memory addressData = _addressData[to]; |
|
_addressData[to] = AddressData( |
|
addressData.balance + uint128(quantity), |
|
addressData.numberMinted + (isAdminMint ? 0 : uint128(quantity)) |
|
); |
|
_ownerships[startTokenId] = TokenOwnership(to, uint64(block.timestamp)); |
|
|
|
uint256 updatedIndex = startTokenId; |
|
|
|
for (uint256 i = 0; i < quantity; i++) { |
|
emit Transfer(address(0), to, updatedIndex); |
|
require( |
|
_checkOnERC721Received(address(0), to, updatedIndex, _data), |
|
"ERC721A: transfer to non ERC721Receiver implementer" |
|
); |
|
updatedIndex++; |
|
} |
|
|
|
currentIndex = updatedIndex; |
|
_afterTokenTransfers(address(0), to, startTokenId, quantity); |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function _transfer( |
|
address from, |
|
address to, |
|
uint256 tokenId |
|
) private { |
|
TokenOwnership memory prevOwnership = ownershipOf(tokenId); |
|
|
|
bool isApprovedOrOwner = (_msgSender() == prevOwnership.addr || |
|
getApproved(tokenId) == _msgSender() || |
|
isApprovedForAll(prevOwnership.addr, _msgSender())); |
|
|
|
require( |
|
isApprovedOrOwner, |
|
"ERC721A: transfer caller is not owner nor approved" |
|
); |
|
|
|
require( |
|
prevOwnership.addr == from, |
|
"ERC721A: transfer from incorrect owner" |
|
); |
|
require(to != address(0), "ERC721A: transfer to the zero address"); |
|
|
|
_beforeTokenTransfers(from, to, tokenId, 1); |
|
|
|
|
|
_approve(address(0), tokenId, prevOwnership.addr); |
|
|
|
_addressData[from].balance -= 1; |
|
_addressData[to].balance += 1; |
|
_ownerships[tokenId] = TokenOwnership(to, uint64(block.timestamp)); |
|
|
|
|
|
|
|
uint256 nextTokenId = tokenId + 1; |
|
if (_ownerships[nextTokenId].addr == address(0)) { |
|
if (_exists(nextTokenId)) { |
|
_ownerships[nextTokenId] = TokenOwnership( |
|
prevOwnership.addr, |
|
prevOwnership.startTimestamp |
|
); |
|
} |
|
} |
|
|
|
emit Transfer(from, to, tokenId); |
|
_afterTokenTransfers(from, to, tokenId, 1); |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
function _approve( |
|
address to, |
|
uint256 tokenId, |
|
address owner |
|
) private { |
|
_tokenApprovals[tokenId] = to; |
|
emit Approval(owner, to, tokenId); |
|
} |
|
|
|
uint256 public nextOwnerToExplicitlySet = 0; |
|
|
|
|
|
|
|
|
|
function _setOwnersExplicit(uint256 quantity) internal { |
|
uint256 oldNextOwnerToSet = nextOwnerToExplicitlySet; |
|
require(quantity > 0, "quantity must be nonzero"); |
|
if (currentIndex == _startTokenId()) revert('No Tokens Minted Yet'); |
|
|
|
uint256 endIndex = oldNextOwnerToSet + quantity - 1; |
|
if (endIndex > collectionSize - 1) { |
|
endIndex = collectionSize - 1; |
|
} |
|
|
|
require(_exists(endIndex), "not enough minted yet for this cleanup"); |
|
for (uint256 i = oldNextOwnerToSet; i <= endIndex; i++) { |
|
if (_ownerships[i].addr == address(0)) { |
|
TokenOwnership memory ownership = ownershipOf(i); |
|
_ownerships[i] = TokenOwnership( |
|
ownership.addr, |
|
ownership.startTimestamp |
|
); |
|
} |
|
} |
|
nextOwnerToExplicitlySet = endIndex + 1; |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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(to).onERC721Received.selector; |
|
} catch (bytes memory reason) { |
|
if (reason.length == 0) { |
|
revert("ERC721A: transfer to non ERC721Receiver implementer"); |
|
} else { |
|
assembly { |
|
revert(add(32, reason), mload(reason)) |
|
} |
|
} |
|
} |
|
} else { |
|
return true; |
|
} |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function _beforeTokenTransfers( |
|
address from, |
|
address to, |
|
uint256 startTokenId, |
|
uint256 quantity |
|
) internal virtual {} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function _afterTokenTransfers( |
|
address from, |
|
address to, |
|
uint256 startTokenId, |
|
uint256 quantity |
|
) internal virtual {} |
|
} |
|
|
|
|
|
|
|
|
|
|
|
abstract contract ERC721ARedemption is ERC721A { |
|
|
|
event Redeemed(address indexed from, uint256 indexed tokenId, address indexed contractAddress); |
|
|
|
|
|
event VerifiedClaim(address indexed from, uint256 indexed tokenId, address indexed contractAddress); |
|
|
|
uint256 public redemptionSurcharge = 0 ether; |
|
bool public redemptionModeEnabled; |
|
bool public verifiedClaimModeEnabled; |
|
address public redemptionAddress = 0x000000000000000000000000000000000000dEaD; |
|
mapping(address => bool) public redemptionContracts; |
|
mapping(address => mapping(uint256 => bool)) public tokenRedemptions; |
|
|
|
|
|
function setRedeemableContract(address _contractAddress, bool _status) public onlyTeamOrOwner { |
|
redemptionContracts[_contractAddress] = _status; |
|
} |
|
|
|
|
|
function setRedemptionMode(bool _newStatus) public onlyTeamOrOwner { |
|
redemptionModeEnabled = _newStatus; |
|
} |
|
|
|
|
|
function setVerifiedClaimMode(bool _newStatus) public onlyTeamOrOwner { |
|
verifiedClaimModeEnabled = _newStatus; |
|
} |
|
|
|
|
|
function setRedemptionSurcharge(uint256 _newSurchargeInWei) public onlyTeamOrOwner { |
|
redemptionSurcharge = _newSurchargeInWei; |
|
} |
|
|
|
|
|
|
|
|
|
|
|
function setRedemptionAddress(address _newRedemptionAddress) public onlyTeamOrOwner { |
|
if(_newRedemptionAddress == address(0)) revert CannotBeNullAddress(); |
|
redemptionAddress = _newRedemptionAddress; |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function redeem(address redemptionContract, uint256 tokenId) public payable { |
|
if(getNextTokenId() > collectionSize) revert CapExceeded(); |
|
if(!redemptionModeEnabled) revert ClaimModeDisabled(); |
|
if(redemptionContract == address(0)) revert CannotBeNullAddress(); |
|
if(!redemptionContracts[redemptionContract]) revert IneligibleRedemptionContract(); |
|
if(msg.value != redemptionSurcharge) revert InvalidPayment(); |
|
if(tokenRedemptions[redemptionContract][tokenId]) revert TokenAlreadyRedeemed(); |
|
|
|
IERC721 _targetContract = IERC721(redemptionContract); |
|
if(_targetContract.ownerOf(tokenId) != _msgSender()) revert InvalidOwnerForRedemption(); |
|
if(_targetContract.getApproved(tokenId) != address(this)) revert InvalidApprovalForRedemption(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
_targetContract.safeTransferFrom(_msgSender(), redemptionAddress, tokenId); |
|
tokenRedemptions[redemptionContract][tokenId] = true; |
|
|
|
emit Redeemed(_msgSender(), tokenId, redemptionContract); |
|
_safeMint(_msgSender(), 1, false); |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function verifedClaim(address redemptionContract, uint256 tokenId) public payable { |
|
if(getNextTokenId() > collectionSize) revert CapExceeded(); |
|
if(!verifiedClaimModeEnabled) revert ClaimModeDisabled(); |
|
if(redemptionContract == address(0)) revert CannotBeNullAddress(); |
|
if(!redemptionContracts[redemptionContract]) revert IneligibleRedemptionContract(); |
|
if(msg.value != redemptionSurcharge) revert InvalidPayment(); |
|
if(tokenRedemptions[redemptionContract][tokenId]) revert TokenAlreadyRedeemed(); |
|
|
|
tokenRedemptions[redemptionContract][tokenId] = true; |
|
emit VerifiedClaim(_msgSender(), tokenId, redemptionContract); |
|
_safeMint(_msgSender(), 1, false); |
|
} |
|
} |
|
|
|
|
|
|
|
|
|
interface IERC20 { |
|
function allowance(address owner, address spender) external view returns (uint256); |
|
function transfer(address _to, uint256 _amount) external returns (bool); |
|
function balanceOf(address account) external view returns (uint256); |
|
function transferFrom(address from, address to, uint256 amount) external returns (bool); |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
abstract contract WithdrawableV2 is Teams { |
|
struct acceptedERC20 { |
|
bool isActive; |
|
uint256 chargeAmount; |
|
} |
|
|
|
|
|
mapping(address => acceptedERC20) private allowedTokenContracts; |
|
address[] public payableAddresses = [0xA4a85096ab36Cd2fCb68580DC7Fe98b98b4880bc]; |
|
address public erc20Payable = 0xA4a85096ab36Cd2fCb68580DC7Fe98b98b4880bc; |
|
uint256[] public payableFees = [100]; |
|
uint256 public payableAddressCount = 1; |
|
bool public onlyERC20MintingMode; |
|
|
|
|
|
function withdrawAll() public onlyTeamOrOwner { |
|
if(address(this).balance == 0) revert ValueCannotBeZero(); |
|
_withdrawAll(address(this).balance); |
|
} |
|
|
|
function _withdrawAll(uint256 balance) private { |
|
for(uint i=0; i < payableAddressCount; i++ ) { |
|
_widthdraw( |
|
payableAddresses[i], |
|
(balance * payableFees[i]) / 100 |
|
); |
|
} |
|
} |
|
|
|
function _widthdraw(address _address, uint256 _amount) private { |
|
(bool success, ) = _address.call{value: _amount}(""); |
|
require(success, "Transfer failed."); |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function withdrawERC20(address _tokenContract, uint256 _amountToWithdraw) public onlyTeamOrOwner { |
|
if(_amountToWithdraw == 0) revert ValueCannotBeZero(); |
|
IERC20 tokenContract = IERC20(_tokenContract); |
|
if(tokenContract.balanceOf(address(this)) < _amountToWithdraw) revert ERC20InsufficientBalance(); |
|
tokenContract.transfer(erc20Payable, _amountToWithdraw); |
|
} |
|
|
|
|
|
|
|
|
|
|
|
function isApprovedForERC20Payments(address _erc20TokenContract) public view returns(bool) { |
|
return allowedTokenContracts[_erc20TokenContract].isActive == true; |
|
} |
|
|
|
|
|
|
|
|
|
|
|
function chargeAmountForERC20(address _erc20TokenContract) public view returns(uint256) { |
|
if(!isApprovedForERC20Payments(_erc20TokenContract)) revert ERC20TokenNotApproved(); |
|
return allowedTokenContracts[_erc20TokenContract].chargeAmount; |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function addOrUpdateERC20ContractAsPayment(address _erc20TokenContract, bool _isActive, uint256 _chargeAmountInTokens) public onlyTeamOrOwner { |
|
allowedTokenContracts[_erc20TokenContract].isActive = _isActive; |
|
allowedTokenContracts[_erc20TokenContract].chargeAmount = _chargeAmountInTokens; |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
function enableERC20ContractAsPayment(address _erc20TokenContract) public onlyTeamOrOwner { |
|
allowedTokenContracts[_erc20TokenContract].isActive = true; |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
function disableERC20ContractAsPayment(address _erc20TokenContract) public onlyTeamOrOwner { |
|
allowedTokenContracts[_erc20TokenContract].isActive = false; |
|
} |
|
|
|
|
|
|
|
|
|
function enableERC20OnlyMinting() public onlyTeamOrOwner { |
|
onlyERC20MintingMode = true; |
|
} |
|
|
|
|
|
|
|
|
|
function disableERC20OnlyMinting() public onlyTeamOrOwner { |
|
onlyERC20MintingMode = false; |
|
} |
|
|
|
|
|
|
|
|
|
|
|
function setERC20PayableAddress(address _newErc20Payable) public onlyTeamOrOwner { |
|
if(_newErc20Payable == address(0)) revert CannotBeNullAddress(); |
|
if(_newErc20Payable == erc20Payable) revert NoStateChange(); |
|
erc20Payable = _newErc20Payable; |
|
} |
|
} |
|
|
|
|
|
|
|
|
|
abstract contract Feeable is Teams { |
|
uint256 public PRICE = 0.003 ether; |
|
|
|
function setPrice(uint256 _feeInWei) public onlyTeamOrOwner { |
|
PRICE = _feeInWei; |
|
} |
|
|
|
function getPrice(uint256 _count) public view returns (uint256) { |
|
return PRICE * _count; |
|
} |
|
} |
|
|
|
|
|
|
|
|
|
abstract contract RamppERC721A is |
|
Ownable, |
|
Teams, |
|
ERC721ARedemption, |
|
WithdrawableV2, |
|
ReentrancyGuard |
|
, Feeable |
|
|
|
|
|
{ |
|
constructor( |
|
string memory tokenName, |
|
string memory tokenSymbol |
|
) ERC721A(tokenName, tokenSymbol, 10, 792) { } |
|
uint8 constant public CONTRACT_VERSION = 2; |
|
string public _baseTokenURI = "ipfs://QmNecqPmab7xKB9Q3W38vUXLhD94AubsoBxJgeoMLjT9Xd/"; |
|
string public _baseTokenExtension = ".json"; |
|
|
|
bool public mintingOpen = true; |
|
|
|
|
|
uint256 public MAX_WALLET_MINTS = 10; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function mintToAdminV2(address _to, uint256 _qty) public onlyTeamOrOwner{ |
|
if(_qty == 0) revert MintZeroQuantity(); |
|
if(currentTokenId() + _qty > collectionSize) revert CapExceeded(); |
|
_safeMint(_to, _qty, true); |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function mintToMultiple(address _to, uint256 _amount) public payable { |
|
if(onlyERC20MintingMode) revert OnlyERC20MintingEnabled(); |
|
if(_amount == 0) revert MintZeroQuantity(); |
|
if(_amount > maxBatchSize) revert TransactionCapExceeded(); |
|
if(!mintingOpen) revert PublicMintClosed(); |
|
|
|
|
|
if(!canMintAmount(_to, _amount)) revert ExcessiveOwnedMints(); |
|
if(currentTokenId() + _amount > collectionSize) revert CapExceeded(); |
|
if(msg.value != getPrice(_amount)) revert InvalidPayment(); |
|
|
|
_safeMint(_to, _amount, false); |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function mintToMultipleERC20(address _to, uint256 _amount, address _erc20TokenContract) public payable { |
|
if(_amount == 0) revert MintZeroQuantity(); |
|
if(_amount > maxBatchSize) revert TransactionCapExceeded(); |
|
if(!mintingOpen) revert PublicMintClosed(); |
|
if(currentTokenId() + _amount > collectionSize) revert CapExceeded(); |
|
|
|
|
|
if(!canMintAmount(_to, _amount)) revert ExcessiveOwnedMints(); |
|
|
|
|
|
if(!isApprovedForERC20Payments(_erc20TokenContract)) revert ERC20TokenNotApproved(); |
|
uint256 tokensQtyToTransfer = chargeAmountForERC20(_erc20TokenContract) * _amount; |
|
IERC20 payableToken = IERC20(_erc20TokenContract); |
|
|
|
if(payableToken.balanceOf(_to) < tokensQtyToTransfer) revert ERC20InsufficientBalance(); |
|
if(payableToken.allowance(_to, address(this)) < tokensQtyToTransfer) revert ERC20InsufficientAllowance(); |
|
|
|
bool transferComplete = payableToken.transferFrom(_to, address(this), tokensQtyToTransfer); |
|
if(!transferComplete) revert ERC20TransferFailed(); |
|
|
|
_safeMint(_to, _amount, false); |
|
} |
|
|
|
function openMinting() public onlyTeamOrOwner { |
|
mintingOpen = true; |
|
} |
|
|
|
function stopMinting() public onlyTeamOrOwner { |
|
mintingOpen = false; |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function canMintAmount(address _address, uint256 _amount) public view returns(bool) { |
|
if(_amount == 0) revert ValueCannotBeZero(); |
|
return (_numberMinted(_address) + _amount) <= MAX_WALLET_MINTS; |
|
} |
|
|
|
|
|
|
|
|
|
|
|
function setWalletMax(uint256 _newWalletMax) public onlyTeamOrOwner { |
|
if(_newWalletMax == 0) revert ValueCannotBeZero(); |
|
MAX_WALLET_MINTS = _newWalletMax; |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function setMaxMint(uint256 _newMaxMint) public onlyTeamOrOwner { |
|
if(_newMaxMint == 0) revert ValueCannotBeZero(); |
|
maxBatchSize = _newMaxMint; |
|
} |
|
|
|
|
|
|
|
|
|
|
|
function contractURI() public pure returns (string memory) { |
|
return "https://metadata.mintplex.xyz/QqJPZnYYp2ADLE6e4PmT/contract-metadata"; |
|
} |
|
|
|
|
|
function _baseURI() internal view virtual override returns(string memory) { |
|
return _baseTokenURI; |
|
} |
|
|
|
function _baseURIExtension() internal view virtual override returns(string memory) { |
|
return _baseTokenExtension; |
|
} |
|
|
|
function baseTokenURI() public view returns(string memory) { |
|
return _baseTokenURI; |
|
} |
|
|
|
function setBaseURI(string calldata baseURI) external onlyTeamOrOwner { |
|
_baseTokenURI = baseURI; |
|
} |
|
|
|
function setBaseTokenExtension(string calldata baseExtension) external onlyTeamOrOwner { |
|
_baseTokenExtension = baseExtension; |
|
} |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
pragma solidity ^0.8.0; |
|
|
|
contract FunksByDasaContract is RamppERC721A { |
|
constructor() RamppERC721A("Funks By Dasa", "Funks"){} |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|