# Mint Permissions

## Implementations

Basic implementations (ERC721 and ERC1155) of a Mint Permissions contract that works with a singular creator contract are shown below. Note the approveMint function requires the sender to be the configured creator.

### ERC721

```solidity
abstract contract ERC721CreatorMintPermissions is ERC165, AdminControl, IERC721CreatorMintPermissions {
     address internal immutable _creator;

     constructor(address creator_) {
         require(ERC165Checker.supportsInterface(creator_, type(IERC721CreatorCore).interfaceId), "Must implement IERC721CreatorCore");
         _creator = creator_;
     }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165, AdminControl) returns (bool) {
        return interfaceId == type(IERC721CreatorMintPermissions).interfaceId
            || super.supportsInterface(interfaceId);
    }

    /**
     * @dev See {IERC721CreatorMintPermissions-approve}.
     */
    function approveMint(address, address, uint256) public virtual override {
        require(msg.sender == _creator, "Can only be called by token creator");
    }
}
```

### ERC155

```solidity
abstract contract ERC1155CreatorMintPermissions is ERC165, AdminControl, IERC1155CreatorMintPermissions {
     address internal immutable _creator;

     constructor(address creator_) {
         require(ERC165Checker.supportsInterface(creator_, type(IERC1155CreatorCore).interfaceId), "Must implement IERC1155CreatorCore");
         _creator = creator_;
     }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165, AdminControl) returns (bool) {
        return interfaceId == type(IERC1155CreatorMintPermissions).interfaceId
            || super.supportsInterface(interfaceId);
    }

    /**
     * @dev See {IERC1155CreatorMintPermissions-approve}.
     */
    function approveMint(address, address[] calldata, uint256[] calldata, uint256[] calldata)  public virtual override {
        require(msg.sender == _creator, "Can only be called by token creator");
    }
}
```

## Adding a Mint Permissions Contract

Adding a Mint Permissions contract is similar to registering an extension. Add a mint permissions contract by calling the `setMintPermissions` function and indicating the registered extension contract and mint permissions contract you wish to set.

For detailed Mint Permissions functions information see [Mint Permissions Functions](/manifold-for-developers/smart-contracts/manifold-creator/contracts/mint-permissions/mint-permissions-functions.md).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.manifold.xyz/manifold-for-developers/smart-contracts/manifold-creator/contracts/mint-permissions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
