// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.18; import "./SmartAssetBase.sol"; import "../Interfaces/ISmartAssetURIStorage.sol"; /** * @title SmartAssetURIStorage. * @author Arianee - Dynamic NFTs for real-world use cases and consumer engagement (www.arianee.org). */ abstract contract SmartAssetURIStorage is SmartAssetBase, ISmartAssetURIStorage { /** * @notice Base URI for computing {tokenURI}. */ string public baseURI = ""; /** * @notice This emits when the base URI is updated. */ event SetNewBaseURI(string newBaseURI); constructor(string memory baseURI_) { setBaseURI(baseURI_); } /** * @notice Set the base URI for all smart assets. It is automatically added as a prefix to the value returned in {ERC721-tokenURI}. * @param newBaseURI The new base URI. */ function setBaseURI(string memory newBaseURI) public onlyRole(DEFAULT_ADMIN_ROLE) { baseURI = newBaseURI; emit SetNewBaseURI(newBaseURI); } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overridden in child contracts. */ function _baseURI() internal view virtual override returns (string memory) { return baseURI; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(ISmartAssetURIStorage).interfaceId || super.supportsInterface(interfaceId); } }