// SPDX-License-Identifier: UNLICENSEDpragmasolidity 0.8.10;import"../royaltyManager/interfaces/IRoyaltyManager.sol";
/**
* @title IObservability
* @author highlight.xyz
* @notice Interface to interact with the Highlight observability singleton
* @dev Singleton to coalesce select Highlight protocol events
*/interfaceIObservability{
/**************************
ERC721Base / ERC721MinimizedBase events
**************************//**
* @notice Emitted when minter is registered or unregistered
* @param contractAddress Initial contract that emitted event
* @param minter Minter that was changed
* @param registered True if the minter was registered, false if unregistered
*/eventMinterRegistrationChanged(addressindexed contractAddress, addressindexed minter, boolindexed registered);
/**
* @notice Emitted when token managers are set for token/edition ids
* @param contractAddress Initial contract that emitted event
* @param _ids Edition / token ids
* @param _tokenManagers Token managers to set for tokens / editions
*/eventGranularTokenManagersSet(addressindexed contractAddress, uint256[] _ids, address[] _tokenManagers);
/**
* @notice Emitted when token managers are removed for token/edition ids
* @param contractAddress Initial contract that emitted event
* @param _ids Edition / token ids to remove token managers for
*/eventGranularTokenManagersRemoved(addressindexed contractAddress, uint256[] _ids);
/**
* @notice Emitted when default token manager changed
* @param contractAddress Initial contract that emitted event
* @param newDefaultTokenManager New default token manager. Zero address if old one was removed
*/eventDefaultTokenManagerChanged(addressindexed contractAddress, addressindexed newDefaultTokenManager);
/**
* @notice Emitted when default royalty is set
* @param contractAddress Initial contract that emitted event
* @param recipientAddress Royalty recipient
* @param royaltyPercentageBPS Percentage of sale (in basis points) owed to royalty recipient
*/eventDefaultRoyaltySet(addressindexed contractAddress,
addressindexed recipientAddress,
uint16indexed royaltyPercentageBPS
);
/**
* @notice Emitted when royalties are set for edition / token ids
* @param contractAddress Initial contract that emitted event
* @param ids Token / edition ids
* @param _newRoyalties New royalties for each token / edition
*/eventGranularRoyaltiesSet(addressindexed contractAddress, uint256[] ids, IRoyaltyManager.Royalty[] _newRoyalties);
/**
* @notice Emitted when royalty manager is updated
* @param contractAddress Initial contract that emitted event
* @param newRoyaltyManager New royalty manager. Zero address if old one was removed
*/eventRoyaltyManagerChanged(addressindexed contractAddress, addressindexed newRoyaltyManager);
/**
* @notice Emitted when mints are frozen permanently
* @param contractAddress Initial contract that emitted event
*/eventMintsFrozen(addressindexed contractAddress);
/**
* @notice Emitted when contract metadata is set
* @param contractAddress Initial contract that emitted event
* @param name New name
* @param symbol New symbol
* @param contractURI New contract uri
*/eventContractMetadataSet(addressindexed contractAddress, string name, string symbol, string contractURI);
/**************************
ERC721General events
**************************//**
* @notice Emitted when hashed metadata config is set
* @param contractAddress Initial contract that emitted event
* @param hashedURIData Hashed uri data
* @param hashedRotationData Hashed rotation key
* @param _supply Supply of tokens to mint w/ reveal
*/eventHashedMetadataConfigSet(addressindexed contractAddress,
bytes hashedURIData,
bytes hashedRotationData,
uint256indexed _supply
);
/**
* @notice Emitted when metadata is revealed
* @param contractAddress Initial contract that emitted event
* @param key Key used to decode hashed data
* @param newRotationKey Actual rotation key to be used
*/eventRevealed(addressindexed contractAddress, bytes key, uint256 newRotationKey);
/**************************
ERC721GeneralBase events
**************************//**
* @notice Emitted when uris are set for tokens
* @param contractAddress Initial contract that emitted event
* @param ids IDs of tokens to set uris for
* @param uris Uris to set on tokens
*/eventTokenURIsSet(addressindexed contractAddress, uint256[] ids, string[] uris);
/**
* @notice Emitted when limit supply is set
* @param contractAddress Initial contract that emitted event
* @param newLimitSupply Limit supply to set
*/eventLimitSupplySet(addressindexed contractAddress, uint256indexed newLimitSupply);
/**************************
ERC721StorageUri events
**************************//**
* @notice Emits when a series collection has its base uri set
* @param contractAddress Contract with updated base uri
* @param newBaseUri New base uri
*/eventBaseUriSet(addressindexed contractAddress, string newBaseUri);
/**************************
ERC721Editions / ERC721SingleEdition events
**************************/// Not adding EditionCreated, EditionMintedToOneRecipient, EditionMintedToRecipients// EditionCreated - handled by MetadataInitialized// EditionMintedToOneRecipient / EditionMintedToRecipients - handled via mint module events/**************************
Deployment events
**************************//**
* @notice Emitted when Generative Series contract is deployed
* @param deployer Contract deployer
* @param contractAddress Address of contract that was deployed
*/eventGenerativeSeriesDeployed(addressindexed deployer, addressindexed contractAddress);
/**
* @notice Emitted when Series contract is deployed
* @param deployer Contract deployer
* @param contractAddress Address of contract that was deployed
*/eventSeriesDeployed(addressindexed deployer, addressindexed contractAddress);
/**
* @notice Emitted when MultipleEditions contract is deployed
* @param deployer Contract deployer
* @param contractAddress Address of contract that was deployed
*/eventMultipleEditionsDeployed(addressindexed deployer, addressindexed contractAddress);
/**
* @notice Emitted when SingleEdition contract is deployed
* @param deployer Contract deployer
* @param contractAddress Address of contract that was deployed
*/eventSingleEditionDeployed(addressindexed deployer, addressindexed contractAddress);
/**************************
ERC721 events
**************************//**
* @notice Emitted when `tokenId` token is transferred from `from` to `to` on contractAddress
* @param contractAddress NFT contract token resides on
* @param from Token sender
* @param to Token receiver
* @param tokenId Token being sent
*/eventTransfer(addressindexed contractAddress, addressindexedfrom, address to, uint256indexed tokenId);
/**
* @notice Emit MinterRegistrationChanged
*/functionemitMinterRegistrationChanged(address minter, bool registered) external;
/**
* @notice Emit GranularTokenManagersSet
*/functionemitGranularTokenManagersSet(uint256[] calldata _ids, address[] calldata _tokenManagers) external;
/**
* @notice Emit GranularTokenManagersRemoved
*/functionemitGranularTokenManagersRemoved(uint256[] calldata _ids) external;
/**
* @notice Emit DefaultTokenManagerChanged
*/functionemitDefaultTokenManagerChanged(address newDefaultTokenManager) external;
/**
* @notice Emit DefaultRoyaltySet
*/functionemitDefaultRoyaltySet(address recipientAddress, uint16 royaltyPercentageBPS) external;
/**
* @notice Emit GranularRoyaltiesSet
*/functionemitGranularRoyaltiesSet(uint256[] calldata ids,
IRoyaltyManager.Royalty[] calldata _newRoyalties
) external;
/**
* @notice Emit RoyaltyManagerChanged
*/functionemitRoyaltyManagerChanged(address newRoyaltyManager) external;
/**
* @notice Emit MintsFrozen
*/functionemitMintsFrozen() external;
/**
* @notice Emit ContractMetadataSet
*/functionemitContractMetadataSet(stringcalldata name,
stringcalldata symbol,
stringcalldata contractURI
) external;
/**
* @notice Emit HashedMetadataConfigSet
*/functionemitHashedMetadataConfigSet(bytescalldata hashedURIData,
bytescalldata hashedRotationData,
uint256 _supply
) external;
/**
* @notice Emit Revealed
*/functionemitRevealed(bytescalldata key, uint256 newRotationKey) external;
/**
* @notice Emit TokenURIsSet
*/functionemitTokenURIsSet(uint256[] calldata ids, string[] calldata uris) external;
/**
* @notice Emit LimitSupplySet
*/functionemitLimitSupplySet(uint256 newLimitSupply) external;
/**
* @notice Emit BaseUriSet
*/functionemitBaseUriSet(stringcalldata newBaseUri) external;
/**
* @notice Emit GenerativeSeriesDeployed
*/functionemitGenerativeSeriesDeployed(address contractAddress) external;
/**
* @notice Emit SeriesDeployed
*/functionemitSeriesDeployed(address contractAddress) external;
/**
* @notice Emit MultipleEditionsDeployed
*/functionemitMultipleEditionsDeployed(address contractAddress) external;
/**
* @notice Emit SingleEditionDeployed
*/functionemitSingleEditionDeployed(address contractAddress) external;
/**
* @notice Emit Transfer
*/functionemitTransfer(addressfrom, address to, uint256 tokenId) external;
}
Contract Source Code
File 2 of 3: IRoyaltyManager.sol
// SPDX-License-Identifier: UNLICENSEDpragmasolidity 0.8.10;/**
* @title IRoyaltyManager
* @author highlight.xyz
* @notice Enables interfacing with custom royalty managers that define conditions on setting royalties for
* NFT contracts
*/interfaceIRoyaltyManager{
/**
* @notice Struct containing values required to adhere to ERC-2981
* @param recipientAddress Royalty recipient - can be EOA, royalty splitter contract, etc.
* @param royaltyPercentageBPS Royalty cut, in basis points
*/structRoyalty {
address recipientAddress;
uint16 royaltyPercentageBPS;
}
/**
* @notice Defines conditions around being able to swap royalty manager for another one
* @param newRoyaltyManager New royalty manager being swapped in
* @param sender msg sender
*/functioncanSwap(address newRoyaltyManager, address sender) externalviewreturns (bool);
/**
* @notice Defines conditions around being able to remove current royalty manager
* @param sender msg sender
*/functioncanRemoveItself(address sender) externalviewreturns (bool);
/**
* @notice Defines conditions around being able to set granular royalty (per token or per edition)
* @param id Edition / token ID whose royalty is being set
* @param royalty Royalty being set
* @param sender msg sender
*/functioncanSetGranularRoyalty(uint256 id, Royalty calldata royalty, address sender) externalviewreturns (bool);
/**
* @notice Defines conditions around being able to set default royalty
* @param royalty Royalty being set
* @param sender msg sender
*/functioncanSetDefaultRoyalty(Royalty calldata royalty, address sender) externalviewreturns (bool);
}
Contract Source Code
File 3 of 3: Observability.sol
// SPDX-License-Identifier: UNLICENSEDpragmasolidity 0.8.10;import"./IObservability.sol";
/**
* @title Observability
* @author highlight.xyz
* @notice Highlight Observability
* @dev Singleton to coalesce select Highlight protocol events
*/contractObservabilityisIObservability{
/**
* @notice See {IObservability-emitMinterRegistrationChanged}
*/functionemitMinterRegistrationChanged(address minter, bool registered) external{
emit MinterRegistrationChanged(msg.sender, minter, registered);
}
/**
* @notice See {IObservability-emitGranularTokenManagersSet}
*/functionemitGranularTokenManagersSet(uint256[] calldata _ids, address[] calldata _tokenManagers) external{
emit GranularTokenManagersSet(msg.sender, _ids, _tokenManagers);
}
/**
* @notice See {IObservability-emitGranularTokenManagersRemoved}
*/functionemitGranularTokenManagersRemoved(uint256[] calldata _ids) external{
emit GranularTokenManagersRemoved(msg.sender, _ids);
}
/**
* @notice See {IObservability-emitDefaultTokenManagerChanged}
*/functionemitDefaultTokenManagerChanged(address newDefaultTokenManager) external{
emit DefaultTokenManagerChanged(msg.sender, newDefaultTokenManager);
}
/**
* @notice See {IObservability-emitDefaultRoyaltySet}
*/functionemitDefaultRoyaltySet(address recipientAddress, uint16 royaltyPercentageBPS) external{
emit DefaultRoyaltySet(msg.sender, recipientAddress, royaltyPercentageBPS);
}
/**
* @notice See {IObservability-emitGranularRoyaltiesSet}
*/functionemitGranularRoyaltiesSet(uint256[] calldata ids,
IRoyaltyManager.Royalty[] calldata _newRoyalties
) external{
emit GranularRoyaltiesSet(msg.sender, ids, _newRoyalties);
}
/**
* @notice See {IObservability-emitRoyaltyManagerChanged}
*/functionemitRoyaltyManagerChanged(address newRoyaltyManager) external{
emit RoyaltyManagerChanged(msg.sender, newRoyaltyManager);
}
/**
* @notice See {IObservability-emitMintsFrozen}
*/functionemitMintsFrozen() external{
emit MintsFrozen(msg.sender);
}
/**
* @notice See {IObservability-emitContractMetadataSet}
*/functionemitContractMetadataSet(stringcalldata name,
stringcalldata symbol,
stringcalldata contractURI
) external{
emit ContractMetadataSet(msg.sender, name, symbol, contractURI);
}
/**
* @notice See {IObservability-emitHashedMetadataConfigSet}
*/functionemitHashedMetadataConfigSet(bytescalldata hashedURIData,
bytescalldata hashedRotationData,
uint256 _supply
) external{
emit HashedMetadataConfigSet(msg.sender, hashedURIData, hashedRotationData, _supply);
}
/**
* @notice See {IObservability-emitRevealed}
*/functionemitRevealed(bytescalldata key, uint256 newRotationKey) external{
emit Revealed(msg.sender, key, newRotationKey);
}
/**
* @notice See {IObservability-emitTokenURIsSet}
* @dev If sent by an EditionsDFS based contract,
* ids and uris will be of length 1 and contain edition id / new edition uri
*/functionemitTokenURIsSet(uint256[] calldata ids, string[] calldata uris) external{
emit TokenURIsSet(msg.sender, ids, uris);
}
/**
* @notice See {IObservability-emitLimitSupplySet}
*/functionemitLimitSupplySet(uint256 newLimitSupply) external{
emit LimitSupplySet(msg.sender, newLimitSupply);
}
/**
* @notice See {IObservability-emitBaseUriSet}
*/functionemitBaseUriSet(stringcalldata newBaseUri) external{
emit BaseUriSet(msg.sender, newBaseUri);
}
/**
* @notice See {IObservability-emitGenerativeSeriesDeployed}
*/functionemitGenerativeSeriesDeployed(address contractAddress) external{
emit GenerativeSeriesDeployed(msg.sender, contractAddress);
}
/**
* @notice See {IObservability-emitSeriesDeployed}
*/functionemitSeriesDeployed(address contractAddress) external{
emit SeriesDeployed(msg.sender, contractAddress);
}
/**
* @notice See {IObservability-emitMultipleEditionsDeployed}
*/functionemitMultipleEditionsDeployed(address contractAddress) external{
emit MultipleEditionsDeployed(msg.sender, contractAddress);
}
/**
* @notice See {IObservability-emitSingleEditionDeployed}
*/functionemitSingleEditionDeployed(address contractAddress) external{
emit SingleEditionDeployed(msg.sender, contractAddress);
}
/**
* @notice See {IObservability-emitTransfer}
*/functionemitTransfer(addressfrom, address to, uint256 tokenId) external{
emit Transfer(msg.sender, from, to, tokenId);
}
}