Address Contract Verified
Address
0xc68afc6A3B47b108Db5e48fB53a10D2D9c11b094
Balance
0 ETH
Nonce
1
Code Size
5808 bytes
Creator
0xa8863bf1...05Ea at tx 0x14a65e25...50f739
Indexed Transactions
0
Contract Bytecode
5808 bytes
0x608060405234801561001057600080fd5b50600436106100935760003560e01c8063346e6c0e11610066578063346e6c0e146101095780633580e71b1461013f578063654fb5bd146101685780637e4e3d6f1461017b578063e9dc6375146101b157600080fd5b806301ffc9a714610098578063151c6f41146100c05780631e396066146100e15780632f6196b7146100f6575b600080fd5b6100ab6100a636600461116c565b6101d1565b60405190151581526020015b60405180910390f35b6100d36100ce3660046111b9565b610217565b6040519081526020016100b7565b6100f46100ef366004611240565b6103cb565b005b6100f46101043660046112bb565b610768565b6100d3610117366004611311565b6001600160a01b03919091166000908152600360209081526040808320938352929052205490565b6100d361014d36600461133b565b6001600160a01b031660009081526005602052604090205490565b6100f46101763660046111b9565b610a2e565b6100d3610189366004611311565b6001600160a01b03919091166000908152600260209081526040808320938352929052205490565b6101c46101bf366004611311565b610bb0565b6040516100b79190611386565b60006001600160e01b0319821663e9dc637560e01b148061020257506001600160e01b03198216633eab9a5760e01b145b80610211575061021182610c27565b92915050565b604051630935e01b60e21b815233600482015260009085906001600160a01b038216906324d7806c9060240160206040518083038186803b15801561025b57600080fd5b505afa15801561026f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061029391906113b9565b6102f75760405162461bcd60e51b815260206004820152602a60248201527f4d757374206265206f776e6572206f722061646d696e206f662063726561746f6044820152691c8818dbdb9d1c9858dd60b21b60648201526084015b60405180910390fd5b6001600160a01b03861660009081526005602052604081208054600192906103209084906113f1565b90915550506001600160a01b0386166000818152600560209081526040808320546002835281842081855283528184208a90559383526001825280832084845290915290206103709086866110d3565b50604080513381526001600160a01b0389166020820152908101829052606081018790527f739bed52023d4028ee60025b96a4024aacf5aff3162e8c9711084c74d6b8c6139060800160405180910390a19695505050505050565b6002600054141561041e5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016102ee565b6002600055604051630935e01b60e21b815233600482015284906001600160a01b038216906324d7806c9060240160206040518083038186803b15801561046457600080fd5b505afa158015610478573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061049c91906113b9565b6104fb5760405162461bcd60e51b815260206004820152602a60248201527f4d757374206265206f776e6572206f722061646d696e206f662063726561746f6044820152691c8818dbdb9d1c9858dd60b21b60648201526084016102ee565b816105485760405162461bcd60e51b815260206004820152601860248201527f496e76616c696420616d6f756e7420726571756573746564000000000000000060448201526064016102ee565b6001600160a01b03851660008181526002602090815260408083208884528252808320549383526003825280832088845290915290205461058a9084906113f1565b11156105cd5760405162461bcd60e51b8152602060048201526012602482015271151bdbc81b585b9e481c995c5d595cdd195960721b60448201526064016102ee565b6000856001600160a01b0316632928ca58858560008181106105f1576105f1611409565b9050602002016020810190610606919061133b565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381600087803b15801561064757600080fd5b505af115801561065b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061067f919061141f565b905060015b8381101561074e57866001600160a01b0316632928ca588686848181106106ad576106ad611409565b90506020020160208101906106c2919061133b565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381600087803b15801561070357600080fd5b505af1158015610717573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061073b919061141f565b508061074681611438565b915050610684565b5061075b86868386610c5c565b5050600160005550505050565b600260005414156107bb5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016102ee565b6002600055604051630935e01b60e21b815233600482015284906001600160a01b038216906324d7806c9060240160206040518083038186803b15801561080157600080fd5b505afa158015610815573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061083991906113b9565b6108985760405162461bcd60e51b815260206004820152602a60248201527f4d757374206265206f776e6572206f722061646d696e206f662063726561746f6044820152691c8818dbdb9d1c9858dd60b21b60648201526084016102ee565b60008261ffff16116108ec5760405162461bcd60e51b815260206004820152601860248201527f496e76616c696420616d6f756e7420726571756573746564000000000000000060448201526064016102ee565b6001600160a01b0385166000818152600260209081526040808320888452825280832054938352600382528083208884529091529020546109329061ffff8516906113f1565b11156109755760405162461bcd60e51b8152602060048201526012602482015271151bdbc81b585b9e481c995c5d595cdd195960721b60448201526064016102ee565b60405163e00aab4b60e01b81526001600160a01b03848116600483015261ffff841660248301526000919087169063e00aab4b90604401600060405180830381600087803b1580156109c657600080fd5b505af11580156109da573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610a029190810190611469565b905061075b868683600081518110610a1c57610a1c611409565b60200260200101518661ffff16610c5c565b604051630935e01b60e21b815233600482015284906001600160a01b038216906324d7806c9060240160206040518083038186803b158015610a6f57600080fd5b505afa158015610a83573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aa791906113b9565b610b065760405162461bcd60e51b815260206004820152602a60248201527f4d757374206265206f776e6572206f722061646d696e206f662063726561746f6044820152691c8818dbdb9d1c9858dd60b21b60648201526084016102ee565b600084118015610b2e57506001600160a01b0385166000908152600560205260409020548411155b610b7a5760405162461bcd60e51b815260206004820152600e60248201527f496e76616c69642073657269657300000000000000000000000000000000000060448201526064016102ee565b6001600160a01b03851660009081526001602090815260408083208784529091529020610ba89084846110d3565b505050505050565b6060600080610bbf8585610da9565b6001600160a01b0387166000908152600160208181526040808420868552909152909120929450909250610bfd90610bf89084906113f1565b610fb5565b604051602001610c0e92919061157e565b6040516020818303038152906040529250505092915050565b60006001600160e01b03198216637005caad60e01b148061021157506301ffc9a760e01b6001600160e01b0319831614610211565b6001600160a01b038416600090815260046020908152604080832086845290915290208054610cc2576040805180820190915283815260208082018481528354600181810186556000868152939093209351600290910290930192835551910155610d6a565b80546000908290610cd590600190611625565b81548110610ce557610ce5611409565b906000526020600020906002020190508381600101548260000154610d0a91906113f1565b1415610d2f5782816001016000828254610d2491906113f1565b90915550610d689050565b60408051808201909152848152602080820185815284546001818101875560008781529390932093516002909102909301928355519101555b505b6001600160a01b038516600090815260036020908152604080832087845290915281208054849290610d9d9084906113f1565b90915550505050505050565b6001600160a01b0382166000908152600560205260408120548190610e005760405162461bcd60e51b815260206004820152600d60248201526c24b73b30b634b2103a37b5b2b760991b60448201526064016102ee565b60015b6001600160a01b0385166000908152600560205260409020548111610f75576001600160a01b0385166000908152600460209081526040808320848452825280832080548251818502810185019093528083529192909190849084015b82821015610ea657838290600052602060002090600202016040518060400160405290816000820154815260200160018201548152505081526020019060010190610e60565b505050509050600080600090505b8251811015610f5f576000838281518110610ed157610ed1611409565b602002602001015190508060000151881015610eed5750610f5f565b80518810801590610f0d575060208101518151610f0a91906113f1565b88105b15610f3a57805185908490610f22908b611625565b610f2c91906113f1565b965096505050505050610fae565b6020810151610f4990846113f1565b9250508080610f5790611438565b915050610eb4565b5050508080610f6d90611438565b915050610e03565b5060405162461bcd60e51b815260206004820152600d60248201526c24b73b30b634b2103a37b5b2b760991b60448201526064016102ee565b9250929050565b606081610fd95750506040805180820190915260018152600360fc1b602082015290565b8160005b81156110035780610fed81611438565b9150610ffc9050600a83611652565b9150610fdd565b60008167ffffffffffffffff81111561101e5761101e611453565b6040519080825280601f01601f191660200182016040528015611048576020820181803683370190505b5090505b84156110cb5761105d600183611625565b915061106a600a86611666565b6110759060306113f1565b60f81b81838151811061108a5761108a611409565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506110c4600a86611652565b945061104c565b949350505050565b8280546110df90611527565b90600052602060002090601f0160209004810192826111015760008555611147565b82601f1061111a5782800160ff19823516178555611147565b82800160010185558215611147579182015b8281111561114757823582559160200191906001019061112c565b50611153929150611157565b5090565b5b808211156111535760008155600101611158565b60006020828403121561117e57600080fd5b81356001600160e01b03198116811461119657600080fd5b9392505050565b80356001600160a01b03811681146111b457600080fd5b919050565b600080600080606085870312156111cf57600080fd5b6111d88561119d565b935060208501359250604085013567ffffffffffffffff808211156111fc57600080fd5b818701915087601f83011261121057600080fd5b81358181111561121f57600080fd5b88602082850101111561123157600080fd5b95989497505060200194505050565b6000806000806060858703121561125657600080fd5b61125f8561119d565b935060208501359250604085013567ffffffffffffffff8082111561128357600080fd5b818701915087601f83011261129757600080fd5b8135818111156112a657600080fd5b8860208260051b850101111561123157600080fd5b600080600080608085870312156112d157600080fd5b6112da8561119d565b9350602085013592506112ef6040860161119d565b9150606085013561ffff8116811461130657600080fd5b939692955090935050565b6000806040838503121561132457600080fd5b61132d8361119d565b946020939093013593505050565b60006020828403121561134d57600080fd5b6111968261119d565b60005b83811015611371578181015183820152602001611359565b83811115611380576000848401525b50505050565b60208152600082518060208401526113a5816040850160208701611356565b601f01601f19169190910160400192915050565b6000602082840312156113cb57600080fd5b8151801515811461119657600080fd5b634e487b7160e01b600052601160045260246000fd5b60008219821115611404576114046113db565b500190565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561143157600080fd5b5051919050565b600060001982141561144c5761144c6113db565b5060010190565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561147c57600080fd5b825167ffffffffffffffff8082111561149457600080fd5b818501915085601f8301126114a857600080fd5b8151818111156114ba576114ba611453565b8060051b604051601f19603f830116810181811085821117156114df576114df611453565b6040529182528482019250838101850191888311156114fd57600080fd5b938501935b8285101561151b57845184529385019392850192611502565b98975050505050505050565b600181811c9082168061153b57607f821691505b6020821081141561155c57634e487b7160e01b600052602260045260246000fd5b50919050565b60008151611574818560208601611356565b9290920192915050565b600080845481600182811c91508083168061159a57607f831692505b60208084108214156115ba57634e487b7160e01b86526022600452602486fd5b8180156115ce57600181146115df5761160c565b60ff1986168952848901965061160c565b60008b81526020902060005b868110156116045781548b8201529085019083016115eb565b505084890196505b50505050505061161c8185611562565b95945050505050565b600082821015611637576116376113db565b500390565b634e487b7160e01b600052601260045260246000fd5b6000826116615761166161163c565b500490565b6000826116755761167561163c565b50069056fea264697066735822122038724ab43c42706f8389fc8f2ac441cf23e513ecb9d0c5a79dd5756aa279c39764736f6c63430008090033
Verified Source Code Full Match
Compiler: v0.8.9+commit.e5eed63a
EVM: london
Optimization: Yes (500 runs)
Strings.sol 67 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
// Inspired by OraclizeAPI's implementation - MIT licence
// https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
while (value != 0) {
digits -= 1;
buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
value /= 10;
}
return string(buffer);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0x00";
}
uint256 temp = value;
uint256 length = 0;
while (temp != 0) {
length++;
temp >>= 8;
}
return toHexString(value, length);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _HEX_SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
}
ReentrancyGuard.sol 63 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
// On the first call to nonReentrant, _notEntered will be true
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
_;
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
}
ManifoldERC721Edition.sol 160 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/// @author: manifold.xyz
import "@manifoldxyz/libraries-solidity/contracts/access/IAdminControl.sol";
import "@manifoldxyz/creator-core-solidity/contracts/core/IERC721CreatorCore.sol";
import "@manifoldxyz/creator-core-solidity/contracts/extensions/CreatorExtension.sol";
import "@manifoldxyz/creator-core-solidity/contracts/extensions/ICreatorExtensionTokenURI.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "./IManifoldERC721Edition.sol";
/**
* Manifold ERC721 Edition Controller Implementation
*/
contract ManifoldERC721Edition is CreatorExtension, ICreatorExtensionTokenURI, IManifoldERC721Edition, ReentrancyGuard {
using Strings for uint256;
struct IndexRange {
uint256 startIndex;
uint256 count;
}
mapping(address => mapping(uint256 => string)) _tokenPrefix;
mapping(address => mapping(uint256 => uint256)) _maxSupply;
mapping(address => mapping(uint256 => uint256)) _totalSupply;
mapping(address => mapping(uint256 => IndexRange[])) _indexRanges;
mapping(address => uint256) _currentSeries;
/**
* @dev Only allows approved admins to call the specified function
*/
modifier creatorAdminRequired(address creator) {
require(IAdminControl(creator).isAdmin(msg.sender), "Must be owner or admin of creator contract");
_;
}
function supportsInterface(bytes4 interfaceId) public view virtual override(CreatorExtension, IERC165) returns (bool) {
return interfaceId == type(ICreatorExtensionTokenURI).interfaceId || interfaceId == type(IManifoldERC721Edition).interfaceId ||
CreatorExtension.supportsInterface(interfaceId);
}
/**
* @dev See {IManifoldERC721Edition-totalSupply}.
*/
function totalSupply(address creator, uint256 series) external view override returns(uint256) {
return _totalSupply[creator][series];
}
/**
* @dev See {IManifoldERC721Edition-maxSupply}.
*/
function maxSupply(address creator, uint256 series) external view override returns(uint256) {
return _maxSupply[creator][series];
}
/**
* @dev See {IManifoldERC721Edition-createSeries}.
*/
function createSeries(address creator, uint256 maxSupply_, string calldata prefix) external override creatorAdminRequired(creator) returns(uint256) {
_currentSeries[creator] += 1;
uint256 series = _currentSeries[creator];
_maxSupply[creator][series] = maxSupply_;
_tokenPrefix[creator][series] = prefix;
emit SeriesCreated(msg.sender, creator, series, maxSupply_);
return series;
}
/**
* @dev See {IManifoldERC721Edition-latestSeries}.
*/
function latestSeries(address creator) external view override returns(uint256) {
return _currentSeries[creator];
}
/**
* See {IManifoldERC721Edition-setTokenURIPrefix}.
*/
function setTokenURIPrefix(address creator, uint256 series, string calldata prefix) external override creatorAdminRequired(creator) {
require(series > 0 && series <= _currentSeries[creator], "Invalid series");
_tokenPrefix[creator][series] = prefix;
}
/**
* @dev See {ICreatorExtensionTokenURI-tokenURI}.
*/
function tokenURI(address creator, uint256 tokenId) external view override returns (string memory) {
(uint256 series, uint256 index) = _tokenSeriesAndIndex(creator, tokenId);
return string(abi.encodePacked(_tokenPrefix[creator][series], (index+1).toString()));
}
/**
* @dev See {IManifoldERC721Edition-mint}.
*/
function mint(address creator, uint256 series, address recipient, uint16 count) external override nonReentrant creatorAdminRequired(creator) {
require(count > 0, "Invalid amount requested");
require(_totalSupply[creator][series]+count <= _maxSupply[creator][series], "Too many requested");
uint256[] memory tokenIds = IERC721CreatorCore(creator).mintExtensionBatch(recipient, count);
_updateIndexRanges(creator, series, tokenIds[0], count);
}
/**
* @dev See {IManifoldERC721Edition-mint}.
*/
function mint(address creator, uint256 series, address[] calldata recipients) external override nonReentrant creatorAdminRequired(creator) {
require(recipients.length > 0, "Invalid amount requested");
require(_totalSupply[creator][series]+recipients.length <= _maxSupply[creator][series], "Too many requested");
uint256 startIndex = IERC721CreatorCore(creator).mintExtension(recipients[0]);
for (uint256 i = 1; i < recipients.length; i++) {
IERC721CreatorCore(creator).mintExtension(recipients[i]);
}
_updateIndexRanges(creator, series, startIndex, recipients.length);
}
/**
* @dev Update the index ranges, which is used to figure out the index from a tokenId
*/
function _updateIndexRanges(address creator, uint256 series, uint256 startIndex, uint256 count) internal {
IndexRange[] storage indexRanges = _indexRanges[creator][series];
if (indexRanges.length == 0) {
indexRanges.push(IndexRange(startIndex, count));
} else {
IndexRange storage lastIndexRange = indexRanges[indexRanges.length-1];
if ((lastIndexRange.startIndex + lastIndexRange.count) == startIndex) {
lastIndexRange.count += count;
} else {
indexRanges.push(IndexRange(startIndex, count));
}
}
_totalSupply[creator][series] += count;
}
/**
* @dev Index from tokenId
*/
function _tokenSeriesAndIndex(address creator, uint256 tokenId) internal view returns(uint256, uint256) {
require(_currentSeries[creator] > 0, "Invalid token");
for (uint series=1; series <= _currentSeries[creator]; series++) {
IndexRange[] memory indexRanges = _indexRanges[creator][series];
uint256 offset;
for (uint i = 0; i < indexRanges.length; i++) {
IndexRange memory currentIndex = indexRanges[i];
if (tokenId < currentIndex.startIndex) break;
if (tokenId >= currentIndex.startIndex && tokenId < currentIndex.startIndex + currentIndex.count) {
return (series, tokenId - currentIndex.startIndex + offset);
}
offset += currentIndex.count;
}
}
revert("Invalid token");
}
}
IManifoldERC721Edition.sol 48 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/// @author: manifold.xyz
/**
* Manifold ERC721 Edition Controller interface
*/
interface IManifoldERC721Edition {
event SeriesCreated(address caller, address creator, uint256 series, uint256 maxSupply);
/**
* @dev Create a new series. Returns the series id.
*/
function createSeries(address creator, uint256 maxSupply, string calldata prefix) external returns(uint256);
/**
* @dev Get the latest series created.
*/
function latestSeries(address creator) external view returns(uint256);
/**
* @dev Set the token uri prefix
*/
function setTokenURIPrefix(address creator, uint256 series, string calldata prefix) external;
/**
* @dev Mint NFTs to a single recipient
*/
function mint(address creator, uint256 series, address recipient, uint16 count) external;
/**
* @dev Mint NFTS to the recipients
*/
function mint(address creator, uint256 series, address[] calldata recipients) external;
/**
* @dev Total supply of editions
*/
function totalSupply(address creator, uint256 series) external view returns(uint256);
/**
* @dev Max supply of editions
*/
function maxSupply(address creator, uint256 series) external view returns(uint256);
}
ERC165.sol 29 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)
pragma solidity ^0.8.0;
import "./IERC165.sol";
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}
IERC165.sol 25 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
ICreatorCore.sol 149 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/// @author: manifold.xyz
import "@openzeppelin/contracts/utils/introspection/IERC165.sol";
/**
* @dev Core creator interface
*/
interface ICreatorCore is IERC165 {
event ExtensionRegistered(address indexed extension, address indexed sender);
event ExtensionUnregistered(address indexed extension, address indexed sender);
event ExtensionBlacklisted(address indexed extension, address indexed sender);
event MintPermissionsUpdated(address indexed extension, address indexed permissions, address indexed sender);
event RoyaltiesUpdated(uint256 indexed tokenId, address payable[] receivers, uint256[] basisPoints);
event DefaultRoyaltiesUpdated(address payable[] receivers, uint256[] basisPoints);
event ExtensionRoyaltiesUpdated(address indexed extension, address payable[] receivers, uint256[] basisPoints);
event ExtensionApproveTransferUpdated(address indexed extension, bool enabled);
/**
* @dev gets address of all extensions
*/
function getExtensions() external view returns (address[] memory);
/**
* @dev add an extension. Can only be called by contract owner or admin.
* extension address must point to a contract implementing ICreatorExtension.
* Returns True if newly added, False if already added.
*/
function registerExtension(address extension, string calldata baseURI) external;
/**
* @dev add an extension. Can only be called by contract owner or admin.
* extension address must point to a contract implementing ICreatorExtension.
* Returns True if newly added, False if already added.
*/
function registerExtension(address extension, string calldata baseURI, bool baseURIIdentical) external;
/**
* @dev add an extension. Can only be called by contract owner or admin.
* Returns True if removed, False if already removed.
*/
function unregisterExtension(address extension) external;
/**
* @dev blacklist an extension. Can only be called by contract owner or admin.
* This function will destroy all ability to reference the metadata of any tokens created
* by the specified extension. It will also unregister the extension if needed.
* Returns True if removed, False if already removed.
*/
function blacklistExtension(address extension) external;
/**
* @dev set the baseTokenURI of an extension. Can only be called by extension.
*/
function setBaseTokenURIExtension(string calldata uri) external;
/**
* @dev set the baseTokenURI of an extension. Can only be called by extension.
* For tokens with no uri configured, tokenURI will return "uri+tokenId"
*/
function setBaseTokenURIExtension(string calldata uri, bool identical) external;
/**
* @dev set the common prefix of an extension. Can only be called by extension.
* If configured, and a token has a uri set, tokenURI will return "prefixURI+tokenURI"
* Useful if you want to use ipfs/arweave
*/
function setTokenURIPrefixExtension(string calldata prefix) external;
/**
* @dev set the tokenURI of a token extension. Can only be called by extension that minted token.
*/
function setTokenURIExtension(uint256 tokenId, string calldata uri) external;
/**
* @dev set the tokenURI of a token extension for multiple tokens. Can only be called by extension that minted token.
*/
function setTokenURIExtension(uint256[] memory tokenId, string[] calldata uri) external;
/**
* @dev set the baseTokenURI for tokens with no extension. Can only be called by owner/admin.
* For tokens with no uri configured, tokenURI will return "uri+tokenId"
*/
function setBaseTokenURI(string calldata uri) external;
/**
* @dev set the common prefix for tokens with no extension. Can only be called by owner/admin.
* If configured, and a token has a uri set, tokenURI will return "prefixURI+tokenURI"
* Useful if you want to use ipfs/arweave
*/
function setTokenURIPrefix(string calldata prefix) external;
/**
* @dev set the tokenURI of a token with no extension. Can only be called by owner/admin.
*/
function setTokenURI(uint256 tokenId, string calldata uri) external;
/**
* @dev set the tokenURI of multiple tokens with no extension. Can only be called by owner/admin.
*/
function setTokenURI(uint256[] memory tokenIds, string[] calldata uris) external;
/**
* @dev set a permissions contract for an extension. Used to control minting.
*/
function setMintPermissions(address extension, address permissions) external;
/**
* @dev Configure so transfers of tokens created by the caller (must be extension) gets approval
* from the extension before transferring
*/
function setApproveTransferExtension(bool enabled) external;
/**
* @dev get the extension of a given token
*/
function tokenExtension(uint256 tokenId) external view returns (address);
/**
* @dev Set default royalties
*/
function setRoyalties(address payable[] calldata receivers, uint256[] calldata basisPoints) external;
/**
* @dev Set royalties of a token
*/
function setRoyalties(uint256 tokenId, address payable[] calldata receivers, uint256[] calldata basisPoints) external;
/**
* @dev Set royalties of an extension
*/
function setRoyaltiesExtension(address extension, address payable[] calldata receivers, uint256[] calldata basisPoints) external;
/**
* @dev Get royalites of a token. Returns list of receivers and basisPoints
*/
function getRoyalties(uint256 tokenId) external view returns (address payable[] memory, uint256[] memory);
// Royalty support for various other standards
function getFeeRecipients(uint256 tokenId) external view returns (address payable[] memory);
function getFeeBps(uint256 tokenId) external view returns (uint[] memory);
function getFees(uint256 tokenId) external view returns (address payable[] memory, uint256[] memory);
function royaltyInfo(uint256 tokenId, uint256 value) external view returns (address, uint256);
}
IAdminControl.sol 38 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/// @author: manifold.xyz
import "@openzeppelin/contracts/utils/introspection/IERC165.sol";
/**
* @dev Interface for admin control
*/
interface IAdminControl is IERC165 {
event AdminApproved(address indexed account, address indexed sender);
event AdminRevoked(address indexed account, address indexed sender);
/**
* @dev gets address of all admins
*/
function getAdmins() external view returns (address[] memory);
/**
* @dev add an admin. Can only be called by contract owner.
*/
function approveAdmin(address admin) external;
/**
* @dev remove an admin. Can only be called by contract owner.
*/
function revokeAdmin(address admin) external;
/**
* @dev checks whether or not given address is an admin
* Returns True if they are
*/
function isAdmin(address admin) external view returns (bool);
}
IERC721CreatorCore.sol 68 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/// @author: manifold.xyz
import "./ICreatorCore.sol";
/**
* @dev Core ERC721 creator interface
*/
interface IERC721CreatorCore is ICreatorCore {
/**
* @dev mint a token with no extension. Can only be called by an admin.
* Returns tokenId minted
*/
function mintBase(address to) external returns (uint256);
/**
* @dev mint a token with no extension. Can only be called by an admin.
* Returns tokenId minted
*/
function mintBase(address to, string calldata uri) external returns (uint256);
/**
* @dev batch mint a token with no extension. Can only be called by an admin.
* Returns tokenId minted
*/
function mintBaseBatch(address to, uint16 count) external returns (uint256[] memory);
/**
* @dev batch mint a token with no extension. Can only be called by an admin.
* Returns tokenId minted
*/
function mintBaseBatch(address to, string[] calldata uris) external returns (uint256[] memory);
/**
* @dev mint a token. Can only be called by a registered extension.
* Returns tokenId minted
*/
function mintExtension(address to) external returns (uint256);
/**
* @dev mint a token. Can only be called by a registered extension.
* Returns tokenId minted
*/
function mintExtension(address to, string calldata uri) external returns (uint256);
/**
* @dev batch mint a token. Can only be called by a registered extension.
* Returns tokenIds minted
*/
function mintExtensionBatch(address to, uint16 count) external returns (uint256[] memory);
/**
* @dev batch mint a token. Can only be called by a registered extension.
* Returns tokenId minted
*/
function mintExtensionBatch(address to, string[] calldata uris) external returns (uint256[] memory);
/**
* @dev burn a token. Can only be called by token owner or approved address.
* On burn, calls back to the registered extension's onBurn method
*/
function burn(uint256 tokenId) external;
}
CreatorExtension.sol 30 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/// @author: manifold.xyz
import "@openzeppelin/contracts/utils/introspection/ERC165.sol";
/**
* @dev Base creator extension variables
*/
abstract contract CreatorExtension is ERC165 {
/**
* @dev Legacy extension interface identifiers
*
* {IERC165-supportsInterface} needs to return 'true' for this interface
* in order backwards compatible with older creator contracts
*/
bytes4 constant internal LEGACY_EXTENSION_INTERFACE = 0x7005caad;
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165) returns (bool) {
return interfaceId == LEGACY_EXTENSION_INTERFACE
|| super.supportsInterface(interfaceId);
}
}
ICreatorExtensionTokenURI.sol 18 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/// @author: manifold.xyz
import "@openzeppelin/contracts/utils/introspection/IERC165.sol";
/**
* @dev Implement this if you want your extension to have overloadable URI's
*/
interface ICreatorExtensionTokenURI is IERC165 {
/**
* Get the uri for a given creator/tokenId
*/
function tokenURI(address creator, uint256 tokenId) external view returns (string memory);
}
Read Contract
latestSeries 0x3580e71b → uint256
maxSupply 0x7e4e3d6f → uint256
supportsInterface 0x01ffc9a7 → bool
tokenURI 0xe9dc6375 → string
totalSupply 0x346e6c0e → uint256
Write Contract 4 functions
These functions modify contract state and require a wallet transaction to execute.
createSeries 0x151c6f41
address creator
uint256 maxSupply_
string prefix
returns: uint256
mint 0x1e396066
address creator
uint256 series
address[] recipients
mint 0x2f6196b7
address creator
uint256 series
address recipient
uint16 count
setTokenURIPrefix 0x654fb5bd
address creator
uint256 series
string prefix
Recent Transactions
No transactions found for this address