Request form
Cookbook may introduce a token in the future. Share and contribute to be eligible for future airdrops.
close icon
relevant tag icon
Manifold Royalties Creator Extension
copy icon
manifoldxyz
• version 1.0.0
Manifold
Extension
Royalties

Manifold Royalties Creator Extension

Manifold Creator Extension: Extend this implementation to have creator check with it for token based royalties

*Visit desktop site to download or deploy

Version

1.0.0

Recent Use

🍞 0x1330 downloaded
🥐 0x1330 downloaded

Last Publish

11/28/2022
Any contract you deploy is yours.
Fully owned and controlled by your wallet.
Documentation
Source Code
CreatorExtensionRoyalties.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /// @author: manifold.xyz import "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol"; import "@manifoldxyz/libraries-solidity/contracts/access/AdminControl.sol"; import "../core/IERC721CreatorCore.sol"; import "./CreatorExtension.sol"; import "./ICreatorExtensionRoyalties.sol"; /** * @dev Extend this implementation to have creator * check with it for token based royalties */ abstract contract CreatorExtensionRoyalties is AdminControl, CreatorExtension, ICreatorExtensionRoyalties { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(AdminControl, CreatorExtension, IERC165) returns (bool) { return interfaceId == type(ICreatorExtensionRoyalties).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {ICreatorExtensionRoyalties-getRoyalties} */ function getRoyalties(address creator, uint256 tokenId) external virtual view returns (address payable[] memory, uint256[] memory); }
IERC721CreatorCore.sol
// 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
// 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); } }
ICreatorExtensionRoyalties.sol
// 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 royalties */ interface ICreatorExtensionRoyalties is IERC165 { /** * Get the royalties for a given creator/tokenId */ function getRoyalties(address creator, uint256 tokenId) external view returns (address payable[] memory, uint256[] memory); }

Get Cookin'
share iconShare

copy iconDownload Source
copy iconnpx cookbookdev i manifold-creator-extension-royalties
copy icon

Recent Use

🍞 0x1330 downloaded
🥐 0x1330 downloaded

Last Publish

11/28/2022

Version

1.0.0

Cookbook is free.
Any contract you deploy is yours.
Your contract is owned and controlled by you.