Skip to content

Instantly share code, notes, and snippets.

@ipekt
Last active May 21, 2024 04:20
Show Gist options
  • Select an option

  • Save ipekt/b468d96f3fdf242317c86bca1deae3e1 to your computer and use it in GitHub Desktop.

Select an option

Save ipekt/b468d96f3fdf242317c86bca1deae3e1 to your computer and use it in GitHub Desktop.
// Using "@imtbl/contracts": "2.2.7" - https://github.com/immutable/contracts/releases/tag/v2.2.7
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.19;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {OperatorAllowlistEnforced} from "@imtbl/contracts/contracts/allowlist/OperatorAllowlistEnforced.sol";
contract ClashOfCats is
ERC721,
Ownable,
OperatorAllowlistEnforced
{
constructor(
string memory name,
string memory symbol,
address operatorAllowlist_ // OAL contract address
) ERC721(name, symbol) Ownable() {
_setOperatorAllowlistRegistry(operatorAllowlist_);
}
function _approve(
address to,
uint256 tokenId
) internal override(ERC721) validateApproval(to) {
super._approve(to, tokenId);
}
function setApprovalForAll(
address operator,
bool approved
) public override(ERC721) validateApproval(operator) {
super.setApprovalForAll(operator, approved);
}
function _transfer(
address from,
address to,
uint256 tokenId
) internal override(ERC721) validateTransfer(from, to) {
super._transfer(from, to, tokenId);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment