diff --git a/contracts/base/LensGovernable.sol b/contracts/base/LensGovernable.sol index 04ae4e8..d52df9b 100644 --- a/contracts/base/LensGovernable.sol +++ b/contracts/base/LensGovernable.sol @@ -7,6 +7,7 @@ import {GovernanceLib} from 'contracts/libraries/GovernanceLib.sol'; import {ValidationLib} from 'contracts/libraries/ValidationLib.sol'; import {StorageLib} from 'contracts/libraries/StorageLib.sol'; import {Types} from 'contracts/libraries/constants/Types.sol'; +import {Events} from 'contracts/libraries/constants/Events.sol'; abstract contract LensGovernable is ILensGovernable { /** @@ -54,6 +55,7 @@ abstract contract LensGovernable is ILensGovernable { function setProfileTokenURIContract(address profileTokenURIContract) external override onlyGov { GovernanceLib.setProfileTokenURIContract(profileTokenURIContract); + emit Events.BatchMetadataUpdate({fromTokenId: 0, toTokenId: type(uint256).max}); } function setFollowTokenURIContract(address followTokenURIContract) external override onlyGov { diff --git a/contracts/libraries/constants/Events.sol b/contracts/libraries/constants/Events.sol index 41cc394..f049fd4 100644 --- a/contracts/libraries/constants/Events.sol +++ b/contracts/libraries/constants/Events.sol @@ -398,4 +398,12 @@ library Events { * @param timestamp The UNIX timestamp of the nonce being used. */ event NonceUpdated(address indexed signer, uint256 nonce, uint256 timestamp); + + /** + * @dev Emitted when a collection's token URI is updated. + * @param fromTokenId The ID of the smallest token that requires its token URI to be refreshed. + * @param toTokenId The ID of the biggest token that requires its token URI to be refreshed. Max uint256 to refresh + * all of them. + */ + event BatchMetadataUpdate(uint256 fromTokenId, uint256 toTokenId); } diff --git a/contracts/namespaces/LensHandles.sol b/contracts/namespaces/LensHandles.sol index 51f109e..22f7e3e 100644 --- a/contracts/namespaces/LensHandles.sol +++ b/contracts/namespaces/LensHandles.sol @@ -89,6 +89,7 @@ contract LensHandles is ERC721, ERC2981CollectionRoyalties, ImmutableOwnable, IL function setHandleTokenURIContract(address handleTokenURIContract) external override onlyOwner { _handleTokenURIContract = handleTokenURIContract; + emit HandlesEvents.BatchMetadataUpdate({fromTokenId: 0, toTokenId: type(uint256).max}); } function getHandleTokenURIContract() external view override returns (address) { diff --git a/contracts/namespaces/constants/Events.sol b/contracts/namespaces/constants/Events.sol index 2272a7e..7de379f 100644 --- a/contracts/namespaces/constants/Events.sol +++ b/contracts/namespaces/constants/Events.sol @@ -22,6 +22,14 @@ library HandlesEvents { uint256 tokenGuardianDisablingTimestamp, uint256 timestamp ); + + /** + * @dev Emitted when a collection's token URI is updated. + * @param fromTokenId The ID of the smallest token that requires its token URI to be refreshed. + * @param toTokenId The ID of the biggest token that requires its token URI to be refreshed. Max uint256 to refresh + * all of them. + */ + event BatchMetadataUpdate(uint256 fromTokenId, uint256 toTokenId); } library RegistryEvents {