mirror of
https://github.com/lens-protocol/core.git
synced 2026-01-09 14:18:04 -05:00
feat: BatchMetadataUpdate added to trigger collection token URI refresh
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user