@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,220 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
pragma solidity ^0.8.0;
|
|
3
|
+
|
|
4
|
+
import {IJB721TokenUriResolver} from "./IJB721TokenUriResolver.sol";
|
|
5
|
+
import {JB721Tier} from "../structs/JB721Tier.sol";
|
|
6
|
+
import {JB721TierConfig} from "../structs/JB721TierConfig.sol";
|
|
7
|
+
import {JB721TiersHookFlags} from "../structs/JB721TiersHookFlags.sol";
|
|
8
|
+
|
|
9
|
+
interface IJB721TiersHookStore {
|
|
10
|
+
event CleanTiers(address indexed hook, address caller);
|
|
11
|
+
|
|
12
|
+
/// @notice Get the number of NFTs that the specified address owns from the specified 721 contract.
|
|
13
|
+
/// @param hook The 721 contract to get the balance within.
|
|
14
|
+
/// @param owner The address to check the balance of.
|
|
15
|
+
/// @return The number of NFTs the owner has from the 721 contract.
|
|
16
|
+
function balanceOf(address hook, address owner) external view returns (uint256);
|
|
17
|
+
|
|
18
|
+
/// @notice The combined cash out weight of the NFTs with the provided token IDs.
|
|
19
|
+
/// @param hook The 721 contract that the NFTs belong to.
|
|
20
|
+
/// @param tokenIds The token IDs of the NFTs to get the cash out weight of.
|
|
21
|
+
/// @return weight The cash out weight.
|
|
22
|
+
function cashOutWeightOf(address hook, uint256[] calldata tokenIds) external view returns (uint256 weight);
|
|
23
|
+
|
|
24
|
+
/// @notice The default reserve beneficiary for the provided 721 contract.
|
|
25
|
+
/// @param hook The 721 contract to get the default reserve beneficiary of.
|
|
26
|
+
/// @return The default reserve beneficiary address.
|
|
27
|
+
function defaultReserveBeneficiaryOf(address hook) external view returns (address);
|
|
28
|
+
|
|
29
|
+
/// @notice The encoded IPFS URI for the provided tier ID of the provided 721 contract.
|
|
30
|
+
/// @param hook The 721 contract that the tier belongs to.
|
|
31
|
+
/// @param tierId The ID of the tier to get the encoded IPFS URI of.
|
|
32
|
+
/// @return The encoded IPFS URI.
|
|
33
|
+
function encodedIPFSUriOf(address hook, uint256 tierId) external view returns (bytes32);
|
|
34
|
+
|
|
35
|
+
/// @notice The encoded IPFS URI for the tier of the 721 with the provided token ID.
|
|
36
|
+
/// @param hook The 721 contract that the encoded IPFS URI belongs to.
|
|
37
|
+
/// @param tokenId The token ID of the 721 to get the encoded tier IPFS URI of.
|
|
38
|
+
/// @return The encoded IPFS URI.
|
|
39
|
+
function encodedTierIPFSUriOf(address hook, uint256 tokenId) external view returns (bytes32);
|
|
40
|
+
|
|
41
|
+
/// @notice Get the flags that dictate the behavior of the provided 721 contract.
|
|
42
|
+
/// @param hook The 721 contract to get the flags of.
|
|
43
|
+
/// @return The flags.
|
|
44
|
+
function flagsOf(address hook) external view returns (JB721TiersHookFlags memory);
|
|
45
|
+
|
|
46
|
+
/// @notice Check if the provided tier has been removed from the provided 721 contract.
|
|
47
|
+
/// @param hook The 721 contract the tier belongs to.
|
|
48
|
+
/// @param tierId The ID of the tier to check the removal status of.
|
|
49
|
+
/// @return Whether the tier has been removed.
|
|
50
|
+
function isTierRemoved(address hook, uint256 tierId) external view returns (bool);
|
|
51
|
+
|
|
52
|
+
/// @notice The largest tier ID currently used on the provided 721 contract.
|
|
53
|
+
/// @param hook The 721 contract to get the largest tier ID from.
|
|
54
|
+
/// @return The largest tier ID.
|
|
55
|
+
function maxTierIdOf(address hook) external view returns (uint256);
|
|
56
|
+
|
|
57
|
+
/// @notice The number of NFTs which have been burned from the provided tier ID.
|
|
58
|
+
/// @param hook The 721 contract that the tier belongs to.
|
|
59
|
+
/// @param tierId The ID of the tier to get the burn count of.
|
|
60
|
+
/// @return The number of burned NFTs.
|
|
61
|
+
function numberOfBurnedFor(address hook, uint256 tierId) external view returns (uint256);
|
|
62
|
+
|
|
63
|
+
/// @notice The number of pending reserve NFTs for the provided tier ID.
|
|
64
|
+
/// @param hook The 721 contract to check for pending reserved NFTs.
|
|
65
|
+
/// @param tierId The ID of the tier to get the number of pending reserves for.
|
|
66
|
+
/// @return The number of pending reserved NFTs.
|
|
67
|
+
function numberOfPendingReservesFor(address hook, uint256 tierId) external view returns (uint256);
|
|
68
|
+
|
|
69
|
+
/// @notice The number of reserve NFTs which have been minted from the provided tier ID.
|
|
70
|
+
/// @param hook The 721 contract that the tier belongs to.
|
|
71
|
+
/// @param tierId The ID of the tier to get the reserve mint count of.
|
|
72
|
+
/// @return The number of reserve NFTs minted.
|
|
73
|
+
function numberOfReservesMintedFor(address hook, uint256 tierId) external view returns (uint256);
|
|
74
|
+
|
|
75
|
+
/// @notice The reserve beneficiary for the provided tier ID on the provided 721 contract.
|
|
76
|
+
/// @param hook The 721 contract that the tier belongs to.
|
|
77
|
+
/// @param tierId The ID of the tier to get the reserve beneficiary of.
|
|
78
|
+
/// @return The reserve beneficiary address.
|
|
79
|
+
function reserveBeneficiaryOf(address hook, uint256 tierId) external view returns (address);
|
|
80
|
+
|
|
81
|
+
/// @notice The number of NFTs the provided owner address owns from the provided tier.
|
|
82
|
+
/// @param hook The 721 contract to get the balance from.
|
|
83
|
+
/// @param owner The address to get the tier balance of.
|
|
84
|
+
/// @param tierId The ID of the tier to get the balance for.
|
|
85
|
+
/// @return The tier balance.
|
|
86
|
+
function tierBalanceOf(address hook, address owner, uint256 tierId) external view returns (uint256);
|
|
87
|
+
|
|
88
|
+
/// @notice The tier ID for the 721 with the provided token ID.
|
|
89
|
+
/// @param tokenId The token ID of the 721 to get the tier ID of.
|
|
90
|
+
/// @return The tier ID.
|
|
91
|
+
function tierIdOfToken(uint256 tokenId) external pure returns (uint256);
|
|
92
|
+
|
|
93
|
+
/// @notice Get the tier with the provided ID from the provided 721 contract.
|
|
94
|
+
/// @param hook The 721 contract to get the tier from.
|
|
95
|
+
/// @param id The ID of the tier to get.
|
|
96
|
+
/// @param includeResolvedUri If `true`, the resolved token URI will be included.
|
|
97
|
+
/// @return tier The tier.
|
|
98
|
+
function tierOf(address hook, uint256 id, bool includeResolvedUri) external view returns (JB721Tier memory tier);
|
|
99
|
+
|
|
100
|
+
/// @notice Get the tier of the 721 with the provided token ID.
|
|
101
|
+
/// @param hook The 721 contract that the tier belongs to.
|
|
102
|
+
/// @param tokenId The token ID of the 721 to get the tier of.
|
|
103
|
+
/// @param includeResolvedUri If `true`, the resolved token URI will be included.
|
|
104
|
+
/// @return tier The tier.
|
|
105
|
+
function tierOfTokenId(
|
|
106
|
+
address hook,
|
|
107
|
+
uint256 tokenId,
|
|
108
|
+
bool includeResolvedUri
|
|
109
|
+
)
|
|
110
|
+
external
|
|
111
|
+
view
|
|
112
|
+
returns (JB721Tier memory tier);
|
|
113
|
+
|
|
114
|
+
/// @notice Get an array of currently active 721 tiers for the provided 721 contract.
|
|
115
|
+
/// @param hook The 721 contract to get the tiers of.
|
|
116
|
+
/// @param categories An array of tier categories to get tiers from. Empty for all categories.
|
|
117
|
+
/// @param includeResolvedUri If `true`, the resolved token URIs will be included.
|
|
118
|
+
/// @param startingId The ID of the first tier to get. Send 0 to get all active tiers.
|
|
119
|
+
/// @param size The number of tiers to include.
|
|
120
|
+
/// @return tiers An array of active 721 tiers.
|
|
121
|
+
function tiersOf(
|
|
122
|
+
address hook,
|
|
123
|
+
uint256[] calldata categories,
|
|
124
|
+
bool includeResolvedUri,
|
|
125
|
+
uint256 startingId,
|
|
126
|
+
uint256 size
|
|
127
|
+
)
|
|
128
|
+
external
|
|
129
|
+
view
|
|
130
|
+
returns (JB721Tier[] memory tiers);
|
|
131
|
+
|
|
132
|
+
/// @notice The number of voting units an address has within the specified tier.
|
|
133
|
+
/// @param hook The 721 contract that the tier belongs to.
|
|
134
|
+
/// @param account The address to get the voting units of within the tier.
|
|
135
|
+
/// @param tierId The ID of the tier to get voting units within.
|
|
136
|
+
/// @return units The voting units.
|
|
137
|
+
function tierVotingUnitsOf(address hook, address account, uint256 tierId) external view returns (uint256 units);
|
|
138
|
+
|
|
139
|
+
/// @notice The custom token URI resolver for the provided 721 contract.
|
|
140
|
+
/// @param hook The 721 contract to get the custom token URI resolver of.
|
|
141
|
+
/// @return The token URI resolver.
|
|
142
|
+
function tokenUriResolverOf(address hook) external view returns (IJB721TokenUriResolver);
|
|
143
|
+
|
|
144
|
+
/// @notice The combined cash out weight for all NFTs from the provided 721 contract.
|
|
145
|
+
/// @param hook The 721 contract to get the total cash out weight of.
|
|
146
|
+
/// @return weight The total cash out weight.
|
|
147
|
+
function totalCashOutWeight(address hook) external view returns (uint256 weight);
|
|
148
|
+
|
|
149
|
+
/// @notice The total number of NFTs minted from the provided 721 contract.
|
|
150
|
+
/// @param hook The 721 contract to get a total supply of.
|
|
151
|
+
/// @return The total supply.
|
|
152
|
+
function totalSupplyOf(address hook) external view returns (uint256);
|
|
153
|
+
|
|
154
|
+
/// @notice The total number of voting units an address has for the provided 721 contract.
|
|
155
|
+
/// @param hook The 721 contract to get the voting units within.
|
|
156
|
+
/// @param account The address to get the voting unit total of.
|
|
157
|
+
/// @return units The total voting units.
|
|
158
|
+
function votingUnitsOf(address hook, address account) external view returns (uint256 units);
|
|
159
|
+
|
|
160
|
+
/// @notice Clean removed tiers from the tier sorting sequence.
|
|
161
|
+
/// @param hook The 721 contract to clean tiers for.
|
|
162
|
+
function cleanTiers(address hook) external;
|
|
163
|
+
|
|
164
|
+
/// @notice Record newly added tiers.
|
|
165
|
+
/// @param tiersToAdd The tiers to add.
|
|
166
|
+
/// @return tierIds The IDs of the tiers being added.
|
|
167
|
+
function recordAddTiers(JB721TierConfig[] calldata tiersToAdd) external returns (uint256[] memory tierIds);
|
|
168
|
+
|
|
169
|
+
/// @notice Record 721 burns.
|
|
170
|
+
/// @param tokenIds The token IDs of the NFTs to burn.
|
|
171
|
+
function recordBurn(uint256[] calldata tokenIds) external;
|
|
172
|
+
|
|
173
|
+
/// @notice Record newly set flags.
|
|
174
|
+
/// @param flags The flags to set.
|
|
175
|
+
function recordFlags(JB721TiersHookFlags calldata flags) external;
|
|
176
|
+
|
|
177
|
+
/// @notice Record 721 mints from the provided tiers.
|
|
178
|
+
/// @param amount The amount being spent on NFTs.
|
|
179
|
+
/// @param tierIds The IDs of the tiers to mint from.
|
|
180
|
+
/// @param isOwnerMint Whether this is a direct owner mint.
|
|
181
|
+
/// @return tokenIds The token IDs of the NFTs which were minted.
|
|
182
|
+
/// @return leftoverAmount The amount remaining after minting.
|
|
183
|
+
function recordMint(
|
|
184
|
+
uint256 amount,
|
|
185
|
+
uint16[] calldata tierIds,
|
|
186
|
+
bool isOwnerMint
|
|
187
|
+
)
|
|
188
|
+
external
|
|
189
|
+
returns (uint256[] memory tokenIds, uint256 leftoverAmount);
|
|
190
|
+
|
|
191
|
+
/// @notice Record reserve 721 minting for the provided tier ID.
|
|
192
|
+
/// @param tierId The ID of the tier to mint reserves from.
|
|
193
|
+
/// @param count The number of reserve NFTs to mint.
|
|
194
|
+
/// @return tokenIds The token IDs of the reserve NFTs which were minted.
|
|
195
|
+
function recordMintReservesFor(uint256 tierId, uint256 count) external returns (uint256[] memory tokenIds);
|
|
196
|
+
|
|
197
|
+
/// @notice Record tiers being removed.
|
|
198
|
+
/// @param tierIds The IDs of the tiers being removed.
|
|
199
|
+
function recordRemoveTierIds(uint256[] calldata tierIds) external;
|
|
200
|
+
|
|
201
|
+
/// @notice Record the setting of a discount for a tier.
|
|
202
|
+
/// @param tierId The ID of the tier to set the discount of.
|
|
203
|
+
/// @param discountPercent The new discount percent being applied.
|
|
204
|
+
function recordSetDiscountPercentOf(uint256 tierId, uint256 discountPercent) external;
|
|
205
|
+
|
|
206
|
+
/// @notice Record a new encoded IPFS URI for a tier.
|
|
207
|
+
/// @param tierId The ID of the tier to set the encoded IPFS URI of.
|
|
208
|
+
/// @param encodedIPFSUri The encoded IPFS URI to set for the tier.
|
|
209
|
+
function recordSetEncodedIPFSUriOf(uint256 tierId, bytes32 encodedIPFSUri) external;
|
|
210
|
+
|
|
211
|
+
/// @notice Record a newly set token URI resolver.
|
|
212
|
+
/// @param resolver The resolver to set.
|
|
213
|
+
function recordSetTokenUriResolver(IJB721TokenUriResolver resolver) external;
|
|
214
|
+
|
|
215
|
+
/// @notice Record an 721 transfer.
|
|
216
|
+
/// @param tierId The ID of the tier that the 721 being transferred belongs to.
|
|
217
|
+
/// @param from The address that the 721 is being transferred from.
|
|
218
|
+
/// @param to The address that the 721 is being transferred to.
|
|
219
|
+
function recordTransferForTier(uint256 tierId, address from, address to) external;
|
|
220
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
pragma solidity ^0.8.0;
|
|
3
|
+
|
|
4
|
+
interface IJB721TokenUriResolver {
|
|
5
|
+
/// @notice Resolve the token URI for the given NFT.
|
|
6
|
+
/// @param nft The address of the NFT contract.
|
|
7
|
+
/// @param tokenId The token ID of the NFT to get the URI of.
|
|
8
|
+
/// @return tokenUri The token URI.
|
|
9
|
+
function tokenUriOf(address nft, uint256 tokenId) external view returns (string memory tokenUri);
|
|
10
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
pragma solidity ^0.8.17;
|
|
3
|
+
|
|
4
|
+
import {JB721TiersRulesetMetadata} from "../structs/JB721TiersRulesetMetadata.sol";
|
|
5
|
+
|
|
6
|
+
/// @title JB721TiersRulesetMetadataResolver
|
|
7
|
+
/// @notice Utility library to parse and store ruleset metadata associated for the tiered 721 hook.
|
|
8
|
+
/// @dev This library parses the `metadata` member of the `JBRulesetMetadata` struct.
|
|
9
|
+
library JB721TiersRulesetMetadataResolver {
|
|
10
|
+
/// @notice Check whether transfers are paused based on the packed ruleset metadata.
|
|
11
|
+
/// @param data The packed metadata to check.
|
|
12
|
+
/// @return Whether transfers are paused (bit 0).
|
|
13
|
+
function transfersPaused(uint256 data) internal pure returns (bool) {
|
|
14
|
+
return (data & 1) == 1;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/// @notice Check whether minting pending reserves is paused based on the packed ruleset metadata.
|
|
18
|
+
/// @param data The packed metadata to check.
|
|
19
|
+
/// @return Whether minting pending reserves is paused (bit 1).
|
|
20
|
+
function mintPendingReservesPaused(uint256 data) internal pure returns (bool) {
|
|
21
|
+
return ((data >> 1) & 1) == 1;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/// @notice Pack the ruleset metadata for the 721 hook into a single `uint256`.
|
|
25
|
+
/// @param metadata The metadata to validate and pack.
|
|
26
|
+
/// @return packed A `uint256` containing the packed metadata for the 721 hook.
|
|
27
|
+
function pack721TiersRulesetMetadata(JB721TiersRulesetMetadata memory metadata)
|
|
28
|
+
internal
|
|
29
|
+
pure
|
|
30
|
+
returns (uint256 packed)
|
|
31
|
+
{
|
|
32
|
+
// pause transfers in bit 0.
|
|
33
|
+
if (metadata.pauseTransfers) packed |= 1;
|
|
34
|
+
// pause mint reserves in bit 1.
|
|
35
|
+
if (metadata.pauseMintPendingReserves) packed |= 1 << 1;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/// @notice Expand packed ruleset metadata for the 721 hook.
|
|
39
|
+
/// @param packedMetadata The packed metadata to expand.
|
|
40
|
+
/// @return metadata The metadata as a `JB721TiersRulesetMetadata` struct.
|
|
41
|
+
function expandMetadata(uint16 packedMetadata) internal pure returns (JB721TiersRulesetMetadata memory metadata) {
|
|
42
|
+
return JB721TiersRulesetMetadata(transfersPaused(packedMetadata), mintPendingReservesPaused(packedMetadata));
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
pragma solidity ^0.8.17;
|
|
3
|
+
|
|
4
|
+
import {JBBitmapWord} from "../structs/JBBitmapWord.sol";
|
|
5
|
+
|
|
6
|
+
/// @title JBBitmap
|
|
7
|
+
/// @notice Utilities to manage a bool bitmap. Used for storing inactive tiers.
|
|
8
|
+
library JBBitmap {
|
|
9
|
+
/// @notice Initialize a `JBBitmapWord` struct based on a mapping storage pointer and an index.
|
|
10
|
+
function readId(
|
|
11
|
+
mapping(uint256 => uint256) storage self,
|
|
12
|
+
uint256 index
|
|
13
|
+
)
|
|
14
|
+
internal
|
|
15
|
+
view
|
|
16
|
+
returns (JBBitmapWord memory)
|
|
17
|
+
{
|
|
18
|
+
uint256 depth = _retrieveDepth(index);
|
|
19
|
+
|
|
20
|
+
return JBBitmapWord({currentWord: self[depth], currentDepth: depth});
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/// @notice Get the status of the specified bit within the `JBBitmapWord` struct.
|
|
24
|
+
/// @dev The `index` is the index that the bit would have if the bitmap were reshaped to a 1*n matrix.
|
|
25
|
+
/// @return The boolean value at the specified index, which indicates whether the corresponding tier has been
|
|
26
|
+
/// removed.
|
|
27
|
+
function isTierIdRemoved(JBBitmapWord memory self, uint256 index) internal pure returns (bool) {
|
|
28
|
+
return (self.currentWord >> (index % 256)) & 1 == 1;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/// @notice Get the status of the specified bit within the `JBBitmapWord` struct.
|
|
32
|
+
/// @dev The `index` is the index that the bit would have if the bitmap were reshaped to a 1*n matrix.
|
|
33
|
+
function isTierIdRemoved(mapping(uint256 => uint256) storage self, uint256 index) internal view returns (bool) {
|
|
34
|
+
uint256 depth = _retrieveDepth(index);
|
|
35
|
+
return isTierIdRemoved(JBBitmapWord({currentWord: self[depth], currentDepth: depth}), index);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/// @notice Set the bit at the given index to true, indicating that the corresponding tier has been removed.
|
|
39
|
+
/// @dev This is a one-way operation.
|
|
40
|
+
function removeTier(mapping(uint256 => uint256) storage self, uint256 index) internal {
|
|
41
|
+
uint256 depth = _retrieveDepth(index);
|
|
42
|
+
self[depth] |= uint256(1 << (index % 256));
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/// @notice Check if the specified index is at a different depth than the current depth of the `JBBitmapWord`
|
|
46
|
+
/// struct.
|
|
47
|
+
/// @dev If the depth is different, the bitmap's current depth needs to be updated.
|
|
48
|
+
/// @return Whether the bitmap needs to be refreshed.
|
|
49
|
+
function refreshBitmapNeeded(JBBitmapWord memory self, uint256 index) internal pure returns (bool) {
|
|
50
|
+
return _retrieveDepth(index) != self.currentDepth;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/// @notice Return the line number (depth) of a given index within the bitmap matrix.
|
|
54
|
+
function _retrieveDepth(uint256 index) internal pure returns (uint256) {
|
|
55
|
+
return index >> 8; // div by 256
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
pragma solidity ^0.8.17;
|
|
3
|
+
|
|
4
|
+
/// @title JBIpfsDecoder
|
|
5
|
+
/// @notice Utilities to decode an IPFS hash.
|
|
6
|
+
/// @dev This is fairly gas intensive due to multiple nested loops. Onchain IPFS hash decoding is not advised –
|
|
7
|
+
/// storing them as a string *might* be more efficient for that use-case.
|
|
8
|
+
library JBIpfsDecoder {
|
|
9
|
+
//*********************************************************************//
|
|
10
|
+
// ------------------- internal constant properties ------------------ //
|
|
11
|
+
//*********************************************************************//
|
|
12
|
+
|
|
13
|
+
/// @notice Just a kind reminder to our readers.
|
|
14
|
+
/// @dev Used in `base58ToString`
|
|
15
|
+
bytes internal constant ALPHABET = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
|
|
16
|
+
|
|
17
|
+
/// @notice Decode an IPFS hash from a bytes32 and concatenate it with a base URI.
|
|
18
|
+
/// @param baseUri The base URI to prepend to the decoded IPFS hash.
|
|
19
|
+
/// @param hexString The encoded IPFS hash to decode.
|
|
20
|
+
/// @return The full URI with the base URI and decoded IPFS hash.
|
|
21
|
+
function decode(string memory baseUri, bytes32 hexString) internal pure returns (string memory) {
|
|
22
|
+
// All IPFS hashes start with a fixed sequence (0x12 and 0x20)
|
|
23
|
+
bytes memory completeHexString = abi.encodePacked(bytes2(0x1220), hexString);
|
|
24
|
+
|
|
25
|
+
// Convert the hex string to a hash
|
|
26
|
+
string memory ipfsHash = _toBase58(completeHexString);
|
|
27
|
+
|
|
28
|
+
// Concatenate with the base URI
|
|
29
|
+
return string(abi.encodePacked(baseUri, ipfsHash));
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/// @notice Convert a hex string to base58
|
|
33
|
+
/// @notice Written by Martin Ludfall - Licence: MIT
|
|
34
|
+
function _toBase58(bytes memory source) private pure returns (string memory) {
|
|
35
|
+
if (source.length == 0) return new string(0);
|
|
36
|
+
|
|
37
|
+
uint8[] memory digits = new uint8[](46); // hash size with the prefix
|
|
38
|
+
|
|
39
|
+
digits[0] = 0;
|
|
40
|
+
|
|
41
|
+
uint8 digitlength = 1;
|
|
42
|
+
uint256 sourceLength = source.length;
|
|
43
|
+
|
|
44
|
+
for (uint256 i; i < sourceLength; i++) {
|
|
45
|
+
uint256 carry = uint8(source[i]);
|
|
46
|
+
|
|
47
|
+
for (uint256 j; j < digitlength;) {
|
|
48
|
+
carry += uint256(digits[j]) << 8; // mul 256
|
|
49
|
+
digits[j] = uint8(carry % 58);
|
|
50
|
+
carry = carry / 58;
|
|
51
|
+
|
|
52
|
+
unchecked {
|
|
53
|
+
++j;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
while (carry > 0) {
|
|
58
|
+
digits[digitlength] = uint8(carry % 58);
|
|
59
|
+
unchecked {
|
|
60
|
+
++digitlength;
|
|
61
|
+
}
|
|
62
|
+
carry = carry / 58;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return string(_toAlphabet(_reverse(_truncate(digits, digitlength))));
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function _truncate(uint8[] memory array, uint8 length) private pure returns (uint8[] memory) {
|
|
69
|
+
uint8[] memory output = new uint8[](length);
|
|
70
|
+
for (uint256 i; i < length; i++) {
|
|
71
|
+
output[i] = array[i];
|
|
72
|
+
}
|
|
73
|
+
return output;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function _reverse(uint8[] memory input) private pure returns (uint8[] memory) {
|
|
77
|
+
uint256 inputLength = input.length;
|
|
78
|
+
uint8[] memory output = new uint8[](inputLength);
|
|
79
|
+
for (uint256 i; i < inputLength; i++) {
|
|
80
|
+
unchecked {
|
|
81
|
+
output[i] = input[input.length - 1 - i];
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return output;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function _toAlphabet(uint8[] memory indices) private pure returns (bytes memory) {
|
|
88
|
+
uint256 indicesLength = indices.length;
|
|
89
|
+
bytes memory output = new bytes(indicesLength);
|
|
90
|
+
for (uint256 i; i < indicesLength; i++) {
|
|
91
|
+
output[i] = ALPHABET[indices[i]];
|
|
92
|
+
}
|
|
93
|
+
return output;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
pragma solidity ^0.8.0;
|
|
3
|
+
|
|
4
|
+
import {IJBPrices} from "@bananapus/core-v6/src/interfaces/IJBPrices.sol";
|
|
5
|
+
|
|
6
|
+
import {JB721TierConfig} from "./JB721TierConfig.sol";
|
|
7
|
+
|
|
8
|
+
/// @notice Config to initialize a `JB721TiersHook` with tiers and price data.
|
|
9
|
+
/// @dev The `tiers` must be sorted by price (from least to greatest).
|
|
10
|
+
/// @custom:member tiers The tiers to initialize the hook with.
|
|
11
|
+
/// @custom:member currency The currency that the tier prices are denoted in. See `JBPrices`.
|
|
12
|
+
/// @custom:member decimals The number of decimals in the fixed point tier prices.
|
|
13
|
+
/// @custom:member prices A contract that exposes price feeds that can be used to calculate prices in different
|
|
14
|
+
/// currencies. To only accept payments in `currency`, set `prices` to the zero address. See `JBPrices`.
|
|
15
|
+
struct JB721InitTiersConfig {
|
|
16
|
+
JB721TierConfig[] tiers;
|
|
17
|
+
uint32 currency;
|
|
18
|
+
uint8 decimals;
|
|
19
|
+
IJBPrices prices;
|
|
20
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
pragma solidity ^0.8.0;
|
|
3
|
+
|
|
4
|
+
/// @custom:member id The tier's ID.
|
|
5
|
+
/// @custom:member price The price to buy an NFT in this tier, in terms of the currency in its `JBInitTiersConfig`.
|
|
6
|
+
/// @custom:member remainingSupply The remaining number of NFTs which can be minted from this tier.
|
|
7
|
+
/// @custom:member initialSupply The total number of NFTs which can be minted from this tier.
|
|
8
|
+
/// @custom:member votingUnits The number of votes that each NFT in this tier gets.
|
|
9
|
+
/// @custom:member reserveFrequency The frequency at which an extra NFT is minted for the `reserveBeneficiary` from this
|
|
10
|
+
/// tier. With a `reserveFrequency` of 5, an extra NFT will be minted for the `reserveBeneficiary` for every 5 NFTs
|
|
11
|
+
/// purchased.
|
|
12
|
+
/// @custom:member reserveBeneficiary The address which receives any reserve NFTs from this tier.
|
|
13
|
+
/// @custom:member encodedIPFSUri The IPFS URI to use for each NFT in this tier.
|
|
14
|
+
/// @custom:member category The category that NFTs in this tier belongs to. Used to group NFT tiers.
|
|
15
|
+
/// @custom:member discountPercent The discount that should be applied to the tier.
|
|
16
|
+
/// @custom:member allowOwnerMint A boolean indicating whether the contract's owner can mint NFTs from this tier
|
|
17
|
+
/// on-demand.
|
|
18
|
+
/// @custom:member cannotBeRemoved A boolean indicating whether attempts to remove this tier will revert.
|
|
19
|
+
/// @custom:member cannotIncreaseDiscountPercent If the tier cannot have its discount increased.
|
|
20
|
+
/// @custom:member transfersPausable A boolean indicating whether transfers for NFTs in tier can be paused.
|
|
21
|
+
/// @custom:member resolvedUri A resolved token URI for NFTs in this tier. Only available if the NFT this tier belongs
|
|
22
|
+
/// to has a resolver.
|
|
23
|
+
struct JB721Tier {
|
|
24
|
+
uint32 id;
|
|
25
|
+
uint104 price;
|
|
26
|
+
uint32 remainingSupply;
|
|
27
|
+
uint32 initialSupply;
|
|
28
|
+
uint104 votingUnits;
|
|
29
|
+
uint16 reserveFrequency;
|
|
30
|
+
address reserveBeneficiary;
|
|
31
|
+
bytes32 encodedIPFSUri;
|
|
32
|
+
uint24 category;
|
|
33
|
+
uint8 discountPercent;
|
|
34
|
+
bool allowOwnerMint;
|
|
35
|
+
bool transfersPausable;
|
|
36
|
+
bool cannotBeRemoved;
|
|
37
|
+
bool cannotIncreaseDiscountPercent;
|
|
38
|
+
string resolvedUri;
|
|
39
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
pragma solidity ^0.8.0;
|
|
3
|
+
|
|
4
|
+
/// @notice Config for a single NFT tier within a `JB721TiersHook`.
|
|
5
|
+
/// @custom:member price The price to buy an NFT in this tier, in terms of the currency in its `JBInitTiersConfig`.
|
|
6
|
+
/// @custom:member initialSupply The total number of NFTs which can be minted from this tier.
|
|
7
|
+
/// @custom:member votingUnits The number of votes that each NFT in this tier gets if `useVotingUnits` is true.
|
|
8
|
+
/// @custom:member reserveFrequency The frequency at which an extra NFT is minted for the `reserveBeneficiary` from this
|
|
9
|
+
/// tier. With a `reserveFrequency` of 5, an extra NFT will be minted for the `reserveBeneficiary` for every 5 NFTs
|
|
10
|
+
/// purchased.
|
|
11
|
+
/// @custom:member reserveBeneficiary The address which receives any reserve NFTs from this tier. Overrides the default
|
|
12
|
+
/// reserve beneficiary if one is set.
|
|
13
|
+
/// @custom:member encodedIPFSUri The IPFS URI to use for each NFT in this tier.
|
|
14
|
+
/// @custom:member category The category that NFTs in this tier belongs to. Used to group NFT tiers.
|
|
15
|
+
/// @custom:member discountPercent The discount that should be applied to the tier.
|
|
16
|
+
/// @custom:member allowOwnerMint A boolean indicating whether the contract's owner can mint NFTs from this tier
|
|
17
|
+
/// on-demand.
|
|
18
|
+
/// @custom:member useReserveBeneficiaryAsDefault A boolean indicating whether this tier's `reserveBeneficiary` should
|
|
19
|
+
/// be stored as the default beneficiary for all tiers.
|
|
20
|
+
/// @custom:member transfersPausable A boolean indicating whether transfers for NFTs in tier can be paused.
|
|
21
|
+
/// @custom:member useVotingUnits A boolean indicating whether the `votingUnits` should be used to calculate voting
|
|
22
|
+
/// power. If `useVotingUnits` is false, voting power is based on the tier's price.
|
|
23
|
+
/// @custom:member cannotBeRemoved If the tier cannot be removed once added.
|
|
24
|
+
/// @custom:member cannotIncreaseDiscount If the tier cannot have its discount increased.
|
|
25
|
+
struct JB721TierConfig {
|
|
26
|
+
uint104 price;
|
|
27
|
+
uint32 initialSupply;
|
|
28
|
+
uint32 votingUnits;
|
|
29
|
+
uint16 reserveFrequency;
|
|
30
|
+
address reserveBeneficiary;
|
|
31
|
+
bytes32 encodedIPFSUri;
|
|
32
|
+
uint24 category;
|
|
33
|
+
uint8 discountPercent;
|
|
34
|
+
bool allowOwnerMint;
|
|
35
|
+
bool useReserveBeneficiaryAsDefault;
|
|
36
|
+
bool transfersPausable;
|
|
37
|
+
bool useVotingUnits;
|
|
38
|
+
bool cannotBeRemoved;
|
|
39
|
+
bool cannotIncreaseDiscountPercent;
|
|
40
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
pragma solidity ^0.8.0;
|
|
3
|
+
|
|
4
|
+
/// @custom:member noNewTiersWithReserves A boolean indicating whether attempts to add new tiers with a non-zero
|
|
5
|
+
/// `reserveFrequency` will revert.
|
|
6
|
+
/// @custom:member noNewTiersWithVotes A boolean indicating whether attempts to add new tiers with non-zero
|
|
7
|
+
/// `votingUnits` will revert.
|
|
8
|
+
/// @custom:member noNewTiersWithOwnerMinting A boolean indicating whether attempts to add new tiers with
|
|
9
|
+
/// `allowOwnerMint` set to true will revert.
|
|
10
|
+
/// @custom:member preventOverspending A boolean indicating whether payments attempting to spend more than the price of
|
|
11
|
+
/// the NFTs being minted will revert.
|
|
12
|
+
struct JB721TiersHookFlags {
|
|
13
|
+
bool noNewTiersWithReserves;
|
|
14
|
+
bool noNewTiersWithVotes;
|
|
15
|
+
bool noNewTiersWithOwnerMinting;
|
|
16
|
+
bool preventOverspending;
|
|
17
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
pragma solidity ^0.8.0;
|
|
3
|
+
|
|
4
|
+
/// @custom:member tierId The ID of the tier to mint from.
|
|
5
|
+
/// @custom:member count The number of NFTs to mint from that tier.
|
|
6
|
+
struct JB721TiersMintReservesConfig {
|
|
7
|
+
uint32 tierId;
|
|
8
|
+
uint16 count;
|
|
9
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
pragma solidity ^0.8.0;
|
|
3
|
+
|
|
4
|
+
/// @notice `JB721TiersHook` options which are packed and stored in the corresponding `JBRulesetMetadata.metadata` on a
|
|
5
|
+
/// per-ruleset basis.
|
|
6
|
+
/// @custom:member pauseTransfers A boolean indicating whether NFT transfers are paused during this ruleset.
|
|
7
|
+
/// @custom:member pauseMintPendingReserves A boolean indicating whether pending/outstanding NFT reserves can be minted
|
|
8
|
+
/// during this ruleset.
|
|
9
|
+
struct JB721TiersRulesetMetadata {
|
|
10
|
+
bool pauseTransfers;
|
|
11
|
+
bool pauseMintPendingReserves;
|
|
12
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
pragma solidity ^0.8.0;
|
|
3
|
+
|
|
4
|
+
/// @custom:member tierId The ID of the tier to set the discount percent for.
|
|
5
|
+
/// @custom:member discountPercent The discount percent to set for the tier.
|
|
6
|
+
struct JB721TiersSetDiscountPercentConfig {
|
|
7
|
+
uint32 tierId;
|
|
8
|
+
uint16 discountPercent;
|
|
9
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
pragma solidity ^0.8.0;
|
|
3
|
+
|
|
4
|
+
/// @dev A "word" is a 256-bit integer that stores the status of 256 bits (true/false values). Each row of the
|
|
5
|
+
/// `JBBitmap` matrix is a "word".
|
|
6
|
+
/// @custom:member The information stored at the index.
|
|
7
|
+
/// @custom:member The index.
|
|
8
|
+
struct JBBitmapWord {
|
|
9
|
+
uint256 currentWord;
|
|
10
|
+
uint256 currentDepth;
|
|
11
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
pragma solidity ^0.8.0;
|
|
3
|
+
|
|
4
|
+
import {JB721InitTiersConfig} from "./JB721InitTiersConfig.sol";
|
|
5
|
+
import {JB721TiersHookFlags} from "./JB721TiersHookFlags.sol";
|
|
6
|
+
import {IJB721TokenUriResolver} from "../interfaces/IJB721TokenUriResolver.sol";
|
|
7
|
+
|
|
8
|
+
/// @custom:member name The NFT collection's name.
|
|
9
|
+
/// @custom:member symbol The NFT collection's symbol.
|
|
10
|
+
/// @custom:member baseUri The URI to use as a base for full NFT URIs.
|
|
11
|
+
/// @custom:member tokenUriResolver The contract responsible for resolving the URI for each NFT.
|
|
12
|
+
/// @custom:member contractUri The URI where this contract's metadata can be found.
|
|
13
|
+
/// @custom:member tiersConfig The NFT tiers and pricing config to launch the hook with.
|
|
14
|
+
/// @custom:member reserveBeneficiary The default reserved beneficiary for all tiers.
|
|
15
|
+
/// @custom:member flags A set of boolean options to configure the hook with.
|
|
16
|
+
struct JBDeploy721TiersHookConfig {
|
|
17
|
+
string name;
|
|
18
|
+
string symbol;
|
|
19
|
+
string baseUri;
|
|
20
|
+
IJB721TokenUriResolver tokenUriResolver;
|
|
21
|
+
string contractUri;
|
|
22
|
+
JB721InitTiersConfig tiersConfig;
|
|
23
|
+
address reserveBeneficiary;
|
|
24
|
+
JB721TiersHookFlags flags;
|
|
25
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
pragma solidity ^0.8.0;
|
|
3
|
+
|
|
4
|
+
import {JBTerminalConfig} from "@bananapus/core-v6/src/structs/JBTerminalConfig.sol";
|
|
5
|
+
|
|
6
|
+
import {JBPayDataHookRulesetConfig} from "./JBPayDataHookRulesetConfig.sol";
|
|
7
|
+
|
|
8
|
+
/// @custom:member projectUri Metadata URI to associate with the project. This can be updated any time by the owner of
|
|
9
|
+
/// the project.
|
|
10
|
+
/// @custom:member rulesetConfigurations The ruleset configurations to queue.
|
|
11
|
+
/// @custom:member terminalConfigurations The terminal configurations to add for the project.
|
|
12
|
+
/// @custom:member memo A memo to pass along to the emitted event.
|
|
13
|
+
struct JBLaunchProjectConfig {
|
|
14
|
+
string projectUri;
|
|
15
|
+
JBPayDataHookRulesetConfig[] rulesetConfigurations;
|
|
16
|
+
JBTerminalConfig[] terminalConfigurations;
|
|
17
|
+
string memo;
|
|
18
|
+
}
|