-
Notifications
You must be signed in to change notification settings - Fork 86
/
IAsset.sol
77 lines (70 loc) · 2.76 KB
/
IAsset.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
//SPDX-License-Identifier: MIT
pragma solidity 0.8.18;
/// @title Asset interface
/// @author The Sandbox
interface IAsset {
// AssetData reflects the asset tokenId structure
// Refer to TokenIdUtils.sol
struct AssetData {
uint256 tokenId;
address creator;
uint256 amount;
uint8 tier;
uint16 creatorNonce;
bool revealed;
string metadataHash;
bool bridged;
}
event TrustedForwarderChanged(address indexed newTrustedForwarderAddress);
/// @notice Mint new tokens
/// @dev Only callable by the minter role
/// @param to The address of the recipient
/// @param id The id of the token to mint
/// @param amount The amount of the token to mint
/// @param metadataHash The metadata hash of the token to mint
function mint(
address to,
uint256 id,
uint256 amount,
string memory metadataHash
) external;
/// @notice Mint new tokens with catalyst tier chosen by the creator
/// @dev Only callable by the minter role
/// @param to The address of the recipient
/// @param ids The ids of the tokens to mint
/// @param amounts The amounts of the tokens to mint
/// @param metadataHashes The metadata hashes of the tokens to mint
function mintBatch(
address to,
uint256[] memory ids,
uint256[] memory amounts,
string[] memory metadataHashes
) external;
/// @notice Burn a token from a given account
/// @dev Only the minter role can burn tokens
/// @dev This function was added with token recycling and bridging in mind but may have other use cases
/// @param account The account to burn tokens from
/// @param id The token id to burn
/// @param amount The amount of tokens to burn
function burnFrom(
address account,
uint256 id,
uint256 amount
) external;
/// @notice Burn a batch of tokens from a given account
/// @dev Only the minter role can burn tokens
/// @dev This function was added with token recycling and bridging in mind but may have other use cases
/// @dev The length of the ids and amounts arrays must be the same
/// @param account The account to burn tokens from
/// @param ids An array of token ids to burn
/// @param amounts An array of amounts of tokens to burn
function burnBatchFrom(
address account,
uint256[] memory ids,
uint256[] memory amounts
) external;
/// @notice returns the tokenId associated with provided metadata hash
/// @param metadataHash The metadata hash to get tokenId for
/// @return tokenId the tokenId associated with the metadata hash
function getTokenIdByMetadataHash(string memory metadataHash) external view returns (uint256 tokenId);
}