@bananapus/721-hook-v6 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.gas-snapshot +152 -0
- package/LICENSE +21 -0
- package/README.md +253 -0
- package/SKILLS.md +140 -0
- package/docs/book.css +13 -0
- package/docs/book.toml +12 -0
- package/docs/solidity.min.js +74 -0
- package/docs/src/README.md +253 -0
- package/docs/src/SUMMARY.md +38 -0
- package/docs/src/src/JB721TiersHook.sol/contract.JB721TiersHook.md +645 -0
- package/docs/src/src/JB721TiersHookDeployer.sol/contract.JB721TiersHookDeployer.md +99 -0
- package/docs/src/src/JB721TiersHookProjectDeployer.sol/contract.JB721TiersHookProjectDeployer.md +288 -0
- package/docs/src/src/JB721TiersHookStore.sol/contract.JB721TiersHookStore.md +1096 -0
- package/docs/src/src/README.md +11 -0
- package/docs/src/src/abstract/ERC721.sol/abstract.ERC721.md +430 -0
- package/docs/src/src/abstract/JB721Hook.sol/abstract.JB721Hook.md +309 -0
- package/docs/src/src/abstract/README.md +5 -0
- package/docs/src/src/interfaces/IJB721Hook.sol/interface.IJB721Hook.md +29 -0
- package/docs/src/src/interfaces/IJB721TiersHook.sol/interface.IJB721TiersHook.md +203 -0
- package/docs/src/src/interfaces/IJB721TiersHookDeployer.sol/interface.IJB721TiersHookDeployer.md +25 -0
- package/docs/src/src/interfaces/IJB721TiersHookProjectDeployer.sol/interface.IJB721TiersHookProjectDeployer.md +64 -0
- package/docs/src/src/interfaces/IJB721TiersHookStore.sol/interface.IJB721TiersHookStore.md +265 -0
- package/docs/src/src/interfaces/IJB721TokenUriResolver.sol/interface.IJB721TokenUriResolver.md +12 -0
- package/docs/src/src/interfaces/README.md +9 -0
- package/docs/src/src/libraries/JB721Constants.sol/library.JB721Constants.md +14 -0
- package/docs/src/src/libraries/JB721TiersRulesetMetadataResolver.sol/library.JB721TiersRulesetMetadataResolver.md +68 -0
- package/docs/src/src/libraries/JBBitmap.sol/library.JBBitmap.md +82 -0
- package/docs/src/src/libraries/JBIpfsDecoder.sol/library.JBIpfsDecoder.md +61 -0
- package/docs/src/src/libraries/README.md +7 -0
- package/docs/src/src/structs/JB721InitTiersConfig.sol/struct.JB721InitTiersConfig.md +27 -0
- package/docs/src/src/structs/JB721Tier.sol/struct.JB721Tier.md +59 -0
- package/docs/src/src/structs/JB721TierConfig.sol/struct.JB721TierConfig.md +60 -0
- package/docs/src/src/structs/JB721TiersHookFlags.sol/struct.JB721TiersHookFlags.md +26 -0
- package/docs/src/src/structs/JB721TiersMintReservesConfig.sol/struct.JB721TiersMintReservesConfig.md +16 -0
- package/docs/src/src/structs/JB721TiersRulesetMetadata.sol/struct.JB721TiersRulesetMetadata.md +20 -0
- package/docs/src/src/structs/JB721TiersSetDiscountPercentConfig.sol/struct.JB721TiersSetDiscountPercentConfig.md +16 -0
- package/docs/src/src/structs/JBBitmapWord.sol/struct.JBBitmapWord.md +19 -0
- package/docs/src/src/structs/JBDeploy721TiersHookConfig.sol/struct.JBDeploy721TiersHookConfig.md +34 -0
- package/docs/src/src/structs/JBLaunchProjectConfig.sol/struct.JBLaunchProjectConfig.md +23 -0
- package/docs/src/src/structs/JBLaunchRulesetsConfig.sol/struct.JBLaunchRulesetsConfig.md +22 -0
- package/docs/src/src/structs/JBPayDataHookRulesetConfig.sol/struct.JBPayDataHookRulesetConfig.md +51 -0
- package/docs/src/src/structs/JBPayDataHookRulesetMetadata.sol/struct.JBPayDataHookRulesetMetadata.md +66 -0
- package/docs/src/src/structs/JBQueueRulesetsConfig.sol/struct.JBQueueRulesetsConfig.md +21 -0
- package/docs/src/src/structs/JBStored721Tier.sol/struct.JBStored721Tier.md +42 -0
- package/docs/src/src/structs/README.md +18 -0
- package/foundry.lock +11 -0
- package/foundry.toml +22 -0
- package/package.json +31 -0
- package/remappings.txt +1 -0
- package/script/Deploy.s.sol +140 -0
- package/script/helpers/Hook721DeploymentLib.sol +81 -0
- package/slither-ci.config.json +10 -0
- package/sphinx.lock +476 -0
- package/src/JB721TiersHook.sol +765 -0
- package/src/JB721TiersHookDeployer.sol +114 -0
- package/src/JB721TiersHookProjectDeployer.sol +413 -0
- package/src/JB721TiersHookStore.sol +1195 -0
- package/src/abstract/ERC721.sol +484 -0
- package/src/abstract/JB721Hook.sol +279 -0
- package/src/interfaces/IJB721Hook.sol +21 -0
- package/src/interfaces/IJB721TiersHook.sol +135 -0
- package/src/interfaces/IJB721TiersHookDeployer.sol +22 -0
- package/src/interfaces/IJB721TiersHookProjectDeployer.sol +76 -0
- package/src/interfaces/IJB721TiersHookStore.sol +220 -0
- package/src/interfaces/IJB721TokenUriResolver.sol +10 -0
- package/src/libraries/JB721Constants.sol +7 -0
- package/src/libraries/JB721TiersRulesetMetadataResolver.sol +44 -0
- package/src/libraries/JBBitmap.sol +57 -0
- package/src/libraries/JBIpfsDecoder.sol +95 -0
- package/src/structs/JB721InitTiersConfig.sol +20 -0
- package/src/structs/JB721Tier.sol +39 -0
- package/src/structs/JB721TierConfig.sol +40 -0
- package/src/structs/JB721TiersHookFlags.sol +17 -0
- package/src/structs/JB721TiersMintReservesConfig.sol +9 -0
- package/src/structs/JB721TiersRulesetMetadata.sol +12 -0
- package/src/structs/JB721TiersSetDiscountPercentConfig.sol +9 -0
- package/src/structs/JBBitmapWord.sol +11 -0
- package/src/structs/JBDeploy721TiersHookConfig.sol +25 -0
- package/src/structs/JBLaunchProjectConfig.sol +18 -0
- package/src/structs/JBLaunchRulesetsConfig.sol +17 -0
- package/src/structs/JBPayDataHookRulesetConfig.sol +44 -0
- package/src/structs/JBPayDataHookRulesetMetadata.sol +46 -0
- package/src/structs/JBQueueRulesetsConfig.sol +13 -0
- package/src/structs/JBStored721Tier.sol +24 -0
- package/test/721HookAttacks.t.sol +396 -0
- package/test/E2E/Pay_Mint_Redeem_E2E.t.sol +944 -0
- package/test/invariants/TierLifecycleInvariant.t.sol +187 -0
- package/test/invariants/TieredHookStoreInvariant.t.sol +81 -0
- package/test/invariants/handlers/TierLifecycleHandler.sol +262 -0
- package/test/invariants/handlers/TierStoreHandler.sol +155 -0
- package/test/unit/JB721TiersRulesetMetadataResolver.t.sol +141 -0
- package/test/unit/JBBitmap.t.sol +169 -0
- package/test/unit/JBIpfsDecoder.t.sol +131 -0
- package/test/unit/M6_TierSupplyCheck.t.sol +220 -0
- package/test/unit/adjustTier_Unit.t.sol +1740 -0
- package/test/unit/deployer_Unit.t.sol +103 -0
- package/test/unit/getters_constructor_Unit.t.sol +548 -0
- package/test/unit/mintFor_mintReservesFor_Unit.t.sol +443 -0
- package/test/unit/pay_Unit.t.sol +1537 -0
- package/test/unit/redeem_Unit.t.sol +459 -0
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
# JB721Hook
|
|
2
|
+
[Git Source](https://github.com/Bananapus/nana-721-hook/blob/e813fb5b7d17cd3d18023137d70a7b2f3911ad99/src/abstract/JB721Hook.sol)
|
|
3
|
+
|
|
4
|
+
**Inherits:**
|
|
5
|
+
[ERC721](/src/abstract/ERC721.sol/abstract.ERC721.md), [IJB721Hook](/src/interfaces/IJB721Hook.sol/interface.IJB721Hook.md)
|
|
6
|
+
|
|
7
|
+
When a project which uses this hook is paid, this hook may mint NFTs to the payer, depending on this hook's
|
|
8
|
+
setup, the amount paid, and information specified by the payer. The project's owner can enable NFT cash outs.
|
|
9
|
+
through this hook, allowing the NFT holders to burn their NFTs to reclaim funds from the project (in proportion to
|
|
10
|
+
the NFT's price).
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
## State Variables
|
|
14
|
+
### DIRECTORY
|
|
15
|
+
The directory of terminals and controllers for projects.
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
```solidity
|
|
19
|
+
IJBDirectory public immutable override DIRECTORY;
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### METADATA_ID_TARGET
|
|
24
|
+
The ID used when parsing metadata.
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
```solidity
|
|
28
|
+
address public immutable override METADATA_ID_TARGET;
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
### PROJECT_ID
|
|
33
|
+
The ID of the project that this contract is associated with.
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
```solidity
|
|
37
|
+
uint256 public override PROJECT_ID;
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
## Functions
|
|
42
|
+
### constructor
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
```solidity
|
|
46
|
+
constructor(IJBDirectory directory);
|
|
47
|
+
```
|
|
48
|
+
**Parameters**
|
|
49
|
+
|
|
50
|
+
|Name|Type|Description|
|
|
51
|
+
|----|----|-----------|
|
|
52
|
+
|`directory`|`IJBDirectory`|A directory of terminals and controllers for projects.|
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
### beforePayRecordedWith
|
|
56
|
+
|
|
57
|
+
The data calculated before a payment is recorded in the terminal store. This data is provided to the
|
|
58
|
+
terminal's `pay(...)` transaction.
|
|
59
|
+
|
|
60
|
+
*Sets this contract as the pay hook. Part of `IJBRulesetDataHook`.*
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
```solidity
|
|
64
|
+
function beforePayRecordedWith(JBBeforePayRecordedContext calldata context)
|
|
65
|
+
public
|
|
66
|
+
view
|
|
67
|
+
virtual
|
|
68
|
+
override
|
|
69
|
+
returns (uint256 weight, JBPayHookSpecification[] memory hookSpecifications);
|
|
70
|
+
```
|
|
71
|
+
**Parameters**
|
|
72
|
+
|
|
73
|
+
|Name|Type|Description|
|
|
74
|
+
|----|----|-----------|
|
|
75
|
+
|`context`|`JBBeforePayRecordedContext`|The payment context passed to this contract by the `pay(...)` function.|
|
|
76
|
+
|
|
77
|
+
**Returns**
|
|
78
|
+
|
|
79
|
+
|Name|Type|Description|
|
|
80
|
+
|----|----|-----------|
|
|
81
|
+
|`weight`|`uint256`|The new `weight` to use, overriding the ruleset's `weight`.|
|
|
82
|
+
|`hookSpecifications`|`JBPayHookSpecification[]`|The amount and data to send to pay hooks (this contract) instead of adding to the terminal's balance.|
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
### beforeCashOutRecordedWith
|
|
86
|
+
|
|
87
|
+
The data calculated before a cash out is recorded in the terminal store. This data is provided to the
|
|
88
|
+
terminal's `cashOutTokensOf(...)` transaction.
|
|
89
|
+
|
|
90
|
+
*Sets this contract as the cash out hook. Part of `IJBRulesetDataHook`.*
|
|
91
|
+
|
|
92
|
+
*This function is used for NFT cash outs, and will only be called if the project's ruleset has
|
|
93
|
+
`useDataHookForCashOut` set to `true`.*
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
```solidity
|
|
97
|
+
function beforeCashOutRecordedWith(JBBeforeCashOutRecordedContext calldata context)
|
|
98
|
+
public
|
|
99
|
+
view
|
|
100
|
+
virtual
|
|
101
|
+
override
|
|
102
|
+
returns (
|
|
103
|
+
uint256 cashOutTaxRate,
|
|
104
|
+
uint256 cashOutCount,
|
|
105
|
+
uint256 totalSupply,
|
|
106
|
+
JBCashOutHookSpecification[] memory hookSpecifications
|
|
107
|
+
);
|
|
108
|
+
```
|
|
109
|
+
**Parameters**
|
|
110
|
+
|
|
111
|
+
|Name|Type|Description|
|
|
112
|
+
|----|----|-----------|
|
|
113
|
+
|`context`|`JBBeforeCashOutRecordedContext`|The cash out context passed to this contract by the `cashOutTokensOf(...)` function.|
|
|
114
|
+
|
|
115
|
+
**Returns**
|
|
116
|
+
|
|
117
|
+
|Name|Type|Description|
|
|
118
|
+
|----|----|-----------|
|
|
119
|
+
|`cashOutTaxRate`|`uint256`|The cash out tax rate influencing the reclaim amount.|
|
|
120
|
+
|`cashOutCount`|`uint256`|The amount of tokens that should be considered cashed out.|
|
|
121
|
+
|`totalSupply`|`uint256`|The total amount of tokens that are considered to be existing.|
|
|
122
|
+
|`hookSpecifications`|`JBCashOutHookSpecification[]`|The amount and data to send to cash out hooks (this contract) instead of returning to the beneficiary.|
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
### hasMintPermissionFor
|
|
126
|
+
|
|
127
|
+
Required by the IJBRulesetDataHook interfaces. Return false to not leak any permissions.
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
```solidity
|
|
131
|
+
function hasMintPermissionFor(uint256, address) external pure returns (bool);
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### cashOutWeightOf
|
|
135
|
+
|
|
136
|
+
Returns the cumulative cash out weight of the specified token IDs relative to the
|
|
137
|
+
`totalCashOutWeight`.
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
```solidity
|
|
141
|
+
function cashOutWeightOf(
|
|
142
|
+
uint256[] memory tokenIds,
|
|
143
|
+
JBBeforeCashOutRecordedContext calldata context
|
|
144
|
+
)
|
|
145
|
+
public
|
|
146
|
+
view
|
|
147
|
+
virtual
|
|
148
|
+
returns (uint256);
|
|
149
|
+
```
|
|
150
|
+
**Parameters**
|
|
151
|
+
|
|
152
|
+
|Name|Type|Description|
|
|
153
|
+
|----|----|-----------|
|
|
154
|
+
|`tokenIds`|`uint256[]`|The NFT token IDs to calculate the cumulative cash out weight of.|
|
|
155
|
+
|`context`|`JBBeforeCashOutRecordedContext`|The cash out context passed to this contract by the `cashOutTokensOf(...)` function.|
|
|
156
|
+
|
|
157
|
+
**Returns**
|
|
158
|
+
|
|
159
|
+
|Name|Type|Description|
|
|
160
|
+
|----|----|-----------|
|
|
161
|
+
|`<none>`|`uint256`|The cumulative cash out weight of the specified token IDs.|
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
### supportsInterface
|
|
165
|
+
|
|
166
|
+
Indicates if this contract adheres to the specified interface.
|
|
167
|
+
|
|
168
|
+
*See [IERC165-supportsInterface](/src/JB721TiersHook.sol/contract.JB721TiersHook.md#supportsinterface).*
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
```solidity
|
|
172
|
+
function supportsInterface(bytes4 _interfaceId) public view virtual override(ERC721, IERC165) returns (bool);
|
|
173
|
+
```
|
|
174
|
+
**Parameters**
|
|
175
|
+
|
|
176
|
+
|Name|Type|Description|
|
|
177
|
+
|----|----|-----------|
|
|
178
|
+
|`_interfaceId`|`bytes4`|The ID of the interface to check for adherence to.|
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
### totalCashOutWeight
|
|
182
|
+
|
|
183
|
+
Calculates the cumulative cash out weight of all NFT token IDs.
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
```solidity
|
|
187
|
+
function totalCashOutWeight(JBBeforeCashOutRecordedContext calldata context) public view virtual returns (uint256);
|
|
188
|
+
```
|
|
189
|
+
**Parameters**
|
|
190
|
+
|
|
191
|
+
|Name|Type|Description|
|
|
192
|
+
|----|----|-----------|
|
|
193
|
+
|`context`|`JBBeforeCashOutRecordedContext`|The cash out context passed to this contract by the `cashOutTokensOf(...)` function.|
|
|
194
|
+
|
|
195
|
+
**Returns**
|
|
196
|
+
|
|
197
|
+
|Name|Type|Description|
|
|
198
|
+
|----|----|-----------|
|
|
199
|
+
|`<none>`|`uint256`|The total cumulative cash out weight of all NFT token IDs.|
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
### _initialize
|
|
203
|
+
|
|
204
|
+
Initializes the contract by associating it with a project and adding ERC721 details.
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
```solidity
|
|
208
|
+
function _initialize(uint256 projectId, string memory name, string memory symbol) internal;
|
|
209
|
+
```
|
|
210
|
+
**Parameters**
|
|
211
|
+
|
|
212
|
+
|Name|Type|Description|
|
|
213
|
+
|----|----|-----------|
|
|
214
|
+
|`projectId`|`uint256`|The ID of the project that this contract is associated with.|
|
|
215
|
+
|`name`|`string`|The name of the NFT collection.|
|
|
216
|
+
|`symbol`|`string`|The symbol representing the NFT collection.|
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
### afterPayRecordedWith
|
|
220
|
+
|
|
221
|
+
Mints one or more NFTs to the `context.benficiary` upon payment if conditions are met. Part of
|
|
222
|
+
`IJBPayHook`.
|
|
223
|
+
|
|
224
|
+
*Reverts if the calling contract is not one of the project's terminals.*
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
```solidity
|
|
228
|
+
function afterPayRecordedWith(JBAfterPayRecordedContext calldata context) external payable virtual override;
|
|
229
|
+
```
|
|
230
|
+
**Parameters**
|
|
231
|
+
|
|
232
|
+
|Name|Type|Description|
|
|
233
|
+
|----|----|-----------|
|
|
234
|
+
|`context`|`JBAfterPayRecordedContext`|The payment context passed in by the terminal.|
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
### afterCashOutRecordedWith
|
|
238
|
+
|
|
239
|
+
Burns the specified NFTs upon token holder cash out, reclaiming funds from the project's balance for
|
|
240
|
+
`context.beneficiary`. Part of `IJBCashOutHook`.
|
|
241
|
+
|
|
242
|
+
*Reverts if the calling contract is not one of the project's terminals.*
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
```solidity
|
|
246
|
+
function afterCashOutRecordedWith(JBAfterCashOutRecordedContext calldata context) external payable virtual override;
|
|
247
|
+
```
|
|
248
|
+
**Parameters**
|
|
249
|
+
|
|
250
|
+
|Name|Type|Description|
|
|
251
|
+
|----|----|-----------|
|
|
252
|
+
|`context`|`JBAfterCashOutRecordedContext`|The cash out context passed in by the terminal.|
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
### _didBurn
|
|
256
|
+
|
|
257
|
+
Executes after NFTs have been burned via cash out.
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
```solidity
|
|
261
|
+
function _didBurn(uint256[] memory tokenIds) internal virtual;
|
|
262
|
+
```
|
|
263
|
+
**Parameters**
|
|
264
|
+
|
|
265
|
+
|Name|Type|Description|
|
|
266
|
+
|----|----|-----------|
|
|
267
|
+
|`tokenIds`|`uint256[]`|The token IDs of the NFTs that were burned.|
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
### _processPayment
|
|
271
|
+
|
|
272
|
+
Process a received payment.
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
```solidity
|
|
276
|
+
function _processPayment(JBAfterPayRecordedContext calldata context) internal virtual;
|
|
277
|
+
```
|
|
278
|
+
**Parameters**
|
|
279
|
+
|
|
280
|
+
|Name|Type|Description|
|
|
281
|
+
|----|----|-----------|
|
|
282
|
+
|`context`|`JBAfterPayRecordedContext`|The payment context passed in by the terminal.|
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
## Errors
|
|
286
|
+
### JB721Hook_InvalidPay
|
|
287
|
+
|
|
288
|
+
```solidity
|
|
289
|
+
error JB721Hook_InvalidPay();
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
### JB721Hook_InvalidCashOut
|
|
293
|
+
|
|
294
|
+
```solidity
|
|
295
|
+
error JB721Hook_InvalidCashOut();
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
### JB721Hook_UnauthorizedToken
|
|
299
|
+
|
|
300
|
+
```solidity
|
|
301
|
+
error JB721Hook_UnauthorizedToken(uint256 tokenId, address holder);
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
### JB721Hook_UnexpectedTokenCashedOut
|
|
305
|
+
|
|
306
|
+
```solidity
|
|
307
|
+
error JB721Hook_UnexpectedTokenCashedOut();
|
|
308
|
+
```
|
|
309
|
+
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# IJB721Hook
|
|
2
|
+
[Git Source](https://github.com/Bananapus/nana-721-hook/blob/e813fb5b7d17cd3d18023137d70a7b2f3911ad99/src/interfaces/IJB721Hook.sol)
|
|
3
|
+
|
|
4
|
+
**Inherits:**
|
|
5
|
+
IJBRulesetDataHook, IJBPayHook, IJBCashOutHook
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
## Functions
|
|
9
|
+
### DIRECTORY
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
```solidity
|
|
13
|
+
function DIRECTORY() external view returns (IJBDirectory);
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
### METADATA_ID_TARGET
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
```solidity
|
|
20
|
+
function METADATA_ID_TARGET() external view returns (address);
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### PROJECT_ID
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
```solidity
|
|
27
|
+
function PROJECT_ID() external view returns (uint256);
|
|
28
|
+
```
|
|
29
|
+
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
# IJB721TiersHook
|
|
2
|
+
[Git Source](https://github.com/Bananapus/nana-721-hook/blob/e813fb5b7d17cd3d18023137d70a7b2f3911ad99/src/interfaces/IJB721TiersHook.sol)
|
|
3
|
+
|
|
4
|
+
**Inherits:**
|
|
5
|
+
[IJB721Hook](/src/interfaces/IJB721Hook.sol/interface.IJB721Hook.md)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
## Functions
|
|
9
|
+
### RULESETS
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
```solidity
|
|
13
|
+
function RULESETS() external view returns (IJBRulesets);
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
### STORE
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
```solidity
|
|
20
|
+
function STORE() external view returns (IJB721TiersHookStore);
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### baseURI
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
```solidity
|
|
27
|
+
function baseURI() external view returns (string memory);
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### contractURI
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
```solidity
|
|
34
|
+
function contractURI() external view returns (string memory);
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### firstOwnerOf
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
```solidity
|
|
41
|
+
function firstOwnerOf(uint256 tokenId) external view returns (address);
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### payCreditsOf
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
```solidity
|
|
48
|
+
function payCreditsOf(address addr) external view returns (uint256);
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### pricingContext
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
```solidity
|
|
55
|
+
function pricingContext() external view returns (uint256, uint256, IJBPrices);
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### adjustTiers
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
```solidity
|
|
62
|
+
function adjustTiers(JB721TierConfig[] calldata tierDataToAdd, uint256[] calldata tierIdsToRemove) external;
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### initialize
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
```solidity
|
|
69
|
+
function initialize(
|
|
70
|
+
uint256 projectId,
|
|
71
|
+
string memory name,
|
|
72
|
+
string memory symbol,
|
|
73
|
+
string memory baseUri,
|
|
74
|
+
IJB721TokenUriResolver tokenUriResolver,
|
|
75
|
+
string memory contractUri,
|
|
76
|
+
JB721InitTiersConfig memory tiersConfig,
|
|
77
|
+
JB721TiersHookFlags memory flags
|
|
78
|
+
)
|
|
79
|
+
external;
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### setDiscountPercentOf
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
```solidity
|
|
86
|
+
function setDiscountPercentOf(uint256 tierId, uint256 discountPercent) external;
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### setDiscountPercentsOf
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
```solidity
|
|
93
|
+
function setDiscountPercentsOf(JB721TiersSetDiscountPercentConfig[] calldata configs) external;
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### mintFor
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
```solidity
|
|
100
|
+
function mintFor(uint16[] calldata tierIds, address beneficiary) external returns (uint256[] memory tokenIds);
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### mintPendingReservesFor
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
```solidity
|
|
107
|
+
function mintPendingReservesFor(JB721TiersMintReservesConfig[] calldata reserveMintConfigs) external;
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### mintPendingReservesFor
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
```solidity
|
|
114
|
+
function mintPendingReservesFor(uint256 tierId, uint256 count) external;
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### setMetadata
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
```solidity
|
|
121
|
+
function setMetadata(
|
|
122
|
+
string calldata baseUri,
|
|
123
|
+
string calldata contractMetadataUri,
|
|
124
|
+
IJB721TokenUriResolver tokenUriResolver,
|
|
125
|
+
uint256 encodedIPFSUriTierId,
|
|
126
|
+
bytes32 encodedIPFSUri
|
|
127
|
+
)
|
|
128
|
+
external;
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## Events
|
|
132
|
+
### AddPayCredits
|
|
133
|
+
|
|
134
|
+
```solidity
|
|
135
|
+
event AddPayCredits(uint256 indexed amount, uint256 indexed newTotalCredits, address indexed account, address caller);
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### AddTier
|
|
139
|
+
|
|
140
|
+
```solidity
|
|
141
|
+
event AddTier(uint256 indexed tierId, JB721TierConfig tier, address caller);
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### Mint
|
|
145
|
+
|
|
146
|
+
```solidity
|
|
147
|
+
event Mint(
|
|
148
|
+
uint256 indexed tokenId,
|
|
149
|
+
uint256 indexed tierId,
|
|
150
|
+
address indexed beneficiary,
|
|
151
|
+
uint256 totalAmountPaid,
|
|
152
|
+
address caller
|
|
153
|
+
);
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
### MintReservedNft
|
|
157
|
+
|
|
158
|
+
```solidity
|
|
159
|
+
event MintReservedNft(uint256 indexed tokenId, uint256 indexed tierId, address indexed beneficiary, address caller);
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### RemoveTier
|
|
163
|
+
|
|
164
|
+
```solidity
|
|
165
|
+
event RemoveTier(uint256 indexed tierId, address caller);
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### SetBaseUri
|
|
169
|
+
|
|
170
|
+
```solidity
|
|
171
|
+
event SetBaseUri(string indexed baseUri, address caller);
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
### SetContractUri
|
|
175
|
+
|
|
176
|
+
```solidity
|
|
177
|
+
event SetContractUri(string indexed uri, address caller);
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
### SetDiscountPercent
|
|
181
|
+
|
|
182
|
+
```solidity
|
|
183
|
+
event SetDiscountPercent(uint256 indexed tierId, uint256 discountPercent, address caller);
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
### SetEncodedIPFSUri
|
|
187
|
+
|
|
188
|
+
```solidity
|
|
189
|
+
event SetEncodedIPFSUri(uint256 indexed tierId, bytes32 encodedUri, address caller);
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
### SetTokenUriResolver
|
|
193
|
+
|
|
194
|
+
```solidity
|
|
195
|
+
event SetTokenUriResolver(IJB721TokenUriResolver indexed resolver, address caller);
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
### UsePayCredits
|
|
199
|
+
|
|
200
|
+
```solidity
|
|
201
|
+
event UsePayCredits(uint256 indexed amount, uint256 indexed newTotalCredits, address indexed account, address caller);
|
|
202
|
+
```
|
|
203
|
+
|
package/docs/src/src/interfaces/IJB721TiersHookDeployer.sol/interface.IJB721TiersHookDeployer.md
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# IJB721TiersHookDeployer
|
|
2
|
+
[Git Source](https://github.com/Bananapus/nana-721-hook/blob/e813fb5b7d17cd3d18023137d70a7b2f3911ad99/src/interfaces/IJB721TiersHookDeployer.sol)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Functions
|
|
6
|
+
### deployHookFor
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
```solidity
|
|
10
|
+
function deployHookFor(
|
|
11
|
+
uint256 projectId,
|
|
12
|
+
JBDeploy721TiersHookConfig memory deployTiersHookConfig,
|
|
13
|
+
bytes32 salt
|
|
14
|
+
)
|
|
15
|
+
external
|
|
16
|
+
returns (IJB721TiersHook hook);
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Events
|
|
20
|
+
### HookDeployed
|
|
21
|
+
|
|
22
|
+
```solidity
|
|
23
|
+
event HookDeployed(uint256 indexed projectId, IJB721TiersHook hook, address caller);
|
|
24
|
+
```
|
|
25
|
+
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# IJB721TiersHookProjectDeployer
|
|
2
|
+
[Git Source](https://github.com/Bananapus/nana-721-hook/blob/e813fb5b7d17cd3d18023137d70a7b2f3911ad99/src/interfaces/IJB721TiersHookProjectDeployer.sol)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Functions
|
|
6
|
+
### DIRECTORY
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
```solidity
|
|
10
|
+
function DIRECTORY() external view returns (IJBDirectory);
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### HOOK_DEPLOYER
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
```solidity
|
|
17
|
+
function HOOK_DEPLOYER() external view returns (IJB721TiersHookDeployer);
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
### launchProjectFor
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
```solidity
|
|
24
|
+
function launchProjectFor(
|
|
25
|
+
address owner,
|
|
26
|
+
JBDeploy721TiersHookConfig memory deployTiersHookConfig,
|
|
27
|
+
JBLaunchProjectConfig memory launchProjectConfig,
|
|
28
|
+
IJBController controller,
|
|
29
|
+
bytes32 salt
|
|
30
|
+
)
|
|
31
|
+
external
|
|
32
|
+
returns (uint256 projectId, IJB721TiersHook hook);
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### launchRulesetsFor
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
```solidity
|
|
39
|
+
function launchRulesetsFor(
|
|
40
|
+
uint256 projectId,
|
|
41
|
+
JBDeploy721TiersHookConfig memory deployTiersHookConfig,
|
|
42
|
+
JBLaunchRulesetsConfig memory launchRulesetsConfig,
|
|
43
|
+
IJBController controller,
|
|
44
|
+
bytes32 salt
|
|
45
|
+
)
|
|
46
|
+
external
|
|
47
|
+
returns (uint256 rulesetId, IJB721TiersHook hook);
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### queueRulesetsOf
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
```solidity
|
|
54
|
+
function queueRulesetsOf(
|
|
55
|
+
uint256 projectId,
|
|
56
|
+
JBDeploy721TiersHookConfig memory deployTiersHookConfig,
|
|
57
|
+
JBQueueRulesetsConfig memory queueRulesetsConfig,
|
|
58
|
+
IJBController controller,
|
|
59
|
+
bytes32 salt
|
|
60
|
+
)
|
|
61
|
+
external
|
|
62
|
+
returns (uint256 rulesetId, IJB721TiersHook hook);
|
|
63
|
+
```
|
|
64
|
+
|