Skip to content

Commit

Permalink
adding warnings to the doc of the solidity interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
Toni committed Aug 14, 2024
1 parent 16bd9e5 commit d2d7b78
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ pragma solidity >=0.8.3;
/// @custom:address 0x0000000000000000000000000000000000000405
interface AssetMetadataExtender {
/// @notice Emitted when a token metadata is extended
/// @notice The emitted universal location and tokenURI have not undergone
/// @notice any on-chain validation. Users are fully responsible for accuracy,
/// @notice authenticity and preventing potential misuse or exploits.
/// @param _claimer the address of the caller
/// @param _universalLocationHash keccak256 hash of the universal location
/// @param _universalLocation The universal location of the token
Expand All @@ -19,6 +22,9 @@ interface AssetMetadataExtender {
);

/// @notice Emitted when an extended token's URI is updated
/// @notice The emitted universal location and tokenURI have not undergone
/// @notice any on-chain validation. Users are fully responsible for accuracy,
/// @notice authenticity and preventing potential misuse or exploits.
/// @param _claimer the address of the user who updated the token URI
/// @param _universalLocationHash keccak256 hash of the universal location
/// @param _universalLocation the universal location of the token
Expand All @@ -31,6 +37,9 @@ interface AssetMetadataExtender {
);

/// @notice Extends the metadata of a token
/// @notice The universal location and tokenURI provided to this method do not undergo
/// @notice any on-chain validation. Users are fully responsible for accuracy,
/// @notice authenticity and preventing potential misuse or exploits.
/// @dev Emits the ExtendedULWithExternalURI event upon success
/// @dev Reverts if the UL has been extended previously
/// @param _uloc the Universal Location as a string identifying the token
Expand All @@ -41,6 +50,9 @@ interface AssetMetadataExtender {
) external;

/// @notice Updates the URI of an extended token
/// @notice The universal location and tokenURI provided to this method do not undergo
/// @notice any on-chain validation. Users are fully responsible for accuracy,
/// @notice authenticity and preventing potential misuse or exploits.
/// @param _uloc The universal location identifier of the token
/// @param _tokenURI The new URI to be set for the token
function updateExtendedULWithExternalURI(
Expand All @@ -63,6 +75,9 @@ interface AssetMetadataExtender {
) external view returns (address);

/// @notice Returns the tokenURI for an extension at a given index
/// @notice The tokenURI returned by this method has not undergone
/// @notice any on-chain validation. Users are fully responsible for accuracy,
/// @notice authenticity and preventing potential misuse or exploits.
/// @param _uloc The Universal Location string identifying the asset
/// @param _index The index of the extension
/// @return The tokenURI of the extension
Expand All @@ -72,6 +87,9 @@ interface AssetMetadataExtender {
) external view returns (string memory);

/// @notice Returns the extension of a Universal Location made by a claimer
/// @notice The extension returned by this method has not undergone
/// @notice any on-chain validation. Users are fully responsible for accuracy,
/// @notice authenticity and preventing potential misuse or exploits.
/// @dev Reverts if the Universal Location has no extension by the provided claimer
/// @param _universalLocation The Universal Location
/// @param _claimer The address of the claimer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ pragma solidity >=0.8.3;
/// @notice This interface allows Solidity contracts to interact with pallet-laos-evolution
interface EvolutionCollection {
/// @notice Emitted when a new token is minted
/// @notice The emitted tokenURI has not undergone any on-chain validation.
/// @notice Users are fully responsible for accuracy,
/// @notice authenticity and preventing potential misuse or exploits.
/// @dev Id of the token is concatenation of `slot` and `to`
/// @param _to the initial owner of the newly minted token
/// @param _slot the slot of the token
Expand All @@ -19,6 +22,9 @@ interface EvolutionCollection {
);

/// @notice Emitted when a token metadata is updated
/// @notice The emitted tokenURI has not undergone any on-chain validation.
/// @notice Users are fully responsible for accuracy,
/// @notice authenticity and preventing potential misuse or exploits.
/// @param _tokenId the id of the token for which the metadata has changed
/// @param _tokenURI the new URI of the token
event EvolvedWithExternalURI(uint256 indexed _tokenId, string _tokenURI);
Expand All @@ -43,12 +49,18 @@ interface EvolutionCollection {
function owner() external view returns (address);

/// @notice Provides a distinct Uniform Resource Identifier (URI) for a given token within a specified collection.
/// @notice The tokenURI returned by this method has not undergone
/// @notice any on-chain validation. Users are fully responsible for accuracy,
/// @notice authenticity and preventing potential misuse or exploits.
/// @dev Implementations must follow the ERC-721 standard for token URIs, which should point to a JSON file conforming to the "ERC721 Metadata JSON Schema".
/// @param _tokenId The unique identifier of the token within the specified collection.
/// @return A string representing the URI of the specified token.
function tokenURI(uint256 _tokenId) external view returns (string memory);

/// @notice Mint a new token
/// @notice The tokenURI provided to this method does not undergo
/// @notice any on-chain validation. Users are fully responsible for accuracy,
/// @notice authenticity and preventing potential misuse or exploits.
/// @dev Call this function to mint a new token, the caller must be the owner of the collection
/// @param _to the owner of the newly minted token
/// @param _slot the slot of the token
Expand All @@ -61,6 +73,9 @@ interface EvolutionCollection {
) external returns (uint256);

/// @notice Changes the tokenURI of an existing token
/// @notice The tokenURI provided to this method does not undergo
/// @notice any on-chain validation. Users are fully responsible for accuracy,
/// @notice authenticity and preventing potential misuse or exploits.
/// @dev Call this function to evolve an existing token, the caller must be the owner of the collection
/// @param _tokenId the id of the token
/// @param _tokenURI the new tokenURI of the token
Expand Down

0 comments on commit d2d7b78

Please sign in to comment.