11// SPDX-License-Identifier: Apache-2.0
22pragma solidity ^ 0.8.0 ;
33
4- contract ThirdwebContract {
5- /// @dev The publish metadata of the contract of which this contract is an instance.
6- string private publishMetadataUri ;
7- /// @dev The metadata for this contract.
8- string public contractURI;
4+ import " ./feature/Ownable.sol " ;
5+ import " ./feature/Context.sol " ;
6+ import " ./feature/ContractMetadata.sol " ;
7+
8+ contract ThirdwebContract is Context , Ownable , ContractMetadata {
99
1010 struct ThirdwebInfo {
1111 string publishMetadataUri;
1212 string contractURI;
13+ address owner;
1314 }
15+
16+ /// @dev The publish metadata of the contract of which this contract is an instance.
17+ string private publishMetadataUri;
1418
1519 /// @dev Returns the publish metadata for this contract.
1620 function getPublishMetadataUri () external view returns (string memory ) {
@@ -23,5 +27,16 @@ contract ThirdwebContract {
2327
2428 publishMetadataUri = _thirdwebInfo.publishMetadataUri;
2529 contractURI = _thirdwebInfo.contractURI;
30+ owner = _thirdwebInfo.owner;
31+ }
32+
33+ /// @dev Returns whether owner can be set in the given execution context.
34+ function _canSetOwner () internal virtual override returns (bool ) {
35+ return _msgSender () == owner;
36+ }
37+
38+ /// @dev Returns whether contract metadata can be set in the given execution context.
39+ function _canSetContractURI () internal virtual override returns (bool ) {
40+ return _msgSender () == owner;
2641 }
2742}
0 commit comments