Skip to content

Commit 7d427ec

Browse files
run prettier
1 parent 2f6a68d commit 7d427ec

16 files changed

+714
-91
lines changed

contracts/Pack.sol

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -528,12 +528,7 @@ contract Pack is
528528
**/
529529

530530
/// @dev See EIP 165
531-
function supportsInterface(bytes4 interfaceId)
532-
public
533-
view
534-
override(ERC1155PresetUpgradeable)
535-
returns (bool)
536-
{
531+
function supportsInterface(bytes4 interfaceId) public view override(ERC1155PresetUpgradeable) returns (bool) {
537532
return super.supportsInterface(interfaceId) || type(IERC2981Upgradeable).interfaceId == interfaceId;
538533
}
539534

contracts/eip/ERC1155.sol

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ pragma solidity ^0.8.0;
66
@dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1155.md
77
Note: The ERC-165 identifier for this interface is 0xd9b67a26.
88
*/
9-
/* is ERC165 */
10-
interface IERC1155 {
9+
interface ERC1155 {
1110
/**
1211
@dev Either `TransferSingle` or `TransferBatch` MUST emit when tokens are transferred, including zero value transfers as well as minting or burning (see "Safe Transfer Rules" section of the standard).
1312
The `_operator` argument MUST be msg.sender.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// SPDX-License-Identifier: Apache-2.0
2+
pragma solidity ^0.8.0;
3+
4+
/// @title ERC1155Enumarable Non-Fungible Token Standard, optional enumeration extension
5+
/// @dev See https://eips.ethereum.org/EIPS/eip-1155
6+
interface ERC1155Enumerable {
7+
/// @notice Count NFTs tracked by this contract
8+
/// @return A count of valid NFTs tracked by this contract, where each one of
9+
/// them has an assigned and queryable owner not equal to the zero address
10+
function totalSupply(uint256 id) external view returns (uint256);
11+
12+
/// @notice Returns the next token ID available for minting
13+
/// @return The token identifier for the `_index`th NFT,
14+
/// (sort order not specified)
15+
function nextTokenIdToMint() external view returns (uint256);
16+
}

contracts/eip/ERC1155Metadata.sol

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// SPDX-License-Identifier: Apache-2.0
2+
pragma solidity ^0.8.0;
3+
4+
/**
5+
Note: The ERC-165 identifier for this interface is 0x0e89341c.
6+
*/
7+
interface ERC1155Metadata {
8+
/**
9+
@notice A distinct Uniform Resource Identifier (URI) for a given token.
10+
@dev URIs are defined in RFC 3986.
11+
The URI may point to a JSON file that conforms to the "ERC-1155 Metadata URI JSON Schema".
12+
@return URI string
13+
*/
14+
function uri(uint256 _id) external view returns (string memory);
15+
}

contracts/eip/ERC20.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ pragma solidity ^0.8.0;
55
* @title ERC20 interface
66
* @dev see https://github.com/ethereum/EIPs/issues/20
77
*/
8-
interface IERC20 {
8+
interface ERC20 {
99
function totalSupply() external view returns (uint256);
1010

1111
function balanceOf(address who) external view returns (uint256);

contracts/eip/ERC20Metadata.sol

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// SPDX-License-Identifier: Apache-2.0
2+
pragma solidity ^0.8.0;
3+
4+
/**
5+
* @title ERC20Metadata interface
6+
* @dev see https://github.com/ethereum/EIPs/issues/20
7+
*/
8+
interface ERC20Metadata {
9+
function name() external view returns (string memory);
10+
11+
function symbol() external view returns (string memory);
12+
13+
function decimals() external view returns (uint8);
14+
}

contracts/eip/ERC721.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: Apache-2.0
2-
pragma solidity ^0.8.11;
2+
pragma solidity ^0.8.0;
33

44
/// @title ERC-721 Non-Fungible Token Standard
55
/// @dev See https://eips.ethereum.org/EIPS/eip-721

contracts/eip/ERC721Enumerable.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: Apache-2.0
2-
pragma solidity ^0.8.11;
2+
pragma solidity ^0.8.0;
33

44
/// @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
55
/// @dev See https://eips.ethereum.org/EIPS/eip-721

contracts/eip/ERC721Metadata.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: Apache-2.0
2-
pragma solidity ^0.8.11;
2+
pragma solidity ^0.8.0;
33

44
/// @title ERC-721 Non-Fungible Token Standard, optional metadata extension
55
/// @dev See https://eips.ethereum.org/EIPS/eip-721

docs/ERC1155.md

Lines changed: 219 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,219 @@
1+
# ERC1155
2+
3+
4+
5+
> ERC-1155 Multi Token Standard
6+
7+
8+
9+
*See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1155.md Note: The ERC-165 identifier for this interface is 0xd9b67a26.*
10+
11+
## Methods
12+
13+
### balanceOf
14+
15+
```solidity
16+
function balanceOf(address _owner, uint256 _id) external view returns (uint256)
17+
```
18+
19+
Get the balance of an account's Tokens.
20+
21+
22+
23+
#### Parameters
24+
25+
| Name | Type | Description |
26+
|---|---|---|
27+
| _owner | address | The address of the token holder
28+
| _id | uint256 | ID of the Token
29+
30+
#### Returns
31+
32+
| Name | Type | Description |
33+
|---|---|---|
34+
| _0 | uint256 | The _owner's balance of the Token type requested
35+
36+
### balanceOfBatch
37+
38+
```solidity
39+
function balanceOfBatch(address[] _owners, uint256[] _ids) external view returns (uint256[])
40+
```
41+
42+
Get the balance of multiple account/token pairs
43+
44+
45+
46+
#### Parameters
47+
48+
| Name | Type | Description |
49+
|---|---|---|
50+
| _owners | address[] | The addresses of the token holders
51+
| _ids | uint256[] | ID of the Tokens
52+
53+
#### Returns
54+
55+
| Name | Type | Description |
56+
|---|---|---|
57+
| _0 | uint256[] | The _owner's balance of the Token types requested (i.e. balance for each (owner, id) pair)
58+
59+
### isApprovedForAll
60+
61+
```solidity
62+
function isApprovedForAll(address _owner, address _operator) external view returns (bool)
63+
```
64+
65+
Queries the approval status of an operator for a given owner.
66+
67+
68+
69+
#### Parameters
70+
71+
| Name | Type | Description |
72+
|---|---|---|
73+
| _owner | address | The owner of the Tokens
74+
| _operator | address | Address of authorized operator
75+
76+
#### Returns
77+
78+
| Name | Type | Description |
79+
|---|---|---|
80+
| _0 | bool | True if the operator is approved, false if not
81+
82+
### safeBatchTransferFrom
83+
84+
```solidity
85+
function safeBatchTransferFrom(address _from, address _to, uint256[] _ids, uint256[] _values, bytes _data) external nonpayable
86+
```
87+
88+
Transfers `_values` amount(s) of `_ids` from the `_from` address to the `_to` address specified (with safety call).
89+
90+
*Caller must be approved to manage the tokens being transferred out of the `_from` account (see "Approval" section of the standard). MUST revert if `_to` is the zero address. MUST revert if length of `_ids` is not the same as length of `_values`. MUST revert if any of the balance(s) of the holder(s) for token(s) in `_ids` is lower than the respective amount(s) in `_values` sent to the recipient. MUST revert on any other error. MUST emit `TransferSingle` or `TransferBatch` event(s) such that all the balance changes are reflected (see "Safe Transfer Rules" section of the standard). Balance changes and events MUST follow the ordering of the arrays (_ids[0]/_values[0] before _ids[1]/_values[1], etc). After the above conditions for the transfer(s) in the batch are met, this function MUST check if `_to` is a smart contract (e.g. code size > 0). If so, it MUST call the relevant `ERC1155TokenReceiver` hook(s) on `_to` and act appropriately (see "Safe Transfer Rules" section of the standard).*
91+
92+
#### Parameters
93+
94+
| Name | Type | Description |
95+
|---|---|---|
96+
| _from | address | Source address
97+
| _to | address | Target address
98+
| _ids | uint256[] | IDs of each token type (order and length must match _values array)
99+
| _values | uint256[] | Transfer amounts per token type (order and length must match _ids array)
100+
| _data | bytes | Additional data with no specified format, MUST be sent unaltered in call to the `ERC1155TokenReceiver` hook(s) on `_to`
101+
102+
### safeTransferFrom
103+
104+
```solidity
105+
function safeTransferFrom(address _from, address _to, uint256 _id, uint256 _value, bytes _data) external nonpayable
106+
```
107+
108+
Transfers `_value` amount of an `_id` from the `_from` address to the `_to` address specified (with safety call).
109+
110+
*Caller must be approved to manage the tokens being transferred out of the `_from` account (see "Approval" section of the standard). MUST revert if `_to` is the zero address. MUST revert if balance of holder for token `_id` is lower than the `_value` sent. MUST revert on any other error. MUST emit the `TransferSingle` event to reflect the balance change (see "Safe Transfer Rules" section of the standard). After the above conditions are met, this function MUST check if `_to` is a smart contract (e.g. code size > 0). If so, it MUST call `onERC1155Received` on `_to` and act appropriately (see "Safe Transfer Rules" section of the standard).*
111+
112+
#### Parameters
113+
114+
| Name | Type | Description |
115+
|---|---|---|
116+
| _from | address | Source address
117+
| _to | address | Target address
118+
| _id | uint256 | ID of the token type
119+
| _value | uint256 | Transfer amount
120+
| _data | bytes | Additional data with no specified format, MUST be sent unaltered in call to `onERC1155Received` on `_to`
121+
122+
### setApprovalForAll
123+
124+
```solidity
125+
function setApprovalForAll(address _operator, bool _approved) external nonpayable
126+
```
127+
128+
Enable or disable approval for a third party ("operator") to manage all of the caller's tokens.
129+
130+
*MUST emit the ApprovalForAll event on success.*
131+
132+
#### Parameters
133+
134+
| Name | Type | Description |
135+
|---|---|---|
136+
| _operator | address | Address to add to the set of authorized operators
137+
| _approved | bool | True if the operator is approved, false to revoke approval
138+
139+
140+
141+
## Events
142+
143+
### ApprovalForAll
144+
145+
```solidity
146+
event ApprovalForAll(address indexed _owner, address indexed _operator, bool _approved)
147+
```
148+
149+
150+
151+
*MUST emit when approval for a second party/operator address to manage all tokens for an owner address is enabled or disabled (absense of an event assumes disabled).*
152+
153+
#### Parameters
154+
155+
| Name | Type | Description |
156+
|---|---|---|
157+
| _owner `indexed` | address | undefined |
158+
| _operator `indexed` | address | undefined |
159+
| _approved | bool | undefined |
160+
161+
### TransferBatch
162+
163+
```solidity
164+
event TransferBatch(address indexed _operator, address indexed _from, address indexed _to, uint256[] _ids, uint256[] _values)
165+
```
166+
167+
168+
169+
*Either `TransferSingle` or `TransferBatch` MUST emit when tokens are transferred, including zero value transfers as well as minting or burning (see "Safe Transfer Rules" section of the standard). The `_operator` argument MUST be msg.sender. The `_from` argument MUST be the address of the holder whose balance is decreased. The `_to` argument MUST be the address of the recipient whose balance is increased. The `_ids` argument MUST be the list of tokens being transferred. The `_values` argument MUST be the list of number of tokens (matching the list and order of tokens specified in _ids) the holder balance is decreased by and match what the recipient balance is increased by. When minting/creating tokens, the `_from` argument MUST be set to `0x0` (i.e. zero address). When burning/destroying tokens, the `_to` argument MUST be set to `0x0` (i.e. zero address).*
170+
171+
#### Parameters
172+
173+
| Name | Type | Description |
174+
|---|---|---|
175+
| _operator `indexed` | address | undefined |
176+
| _from `indexed` | address | undefined |
177+
| _to `indexed` | address | undefined |
178+
| _ids | uint256[] | undefined |
179+
| _values | uint256[] | undefined |
180+
181+
### TransferSingle
182+
183+
```solidity
184+
event TransferSingle(address indexed _operator, address indexed _from, address indexed _to, uint256 _id, uint256 _value)
185+
```
186+
187+
188+
189+
*Either `TransferSingle` or `TransferBatch` MUST emit when tokens are transferred, including zero value transfers as well as minting or burning (see "Safe Transfer Rules" section of the standard). The `_operator` argument MUST be msg.sender. The `_from` argument MUST be the address of the holder whose balance is decreased. The `_to` argument MUST be the address of the recipient whose balance is increased. The `_id` argument MUST be the token type being transferred. The `_value` argument MUST be the number of tokens the holder balance is decreased by and match what the recipient balance is increased by. When minting/creating tokens, the `_from` argument MUST be set to `0x0` (i.e. zero address). When burning/destroying tokens, the `_to` argument MUST be set to `0x0` (i.e. zero address).*
190+
191+
#### Parameters
192+
193+
| Name | Type | Description |
194+
|---|---|---|
195+
| _operator `indexed` | address | undefined |
196+
| _from `indexed` | address | undefined |
197+
| _to `indexed` | address | undefined |
198+
| _id | uint256 | undefined |
199+
| _value | uint256 | undefined |
200+
201+
### URI
202+
203+
```solidity
204+
event URI(string _value, uint256 indexed _id)
205+
```
206+
207+
208+
209+
*MUST emit when the URI is updated for a token ID. URIs are defined in RFC 3986. The URI MUST point a JSON file that conforms to the "ERC-1155 Metadata URI JSON Schema".*
210+
211+
#### Parameters
212+
213+
| Name | Type | Description |
214+
|---|---|---|
215+
| _value | string | undefined |
216+
| _id `indexed` | uint256 | undefined |
217+
218+
219+

0 commit comments

Comments
 (0)