@bannynet/core-v6 0.0.7 → 0.0.8
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/STYLE_GUIDE.md +15 -2
- package/package.json +9 -9
- package/script/Add.Denver.s.sol +8 -7
- package/script/Deploy.s.sol +84 -75
- package/script/Drop1.s.sol +8 -7
- package/script/helpers/BannyverseDeploymentLib.sol +14 -7
- package/script/helpers/MigrationHelper.sol +21 -18
- package/src/Banny721TokenUriResolver.sol +6 -1
- package/test/Fork.t.sol +2 -4
package/STYLE_GUIDE.md
CHANGED
|
@@ -197,7 +197,7 @@ interface IJBExample is IJBBase {
|
|
|
197
197
|
| Public/external function | `camelCase` | `cashOutTokensOf` |
|
|
198
198
|
| Internal/private function | `_camelCase` | `_processFee` |
|
|
199
199
|
| Internal storage | `_camelCase` | `_accountingContextForTokenOf` |
|
|
200
|
-
| Function parameter | `camelCase` | `projectId`, `cashOutCount` |
|
|
200
|
+
| Function parameter | `camelCase` (no underscores) | `projectId`, `cashOutCount` |
|
|
201
201
|
|
|
202
202
|
## NatSpec
|
|
203
203
|
|
|
@@ -253,9 +253,12 @@ uint256 public constant MAX_RESERVED_PERCENT = 10_000;
|
|
|
253
253
|
|
|
254
254
|
## Function Calls
|
|
255
255
|
|
|
256
|
-
Use named
|
|
256
|
+
Use named arguments for all function calls with 2 or more arguments — in both `src/` and `script/`:
|
|
257
257
|
|
|
258
258
|
```solidity
|
|
259
|
+
// Good — named arguments
|
|
260
|
+
token.mint({account: beneficiary, amount: count});
|
|
261
|
+
_transferOwnership({newOwner: address(0), projectId: 0});
|
|
259
262
|
PERMISSIONS.hasPermission({
|
|
260
263
|
operator: sender,
|
|
261
264
|
account: account,
|
|
@@ -264,8 +267,18 @@ PERMISSIONS.hasPermission({
|
|
|
264
267
|
includeRoot: true,
|
|
265
268
|
includeWildcardProjectId: true
|
|
266
269
|
});
|
|
270
|
+
|
|
271
|
+
// Bad — positional arguments with 2+ args
|
|
272
|
+
token.mint(beneficiary, count);
|
|
273
|
+
_transferOwnership(address(0), 0);
|
|
267
274
|
```
|
|
268
275
|
|
|
276
|
+
Single-argument calls use positional style: `_burn(amount)`.
|
|
277
|
+
|
|
278
|
+
This also applies to constructor calls, struct literals, and inherited/library calls (e.g., OZ `_mint`, `_safeMint`, `safeTransfer`, `allowance`, `Clones.cloneDeterministic`).
|
|
279
|
+
|
|
280
|
+
Named argument keys must use **camelCase** — never underscores. If a function's parameter names use underscores, rename them to camelCase first.
|
|
281
|
+
|
|
269
282
|
## Multiline Signatures
|
|
270
283
|
|
|
271
284
|
```solidity
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bannynet/core-v6",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -20,17 +20,17 @@
|
|
|
20
20
|
"artifacts": "source ./.env && npx sphinx artifacts --org-id 'ea165b21-7cdc-4d7b-be59-ecdd4c26bee4' --project-name 'banny-core-v6'"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@bananapus/721-hook-v6": "^0.0.
|
|
24
|
-
"@bananapus/core-v6": "^0.0.
|
|
25
|
-
"@bananapus/permission-ids-v6": "^0.0.
|
|
26
|
-
"@bananapus/router-terminal-v6": "^0.0.
|
|
27
|
-
"@bananapus/suckers-v6": "^0.0.
|
|
28
|
-
"@croptop/core-v6": "^0.0.
|
|
23
|
+
"@bananapus/721-hook-v6": "^0.0.16",
|
|
24
|
+
"@bananapus/core-v6": "^0.0.16",
|
|
25
|
+
"@bananapus/permission-ids-v6": "^0.0.9",
|
|
26
|
+
"@bananapus/router-terminal-v6": "^0.0.11",
|
|
27
|
+
"@bananapus/suckers-v6": "^0.0.10",
|
|
28
|
+
"@croptop/core-v6": "^0.0.15",
|
|
29
29
|
"@openzeppelin/contracts": "^5.6.1",
|
|
30
|
-
"@rev-net/core-v6": "^0.0.
|
|
30
|
+
"@rev-net/core-v6": "^0.0.12",
|
|
31
31
|
"keccak": "^3.0.4"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@sphinx-labs/plugins": "^0.33.2"
|
|
35
35
|
}
|
|
36
|
-
}
|
|
36
|
+
}
|
package/script/Add.Denver.s.sol
CHANGED
|
@@ -5,10 +5,11 @@ import {JB721TierConfig} from "@bananapus/721-hook-v6/src/structs/JB721TierConfi
|
|
|
5
5
|
import {JBSplit} from "@bananapus/core-v6/src/structs/JBSplit.sol";
|
|
6
6
|
import {JB721TiersHook} from "@bananapus/721-hook-v6/src/JB721TiersHook.sol";
|
|
7
7
|
|
|
8
|
-
import "./helpers/BannyverseDeploymentLib.sol";
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
import {BannyverseDeployment, BannyverseDeploymentLib} from "./helpers/BannyverseDeploymentLib.sol";
|
|
9
|
+
import {
|
|
10
|
+
RevnetCoreDeployment,
|
|
11
|
+
RevnetCoreDeploymentLib
|
|
12
|
+
} from "@rev-net/core-v6/script/helpers/RevnetCoreDeploymentLib.sol";
|
|
12
13
|
import {Sphinx} from "@sphinx-labs/contracts/contracts/foundry/SphinxPlugin.sol";
|
|
13
14
|
import {Script} from "forge-std/Script.sol";
|
|
14
15
|
|
|
@@ -78,13 +79,13 @@ contract Drop1Script is Script, Sphinx {
|
|
|
78
79
|
// Get the next tier ID so we can set names and hashes for the new product.
|
|
79
80
|
uint256 nextTierId = hook.STORE().maxTierIdOf(address(hook)) + 1;
|
|
80
81
|
|
|
81
|
-
hook.adjustTiers(products, new uint256[](0));
|
|
82
|
+
hook.adjustTiers({tiersToAdd: products, tierIdsToRemove: new uint256[](0)});
|
|
82
83
|
|
|
83
84
|
// Build the product IDs array for the newly added tier(s).
|
|
84
85
|
uint256[] memory productIds = new uint256[](1);
|
|
85
86
|
productIds[0] = nextTierId;
|
|
86
87
|
|
|
87
|
-
bannyverse.resolver.setSvgHashesOf(productIds, svgHashes);
|
|
88
|
-
bannyverse.resolver.setProductNames(productIds, names);
|
|
88
|
+
bannyverse.resolver.setSvgHashesOf({upcs: productIds, svgHashes: svgHashes});
|
|
89
|
+
bannyverse.resolver.setProductNames({upcs: productIds, names: names});
|
|
89
90
|
}
|
|
90
91
|
}
|
package/script/Deploy.s.sol
CHANGED
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
pragma solidity 0.8.26;
|
|
3
3
|
|
|
4
|
-
import "@bananapus/721-hook-v6/script/helpers/Hook721DeploymentLib.sol";
|
|
5
|
-
import "@bananapus/core-v6/script/helpers/CoreDeploymentLib.sol";
|
|
6
|
-
import "@bananapus/suckers-v6/script/helpers/SuckerDeploymentLib.sol";
|
|
7
|
-
import
|
|
8
|
-
|
|
4
|
+
import {Hook721Deployment, Hook721DeploymentLib} from "@bananapus/721-hook-v6/script/helpers/Hook721DeploymentLib.sol";
|
|
5
|
+
import {CoreDeployment, CoreDeploymentLib} from "@bananapus/core-v6/script/helpers/CoreDeploymentLib.sol";
|
|
6
|
+
import {SuckerDeployment, SuckerDeploymentLib} from "@bananapus/suckers-v6/script/helpers/SuckerDeploymentLib.sol";
|
|
7
|
+
import {
|
|
8
|
+
RouterTerminalDeployment,
|
|
9
|
+
RouterTerminalDeploymentLib
|
|
10
|
+
} from "@bananapus/router-terminal-v6/script/helpers/RouterTerminalDeploymentLib.sol";
|
|
11
|
+
import {
|
|
12
|
+
RevnetCoreDeployment,
|
|
13
|
+
RevnetCoreDeploymentLib
|
|
14
|
+
} from "@rev-net/core-v6/script/helpers/RevnetCoreDeploymentLib.sol";
|
|
9
15
|
|
|
10
16
|
import {IJB721TokenUriResolver} from "@bananapus/721-hook-v6/src/interfaces/IJB721TokenUriResolver.sol";
|
|
11
17
|
import {JB721InitTiersConfig} from "@bananapus/721-hook-v6/src/structs/JB721InitTiersConfig.sol";
|
|
12
18
|
import {JB721TierConfig} from "@bananapus/721-hook-v6/src/structs/JB721TierConfig.sol";
|
|
13
|
-
import {REVBaseline721HookConfig} from "@rev-net/core-v6/src/structs/REVBaseline721HookConfig.sol";
|
|
14
|
-
import {REV721TiersHookFlags} from "@rev-net/core-v6/src/structs/REV721TiersHookFlags.sol";
|
|
15
|
-
import {IJBPrices} from "@bananapus/core-v6/src/interfaces/IJBPrices.sol";
|
|
16
19
|
import {IJBSplitHook} from "@bananapus/core-v6/src/interfaces/IJBSplitHook.sol";
|
|
17
20
|
import {JBConstants} from "@bananapus/core-v6/src/libraries/JBConstants.sol";
|
|
18
21
|
import {JBCurrencyIds} from "@bananapus/core-v6/src/libraries/JBCurrencyIds.sol";
|
|
@@ -23,8 +26,10 @@ import {JBTokenMapping} from "@bananapus/suckers-v6/src/structs/JBTokenMapping.s
|
|
|
23
26
|
import {REVAutoIssuance} from "@rev-net/core-v6/src/structs/REVAutoIssuance.sol";
|
|
24
27
|
import {REVConfig} from "@rev-net/core-v6/src/structs/REVConfig.sol";
|
|
25
28
|
import {REVCroptopAllowedPost} from "@rev-net/core-v6/src/structs/REVCroptopAllowedPost.sol";
|
|
29
|
+
import {REVBaseline721HookConfig} from "@rev-net/core-v6/src/structs/REVBaseline721HookConfig.sol";
|
|
26
30
|
import {REVDeploy721TiersHookConfig} from "@rev-net/core-v6/src/structs/REVDeploy721TiersHookConfig.sol";
|
|
27
31
|
import {REVDescription} from "@rev-net/core-v6/src/structs/REVDescription.sol";
|
|
32
|
+
import {REV721TiersHookFlags} from "@rev-net/core-v6/src/structs/REV721TiersHookFlags.sol";
|
|
28
33
|
import {REVStageConfig} from "@rev-net/core-v6/src/structs/REVStageConfig.sol";
|
|
29
34
|
import {REVSuckerDeploymentConfig} from "@rev-net/core-v6/src/structs/REVSuckerDeploymentConfig.sol";
|
|
30
35
|
import {JBSuckerDeployerConfig} from "@bananapus/suckers-v6/src/structs/JBSuckerDeployerConfig.sol";
|
|
@@ -56,27 +61,27 @@ contract DeployScript is Script, Sphinx {
|
|
|
56
61
|
|
|
57
62
|
BannyverseRevnetConfig bannyverseConfig;
|
|
58
63
|
|
|
59
|
-
uint32 PREMINT_CHAIN_ID = 1;
|
|
60
|
-
bytes32 ERC20_SALT = "_BAN_ERC20V6_";
|
|
61
|
-
bytes32 SUCKER_SALT = "_BAN_SUCKERV6_";
|
|
62
|
-
bytes32 HOOK_SALT = "_BAN_HOOKV6_";
|
|
63
|
-
bytes32 RESOLVER_SALT = "_BAN_RESOLVERV6_";
|
|
64
|
-
string NAME = "Banny Network";
|
|
65
|
-
string SYMBOL = "BAN";
|
|
66
|
-
string PROJECT_URI = "ipfs://Qme34ww9HuwnsWF6sYDpDfpSdYHpPCGsEyJULk1BikCVYp";
|
|
67
|
-
string BASE_URI = "ipfs://";
|
|
68
|
-
uint32 NATIVE_CURRENCY = uint32(uint160(JBConstants.NATIVE_TOKEN));
|
|
69
|
-
uint32 ETH_CURRENCY = JBCurrencyIds.ETH;
|
|
70
|
-
uint8 DECIMALS = 18;
|
|
71
|
-
uint256 DECIMAL_MULTIPLIER = 10 ** DECIMALS;
|
|
72
|
-
uint24 BANNY_BODY_CATEGORY = 0;
|
|
73
|
-
address
|
|
74
|
-
address
|
|
75
|
-
uint48 BAN_START_TIME = 1_740_435_044;
|
|
76
|
-
uint104
|
|
77
|
-
uint104
|
|
78
|
-
uint104
|
|
79
|
-
uint104
|
|
64
|
+
uint32 constant PREMINT_CHAIN_ID = 1;
|
|
65
|
+
bytes32 constant ERC20_SALT = "_BAN_ERC20V6_";
|
|
66
|
+
bytes32 constant SUCKER_SALT = "_BAN_SUCKERV6_";
|
|
67
|
+
bytes32 constant HOOK_SALT = "_BAN_HOOKV6_";
|
|
68
|
+
bytes32 constant RESOLVER_SALT = "_BAN_RESOLVERV6_";
|
|
69
|
+
string constant NAME = "Banny Network";
|
|
70
|
+
string constant SYMBOL = "BAN";
|
|
71
|
+
string constant PROJECT_URI = "ipfs://Qme34ww9HuwnsWF6sYDpDfpSdYHpPCGsEyJULk1BikCVYp";
|
|
72
|
+
string constant BASE_URI = "ipfs://";
|
|
73
|
+
uint32 constant NATIVE_CURRENCY = uint32(uint160(JBConstants.NATIVE_TOKEN));
|
|
74
|
+
uint32 constant ETH_CURRENCY = JBCurrencyIds.ETH;
|
|
75
|
+
uint8 constant DECIMALS = 18;
|
|
76
|
+
uint256 constant DECIMAL_MULTIPLIER = 10 ** DECIMALS;
|
|
77
|
+
uint24 constant BANNY_BODY_CATEGORY = 0;
|
|
78
|
+
address operator;
|
|
79
|
+
address trustedForwarder;
|
|
80
|
+
uint48 constant BAN_START_TIME = 1_740_435_044;
|
|
81
|
+
uint104 constant BAN_MAINNET_AUTO_ISSUANCE = 545_296_034_092_246_678_345_976;
|
|
82
|
+
uint104 constant BAN_BASE_AUTO_ISSUANCE = 10_097_684_379_816_492_953_872;
|
|
83
|
+
uint104 constant BAN_OP_AUTO_ISSUANCE = 328_366_065_858_064_488_000;
|
|
84
|
+
uint104 constant BAN_ARB_AUTO_ISSUANCE = 2_825_980_000_000_000_000_000;
|
|
80
85
|
|
|
81
86
|
function configureSphinx() public override {
|
|
82
87
|
sphinxConfig.projectName = "banny-core-v6";
|
|
@@ -86,7 +91,7 @@ contract DeployScript is Script, Sphinx {
|
|
|
86
91
|
|
|
87
92
|
function run() public {
|
|
88
93
|
// Get the operator address.
|
|
89
|
-
|
|
94
|
+
operator = safeAddress();
|
|
90
95
|
|
|
91
96
|
// Get the deployment addresses for the nana CORE for this chain.
|
|
92
97
|
// We want to do this outside of the `sphinx` modifier.
|
|
@@ -113,7 +118,7 @@ contract DeployScript is Script, Sphinx {
|
|
|
113
118
|
)
|
|
114
119
|
);
|
|
115
120
|
|
|
116
|
-
|
|
121
|
+
trustedForwarder = core.controller.trustedForwarder();
|
|
117
122
|
|
|
118
123
|
bannyverseConfig = getBannyverseRevnetConfig();
|
|
119
124
|
|
|
@@ -142,7 +147,7 @@ contract DeployScript is Script, Sphinx {
|
|
|
142
147
|
splits[0] = JBSplit({
|
|
143
148
|
percent: JBConstants.SPLITS_TOTAL_PERCENT,
|
|
144
149
|
projectId: 0,
|
|
145
|
-
beneficiary: payable(
|
|
150
|
+
beneficiary: payable(operator),
|
|
146
151
|
preferAddToBalance: false,
|
|
147
152
|
lockedUntil: 0,
|
|
148
153
|
hook: IJBSplitHook(address(0))
|
|
@@ -153,16 +158,17 @@ contract DeployScript is Script, Sphinx {
|
|
|
153
158
|
|
|
154
159
|
{
|
|
155
160
|
REVAutoIssuance[] memory autoIssuances = new REVAutoIssuance[](4);
|
|
156
|
-
autoIssuances[0] = REVAutoIssuance({chainId: 1, count:
|
|
157
|
-
autoIssuances[1] = REVAutoIssuance({chainId: 8453, count:
|
|
158
|
-
autoIssuances[2] = REVAutoIssuance({chainId: 10, count:
|
|
159
|
-
autoIssuances[3] = REVAutoIssuance({chainId: 42_161, count:
|
|
161
|
+
autoIssuances[0] = REVAutoIssuance({chainId: 1, count: BAN_MAINNET_AUTO_ISSUANCE, beneficiary: operator});
|
|
162
|
+
autoIssuances[1] = REVAutoIssuance({chainId: 8453, count: BAN_BASE_AUTO_ISSUANCE, beneficiary: operator});
|
|
163
|
+
autoIssuances[2] = REVAutoIssuance({chainId: 10, count: BAN_OP_AUTO_ISSUANCE, beneficiary: operator});
|
|
164
|
+
autoIssuances[3] = REVAutoIssuance({chainId: 42_161, count: BAN_ARB_AUTO_ISSUANCE, beneficiary: operator});
|
|
160
165
|
|
|
161
166
|
stageConfigurations[0] = REVStageConfig({
|
|
162
167
|
startsAtOrAfter: BAN_START_TIME,
|
|
163
168
|
autoIssuances: autoIssuances,
|
|
164
169
|
splitPercent: 3800, // 38%
|
|
165
170
|
splits: splits,
|
|
171
|
+
// forge-lint: disable-next-line(unsafe-typecast)
|
|
166
172
|
initialIssuance: uint112(10_000 * DECIMAL_MULTIPLIER),
|
|
167
173
|
issuanceCutFrequency: 60 days,
|
|
168
174
|
issuanceCutPercent: 380_000_000, // 38%,
|
|
@@ -174,7 +180,10 @@ contract DeployScript is Script, Sphinx {
|
|
|
174
180
|
{
|
|
175
181
|
REVAutoIssuance[] memory autoIssuances = new REVAutoIssuance[](1);
|
|
176
182
|
autoIssuances[0] = REVAutoIssuance({
|
|
177
|
-
|
|
183
|
+
// forge-lint: disable-next-line(unsafe-typecast)
|
|
184
|
+
chainId: PREMINT_CHAIN_ID,
|
|
185
|
+
count: uint104(1_000_000 * DECIMAL_MULTIPLIER),
|
|
186
|
+
beneficiary: operator
|
|
178
187
|
});
|
|
179
188
|
|
|
180
189
|
// decrease by a smaller percent more frequently. 30 days, 7%-ish.
|
|
@@ -204,9 +213,9 @@ contract DeployScript is Script, Sphinx {
|
|
|
204
213
|
});
|
|
205
214
|
|
|
206
215
|
REVConfig memory revnetConfiguration = REVConfig({
|
|
207
|
-
description: REVDescription(NAME, SYMBOL, PROJECT_URI, ERC20_SALT),
|
|
216
|
+
description: REVDescription({name: NAME, ticker: SYMBOL, uri: PROJECT_URI, salt: ERC20_SALT}),
|
|
208
217
|
baseCurrency: ETH_CURRENCY,
|
|
209
|
-
splitOperator:
|
|
218
|
+
splitOperator: operator,
|
|
210
219
|
stageConfigurations: stageConfigurations
|
|
211
220
|
});
|
|
212
221
|
|
|
@@ -219,7 +228,7 @@ contract DeployScript is Script, Sphinx {
|
|
|
219
228
|
votingUnits: 0,
|
|
220
229
|
reserveFrequency: 0,
|
|
221
230
|
reserveBeneficiary: address(0),
|
|
222
|
-
encodedIPFSUri: bytes32(
|
|
231
|
+
encodedIPFSUri: bytes32(0),
|
|
223
232
|
category: BANNY_BODY_CATEGORY,
|
|
224
233
|
discountPercent: 0,
|
|
225
234
|
cannotIncreaseDiscountPercent: true,
|
|
@@ -237,7 +246,7 @@ contract DeployScript is Script, Sphinx {
|
|
|
237
246
|
votingUnits: 0,
|
|
238
247
|
reserveFrequency: 0,
|
|
239
248
|
reserveBeneficiary: address(0),
|
|
240
|
-
encodedIPFSUri: bytes32(
|
|
249
|
+
encodedIPFSUri: bytes32(0),
|
|
241
250
|
category: BANNY_BODY_CATEGORY,
|
|
242
251
|
discountPercent: 0,
|
|
243
252
|
cannotIncreaseDiscountPercent: true,
|
|
@@ -255,7 +264,7 @@ contract DeployScript is Script, Sphinx {
|
|
|
255
264
|
votingUnits: 0,
|
|
256
265
|
reserveFrequency: 0,
|
|
257
266
|
reserveBeneficiary: address(0),
|
|
258
|
-
encodedIPFSUri: bytes32(
|
|
267
|
+
encodedIPFSUri: bytes32(0),
|
|
259
268
|
category: BANNY_BODY_CATEGORY,
|
|
260
269
|
discountPercent: 0,
|
|
261
270
|
cannotIncreaseDiscountPercent: true,
|
|
@@ -273,7 +282,7 @@ contract DeployScript is Script, Sphinx {
|
|
|
273
282
|
votingUnits: 0,
|
|
274
283
|
reserveFrequency: 0,
|
|
275
284
|
reserveBeneficiary: address(0),
|
|
276
|
-
encodedIPFSUri: bytes32(
|
|
285
|
+
encodedIPFSUri: bytes32(0),
|
|
277
286
|
category: BANNY_BODY_CATEGORY,
|
|
278
287
|
discountPercent: 0,
|
|
279
288
|
cannotIncreaseDiscountPercent: true,
|
|
@@ -338,9 +347,7 @@ contract DeployScript is Script, Sphinx {
|
|
|
338
347
|
tokenUriResolver: IJB721TokenUriResolver(address(0)), // This will be replaced once we know the
|
|
339
348
|
// address.
|
|
340
349
|
contractUri: "https://jbm.infura-ipfs.io/ipfs/Qmd2hgb1E4caEB51VvoC3GvonhwkCoVyXjJ3zqsCxHPTKK",
|
|
341
|
-
tiersConfig: JB721InitTiersConfig({
|
|
342
|
-
tiers: tiers, currency: ETH_CURRENCY, decimals: DECIMALS, prices: core.prices
|
|
343
|
-
}),
|
|
350
|
+
tiersConfig: JB721InitTiersConfig({tiers: tiers, currency: ETH_CURRENCY, decimals: DECIMALS}),
|
|
344
351
|
reserveBeneficiary: address(0),
|
|
345
352
|
flags: REV721TiersHookFlags({
|
|
346
353
|
noNewTiersWithReserves: false,
|
|
@@ -350,10 +357,10 @@ contract DeployScript is Script, Sphinx {
|
|
|
350
357
|
})
|
|
351
358
|
}),
|
|
352
359
|
salt: HOOK_SALT,
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
360
|
+
preventSplitOperatorAdjustingTiers: false,
|
|
361
|
+
preventSplitOperatorUpdatingMetadata: false,
|
|
362
|
+
preventSplitOperatorMinting: false,
|
|
363
|
+
preventSplitOperatorIncreasingDiscountPercent: false
|
|
357
364
|
})
|
|
358
365
|
});
|
|
359
366
|
}
|
|
@@ -362,15 +369,15 @@ contract DeployScript is Script, Sphinx {
|
|
|
362
369
|
// Deploy the Banny URI Resolver.
|
|
363
370
|
Banny721TokenUriResolver resolver;
|
|
364
371
|
|
|
365
|
-
string memory
|
|
372
|
+
string memory bannyBodySvg =
|
|
366
373
|
'<g class="a1"><path d="M173 53h4v17h-4z"/></g><g class="a2"><path d="M167 57h3v10h-3z"/><path d="M169 53h4v17h-4z"/></g><g class="a3"><path d="M167 53h3v4h-3z"/><path d="M163 57h4v10h-4z"/><path d="M167 67h3v3h-3z"/></g><g class="b1"><path d="M213 253h-3v-3-3h-3v-7-3h-4v-10h-3v-7-7-3h-3v-73h-4v-10h-3v-10h-3v-7h-4v-7h-3v-3h-3v-3h-4v10h4v10h3v10h3v3h4v7 3 70 3h3v7h3v20h4v7h3v3h3v3h4v4h3v3h3v-3-4z"/><path d="M253 307v-4h-3v-3h-3v-3h-4v-4h-3v-3h-3v-3h-4v-4h-3v-3h-3v-3h-4v-4h-3v-6h-3v-7h-4v17h4v3h3v3h3 4v4h3v3h3v3h4v4h3v3h3v3h4v4h3v3h3v3h4v-6h-4z"/></g><g class="b2"><path d="M250 310v-3h-3v-4h-4v-3h-3v-3h-3v-4h-4v-3h-3v-3h-3v-4h-7v-3h-3v-3h-4v-17h-3v-3h-3v-4h-4v-3h-3v-3h-3v-7h-4v-20h-3v-7h-3v-73-3-7h-4v-3h-3v-10h-3v-10h-4V70h-3v-3l-3 100 3-100v40h-3v10h-4v6h-3v14h-3v3 13h-4v44h4v16h3v14h3v13h4v10h3v7h3v3h4v3h3v4h3v3h4v3h3v4h3v3h4v3h3v7h7v7h6v3h7v3h7v4h13v3h3v3h10v-3h-3zm-103-87v-16h3v-10h-3v6h-4v17h-3v10h3v-7h4z"/><path d="M143 230h4v7h-4zm4 10h3v3h-3zm3 7h3v3h-3zm3 6h4v4h-4z"/><path d="M163 257h-6v3h3v3h3v4h4v-4-3h-4v-3z"/></g><g class="b3"><path d="M143 197v6h4v-6h6v-44h4v-16h3v-14h3v-6h4v-10h3V97h-7v6h-3v4h-3v3h-4v3h-3v4 3h-3v3 4h-4v10h-3v16 4h-3v46h3v-6h3z"/><path d="M140 203h3v17h-3z"/><path d="M137 220h3v10h-3z"/><path d="M153 250h-3v-7h-3v-6h-4v-7h-3v10h3v7h4v6h3v4h3v-7zm-3 10h3v7h-3z"/><path d="M147 257h3v3h-3zm6 0h4v3h-4z"/><path d="M160 263v-3h-3v3 7h6v-7h-3zm-10-56v16h-3v7h3v10h3v7h4v6h6v4h7v-4-3h-3v-10h-4v-13h-3v-14h-3v-16h-4v10h-3z"/><path d="M243 313v-3h-3v-3h-10-3v-4h-7v-3h-7v-3h-6v-7h-7v-7h-3v-3h-4v-3h-3v-4h-3v-3h-4v-3h-3v-4h-3v-3h-4v-3h-3v10h-3v3h-4v3h-3v7h3v7h4v6h3v5h4v3h6v3h3v3h4 3v3h3 4v3h3 3v4h10v3h7 7 3v3h10 3v-3h10v-3h4v-4h-14z"/></g><g class="b4"><path d="M183 130h4v7h-4z"/><path d="M180 127h3v3h-3zm-27-4h4v7h-4z"/><path d="M157 117h3v6h-3z"/><path d="M160 110h3v7h-3z"/><path d="M163 107h4v3h-4zm-3 83h3v7h-3z"/><path d="M163 187h4v3h-4zm20 0h7v3h-7z"/><path d="M180 190h3v3h-3zm10-7h3v4h-3z"/><path d="M193 187h4v6h-4zm-20 53h4v7h-4z"/><path d="M177 247h3v6h-3z"/><path d="M180 253h3v7h-3z"/><path d="M183 260h7v3h-7z"/><path d="M190 263h3v4h-3zm0-20h3v4h-3z"/><path d="M187 240h3v3h-3z"/><path d="M190 237h3v3h-3zm13 23h4v3h-4z"/><path d="M207 263h3v7h-3z"/><path d="M210 270h3v3h-3zm-10 7h3v6h-3z"/><path d="M203 283h4v7h-4z"/><path d="M207 290h6v3h-6z"/></g><g class="o"><path d="M133 157h4v50h-4zm0 63h4v10h-4zm27-163h3v10h-3z"/><path d="M163 53h4v4h-4z"/><path d="M167 50h10v3h-10z"/><path d="M177 53h3v17h-3z"/><path d="M173 70h4v27h-4zm-6 0h3v27h-3z"/><path d="M163 67h4v3h-4zm0 30h4v3h-4z"/><path d="M160 100h3v3h-3z"/><path d="M157 103h3v4h-3z"/><path d="M153 107h4v3h-4z"/><path d="M150 110h3v3h-3z"/><path d="M147 113h3v7h-3z"/><path d="M143 120h4v7h-4z"/><path d="M140 127h3v10h-3z"/><path d="M137 137h3v20h-3zm56-10h4v10h-4z"/><path d="M190 117h3v10h-3z"/><path d="M187 110h3v7h-3z"/><path d="M183 103h4v7h-4z"/><path d="M180 100h3v3h-3z"/><path d="M177 97h3v3h-3zm-40 106h3v17h-3zm0 27h3v10h-3zm10 30h3v7h-3z"/><path d="M150 257v-4h-3v-6h-4v-7h-3v10h3v10h4v-3h3z"/><path d="M150 257h3v3h-3z"/><path d="M163 273v-3h-6v-10h-4v7h-3v3h3v3h4v7h3v-7h3z"/><path d="M163 267h4v3h-4z"/><path d="M170 257h-3-4v3h4v7h3v-10z"/><path d="M157 253h6v4h-6z"/><path d="M153 247h4v6h-4z"/><path d="M150 240h3v7h-3z"/><path d="M147 230h3v10h-3zm13 50h3v7h-3z"/><path d="M143 223h4v7h-4z"/><path d="M147 207h3v16h-3z"/><path d="M150 197h3v10h-3zm-10 0h3v6h-3zm50 113h7v3h-7zm23 10h17v3h-17z"/><path d="M230 323h13v4h-13z"/><path d="M243 320h10v3h-10z"/><path d="M253 317h4v3h-4z"/><path d="M257 307h3v10h-3z"/><path d="M253 303h4v4h-4z"/><path d="M250 300h3v3h-3z"/><path d="M247 297h3v3h-3z"/><path d="M243 293h4v4h-4z"/><path d="M240 290h3v3h-3z"/><path d="M237 287h3v3h-3z"/><path d="M233 283h4v4h-4z"/><path d="M230 280h3v3h-3z"/><path d="M227 277h3v3h-3z"/><path d="M223 273h4v4h-4z"/><path d="M220 267h3v6h-3z"/><path d="M217 260h3v7h-3z"/><path d="M213 253h4v7h-4z"/><path d="M210 247h3v6h-3z"/><path d="M207 237h3v10h-3z"/><path d="M203 227h4v10h-4zm-40 60h4v6h-4zm24 20h3v3h-3z"/><path d="M167 293h3v5h-3zm16 14h4v3h-4z"/><path d="M170 298h4v3h-4zm10 6h3v3h-3z"/><path d="M174 301h6v3h-6zm23 12h6v4h-6z"/><path d="M203 317h10v3h-10zm-2-107v-73h-4v73h3v17h3v-17h-2z"/></g><g class="o"><path d="M187 307v-4h3v-6h-3v-4h-4v-3h-3v-3h-7v-4h-6v4h-4v3h4v27h-4v13h-3v10h-4v7h4v3h3 10 14v-3h-4v-4h-3v-3h-3v-3h-4v-7h4v-10h3v-7h3v-3h7v-3h-3zm16 10v-4h-6v17h-4v10h-3v7h3v3h4 6 4 3 14v-3h-4v-4h-7v-3h-3v-3h-3v-10h3v-7h3v-3h-10z"/></g>';
|
|
367
|
-
string memory
|
|
374
|
+
string memory defaultNecklaceSvg =
|
|
368
375
|
'<g class="o"><path d="M190 173h-37v-3h-10v-4h-6v4h3v3h-3v4h6v3h10v4h37v-4h3v-3h-3v-4zm-40 4h-3v-4h3v4zm7 3v-3h3v3h-3zm6 0v-3h4v3h-4zm7 0v-3h3v3h-3zm7 0v-3h3v3h-3zm10 0h-4v-3h4v3z"/><path d="M190 170h3v3h-3z"/><path d="M193 166h4v4h-4zm0 7h4v4h-4z"/></g><g class="w"><path d="M137 170h3v3h-3zm10 3h3v4h-3zm10 4h3v3h-3zm6 0h4v3h-4zm7 0h3v3h-3zm7 0h3v3h-3zm6 0h4v3h-4zm7-4h3v4h-3z"/><path d="M193 170h4v3h-4z"/></g>';
|
|
369
|
-
string memory
|
|
376
|
+
string memory defaultMouthSvg =
|
|
370
377
|
'<g class="o"><path d="M183 160v-4h-20v4h-3v3h3v4h24v-7h-4zm-13 3v-3h10v3h-10z" fill="#ad71c8"/><path d="M170 160h10v3h-10z"/></g>';
|
|
371
|
-
string memory
|
|
378
|
+
string memory defaultStandardEyesSvg =
|
|
372
379
|
'<g class="o"><path d="M177 140v3h6v11h10v-11h4v-3h-20z"/><path d="M153 140v3h7v8 3h7 3v-11h3v-3h-20z"/></g><g class="w"><path d="M153 143h7v4h-7z"/><path d="M157 147h3v3h-3zm20-4h6v4h-6z"/><path d="M180 147h3v3h-3z"/></g>';
|
|
373
|
-
string memory
|
|
380
|
+
string memory defaultAlienEyesSvg =
|
|
374
381
|
'<g class="o"><path d="M190 127h3v3h-3zm3 13h4v3h-4zm-42 0h6v6h-6z"/><path d="M151 133h3v7h-3zm10 0h6v4h-6z"/><path d="M157 137h17v6h-17zm3 13h14v3h-14zm17-13h7v16h-7z"/><path d="M184 137h6v6h-6zm0 10h10v6h-10z"/><path d="M187 143h10v4h-10z"/><path d="M190 140h3v3h-3zm-6-10h3v7h-3z"/><path d="M187 130h6v3h-6zm-36 0h10v3h-10zm16 13h7v7h-7zm-10 0h7v7h-7z"/><path d="M164 147h3v3h-3zm29-20h4v6h-4z"/><path d="M194 133h3v7h-3z"/></g><g class="w"><path d="M154 133h7v4h-7z"/><path d="M154 137h3v3h-3zm10 6h3v4h-3zm20 0h3v4h-3zm3-10h7v4h-7z"/><path d="M190 137h4v3h-4z"/></g>';
|
|
375
382
|
{
|
|
376
383
|
// Perform the check for the resolver..
|
|
@@ -378,40 +385,42 @@ contract DeployScript is Script, Sphinx {
|
|
|
378
385
|
RESOLVER_SALT,
|
|
379
386
|
type(Banny721TokenUriResolver).creationCode,
|
|
380
387
|
abi.encode(
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
+
bannyBodySvg,
|
|
389
|
+
defaultNecklaceSvg,
|
|
390
|
+
defaultMouthSvg,
|
|
391
|
+
defaultStandardEyesSvg,
|
|
392
|
+
defaultAlienEyesSvg,
|
|
393
|
+
operator,
|
|
394
|
+
trustedForwarder
|
|
388
395
|
)
|
|
389
396
|
);
|
|
390
397
|
// Deploy it if it has not been deployed yet.
|
|
391
398
|
resolver = !_resolverIsDeployed
|
|
392
|
-
? new Banny721TokenUriResolver{salt: RESOLVER_SALT}(
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
)
|
|
399
|
+
? new Banny721TokenUriResolver{salt: RESOLVER_SALT}({
|
|
400
|
+
bannyBody: bannyBodySvg,
|
|
401
|
+
defaultNecklace: defaultNecklaceSvg,
|
|
402
|
+
defaultMouth: defaultMouthSvg,
|
|
403
|
+
defaultStandardEyes: defaultStandardEyesSvg,
|
|
404
|
+
defaultAlienEyes: defaultAlienEyesSvg,
|
|
405
|
+
owner: operator,
|
|
406
|
+
trustedForwarder: trustedForwarder
|
|
407
|
+
})
|
|
401
408
|
: Banny721TokenUriResolver(_resolver);
|
|
402
409
|
}
|
|
403
410
|
|
|
404
411
|
// Set the resolver's metadata.
|
|
405
|
-
resolver.setMetadata(
|
|
406
|
-
"A piece of Banny Retail.",
|
|
407
|
-
|
|
412
|
+
resolver.setMetadata({
|
|
413
|
+
description: "A piece of Banny Retail.",
|
|
414
|
+
url: "https://retail.banny.eth.shop",
|
|
415
|
+
baseUri: "https://bannyverse.infura-ipfs.io/ipfs/"
|
|
416
|
+
});
|
|
408
417
|
|
|
409
418
|
// Update our config with its address.
|
|
410
419
|
bannyverseConfig.hookConfiguration.baseline721HookConfiguration.tokenUriResolver = resolver;
|
|
411
420
|
|
|
412
421
|
// Deploy the $BANNY Revnet.
|
|
413
422
|
revnet.basic_deployer
|
|
414
|
-
.
|
|
423
|
+
.deployFor({
|
|
415
424
|
revnetId: 0,
|
|
416
425
|
configuration: bannyverseConfig.configuration,
|
|
417
426
|
terminalConfigurations: bannyverseConfig.terminalConfigurations,
|
package/script/Drop1.s.sol
CHANGED
|
@@ -5,10 +5,11 @@ import {JB721TierConfig} from "@bananapus/721-hook-v6/src/structs/JB721TierConfi
|
|
|
5
5
|
import {JBSplit} from "@bananapus/core-v6/src/structs/JBSplit.sol";
|
|
6
6
|
import {JB721TiersHook} from "@bananapus/721-hook-v6/src/JB721TiersHook.sol";
|
|
7
7
|
|
|
8
|
-
import "./helpers/BannyverseDeploymentLib.sol";
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
import {BannyverseDeployment, BannyverseDeploymentLib} from "./helpers/BannyverseDeploymentLib.sol";
|
|
9
|
+
import {
|
|
10
|
+
RevnetCoreDeployment,
|
|
11
|
+
RevnetCoreDeploymentLib
|
|
12
|
+
} from "@rev-net/core-v6/script/helpers/RevnetCoreDeploymentLib.sol";
|
|
12
13
|
import {Sphinx} from "@sphinx-labs/contracts/contracts/foundry/SphinxPlugin.sol";
|
|
13
14
|
import {Script} from "forge-std/Script.sol";
|
|
14
15
|
|
|
@@ -1047,8 +1048,8 @@ contract Drop1Script is Script, Sphinx {
|
|
|
1047
1048
|
productIds[i] = i + 5;
|
|
1048
1049
|
}
|
|
1049
1050
|
|
|
1050
|
-
hook.adjustTiers(products, new uint256[](0));
|
|
1051
|
-
bannyverse.resolver.setSvgHashesOf(productIds, svgHashes);
|
|
1052
|
-
bannyverse.resolver.setProductNames(productIds, names);
|
|
1051
|
+
hook.adjustTiers({tiersToAdd: products, tierIdsToRemove: new uint256[](0)});
|
|
1052
|
+
bannyverse.resolver.setSvgHashesOf({upcs: productIds, svgHashes: svgHashes});
|
|
1053
|
+
bannyverse.resolver.setProductNames({upcs: productIds, names: names});
|
|
1053
1054
|
}
|
|
1054
1055
|
}
|
|
@@ -16,6 +16,7 @@ struct BannyverseDeployment {
|
|
|
16
16
|
library BannyverseDeploymentLib {
|
|
17
17
|
// Cheat code address, 0x7109709ECfa91a80626fF3989D68f67F5b1DD12D.
|
|
18
18
|
address internal constant VM_ADDRESS = address(uint160(uint256(keccak256("hevm cheat code"))));
|
|
19
|
+
// forge-lint: disable-next-line(screaming-snake-case-const)
|
|
19
20
|
Vm internal constant vm = Vm(VM_ADDRESS);
|
|
20
21
|
|
|
21
22
|
function getDeployment(
|
|
@@ -35,7 +36,7 @@ library BannyverseDeploymentLib {
|
|
|
35
36
|
|
|
36
37
|
for (uint256 _i; _i < networks.length; _i++) {
|
|
37
38
|
if (networks[_i].chainId == chainId) {
|
|
38
|
-
return getDeployment(path, networks[_i].name, revnetId);
|
|
39
|
+
return getDeployment({path: path, networkName: networks[_i].name, revnetId: revnetId});
|
|
39
40
|
}
|
|
40
41
|
}
|
|
41
42
|
|
|
@@ -44,7 +45,7 @@ library BannyverseDeploymentLib {
|
|
|
44
45
|
|
|
45
46
|
function getDeployment(
|
|
46
47
|
string memory path,
|
|
47
|
-
string memory
|
|
48
|
+
string memory networkName,
|
|
48
49
|
uint256 revnetId
|
|
49
50
|
)
|
|
50
51
|
internal
|
|
@@ -52,7 +53,12 @@ library BannyverseDeploymentLib {
|
|
|
52
53
|
returns (BannyverseDeployment memory deployment)
|
|
53
54
|
{
|
|
54
55
|
deployment.resolver = Banny721TokenUriResolver(
|
|
55
|
-
_getDeploymentAddress(
|
|
56
|
+
_getDeploymentAddress({
|
|
57
|
+
path: path,
|
|
58
|
+
projectName: "banny-core-v6",
|
|
59
|
+
networkName: networkName,
|
|
60
|
+
contractName: "Banny721TokenUriResolver"
|
|
61
|
+
})
|
|
56
62
|
);
|
|
57
63
|
|
|
58
64
|
deployment.revnetId = revnetId;
|
|
@@ -65,16 +71,17 @@ library BannyverseDeploymentLib {
|
|
|
65
71
|
/// @return The address of the contract.
|
|
66
72
|
function _getDeploymentAddress(
|
|
67
73
|
string memory path,
|
|
68
|
-
string memory
|
|
69
|
-
string memory
|
|
74
|
+
string memory projectName,
|
|
75
|
+
string memory networkName,
|
|
70
76
|
string memory contractName
|
|
71
77
|
)
|
|
72
78
|
internal
|
|
73
79
|
view
|
|
74
80
|
returns (address)
|
|
75
81
|
{
|
|
82
|
+
// forge-lint: disable-next-line(unsafe-cheatcode)
|
|
76
83
|
string memory deploymentJson =
|
|
77
|
-
vm.readFile(string.concat(path,
|
|
78
|
-
return stdJson.readAddress(deploymentJson, ".address");
|
|
84
|
+
vm.readFile(string.concat(path, projectName, "/", networkName, "/", contractName, ".json"));
|
|
85
|
+
return stdJson.readAddress({json: deploymentJson, key: ".address"});
|
|
79
86
|
}
|
|
80
87
|
}
|
|
@@ -7,7 +7,7 @@ import {IJB721TiersHookStore} from "@bananapus/721-hook-v6/src/interfaces/IJB721
|
|
|
7
7
|
|
|
8
8
|
library MigrationHelper {
|
|
9
9
|
/// @notice Get the UPC (tier ID) from a token ID
|
|
10
|
-
function
|
|
10
|
+
function _getUpc(address hook, uint256 tokenId) internal view returns (uint256) {
|
|
11
11
|
IJB721TiersHookStore store = JB721TiersHook(hook).STORE();
|
|
12
12
|
return store.tierOfTokenId({hook: hook, tokenId: tokenId, includeResolvedUri: false}).id;
|
|
13
13
|
}
|
|
@@ -24,22 +24,24 @@ library MigrationHelper {
|
|
|
24
24
|
view
|
|
25
25
|
{
|
|
26
26
|
// Get V5 asset token IDs (from V5 hook)
|
|
27
|
-
(uint256 v5BackgroundId, uint256[] memory v5OutfitIds) =
|
|
27
|
+
(uint256 v5BackgroundId, uint256[] memory v5OutfitIds) =
|
|
28
|
+
resolver.assetIdsOf({hook: hookAddress, bannyBodyId: tokenId});
|
|
28
29
|
// Get V4 asset token IDs (from V4 hook)
|
|
29
|
-
(uint256 v4BackgroundId, uint256[] memory v4OutfitIds) =
|
|
30
|
+
(uint256 v4BackgroundId, uint256[] memory v4OutfitIds) =
|
|
31
|
+
v4Resolver.assetIdsOf({hook: v4HookAddress, bannyBodyId: tokenId});
|
|
30
32
|
|
|
31
33
|
// Compare background UPCs (not token IDs, since they may differ)
|
|
32
|
-
uint256
|
|
33
|
-
uint256
|
|
34
|
+
uint256 v5BackgroundUpc = v5BackgroundId == 0 ? 0 : _getUpc({hook: hookAddress, tokenId: v5BackgroundId});
|
|
35
|
+
uint256 v4BackgroundUpc = v4BackgroundId == 0 ? 0 : _getUpc({hook: v4HookAddress, tokenId: v4BackgroundId});
|
|
34
36
|
|
|
35
|
-
bool matches =
|
|
37
|
+
bool matches = v5BackgroundUpc == v4BackgroundUpc && v5OutfitIds.length == v4OutfitIds.length;
|
|
36
38
|
|
|
37
39
|
if (matches) {
|
|
38
40
|
// Compare outfit UPCs
|
|
39
41
|
for (uint256 i = 0; i < v5OutfitIds.length; i++) {
|
|
40
|
-
uint256
|
|
41
|
-
uint256
|
|
42
|
-
if (
|
|
42
|
+
uint256 v5OutfitUpc = _getUpc({hook: hookAddress, tokenId: v5OutfitIds[i]});
|
|
43
|
+
uint256 v4OutfitUpc = _getUpc({hook: v4HookAddress, tokenId: v4OutfitIds[i]});
|
|
44
|
+
if (v5OutfitUpc != v4OutfitUpc) {
|
|
43
45
|
matches = false;
|
|
44
46
|
break;
|
|
45
47
|
}
|
|
@@ -48,17 +50,17 @@ library MigrationHelper {
|
|
|
48
50
|
|
|
49
51
|
if (!matches) {
|
|
50
52
|
// Try fallback resolver
|
|
51
|
-
(v4BackgroundId, v4OutfitIds) = fallbackV4Resolver.assetIdsOf(v4HookAddress, tokenId);
|
|
52
|
-
|
|
53
|
+
(v4BackgroundId, v4OutfitIds) = fallbackV4Resolver.assetIdsOf({hook: v4HookAddress, bannyBodyId: tokenId});
|
|
54
|
+
v4BackgroundUpc = v4BackgroundId == 0 ? 0 : _getUpc({hook: v4HookAddress, tokenId: v4BackgroundId});
|
|
53
55
|
|
|
54
56
|
require(
|
|
55
|
-
|
|
57
|
+
v5BackgroundUpc == v4BackgroundUpc && v5OutfitIds.length == v4OutfitIds.length, "V4/V5 asset mismatch"
|
|
56
58
|
);
|
|
57
59
|
|
|
58
60
|
for (uint256 i = 0; i < v5OutfitIds.length; i++) {
|
|
59
|
-
uint256
|
|
60
|
-
uint256
|
|
61
|
-
require(
|
|
61
|
+
uint256 v5OutfitUpc = _getUpc({hook: hookAddress, tokenId: v5OutfitIds[i]});
|
|
62
|
+
uint256 v4OutfitUpc = _getUpc({hook: v4HookAddress, tokenId: v4OutfitIds[i]});
|
|
63
|
+
require(v5OutfitUpc == v4OutfitUpc, "V4/V5 asset mismatch");
|
|
62
64
|
}
|
|
63
65
|
}
|
|
64
66
|
}
|
|
@@ -91,14 +93,14 @@ library MigrationHelper {
|
|
|
91
93
|
// Check if this tier is owned by the fallback resolver in V4
|
|
92
94
|
// If so, skip verification (these are now owned by rightful owners in V5)
|
|
93
95
|
uint256 v4FallbackResolverBalance =
|
|
94
|
-
v4Store.tierBalanceOf(v4HookAddress, v4FallbackResolverAddress, tierId);
|
|
96
|
+
v4Store.tierBalanceOf({hook: v4HookAddress, owner: v4FallbackResolverAddress, tierId: tierId});
|
|
95
97
|
if (v4FallbackResolverBalance > 0) {
|
|
96
98
|
continue;
|
|
97
99
|
}
|
|
98
100
|
|
|
99
101
|
// Get V4 and V5 tier balances for this owner and tier
|
|
100
|
-
uint256 v4Balance = v4Store.tierBalanceOf(v4HookAddress, owner, tierId);
|
|
101
|
-
uint256 v5Balance = v5Store.tierBalanceOf(hookAddress, owner, tierId);
|
|
102
|
+
uint256 v4Balance = v4Store.tierBalanceOf({hook: v4HookAddress, owner: owner, tierId: tierId});
|
|
103
|
+
uint256 v5Balance = v5Store.tierBalanceOf({hook: hookAddress, owner: owner, tierId: tierId});
|
|
102
104
|
|
|
103
105
|
// Require that V5 balance is never greater than V4 balance
|
|
104
106
|
require(
|
|
@@ -146,6 +148,7 @@ library MigrationHelper {
|
|
|
146
148
|
bytes memory buffer = new bytes(digits);
|
|
147
149
|
while (value != 0) {
|
|
148
150
|
digits -= 1;
|
|
151
|
+
// forge-lint: disable-next-line(unsafe-typecast)
|
|
149
152
|
buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
|
|
150
153
|
value /= 10;
|
|
151
154
|
}
|
|
@@ -108,10 +108,15 @@ contract Banny721TokenUriResolver is
|
|
|
108
108
|
/// @custom:param upc The universal product code that the SVG hash represent.
|
|
109
109
|
mapping(uint256 upc => bytes32) public override svgHashOf;
|
|
110
110
|
|
|
111
|
+
// forge-lint: disable-next-line(mixed-case-variable)
|
|
111
112
|
string public override DEFAULT_ALIEN_EYES;
|
|
113
|
+
// forge-lint: disable-next-line(mixed-case-variable)
|
|
112
114
|
string public override DEFAULT_MOUTH;
|
|
115
|
+
// forge-lint: disable-next-line(mixed-case-variable)
|
|
113
116
|
string public override DEFAULT_NECKLACE;
|
|
117
|
+
// forge-lint: disable-next-line(mixed-case-variable)
|
|
114
118
|
string public override DEFAULT_STANDARD_EYES;
|
|
119
|
+
// forge-lint: disable-next-line(mixed-case-variable)
|
|
115
120
|
string public override BANNY_BODY;
|
|
116
121
|
|
|
117
122
|
//*********************************************************************//
|
|
@@ -299,7 +304,7 @@ contract Banny721TokenUriResolver is
|
|
|
299
304
|
|
|
300
305
|
// Get a reference to the pricing context.
|
|
301
306
|
// slither-disable-next-line unused-return
|
|
302
|
-
(uint256 currency, uint256 decimals
|
|
307
|
+
(uint256 currency, uint256 decimals) = IJB721TiersHook(hook).pricingContext();
|
|
303
308
|
|
|
304
309
|
attributes = string.concat(
|
|
305
310
|
attributes,
|
package/test/Fork.t.sol
CHANGED
|
@@ -1824,7 +1824,7 @@ contract BannyForkTest is Test {
|
|
|
1824
1824
|
JBAddressRegistry addressRegistry = new JBAddressRegistry();
|
|
1825
1825
|
|
|
1826
1826
|
JB721TiersHook hookImpl =
|
|
1827
|
-
new JB721TiersHook(jbDirectory, jbPermissions, jbRulesets, store, jbSplits, trustedForwarder);
|
|
1827
|
+
new JB721TiersHook(jbDirectory, jbPermissions, jbPrices, jbRulesets, store, jbSplits, trustedForwarder);
|
|
1828
1828
|
|
|
1829
1829
|
hookDeployer = new JB721TiersHookDeployer(hookImpl, store, addressRegistry, trustedForwarder);
|
|
1830
1830
|
}
|
|
@@ -1900,9 +1900,7 @@ contract BannyForkTest is Test {
|
|
|
1900
1900
|
baseUri: "ipfs://",
|
|
1901
1901
|
tokenUriResolver: IJB721TokenUriResolver(address(resolver)),
|
|
1902
1902
|
contractUri: "",
|
|
1903
|
-
tiersConfig: JB721InitTiersConfig({
|
|
1904
|
-
tiers: tiers, currency: JBCurrencyIds.ETH, decimals: 18, prices: IJBPrices(address(0))
|
|
1905
|
-
}),
|
|
1903
|
+
tiersConfig: JB721InitTiersConfig({tiers: tiers, currency: JBCurrencyIds.ETH, decimals: 18}),
|
|
1906
1904
|
reserveBeneficiary: address(0),
|
|
1907
1905
|
flags: JB721TiersHookFlags({
|
|
1908
1906
|
noNewTiersWithReserves: false,
|