Skip to content

Instantly share code, notes, and snippets.

@yann300
Created April 14, 2025 11:27
Show Gist options
  • Select an option

  • Save yann300/3209be9cb0ffed919382141d46e45245 to your computer and use it in GitHub Desktop.

Select an option

Save yann300/3209be9cb0ffed919382141d46e45245 to your computer and use it in GitHub Desktop.
{
"query":"generate an ERC 721 contract which allow minting but not transferring tokens.",
"response":"Source: openzeppelin-contracts/contracts/token/ERC721/extensions/ERC721Pausable.sol\nContent: // SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/extensions/ERC721Pausable.sol) pragma solidity ^0.8.20; import {ERC721} from \"../ERC721.sol\"; import {Pausable} from \"../../../utils/Pausable.sol\"; /** * @dev ERC-721 token with pausable token transfers, minting and burning. * * Useful for scenarios such as preventing trades until the end of an evaluation * period, or having an emergency switch for freezing all token transfers in the * event of a large bug. * * IMPORTANT: This contract does not include public pause and unpause functions. In * addition to inheriting this contract, you must define both functions, invoking the * {Pausable-_pause} and {Pausable-_unpause} internal functions, with appropriate * access control, e.g. using {AccessControl} or {Ownable}. Not doing so will * make the contract pause mechanism of the contract unreachable, and thus unusable. */ abstract contract ERC721Pausable is ERC721, Pausable { /** * @dev See {ERC721-_update}. * * Requirements: * * - the contract must not be paused. */ function _update( address to, uint256 tokenId, address auth ) internal virtual override whenNotPaused returns (address) { return super._update(to, tokenId, auth); } }",
"retrieved_documents":[
{
"content":"// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/extensions/ERC721Pausable.sol) pragma solidity ^0.8.20; import {ERC721} from \"../ERC721.sol\"; import {Pausable} from \"../../../utils/Pausable.sol\"; /** * @dev ERC-721 token with pausable token transfers, minting and burning. * * Useful for scenarios such as preventing trades until the end of an evaluation * period, or having an emergency switch for freezing all token transfers in the * event of a large bug. * * IMPORTANT: This contract does not include public pause and unpause functions. In * addition to inheriting this contract, you must define both functions, invoking the * {Pausable-_pause} and {Pausable-_unpause} internal functions, with appropriate * access control, e.g. using {AccessControl} or {Ownable}. Not doing so will * make the contract pause mechanism of the contract unreachable, and thus unusable. */ abstract contract ERC721Pausable is ERC721, Pausable { /** * @dev See {ERC721-_update}. * * Requirements: * * - the contract must not be paused. */ function _update( address to, uint256 tokenId, address auth ) internal virtual override whenNotPaused returns (address) { return super._update(to, tokenId, auth); } }",
"source":"openzeppelin-contracts/contracts/token/ERC721/extensions/ERC721Pausable.sol"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment