编译器
0.8.11+commit.d7f03943
文件 1 的 24:AccessControl.sol
pragma solidity ^0.8.0;
import "./IAccessControl.sol";
import "../utils/Context.sol";
import "../utils/Strings.sol";
import "../utils/introspection/ERC165.sol";
abstract contract AccessControl is Context, IAccessControl, ERC165 {
struct RoleData {
mapping(address => bool) members;
bytes32 adminRole;
}
mapping(bytes32 => RoleData) private _roles;
bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;
modifier onlyRole(bytes32 role) {
_checkRole(role, _msgSender());
_;
}
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);
}
function hasRole(bytes32 role, address account) public view virtual override returns (bool) {
return _roles[role].members[account];
}
function _checkRole(bytes32 role, address account) internal view virtual {
if (!hasRole(role, account)) {
revert(
string(
abi.encodePacked(
"AccessControl: account ",
Strings.toHexString(uint160(account), 20),
" is missing role ",
Strings.toHexString(uint256(role), 32)
)
)
);
}
}
function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {
return _roles[role].adminRole;
}
function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
_grantRole(role, account);
}
function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
_revokeRole(role, account);
}
function renounceRole(bytes32 role, address account) public virtual override {
require(account == _msgSender(), "AccessControl: can only renounce roles for self");
_revokeRole(role, account);
}
function _setupRole(bytes32 role, address account) internal virtual {
_grantRole(role, account);
}
function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
bytes32 previousAdminRole = getRoleAdmin(role);
_roles[role].adminRole = adminRole;
emit RoleAdminChanged(role, previousAdminRole, adminRole);
}
function _grantRole(bytes32 role, address account) internal virtual {
if (!hasRole(role, account)) {
_roles[role].members[account] = true;
emit RoleGranted(role, account, _msgSender());
}
}
function _revokeRole(bytes32 role, address account) internal virtual {
if (hasRole(role, account)) {
_roles[role].members[account] = false;
emit RoleRevoked(role, account, _msgSender());
}
}
}
文件 2 的 24: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);
}
}
}
}
文件 3 的 24: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;
}
}
文件 4 的 24: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;
}
}
文件 5 的 24:ERC721A.sol
pragma solidity ^0.8.4;
import './IERC721A.sol';
import '@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol';
import '@openzeppelin/contracts/utils/Address.sol';
import '@openzeppelin/contracts/utils/Context.sol';
import '@openzeppelin/contracts/utils/Strings.sol';
import '@openzeppelin/contracts/utils/introspection/ERC165.sol';
contract ERC721A is Context, ERC165, IERC721A {
using Address for address;
using Strings for uint256;
uint256 internal _burnCounter;
uint256 public _mintCounter;
uint256 public _maxSupply = 8888;
string private _name;
string private _symbol;
mapping(uint256 => TokenOwnership) internal _ownerships;
mapping(address => AddressData) internal _addressData;
mapping(uint256 => address) private _tokenApprovals;
mapping(address => mapping(address => bool)) private _operatorApprovals;
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
function _startTokenId() internal view virtual returns (uint256) {
return 1;
}
function totalSupply() public view override returns (uint256) {
unchecked {
return _mintCounter - _burnCounter;
}
}
function _totalMinted() internal view returns (uint256) {
unchecked {
return _mintCounter;
}
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
if (!_exists(tokenId)) revert URIQueryForNonexistentToken();
string memory baseURI = _baseURI();
return bytes(baseURI).length != 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : '';
}
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
return
interfaceId == type(IERC721).interfaceId ||
interfaceId == type(IERC721Metadata).interfaceId ||
super.supportsInterface(interfaceId);
}
function balanceOf(address owner) public view override returns (uint256) {
if (owner == address(0)) revert BalanceQueryForZeroAddress();
return uint256(_addressData[owner].balance);
}
function _numberMinted(address owner) internal view returns (uint256) {
return uint256(_addressData[owner].numberMinted);
}
function _reserveMinted(address owner) internal view returns (uint256) {
return uint256(_addressData[owner].reserveMinted);
}
function _getMintTime(address owner) internal view returns (uint64) {
return _addressData[owner].mintTime;
}
function _setAux(address owner, uint64 mintTime) internal {
_addressData[owner].mintTime = mintTime;
}
function _ownershipOf(uint256 tokenId) internal view returns (TokenOwnership memory) {
return _ownerships[tokenId];
}
function ownerOf(uint256 tokenId) public view override returns (address) {
return _ownerships[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 _baseURI() internal view virtual returns (string memory) {
return '';
}
function approve(address to, uint256 tokenId) public override {
address owner = ERC721A.ownerOf(tokenId);
if (to == owner) revert ApprovalToCurrentOwner();
if (_msgSender() != owner && !isApprovedForAll(owner, _msgSender())) {
revert ApprovalCallerNotOwnerNorApproved();
}
_approve(to, tokenId, owner);
}
function getApproved(uint256 tokenId) public view override returns (address) {
if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken();
return _tokenApprovals[tokenId];
}
function setApprovalForAll(address operator, bool approved) public virtual override {
if (operator == _msgSender()) revert ApproveToCaller();
_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 virtual override {
_transfer(from, to, tokenId);
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
safeTransferFrom(from, to, tokenId, '');
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public virtual override {
_transfer(from, to, tokenId);
if (to.isContract() && !_checkContractOnERC721Received(from, to, tokenId, _data)) {
revert TransferToNonERC721ReceiverImplementer();
}
}
function _exists(uint256 tokenId) internal view returns (bool) {
return _ownerships[tokenId].addr != address(0) && !_ownerships[tokenId].burned;
}
function _mintToken(address to, uint64 tokenId) internal {
if (to == address(0)) revert MintToZeroAddress();
if (tokenId == 0) revert MintZeroQuantity();
_beforeTokenTransfers(address(0), to, tokenId, 1);
unchecked {
_addressData[to].balance++;
_addressData[to].numberMinted++;
_addressData[to].mintTime = uint64(block.timestamp);
_ownerships[tokenId].addr = to;
_ownerships[tokenId].startTimestamp = uint64(block.timestamp);
emit Transfer(address(0), to, tokenId);
_mintCounter++;
}
_afterTokenTransfers(address(0), to, tokenId, 1);
}
function _safeMint(
address to,
uint256 quantity,
bytes memory _data
) internal {
}
function _safeMint(address to, uint256 quantity) internal {
}
function _mint(address to, uint256 quantity) internal {
}
function _transfer(
address from,
address to,
uint256 tokenId
) private {
TokenOwnership memory prevOwnership = _ownershipOf(tokenId);
if (prevOwnership.addr != from) revert TransferFromIncorrectOwner();
bool isApprovedOrOwner = (_msgSender() == from ||
isApprovedForAll(from, _msgSender()) ||
getApproved(tokenId) == _msgSender());
if (!isApprovedOrOwner) revert TransferCallerNotOwnerNorApproved();
if (to == address(0)) revert TransferToZeroAddress();
_beforeTokenTransfers(from, to, tokenId, 1);
_approve(address(0), tokenId, from);
unchecked {
_addressData[from].balance -= 1;
_addressData[to].balance += 1;
TokenOwnership storage currSlot = _ownerships[tokenId];
currSlot.addr = to;
currSlot.startTimestamp = uint64(block.timestamp);
uint256 nextTokenId = tokenId + 1;
TokenOwnership storage nextSlot = _ownerships[nextTokenId];
if (nextSlot.addr == address(0)) {
if (_exists(tokenId)) {
nextSlot.addr = from;
nextSlot.startTimestamp = prevOwnership.startTimestamp;
}
}
}
emit Transfer(from, to, tokenId);
_afterTokenTransfers(from, to, tokenId, 1);
}
function _burn(uint256 tokenId) internal virtual {
_burn(tokenId, false);
}
function _burn(uint256 tokenId, bool approvalCheck) internal virtual {
TokenOwnership memory prevOwnership = _ownershipOf(tokenId);
address from = prevOwnership.addr;
if (approvalCheck) {
bool isApprovedOrOwner = (_msgSender() == from ||
isApprovedForAll(from, _msgSender()) ||
getApproved(tokenId) == _msgSender());
if (!isApprovedOrOwner) revert TransferCallerNotOwnerNorApproved();
}
_beforeTokenTransfers(from, address(0), tokenId, 1);
_approve(address(0), tokenId, from);
unchecked {
AddressData storage addressData = _addressData[from];
addressData.balance -= 1;
TokenOwnership storage currSlot = _ownerships[tokenId];
currSlot.addr = from;
currSlot.startTimestamp = uint64(block.timestamp);
currSlot.burned = true;
uint256 nextTokenId = tokenId + 1;
TokenOwnership storage nextSlot = _ownerships[nextTokenId];
if (nextSlot.addr == address(0)) {
if (_exists(tokenId)) {
nextSlot.addr = from;
nextSlot.startTimestamp = prevOwnership.startTimestamp;
}
}
}
emit Transfer(from, address(0), tokenId);
_afterTokenTransfers(from, address(0), tokenId, 1);
unchecked {
_burnCounter++;
}
}
function _approve(
address to,
uint256 tokenId,
address owner
) private {
_tokenApprovals[tokenId] = to;
emit Approval(owner, to, tokenId);
}
function _checkContractOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
) private returns (bool) {
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 TransferToNonERC721ReceiverImplementer();
} else {
assembly {
revert(add(32, reason), mload(reason))
}
}
}
}
function _beforeTokenTransfers(
address from,
address to,
uint256 startTokenId,
uint256 quantity
) internal virtual {}
function _afterTokenTransfers(
address from,
address to,
uint256 startTokenId,
uint256 quantity
) internal virtual {}
}
文件 6 的 24:IAccessControl.sol
pragma solidity ^0.8.0;
interface IAccessControl {
event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);
event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);
event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);
function hasRole(bytes32 role, address account) external view returns (bool);
function getRoleAdmin(bytes32 role) external view returns (bytes32);
function grantRole(bytes32 role, address account) external;
function revokeRole(bytes32 role, address account) external;
function renounceRole(bytes32 role, address account) external;
}
文件 7 的 24:IERC165.sol
pragma solidity ^0.8.0;
interface IERC165 {
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
文件 8 的 24:IERC721.sol
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
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;
}
文件 9 的 24:IERC721A.sol
pragma solidity ^0.8.4;
import '@openzeppelin/contracts/token/ERC721/IERC721.sol';
import '@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol';
interface IERC721A is IERC721, IERC721Metadata {
error ApprovalCallerNotOwnerNorApproved();
error ApprovalQueryForNonexistentToken();
error ApproveToCaller();
error ApprovalToCurrentOwner();
error BalanceQueryForZeroAddress();
error MintToZeroAddress();
error MintZeroQuantity();
error OwnerQueryForNonexistentToken();
error TransferCallerNotOwnerNorApproved();
error TransferFromIncorrectOwner();
error TransferToNonERC721ReceiverImplementer();
error TransferToZeroAddress();
error URIQueryForNonexistentToken();
struct TokenOwnership {
address addr;
uint64 startTimestamp;
bool burned;
}
struct AddressData {
uint64 balance;
uint64 numberMinted;
uint64 mintTime;
uint64 reserveMinted;
}
function totalSupply() external view returns (uint256);
}
文件 10 的 24:IERC721Metadata.sol
pragma solidity ^0.8.0;
import "../IERC721.sol";
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);
}
文件 11 的 24:IERC721Receiver.sol
pragma solidity ^0.8.0;
interface IERC721Receiver {
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
文件 12 的 24:ILock.sol
pragma solidity ^0.8.2;
interface IERC721x {
function isUnlocked(uint256 _id) external view returns(bool);
function lockCount(uint256 _tokenId) external view returns(uint256);
function approvedContract(address _contract) external view returns(bool);
function lockMap(uint256 _tokenId, uint256 _index) external view returns(address);
function lockMapIndex(uint256 _tokenId, address _contract) external view returns(uint256);
function lockId(uint256 _id) external;
function unlockId(uint256 _id) external;
function freeId(uint256 _id, address _contract) external;
}
文件 13 的 24:IMimeticMetadata.sol
pragma solidity ^0.8.7;
interface IMimeticMetadata {
struct Generation {
bool enabled;
bool loaded;
bool locked;
bool sticky;
string baseURI;
}
event GenerationChange(uint256 _layerId, uint256 _tokenId);
function loadGeneration(uint256 _layerId, bool _enabled, bool _locked, bool _sticky, string memory _baseURI) external;
function toggleGeneration(uint256 _layerId) external;
}
文件 14 的 24:INonDilutive.sol
pragma solidity ^0.8.0;
interface INonDilutive {
function getTokenGeneration(
uint256 _tokenId
) external returns (
uint256
);
function focusGeneration(
uint256 _layerId
,uint256 _tokenId
) external payable;
}
文件 15 的 24:IROLL.sol
pragma solidity ^0.8.0;
interface IROLL {
function balanceOf(address owner) external view returns(uint256);
function transferFrom(address, address, uint256) external;
function allowance(address owner, address spender) external view returns(uint256);
function approve(address spender, uint256 amount) external returns(bool);
}
文件 16 的 24:LockRegistry.sol
pragma solidity ^0.8.2;
import "@openzeppelin/contracts/access/Ownable.sol";
import "../Interfaces/ILock.sol";
abstract contract LockRegistry is Ownable, IERC721x {
mapping(address => bool) public override approvedContract;
mapping(uint256 => uint256) public override lockCount;
mapping(uint256 => mapping(uint256 => address)) public override lockMap;
mapping(uint256 => mapping(address => uint256)) public override lockMapIndex;
event TokenLocked(uint256 indexed tokenId, address indexed approvedContract);
event TokenUnlocked(uint256 indexed tokenId, address indexed approvedContract);
function isUnlocked(uint256 _id) public view override returns(bool) {
return lockCount[_id] == 0;
}
function updateApprovedContracts(address[] calldata _contracts, bool[] calldata _values) external onlyOwner {
require(_contracts.length == _values.length, "!length");
for(uint256 i = 0; i < _contracts.length; i++)
approvedContract[_contracts[i]] = _values[i];
}
function _lockId(uint256 _id) internal {
require(approvedContract[msg.sender], "Cannot update map");
require(lockMapIndex[_id][msg.sender] == 0, "ID already locked by caller");
uint256 count = lockCount[_id] + 1;
lockMap[_id][count] = msg.sender;
lockMapIndex[_id][msg.sender] = count;
lockCount[_id]++;
emit TokenLocked(_id, msg.sender);
}
function _unlockId(uint256 _id) internal {
require(approvedContract[msg.sender], "Cannot update map");
uint256 index = lockMapIndex[_id][msg.sender];
require(index != 0, "ID not locked by caller");
uint256 last = lockCount[_id];
if (index != last) {
address lastContract = lockMap[_id][last];
lockMap[_id][index] = lastContract;
lockMap[_id][last] = address(0);
lockMapIndex[_id][lastContract] = index;
}
else
lockMap[_id][index] = address(0);
lockMapIndex[_id][msg.sender] = 0;
lockCount[_id]--;
emit TokenUnlocked(_id, msg.sender);
}
function _freeId(uint256 _id, address _contract) internal {
require(!approvedContract[_contract], "Cannot update map");
uint256 index = lockMapIndex[_id][_contract];
require(index != 0, "ID not locked");
uint256 last = lockCount[_id];
if (index != last) {
address lastContract = lockMap[_id][last];
lockMap[_id][index] = lastContract;
lockMap[_id][last] = address(0);
lockMapIndex[_id][lastContract] = index;
}
else
lockMap[_id][index] = address(0);
lockMapIndex[_id][_contract] = 0;
lockCount[_id]--;
emit TokenUnlocked(_id, _contract);
}
}
文件 17 的 24:MDDA.sol
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/access/Ownable.sol";
contract MDDA is Ownable {
uint256 public DA_STARTING_PRICE;
uint256 public DA_ENDING_PRICE;
uint256 public DA_DECREMENT;
uint256 public DA_DECREMENT_FREQUENCY;
uint256 public DA_STARTING_TIMESTAMP;
uint256 public DA_MAX_QUANTITY;
uint256 public DA_FINAL_PRICE;
uint256 public DA_QUANTITY;
bool public DATA_SET;
bool public INITIAL_FUNDS_WITHDRAWN;
struct TokenBatchPriceData {
uint128 pricePaid;
uint128 quantityMinted;
}
mapping(address => TokenBatchPriceData[]) public userToTokenBatchPriceData;
function initializeAuctionData(
uint256 _DAStartingPrice,
uint256 _DAEndingPrice,
uint256 _DADecrement,
uint256 _DADecrementFrequency,
uint256 _DAStartingTimestamp,
uint256 _DAMaxQuantity,
uint256 _DAQuantity
) public onlyOwner {
require(!DATA_SET, "DA data has already been set.");
DA_STARTING_PRICE = _DAStartingPrice;
DA_ENDING_PRICE = _DAEndingPrice;
DA_DECREMENT = _DADecrement;
DA_DECREMENT_FREQUENCY = _DADecrementFrequency;
DA_STARTING_TIMESTAMP = _DAStartingTimestamp;
DA_MAX_QUANTITY = _DAMaxQuantity;
DA_QUANTITY = _DAQuantity;
DATA_SET = true;
}
function userToTokenBatches(address user) public view returns (TokenBatchPriceData[] memory) {
return userToTokenBatchPriceData[user];
}
function currentPrice() public view returns (uint256) {
require( block.timestamp >= DA_STARTING_TIMESTAMP, "DA has not started!");
if (DA_FINAL_PRICE > 0) return DA_FINAL_PRICE;
uint256 timeSinceStart = block.timestamp - DA_STARTING_TIMESTAMP;
uint256 decrementsSinceStart = timeSinceStart / DA_DECREMENT_FREQUENCY;
uint256 totalDecrement = decrementsSinceStart * DA_DECREMENT;
if (totalDecrement >= DA_STARTING_PRICE - DA_ENDING_PRICE) {
return DA_ENDING_PRICE;
}
return DA_STARTING_PRICE - totalDecrement;
}
function DAHook(uint128 _quantity, uint256 _totalSupply) internal {
require(DATA_SET, "DA data not set yet");
uint256 _currentPrice = currentPrice();
require(msg.value >= _quantity * _currentPrice, "Did not send enough eth.");
require(_quantity > 0 && _quantity <= DA_MAX_QUANTITY, "Incorrect quantity!");
require(block.timestamp >= DA_STARTING_TIMESTAMP, "DA has not started!");
require(_totalSupply + _quantity <= DA_QUANTITY, "Max supply for DA reached!");
if (_totalSupply + _quantity == DA_QUANTITY)
DA_FINAL_PRICE = _currentPrice;
userToTokenBatchPriceData[msg.sender].push(TokenBatchPriceData(uint128(msg.value), _quantity));
}
function refundExtraETH() public {
require(DA_FINAL_PRICE > 0, "Dutch action must be over!");
uint256 totalRefund;
for ( uint256 i = userToTokenBatchPriceData[msg.sender].length; i > 0; i--) {
uint256 expectedPrice = userToTokenBatchPriceData[msg.sender][i - 1]
.quantityMinted * DA_FINAL_PRICE;
uint256 refund = userToTokenBatchPriceData[msg.sender][i - 1]
.pricePaid - expectedPrice;
userToTokenBatchPriceData[msg.sender].pop();
totalRefund += refund;
}
payable(msg.sender).transfer(totalRefund);
}
}
文件 18 的 24:MerkleProof.sol
pragma solidity ^0.8.0;
library MerkleProof {
function verify(
bytes32[] memory proof,
bytes32 root,
bytes32 leaf
) internal pure returns (bool) {
return processProof(proof, leaf) == root;
}
function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) {
bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) {
bytes32 proofElement = proof[i];
if (computedHash <= proofElement) {
computedHash = _efficientHash(computedHash, proofElement);
} else {
computedHash = _efficientHash(proofElement, computedHash);
}
}
return computedHash;
}
function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) {
assembly {
mstore(0x00, a)
mstore(0x20, b)
value := keccak256(0x00, 0x40)
}
}
}
文件 19 的 24:MimeticMetadata.sol
pragma solidity ^0.8.7;
import { IMimeticMetadata } from "./IMimeticMetadata.sol";
import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";
import { Strings } from "@openzeppelin/contracts/utils/Strings.sol";
error MintExceedsMaxSupply();
error MintCostMismatch();
error MintNotEnabled();
error GenerationAlreadyLoaded();
error GenerationNotDifferent();
error GenerationNotEnabled();
error GenerationNotDowngradable();
error GenerationNotToggleable();
error GenerationCostMismatch();
error TokenNonExistent();
error TokenNotRevealed();
error TokenRevealed();
error TokenOwnerMismatch();
error WithdrawFailed();
contract MimeticMetadata is IMimeticMetadata, Ownable {
using Strings for uint256;
mapping(uint256 => Generation) public generations;
mapping(uint256 => uint256) tokenToGeneration;
function _tokenURI(uint256 _tokenId) internal virtual view returns (string memory) {
uint256 activeGenerationLayer = tokenToGeneration[_tokenId];
Generation memory activeGeneration = generations[activeGenerationLayer];
return string(abi.encodePacked(activeGeneration.baseURI, _tokenId.toString()));
}
function loadGeneration(uint256 _layerId, bool _enabled, bool _locked, bool _sticky, string memory _baseURI)
override
public
virtual
onlyOwner
{
Generation storage generation = generations[_layerId];
if(generation.loaded) revert GenerationAlreadyLoaded();
generations[_layerId] = Generation({
loaded: true,
enabled: _enabled,
locked: _locked,
sticky: _sticky,
baseURI: _baseURI
});
}
function toggleGeneration( uint256 _layerId) override public virtual onlyOwner {
Generation memory generation = generations[_layerId];
if(generation.enabled && generation.locked) revert GenerationNotToggleable();
generations[_layerId].enabled = !generation.enabled;
}
function _getTokenGeneration(uint256 _tokenId) internal virtual view returns(uint256) {
return tokenToGeneration[_tokenId];
}
function _focusGeneration(uint256 _layerId, uint256 _tokenId) internal virtual {
uint256 activeGenerationLayer = tokenToGeneration[_tokenId];
if(activeGenerationLayer == _layerId) revert GenerationNotDifferent();
Generation memory generation = generations[_layerId];
if(!generation.enabled) revert GenerationNotEnabled();
Generation memory activeGeneration = generations[activeGenerationLayer];
if(activeGeneration.sticky && _layerId < activeGenerationLayer) revert GenerationNotDowngradable();
tokenToGeneration[_tokenId] = _layerId;
emit GenerationChange( _layerId, _tokenId);
}
}
文件 20 的 24: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());
}
function owner() public view virtual returns (address) {
return _owner;
}
modifier onlyOwner() {
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);
}
}
文件 21 的 24: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;
}
}
文件 22 的 24:RetroRollers.sol
pragma solidity ^0.8.0;
import { MimeticMetadata } from "./Mimetics/MimeticMetadata.sol";
import { INonDilutive } from "./Interfaces/INonDilutive.sol";
import "./Interfaces/ILock.sol";
import "./LockRegistry/LockRegistry.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "./ERC721A.sol";
import "./DutchAuction/MDDA.sol";
import "./Scorekeeper.sol";
contract RetroRollers is
ERC721A,
INonDilutive,
MimeticMetadata,
LockRegistry,
AccessControl,
ReentrancyGuard,
MDDA,
Scorekeeper
{
using Strings for uint256;
address public ROLLERS_PAYOUT_ADDRESS = 0x9cEE145eA8842E8C332BEC94Eb48337ff38cdadF;
bytes32 public merkleRoot;
uint256 public mintPrice = 0.08 ether;
uint256 public maxPublicMintPerAddress = 2;
uint256 public MAX_SUPPLY = 8888;
uint256 public lockedSupply = 3333;
uint256 public reservedSupply = 3000;
uint256 public totalReserveMinted;
uint256 public publicSupply;
uint64 public startTime;
bool public mintActive = false;
mapping(uint => uint) private tokenMatrix;
mapping(uint => uint) private mappedTokenIds;
bytes4 private constant _INTERFACE_ID_LOCKABLE = 0xc1c8d4d6;
bytes32 public constant OPERATOR_ROLE = keccak256("OPERATOR_ROLE");
constructor(string memory _baseTokenURI) ERC721A("Retro Rollers", "RR") {
_setupRole(DEFAULT_ADMIN_ROLE, msg.sender);
startTime = 1651770000;
setPublicSupply();
loadGeneration(
0,
true,
true,
true,
_baseTokenURI
);
}
modifier onlyOperator() {
if(!(hasRole(OPERATOR_ROLE, msg.sender)||owner()==msg.sender)) revert CallerIsNotOperator();
_;
}
modifier mintCompliance() {
if(startTime > block.timestamp) revert SaleNotStarted();
if(!mintActive) revert SaleNotStarted();
_;
}
modifier isContract() {
uint32 size = 32;
address _addr = msg.sender;
assembly {
size := extcodesize(_addr)
}
if(size > 0) revert CallerIsContract();
_;
}
function mintDutchAuction(uint8 _quantity) public payable isContract nonReentrant {
DAHook(_quantity, totalSupply());
uint random = randomness();
for(uint i = 0; i < _quantity; i++){
_mintToken(msg.sender, mappedTokenFor((random+i)));
}
}
function mint(uint64 quantity)
external
payable
isContract
nonReentrant
mintCompliance
{
uint totalSupply = totalSupply();
if(_addressData[msg.sender].mintTime < startTime) {
_addressData[msg.sender].reserveMinted = 0;
_addressData[msg.sender].numberMinted = 0;
}
if(totalSupply - totalReserveMinted + quantity > publicSupply) revert MaxMintAmountReached();
if(quantity == 0) revert InvalidMintAmount();
if(quantity + _addressData[msg.sender].numberMinted - _addressData[msg.sender].reserveMinted > maxPublicMintPerAddress) revert MaxMintAmountReached();
delete totalSupply;
uint random = randomness();
for(uint i = 0; i < quantity; i++){
_mintToken(msg.sender, mappedTokenFor((random+i)));
}
refundIfOver(quantity * mintPrice);
}
function reservedMint(bytes32[] calldata _merkleProof)
external
payable
isContract
nonReentrant
mintCompliance
{
if(totalSupply() == MAX_SUPPLY - lockedSupply) revert MaxSupplyReached();
if(!verify(msg.sender, _merkleProof)) revert InvalidProof();
if(_addressData[msg.sender].mintTime < startTime) {
_addressData[msg.sender].reserveMinted = 0;
_addressData[msg.sender].numberMinted = 0;
} else {
if (_addressData[msg.sender].reserveMinted == 1) revert MaxMintAmountReached();
}
_mintToken(msg.sender, mappedTokenFor(randomness()));
_addressData[msg.sender].reserveMinted = 1;
refundIfOver(mintPrice);
}
function randomness() internal view returns (uint256) {
return uint256(keccak256(
abi.encodePacked(
msg.sender,
block.coinbase,
block.difficulty,
block.gaslimit,
block.timestamp,
totalSupply(),
blockhash(block.number - 1)
)
));
}
function mappedTokenFor(uint _randomSeed) internal returns (uint64) {
uint maxIndex = MAX_SUPPLY - lockedSupply-_mintCounter;
uint random = _randomSeed % (maxIndex);
uint lastAvail = tokenMatrix[maxIndex];
uint256 value = 0;
if (tokenMatrix[random] == 0) {
value = random;
} else {
value = tokenMatrix[random];
}
if (lastAvail == 0) {
tokenMatrix[random] = maxIndex;
} else {
tokenMatrix[random] = lastAvail;
}
return uint64(value + _startTokenId());
}
function getOwnershipData(uint256 tokenId) external view returns (TokenOwnership memory) {
return _ownershipOf(tokenId);
}
function getTokensOfOwner(address owner) external view returns(uint[] memory) {
uint[] memory tokens = new uint[](balanceOf(owner));
uint ct = 0;
for(uint i = 1; i <= MAX_SUPPLY - lockedSupply; i++) {
if(_ownerships[i].addr == owner) {
tokens[ct] = i;
ct++;
}
}
return tokens;
}
function refundIfOver(uint256 price) private {
if(msg.value < price) revert NotEnoughETH();
if (msg.value > price) {
payable(msg.sender).transfer(msg.value - price);
}
}
function verify(address target, bytes32[] calldata _merkleProof) public view returns(bool) {
bytes32 leaf = keccak256(abi.encodePacked(target));
return MerkleProof.verify(_merkleProof, merkleRoot, leaf);
}
function tokenURI(uint256 _tokenId) override public view returns (string memory) {
if(!_exists(_tokenId)) revert InvalidTokenId();
return _tokenURI(_tokenId);
}
function ownerMint(address to, uint256 quantity) public
isContract
nonReentrant
onlyOperator
{
if(quantity + totalSupply() > MAX_SUPPLY) revert MaxSupplyReached();
uint random = randomness();
for(uint i = 0; i < quantity; i++){
_mintToken(to, mappedTokenFor(random+i));
}
}
function toggleMint() external onlyOperator {
mintActive = !mintActive;
}
function setStartTime(uint64 _startTime) external onlyOperator {
startTime = _startTime;
}
function setMintPrice(uint _mintPrice) external onlyOperator {
mintPrice = _mintPrice;
}
function setReservedSupply(uint _reservedSupply) external onlyOperator {
reservedSupply = _reservedSupply;
setPublicSupply();
}
function setLockedSupply(uint _lockedSupply) external onlyOperator {
lockedSupply = _lockedSupply;
setPublicSupply();
}
function setMerkleRoot(bytes32 _merkleRoot) external onlyOperator {
merkleRoot = _merkleRoot;
}
function setScoreSignerAddress(address _scoreSigner) external onlyOperator {
scoreSigner = _scoreSigner;
}
function setRollScorePrice(uint64 _price) external onlyOperator {
rollScorePrice = _price;
}
function setRollTokenAddress(address _rollAddress) external onlyOperator {
rollToken = IROLL(_rollAddress);
}
function setPayoutAddress(address _payoutAddress) external onlyOperator {
ROLLERS_PAYOUT_ADDRESS = _payoutAddress;
}
function setPublicSupply() internal {
publicSupply = MAX_SUPPLY - reservedSupply - lockedSupply;
}
function getTokenGeneration(uint256 _tokenId) override public virtual view returns(uint256) {
if(_exists(_tokenId) == false) revert InvalidTokenId();
return _getTokenGeneration(_tokenId);
}
function focusGeneration(uint256 _layerId, uint256 _tokenId) override public virtual payable {
if(!isUnlocked(_tokenId)) revert LockedToken();
_focusGeneration(_layerId, _tokenId);
}
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721A, AccessControl) returns (bool) {
return interfaceId == _INTERFACE_ID_LOCKABLE || super.supportsInterface(interfaceId);
}
function transferFrom(address from, address to, uint256 tokenId) public override {
if(!isUnlocked(tokenId)) revert LockedToken();
ERC721A.transferFrom(from, to, tokenId);
}
function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data) public override {
if(!isUnlocked(tokenId)) revert LockedToken();
ERC721A.safeTransferFrom(from, to, tokenId, _data);
}
function lockId(uint256 _id) external override {
if(!_exists(_id)) revert InvalidTokenId();
_lockId(_id);
}
function unlockId(uint256 _id) external override {
if(!_exists(_id)) revert InvalidTokenId();
_unlockId(_id);
}
function freeId(uint256 _id, address _contract) external override {
if(!_exists(_id)) revert InvalidTokenId();
_freeId(_id, _contract);
}
function recordHighScore(uint8 v, bytes32 r, bytes32 s, UserData memory record) public override(Scorekeeper) {
require(ownerOf(record.rollerId) == msg.sender, "NotOwner");
super.recordHighScore(v,r,s,record);
}
function withdraw() external onlyOperator {
uint256 mintAmount = address(this).balance;
address rollers = payable(ROLLERS_PAYOUT_ADDRESS);
bool success;
(success, ) = rollers.call{value: mintAmount }("");
if(!success) revert TransactionUnsuccessful();
}
function withdrawInitialDAFunds() public onlyOperator {
require(!INITIAL_FUNDS_WITHDRAWN, "Initial funds have already been withdrawn.");
require(DA_FINAL_PRICE > 0, "DA has not finished!");
uint256 initialFunds = DA_QUANTITY * DA_FINAL_PRICE;
INITIAL_FUNDS_WITHDRAWN = true;
(bool succ, ) = payable(ROLLERS_PAYOUT_ADDRESS).call{value: initialFunds}("");
require(succ, "transfer failed");
}
function withdrawFinalDAFunds() public onlyOperator {
require(block.timestamp >= DA_STARTING_TIMESTAMP + 604800);
uint256 finalFunds = address(this).balance;
(bool succ, ) = payable(ROLLERS_PAYOUT_ADDRESS).call{value: finalFunds}("");
require(succ, "transfer failed");
}
}
error CallerIsContract();
error CallerIsNotOperator();
error InvalidMintAmount();
error InvalidProof();
error InvalidTokenId();
error LockedToken();
error MaxMintAmountReached();
error MaxSupplyReached();
error NotEnoughETH();
error SaleNotStarted();
error TransactionUnsuccessful();
文件 23 的 24:Scorekeeper.sol
pragma solidity ^0.8.0;
import '@openzeppelin/contracts/utils/Strings.sol';
import "./IROLL.sol";
contract Scorekeeper
{
using Strings for uint256;
struct EIP712Domain {
string name;
string version;
uint256 chainId;
address verifyingContract;
}
struct UserData {
uint64 rollerId;
uint64 score;
uint64 timestamp;
address wallet;
}
IROLL public rollToken;
address public scoreSigner;
uint256 public rollScorePrice = 100 ether;
bytes32 constant EIP712DOMAIN_TYPEHASH = keccak256(
"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"
);
bytes32 constant USERDATA_TYPEHASH = keccak256(
"UserData(uint64 rollerId,uint64 score,uint64 timestamp,address wallet)"
);
bytes32 DOMAIN_SEPARATOR;
mapping(uint => UserData) public scores;
constructor() {
uint256 chainId;
assembly {
chainId := chainid()
}
DOMAIN_SEPARATOR = hash(EIP712Domain({
name: "RetroRollers",
version: '1',
chainId: chainId,
verifyingContract: address(this)
}));
}
function hash(EIP712Domain memory eip712Domain) internal pure returns (bytes32) {
return keccak256(abi.encode(
EIP712DOMAIN_TYPEHASH,
keccak256(bytes(eip712Domain.name)),
keccak256(bytes(eip712Domain.version)),
eip712Domain.chainId,
eip712Domain.verifyingContract
));
}
function hash(UserData memory score) internal pure returns (bytes32) {
return keccak256(abi.encode(
USERDATA_TYPEHASH,
score.rollerId,
score.score,
score.timestamp,
score.wallet
));
}
function recordHighScore(uint8 v, bytes32 r, bytes32 s, UserData memory record) public virtual {
if(rollScorePrice > rollToken.balanceOf(msg.sender)) revert NotEnoughRollToken();
if(rollScorePrice > rollToken.allowance(msg.sender, address(this))) revert NotEnoughRollToken();
rollToken.transferFrom(msg.sender, address(this), rollScorePrice);
bytes32 digest = keccak256(abi.encodePacked(
"\x19\x01",
DOMAIN_SEPARATOR,
hash(record)
));
address signer = ecrecover(digest, v, r, s);
if(signer != scoreSigner) revert InvalidSignature();
if(signer == address(0)) revert ECDSAInvalidSignature();
if(record.wallet != msg.sender) revert NotScoreWallet();
if(scores[record.rollerId].score > record.score) revert NotHighScore();
saveScore(record);
}
function saveScore(UserData memory record) internal virtual {
scores[record.rollerId] = record;
}
function getScore(uint _tokenId) public virtual view returns (UserData memory) {
return scores[_tokenId];
}
}
error NotHighScore();
error NotEnoughRollToken();
error NotScoreWallet();
error InvalidSignature();
error ECDSAInvalidSignature();
文件 24 的 24:Strings.sol
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);
}
}
{
"compilationTarget": {
"contracts/RetroRollers.sol": "RetroRollers"
},
"evmVersion": "london",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": true,
"runs": 200
},
"remappings": []
}
[{"inputs":[{"internalType":"string","name":"_baseTokenURI","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"ApprovalToCurrentOwner","type":"error"},{"inputs":[],"name":"ApproveToCaller","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"CallerIsContract","type":"error"},{"inputs":[],"name":"CallerIsNotOperator","type":"error"},{"inputs":[],"name":"ECDSAInvalidSignature","type":"error"},{"inputs":[],"name":"GenerationAlreadyLoaded","type":"error"},{"inputs":[],"name":"GenerationNotDifferent","type":"error"},{"inputs":[],"name":"GenerationNotDowngradable","type":"error"},{"inputs":[],"name":"GenerationNotEnabled","type":"error"},{"inputs":[],"name":"GenerationNotToggleable","type":"error"},{"inputs":[],"name":"InvalidMintAmount","type":"error"},{"inputs":[],"name":"InvalidProof","type":"error"},{"inputs":[],"name":"InvalidSignature","type":"error"},{"inputs":[],"name":"InvalidTokenId","type":"error"},{"inputs":[],"name":"LockedToken","type":"error"},{"inputs":[],"name":"MaxMintAmountReached","type":"error"},{"inputs":[],"name":"MaxSupplyReached","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[],"name":"NotEnoughETH","type":"error"},{"inputs":[],"name":"NotEnoughRollToken","type":"error"},{"inputs":[],"name":"NotHighScore","type":"error"},{"inputs":[],"name":"NotScoreWallet","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"SaleNotStarted","type":"error"},{"inputs":[],"name":"TransactionUnsuccessful","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToNonERC721ReceiverImplementer","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"inputs":[],"name":"URIQueryForNonexistentToken","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_layerId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"GenerationChange","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"approvedContract","type":"address"}],"name":"TokenLocked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"approvedContract","type":"address"}],"name":"TokenUnlocked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"DATA_SET","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DA_DECREMENT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DA_DECREMENT_FREQUENCY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DA_ENDING_PRICE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DA_FINAL_PRICE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DA_MAX_QUANTITY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DA_QUANTITY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DA_STARTING_PRICE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DA_STARTING_TIMESTAMP","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"INITIAL_FUNDS_WITHDRAWN","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_SUPPLY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"OPERATOR_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ROLLERS_PAYOUT_ADDRESS","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_maxSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_mintCounter","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"approvedContract","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_layerId","type":"uint256"},{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"focusGeneration","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"},{"internalType":"address","name":"_contract","type":"address"}],"name":"freeId","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"generations","outputs":[{"internalType":"bool","name":"enabled","type":"bool"},{"internalType":"bool","name":"loaded","type":"bool"},{"internalType":"bool","name":"locked","type":"bool"},{"internalType":"bool","name":"sticky","type":"bool"},{"internalType":"string","name":"baseURI","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getOwnershipData","outputs":[{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"bool","name":"burned","type":"bool"}],"internalType":"struct IERC721A.TokenOwnership","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"getScore","outputs":[{"components":[{"internalType":"uint64","name":"rollerId","type":"uint64"},{"internalType":"uint64","name":"score","type":"uint64"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"address","name":"wallet","type":"address"}],"internalType":"struct Scorekeeper.UserData","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"getTokenGeneration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"getTokensOfOwner","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_DAStartingPrice","type":"uint256"},{"internalType":"uint256","name":"_DAEndingPrice","type":"uint256"},{"internalType":"uint256","name":"_DADecrement","type":"uint256"},{"internalType":"uint256","name":"_DADecrementFrequency","type":"uint256"},{"internalType":"uint256","name":"_DAStartingTimestamp","type":"uint256"},{"internalType":"uint256","name":"_DAMaxQuantity","type":"uint256"},{"internalType":"uint256","name":"_DAQuantity","type":"uint256"}],"name":"initializeAuctionData","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"isUnlocked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_layerId","type":"uint256"},{"internalType":"bool","name":"_enabled","type":"bool"},{"internalType":"bool","name":"_locked","type":"bool"},{"internalType":"bool","name":"_sticky","type":"bool"},{"internalType":"string","name":"_baseURI","type":"string"}],"name":"loadGeneration","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"lockCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"lockId","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"lockMap","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"lockMapIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lockedSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxPublicMintPerAddress","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"merkleRoot","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"quantity","type":"uint64"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"mintActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"_quantity","type":"uint8"}],"name":"mintDutchAuction","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"mintPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"ownerMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"publicSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"},{"components":[{"internalType":"uint64","name":"rollerId","type":"uint64"},{"internalType":"uint64","name":"score","type":"uint64"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"address","name":"wallet","type":"address"}],"internalType":"struct Scorekeeper.UserData","name":"record","type":"tuple"}],"name":"recordHighScore","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"refundExtraETH","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"_merkleProof","type":"bytes32[]"}],"name":"reservedMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"reservedSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rollScorePrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rollToken","outputs":[{"internalType":"contract IROLL","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"scoreSigner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"scores","outputs":[{"internalType":"uint64","name":"rollerId","type":"uint64"},{"internalType":"uint64","name":"score","type":"uint64"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"address","name":"wallet","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_lockedSupply","type":"uint256"}],"name":"setLockedSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_merkleRoot","type":"bytes32"}],"name":"setMerkleRoot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_mintPrice","type":"uint256"}],"name":"setMintPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_payoutAddress","type":"address"}],"name":"setPayoutAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_reservedSupply","type":"uint256"}],"name":"setReservedSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"_price","type":"uint64"}],"name":"setRollScorePrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_rollAddress","type":"address"}],"name":"setRollTokenAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_scoreSigner","type":"address"}],"name":"setScoreSignerAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"_startTime","type":"uint64"}],"name":"setStartTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startTime","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","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":"_layerId","type":"uint256"}],"name":"toggleGeneration","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"toggleMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalReserveMinted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"unlockId","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_contracts","type":"address[]"},{"internalType":"bool[]","name":"_values","type":"bool[]"}],"name":"updateApprovedContracts","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"userToTokenBatchPriceData","outputs":[{"internalType":"uint128","name":"pricePaid","type":"uint128"},{"internalType":"uint128","name":"quantityMinted","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"userToTokenBatches","outputs":[{"components":[{"internalType":"uint128","name":"pricePaid","type":"uint128"},{"internalType":"uint128","name":"quantityMinted","type":"uint128"}],"internalType":"struct MDDA.TokenBatchPriceData[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"target","type":"address"},{"internalType":"bytes32[]","name":"_merkleProof","type":"bytes32[]"}],"name":"verify","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawFinalDAFunds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawInitialDAFunds","outputs":[],"stateMutability":"nonpayable","type":"function"}]