Last active
June 6, 2024 02:24
-
-
Save ipekt/960301c95f0dd2ba15092cf9f12bf183 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // SPDX-License-Identifier: UNLICENSED | |
| pragma solidity 0.8.20; | |
| import "@openzeppelin/contracts-upgradeable/token/ERC1155/ERC1155Upgradeable.sol"; | |
| import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; | |
| import {OperatorAllowlistEnforced} from "./OperatorAllowlistEnforced.sol"; | |
| contract ClashOfCatsERC1155Upgradable is ERC1155Upgradeable, OperatorAllowlistEnforced { | |
| function initialize() public initializer { | |
| __ERC1155_init(""); | |
| // Testnet address | |
| _setOperatorAllowlistRegistry( | |
| address(0x6b969FD89dE634d8DE3271EbE97734FEFfcd58eE) | |
| ); | |
| } | |
| function _safeTransferFrom( | |
| address from, | |
| address to, | |
| uint256 id, | |
| uint256 value, | |
| bytes memory data | |
| ) internal override(ERC1155Upgradeable) validateTransfer(from, to) { | |
| super._safeTransferFrom(from, to, id, value, data); | |
| } | |
| function _safeBatchTransferFrom( | |
| address from, | |
| address to, | |
| uint256[] memory ids, | |
| uint256[] memory values, | |
| bytes memory data | |
| ) internal override(ERC1155Upgradeable) validateTransfer(from, to) { | |
| super._safeBatchTransferFrom(from, to, ids, values, data); | |
| } | |
| function setApprovalForAll( | |
| address operator, | |
| bool approved | |
| ) public override(ERC1155Upgradeable) validateApproval(operator) { | |
| super.setApprovalForAll(operator, approved); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment