From 401447a31023b7e5b0d58073de473cfb5bbddf4b Mon Sep 17 00:00:00 2001 From: sonnyquinn24 <227287527+sonnyquinn24@users.noreply.github.com> Date: Tue, 7 Oct 2025 10:08:23 -0500 Subject: [PATCH 1/2] Update Solidity version and refactor ContractMetadata Signed-off-by: sonnyquinn24 <227287527+sonnyquinn24@users.noreply.github.com> --- contracts/extension/ContractMetadata.sol | 53 +++++++----------------- 1 file changed, 15 insertions(+), 38 deletions(-) diff --git a/contracts/extension/ContractMetadata.sol b/contracts/extension/ContractMetadata.sol index ec968f2b6..07050996e 100644 --- a/contracts/extension/ContractMetadata.sol +++ b/contracts/extension/ContractMetadata.sol @@ -1,48 +1,25 @@ // SPDX-License-Identifier: Apache-2.0 -pragma solidity ^0.8.0; +pragma solidity ^0.8.19; -/// @author thirdweb +import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; +import "@openzeppelin/contracts/access/Ownable.sol"; +import "./ContractMetadata.sol"; -import "./interface/IContractMetadata.sol"; +contract RebelByNature is ERC721URIStorage, Ownable, ContractMetadata { + uint256 public nextTokenId; -/** - * @title Contract Metadata - * @notice Thirdweb's `ContractMetadata` is a contract extension for any base contracts. It lets you set a metadata URI - * for you contract. - * Additionally, `ContractMetadata` is necessary for NFT contracts that want royalties to get distributed on OpenSea. - */ + event TributeMinted(uint256 tokenId, address recipient, uint256 timestamp); -abstract contract ContractMetadata is IContractMetadata { - /// @dev The sender is not authorized to perform the action - error ContractMetadataUnauthorized(); + constructor() ERC721("Rebel By Nature", "SEQREB") {} - /// @notice Returns the contract metadata URI. - string public override contractURI; - - /** - * @notice Lets a contract admin set the URI for contract-level metadata. - * @dev Caller should be authorized to setup contractURI, e.g. contract admin. - * See {_canSetContractURI}. - * Emits {ContractURIUpdated Event}. - * - * @param _uri keccak256 hash of the role. e.g. keccak256("TRANSFER_ROLE") - */ - function setContractURI(string memory _uri) external override { - if (!_canSetContractURI()) { - revert ContractMetadataUnauthorized(); - } - - _setupContractURI(_uri); + function mintTribute(address recipient) external onlyOwner { + uint256 tokenId = nextTokenId++; + _mint(recipient, tokenId); + _setTokenURI(tokenId, contractURI); + emit TributeMinted(tokenId, recipient, block.timestamp); } - /// @dev Lets a contract admin set the URI for contract-level metadata. - function _setupContractURI(string memory _uri) internal { - string memory prevURI = contractURI; - contractURI = _uri; - - emit ContractURIUpdated(prevURI, _uri); + function _canSetContractURI() internal view override returns (bool) { + return msg.sender == owner(); } - - /// @dev Returns whether contract metadata can be set in the given execution context. - function _canSetContractURI() internal view virtual returns (bool); } From 3edad0ed242a76c0f071b592e5ef405ae2af2384 Mon Sep 17 00:00:00 2001 From: sonnyquinn24 <227287527+sonnyquinn24@users.noreply.github.com> Date: Tue, 7 Oct 2025 10:12:56 -0500 Subject: [PATCH 2/2] Update contracts/extension/ContractMetadata.sol Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: sonnyquinn24 <227287527+sonnyquinn24@users.noreply.github.com> --- contracts/extension/ContractMetadata.sol | 1 - 1 file changed, 1 deletion(-) diff --git a/contracts/extension/ContractMetadata.sol b/contracts/extension/ContractMetadata.sol index 07050996e..c485ddf92 100644 --- a/contracts/extension/ContractMetadata.sol +++ b/contracts/extension/ContractMetadata.sol @@ -3,7 +3,6 @@ pragma solidity ^0.8.19; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; -import "./ContractMetadata.sol"; contract RebelByNature is ERC721URIStorage, Ownable, ContractMetadata { uint256 public nextTokenId;