// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.16; import "@openzeppelin/contracts/access/AccessControl.sol"; contract KanjiThirdParty is AccessControl() { error NotAllowedToChangeMinter(); bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); constructor(address _minter) { _setupRole(DEFAULT_ADMIN_ROLE, msg.sender); _setupRole(MINTER_ROLE, _minter); } function changeMinter(address _newMinter) external { if (!hasRole(DEFAULT_ADMIN_ROLE, msg.sender) && !hasRole(MINTER_ROLE, msg.sender)) { revert NotAllowedToChangeMinter(); } _revokeRole(MINTER_ROLE, msg.sender); _grantRole(MINTER_ROLE, _newMinter); } }