@bannynet/core-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/README.md +53 -0
- package/SKILLS.md +94 -0
- package/deployments/banny-core-v5/arbitrum/Banny721TokenUriResolver.json +1809 -0
- package/deployments/banny-core-v5/arbitrum_sepolia/Banny721TokenUriResolver.json +1795 -0
- package/deployments/banny-core-v5/base/Banny721TokenUriResolver.json +1810 -0
- package/deployments/banny-core-v5/base_sepolia/Banny721TokenUriResolver.json +1796 -0
- package/deployments/banny-core-v5/ethereum/Banny721TokenUriResolver.json +1795 -0
- package/deployments/banny-core-v5/optimism/Banny721TokenUriResolver.json +1810 -0
- package/deployments/banny-core-v5/optimism_sepolia/Banny721TokenUriResolver.json +1796 -0
- package/deployments/banny-core-v5/sepolia/Banny721TokenUriResolver.json +1795 -0
- package/foundry.toml +22 -0
- package/package.json +53 -0
- package/remappings.txt +1 -0
- package/script/1.Fix.s.sol +290 -0
- package/script/Add.Denver.s.sol +75 -0
- package/script/AirdropOutfits.s.sol +2302 -0
- package/script/Deploy.s.sol +440 -0
- package/script/Drop1.s.sol +979 -0
- package/script/MigrationContractArbitrum.sol +494 -0
- package/script/MigrationContractArbitrum1.sol +170 -0
- package/script/MigrationContractArbitrum2.sol +204 -0
- package/script/MigrationContractArbitrum3.sol +174 -0
- package/script/MigrationContractArbitrum4.sol +478 -0
- package/script/MigrationContractBase1.sol +444 -0
- package/script/MigrationContractBase2.sol +175 -0
- package/script/MigrationContractBase3.sol +309 -0
- package/script/MigrationContractBase4.sol +350 -0
- package/script/MigrationContractBase5.sol +259 -0
- package/script/MigrationContractEthereum1.sol +468 -0
- package/script/MigrationContractEthereum2.sol +306 -0
- package/script/MigrationContractEthereum3.sol +349 -0
- package/script/MigrationContractEthereum4.sol +352 -0
- package/script/MigrationContractEthereum5.sol +354 -0
- package/script/MigrationContractEthereum6.sol +270 -0
- package/script/MigrationContractEthereum7.sol +439 -0
- package/script/MigrationContractEthereum8.sol +385 -0
- package/script/MigrationContractOptimism.sol +196 -0
- package/script/helpers/BannyverseDeploymentLib.sol +73 -0
- package/script/helpers/MigrationHelper.sol +155 -0
- package/script/outfit_drop/generate-migration.js +3441 -0
- package/script/outfit_drop/raw.json +43276 -0
- package/slither-ci.config.json +10 -0
- package/sphinx.lock +521 -0
- package/src/Banny721TokenUriResolver.sol +1288 -0
- package/src/interfaces/IBanny721TokenUriResolver.sol +137 -0
- package/test/Banny721TokenUriResolver.t.sol +669 -0
- package/test/BannyAttacks.t.sol +322 -0
- package/test/DecorateFlow.t.sol +1056 -0
|
@@ -0,0 +1,440 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
pragma solidity 0.8.23;
|
|
3
|
+
|
|
4
|
+
import "@bananapus/721-hook-v5/script/helpers/Hook721DeploymentLib.sol";
|
|
5
|
+
import "@bananapus/core-v5/script/helpers/CoreDeploymentLib.sol";
|
|
6
|
+
import "@bananapus/suckers-v5/script/helpers/SuckerDeploymentLib.sol";
|
|
7
|
+
import "@bananapus/swap-terminal-v5/script/helpers/SwapTerminalDeploymentLib.sol";
|
|
8
|
+
import "@rev-net/core-v5/script/helpers/RevnetCoreDeploymentLib.sol";
|
|
9
|
+
|
|
10
|
+
import {IJB721TokenUriResolver} from "@bananapus/721-hook-v5/src/interfaces/IJB721TokenUriResolver.sol";
|
|
11
|
+
import {JB721InitTiersConfig} from "@bananapus/721-hook-v5/src/structs/JB721InitTiersConfig.sol";
|
|
12
|
+
import {JB721TierConfig} from "@bananapus/721-hook-v5/src/structs/JB721TierConfig.sol";
|
|
13
|
+
import {JB721TiersHookFlags} from "@bananapus/721-hook-v5/src/structs/JB721TiersHookFlags.sol";
|
|
14
|
+
import {JBDeploy721TiersHookConfig} from "@bananapus/721-hook-v5/src/structs/JBDeploy721TiersHookConfig.sol";
|
|
15
|
+
import {IJBPrices} from "@bananapus/core-v5/src/interfaces/IJBPrices.sol";
|
|
16
|
+
import {IJBSplitHook} from "@bananapus/core-v5/src/interfaces/IJBSplitHook.sol";
|
|
17
|
+
import {JBConstants} from "@bananapus/core-v5/src/libraries/JBConstants.sol";
|
|
18
|
+
import {JBCurrencyIds} from "@bananapus/core-v5/src/libraries/JBCurrencyIds.sol";
|
|
19
|
+
import {JBAccountingContext} from "@bananapus/core-v5/src/structs/JBAccountingContext.sol";
|
|
20
|
+
import {JBSplit} from "@bananapus/core-v5/src/structs/JBSplit.sol";
|
|
21
|
+
import {JBTerminalConfig} from "@bananapus/core-v5/src/structs/JBTerminalConfig.sol";
|
|
22
|
+
import {JBTokenMapping} from "@bananapus/suckers-v5/src/structs/JBTokenMapping.sol";
|
|
23
|
+
import {REVAutoIssuance} from "@rev-net/core-v5/src/structs/REVAutoIssuance.sol";
|
|
24
|
+
import {REVConfig} from "@rev-net/core-v5/src/structs/REVConfig.sol";
|
|
25
|
+
import {REVCroptopAllowedPost} from "@rev-net/core-v5/src/structs/REVCroptopAllowedPost.sol";
|
|
26
|
+
import {REVDeploy721TiersHookConfig} from "@rev-net/core-v5/src/structs/REVDeploy721TiersHookConfig.sol";
|
|
27
|
+
import {REVDescription} from "@rev-net/core-v5/src/structs/REVDescription.sol";
|
|
28
|
+
import {REVLoanSource} from "@rev-net/core-v5/src/structs/REVLoanSource.sol";
|
|
29
|
+
import {REVStageConfig} from "@rev-net/core-v5/src/structs/REVStageConfig.sol";
|
|
30
|
+
import {REVSuckerDeploymentConfig} from "@rev-net/core-v5/src/structs/REVSuckerDeploymentConfig.sol";
|
|
31
|
+
import {JBSuckerDeployerConfig} from "@bananapus/suckers-v5/src/structs/JBSuckerDeployerConfig.sol";
|
|
32
|
+
import {IJBTerminal} from "@bananapus/core-v5/src/interfaces/IJBTerminal.sol";
|
|
33
|
+
|
|
34
|
+
import {Sphinx} from "@sphinx-labs/contracts/SphinxPlugin.sol";
|
|
35
|
+
import {Script} from "forge-std/Script.sol";
|
|
36
|
+
|
|
37
|
+
import {Banny721TokenUriResolver} from "./../src/Banny721TokenUriResolver.sol";
|
|
38
|
+
|
|
39
|
+
struct BannyverseRevnetConfig {
|
|
40
|
+
REVConfig configuration;
|
|
41
|
+
JBTerminalConfig[] terminalConfigurations;
|
|
42
|
+
REVSuckerDeploymentConfig suckerDeploymentConfiguration;
|
|
43
|
+
REVDeploy721TiersHookConfig hookConfiguration;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
contract DeployScript is Script, Sphinx {
|
|
47
|
+
/// @notice tracks the deployment of the core contracts for the chain we are deploying to.
|
|
48
|
+
CoreDeployment core;
|
|
49
|
+
/// @notice tracks the deployment of the sucker contracts for the chain we are deploying to.
|
|
50
|
+
SuckerDeployment suckers;
|
|
51
|
+
/// @notice tracks the deployment of the revnet contracts for the chain we are deploying to.
|
|
52
|
+
RevnetCoreDeployment revnet;
|
|
53
|
+
/// @notice tracks the deployment of the 721 hook contracts for the chain we are deploying to.
|
|
54
|
+
Hook721Deployment hook;
|
|
55
|
+
/// @notice tracks the deployment of the swap terminal.
|
|
56
|
+
SwapTerminalDeployment swapTerminal;
|
|
57
|
+
|
|
58
|
+
BannyverseRevnetConfig bannyverseConfig;
|
|
59
|
+
|
|
60
|
+
uint32 PREMINT_CHAIN_ID = 1;
|
|
61
|
+
bytes32 ERC20_SALT = "_BAN_ERC20V6_";
|
|
62
|
+
bytes32 SUCKER_SALT = "_BAN_SUCKERV6_";
|
|
63
|
+
bytes32 HOOK_SALT = "_BAN_HOOKV6_";
|
|
64
|
+
bytes32 RESOLVER_SALT = "_BAN_RESOLVERV6_";
|
|
65
|
+
string NAME = "Banny Network";
|
|
66
|
+
string SYMBOL = "BAN";
|
|
67
|
+
string PROJECT_URI = "ipfs://Qme34ww9HuwnsWF6sYDpDfpSdYHpPCGsEyJULk1BikCVYp";
|
|
68
|
+
string BASE_URI = "ipfs://";
|
|
69
|
+
uint32 NATIVE_CURRENCY = uint32(uint160(JBConstants.NATIVE_TOKEN));
|
|
70
|
+
uint32 ETH_CURRENCY = JBCurrencyIds.ETH;
|
|
71
|
+
uint8 DECIMALS = 18;
|
|
72
|
+
uint256 DECIMAL_MULTIPLIER = 10 ** DECIMALS;
|
|
73
|
+
uint24 BANNY_BODY_CATEGORY = 0;
|
|
74
|
+
address OPERATOR;
|
|
75
|
+
address TRUSTED_FORWARDER;
|
|
76
|
+
uint48 BAN_START_TIME = 1_740_435_044;
|
|
77
|
+
uint104 BAN_MAINNET_AUTO_ISSUANCE_ = 545_296_034_092_246_678_345_976;
|
|
78
|
+
uint104 BAN_BASE_AUTO_ISSUANCE_ = 10_097_684_379_816_492_953_872;
|
|
79
|
+
uint104 BAN_OP_AUTO_ISSUANCE_ = 328_366_065_858_064_488_000;
|
|
80
|
+
uint104 BAN_ARB_AUTO_ISSUANCE_ = 2_825_980_000_000_000_000_000;
|
|
81
|
+
|
|
82
|
+
function configureSphinx() public override {
|
|
83
|
+
sphinxConfig.projectName = "banny-core-v5";
|
|
84
|
+
sphinxConfig.mainnets = ["ethereum", "optimism", "base", "arbitrum"];
|
|
85
|
+
sphinxConfig.testnets = ["ethereum_sepolia", "optimism_sepolia", "base_sepolia", "arbitrum_sepolia"];
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function run() public {
|
|
89
|
+
// Get the operator address.
|
|
90
|
+
OPERATOR = safeAddress();
|
|
91
|
+
|
|
92
|
+
// Get the deployment addresses for the nana CORE for this chain.
|
|
93
|
+
// We want to do this outside of the `sphinx` modifier.
|
|
94
|
+
core = CoreDeploymentLib.getDeployment(
|
|
95
|
+
vm.envOr("NANA_CORE_DEPLOYMENT_PATH", string("node_modules/@bananapus/core-v5/deployments/"))
|
|
96
|
+
);
|
|
97
|
+
// Get the deployment addresses for the 721 hook contracts for this chain.
|
|
98
|
+
hook = Hook721DeploymentLib.getDeployment(
|
|
99
|
+
vm.envOr("NANA_721_DEPLOYMENT_PATH", string("node_modules/@bananapus/721-hook-v5/deployments/"))
|
|
100
|
+
);
|
|
101
|
+
// Get the deployment addresses for the 721 hook contracts for this chain.
|
|
102
|
+
revnet = RevnetCoreDeploymentLib.getDeployment(
|
|
103
|
+
vm.envOr("REVNET_CORE_DEPLOYMENT_PATH", string("node_modules/@rev-net/core-v5/deployments/"))
|
|
104
|
+
);
|
|
105
|
+
// Get the deployment addresses for the suckers contracts for this chain.
|
|
106
|
+
suckers = SuckerDeploymentLib.getDeployment(
|
|
107
|
+
vm.envOr("NANA_SUCKERS_DEPLOYMENT_PATH", string("node_modules/@bananapus/suckers-v5/deployments/"))
|
|
108
|
+
);
|
|
109
|
+
// Get the deployment addresses for the 721 hook contracts for this chain.
|
|
110
|
+
swapTerminal = SwapTerminalDeploymentLib.getDeployment(
|
|
111
|
+
vm.envOr(
|
|
112
|
+
"NANA_SWAP_TERMINAL_DEPLOYMENT_PATH", string("node_modules/@bananapus/swap-terminal-v5/deployments/")
|
|
113
|
+
)
|
|
114
|
+
);
|
|
115
|
+
|
|
116
|
+
TRUSTED_FORWARDER = core.controller.trustedForwarder();
|
|
117
|
+
|
|
118
|
+
bannyverseConfig = getBannyverseRevnetConfig();
|
|
119
|
+
|
|
120
|
+
// Perform the deployment transactions.
|
|
121
|
+
deploy();
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
function getBannyverseRevnetConfig() internal view returns (BannyverseRevnetConfig memory) {
|
|
125
|
+
// The terminals that the project will accept funds through.
|
|
126
|
+
JBTerminalConfig[] memory terminalConfigurations = new JBTerminalConfig[](2);
|
|
127
|
+
JBAccountingContext[] memory accountingContextsToAccept = new JBAccountingContext[](1);
|
|
128
|
+
|
|
129
|
+
// Accept the chain's native currency through the multi terminal.
|
|
130
|
+
accountingContextsToAccept[0] =
|
|
131
|
+
JBAccountingContext({token: JBConstants.NATIVE_TOKEN, decimals: DECIMALS, currency: NATIVE_CURRENCY});
|
|
132
|
+
|
|
133
|
+
terminalConfigurations[0] =
|
|
134
|
+
JBTerminalConfig({terminal: core.terminal, accountingContextsToAccept: accountingContextsToAccept});
|
|
135
|
+
|
|
136
|
+
terminalConfigurations[1] = JBTerminalConfig({
|
|
137
|
+
terminal: IJBTerminal(address(swapTerminal.registry)),
|
|
138
|
+
accountingContextsToAccept: new JBAccountingContext[](0)
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
JBSplit[] memory splits = new JBSplit[](1);
|
|
142
|
+
splits[0] = JBSplit({
|
|
143
|
+
percent: JBConstants.SPLITS_TOTAL_PERCENT,
|
|
144
|
+
projectId: 0,
|
|
145
|
+
beneficiary: payable(OPERATOR),
|
|
146
|
+
preferAddToBalance: false,
|
|
147
|
+
lockedUntil: 0,
|
|
148
|
+
hook: IJBSplitHook(address(0))
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
// The project's revnet stage configurations.
|
|
152
|
+
REVStageConfig[] memory stageConfigurations = new REVStageConfig[](3);
|
|
153
|
+
|
|
154
|
+
{
|
|
155
|
+
REVAutoIssuance[] memory autoIssuances = new REVAutoIssuance[](4);
|
|
156
|
+
autoIssuances[0] = REVAutoIssuance({chainId: 1, count: BAN_MAINNET_AUTO_ISSUANCE_, beneficiary: OPERATOR});
|
|
157
|
+
autoIssuances[1] = REVAutoIssuance({chainId: 8453, count: BAN_BASE_AUTO_ISSUANCE_, beneficiary: OPERATOR});
|
|
158
|
+
autoIssuances[2] = REVAutoIssuance({chainId: 10, count: BAN_OP_AUTO_ISSUANCE_, beneficiary: OPERATOR});
|
|
159
|
+
autoIssuances[3] = REVAutoIssuance({chainId: 42_161, count: BAN_ARB_AUTO_ISSUANCE_, beneficiary: OPERATOR});
|
|
160
|
+
|
|
161
|
+
stageConfigurations[0] = REVStageConfig({
|
|
162
|
+
startsAtOrAfter: BAN_START_TIME,
|
|
163
|
+
autoIssuances: autoIssuances,
|
|
164
|
+
splitPercent: 3800, // 38%
|
|
165
|
+
splits: splits,
|
|
166
|
+
initialIssuance: uint112(10_000 * DECIMAL_MULTIPLIER),
|
|
167
|
+
issuanceCutFrequency: 60 days,
|
|
168
|
+
issuanceCutPercent: 380_000_000, // 38%,
|
|
169
|
+
cashOutTaxRate: 1000, // 0.1
|
|
170
|
+
extraMetadata: 4 // Allow adding suckers.
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
{
|
|
175
|
+
REVAutoIssuance[] memory autoIssuances = new REVAutoIssuance[](1);
|
|
176
|
+
autoIssuances[0] = REVAutoIssuance({
|
|
177
|
+
chainId: PREMINT_CHAIN_ID, count: uint104(1_000_000 * DECIMAL_MULTIPLIER), beneficiary: OPERATOR
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
// decrease by a smaller percent more frequently. 30 days, 7%-ish.
|
|
181
|
+
stageConfigurations[1] = REVStageConfig({
|
|
182
|
+
startsAtOrAfter: uint40(stageConfigurations[0].startsAtOrAfter + 360 days),
|
|
183
|
+
autoIssuances: autoIssuances,
|
|
184
|
+
splitPercent: 3800, // 38%
|
|
185
|
+
splits: splits,
|
|
186
|
+
initialIssuance: 1, // inherit from previous cycle.
|
|
187
|
+
issuanceCutFrequency: 21 days,
|
|
188
|
+
issuanceCutPercent: 70_000_000, // 7%
|
|
189
|
+
cashOutTaxRate: 1000, // 0.1
|
|
190
|
+
extraMetadata: 4 // Allow adding suckers.
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
stageConfigurations[2] = REVStageConfig({
|
|
195
|
+
startsAtOrAfter: uint40(stageConfigurations[1].startsAtOrAfter + (1200 days)),
|
|
196
|
+
autoIssuances: new REVAutoIssuance[](0),
|
|
197
|
+
splitPercent: 0,
|
|
198
|
+
splits: splits,
|
|
199
|
+
initialIssuance: 0, // no more issuance.
|
|
200
|
+
issuanceCutFrequency: 0,
|
|
201
|
+
issuanceCutPercent: 0,
|
|
202
|
+
cashOutTaxRate: 1000, // 0.1
|
|
203
|
+
extraMetadata: 4 // Allow adding suckers.
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
REVConfig memory revnetConfiguration;
|
|
207
|
+
{
|
|
208
|
+
// Thr projects loan configuration.
|
|
209
|
+
REVLoanSource[] memory _loanSources = new REVLoanSource[](1);
|
|
210
|
+
_loanSources[0] = REVLoanSource({token: JBConstants.NATIVE_TOKEN, terminal: core.terminal});
|
|
211
|
+
|
|
212
|
+
// The project's revnet configuration
|
|
213
|
+
revnetConfiguration = REVConfig({
|
|
214
|
+
description: REVDescription(NAME, SYMBOL, PROJECT_URI, ERC20_SALT),
|
|
215
|
+
baseCurrency: ETH_CURRENCY,
|
|
216
|
+
splitOperator: OPERATOR,
|
|
217
|
+
stageConfigurations: stageConfigurations,
|
|
218
|
+
loanSources: _loanSources,
|
|
219
|
+
loans: address(revnet.loans)
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
// The project's NFT tiers.
|
|
224
|
+
JB721TierConfig[] memory tiers = new JB721TierConfig[](4);
|
|
225
|
+
|
|
226
|
+
tiers[0] = JB721TierConfig({
|
|
227
|
+
price: uint104(1 * (10 ** DECIMALS)),
|
|
228
|
+
initialSupply: 100,
|
|
229
|
+
votingUnits: 0,
|
|
230
|
+
reserveFrequency: 0,
|
|
231
|
+
reserveBeneficiary: address(0),
|
|
232
|
+
encodedIPFSUri: bytes32(""),
|
|
233
|
+
category: BANNY_BODY_CATEGORY,
|
|
234
|
+
discountPercent: 0,
|
|
235
|
+
cannotIncreaseDiscountPercent: true,
|
|
236
|
+
allowOwnerMint: false,
|
|
237
|
+
useReserveBeneficiaryAsDefault: false,
|
|
238
|
+
transfersPausable: false,
|
|
239
|
+
useVotingUnits: false,
|
|
240
|
+
cannotBeRemoved: true
|
|
241
|
+
});
|
|
242
|
+
tiers[1] = JB721TierConfig({
|
|
243
|
+
price: uint104(1 * (10 ** (DECIMALS - 1))),
|
|
244
|
+
initialSupply: 1000,
|
|
245
|
+
votingUnits: 0,
|
|
246
|
+
reserveFrequency: 0,
|
|
247
|
+
reserveBeneficiary: address(0),
|
|
248
|
+
encodedIPFSUri: bytes32(""),
|
|
249
|
+
category: BANNY_BODY_CATEGORY,
|
|
250
|
+
discountPercent: 0,
|
|
251
|
+
cannotIncreaseDiscountPercent: true,
|
|
252
|
+
allowOwnerMint: false,
|
|
253
|
+
useReserveBeneficiaryAsDefault: false,
|
|
254
|
+
transfersPausable: false,
|
|
255
|
+
useVotingUnits: false,
|
|
256
|
+
cannotBeRemoved: true
|
|
257
|
+
});
|
|
258
|
+
tiers[2] = JB721TierConfig({
|
|
259
|
+
price: uint104(1 * (10 ** (DECIMALS - 2))),
|
|
260
|
+
initialSupply: 10_000,
|
|
261
|
+
votingUnits: 0,
|
|
262
|
+
reserveFrequency: 0,
|
|
263
|
+
reserveBeneficiary: address(0),
|
|
264
|
+
encodedIPFSUri: bytes32(""),
|
|
265
|
+
category: BANNY_BODY_CATEGORY,
|
|
266
|
+
discountPercent: 0,
|
|
267
|
+
cannotIncreaseDiscountPercent: true,
|
|
268
|
+
allowOwnerMint: false,
|
|
269
|
+
useReserveBeneficiaryAsDefault: false,
|
|
270
|
+
transfersPausable: false,
|
|
271
|
+
useVotingUnits: false,
|
|
272
|
+
cannotBeRemoved: true
|
|
273
|
+
});
|
|
274
|
+
tiers[3] = JB721TierConfig({
|
|
275
|
+
price: uint104(1 * (10 ** (DECIMALS - 4))),
|
|
276
|
+
initialSupply: 999_999_999, // MAX
|
|
277
|
+
votingUnits: 0,
|
|
278
|
+
reserveFrequency: 0,
|
|
279
|
+
reserveBeneficiary: address(0),
|
|
280
|
+
encodedIPFSUri: bytes32(""),
|
|
281
|
+
category: BANNY_BODY_CATEGORY,
|
|
282
|
+
discountPercent: 0,
|
|
283
|
+
cannotIncreaseDiscountPercent: true,
|
|
284
|
+
allowOwnerMint: false,
|
|
285
|
+
useReserveBeneficiaryAsDefault: false,
|
|
286
|
+
transfersPausable: false,
|
|
287
|
+
useVotingUnits: false,
|
|
288
|
+
cannotBeRemoved: true
|
|
289
|
+
});
|
|
290
|
+
|
|
291
|
+
// Organize the instructions for how this project will connect to other chains.
|
|
292
|
+
JBTokenMapping[] memory tokenMappings = new JBTokenMapping[](1);
|
|
293
|
+
tokenMappings[0] = JBTokenMapping({
|
|
294
|
+
localToken: JBConstants.NATIVE_TOKEN,
|
|
295
|
+
remoteToken: JBConstants.NATIVE_TOKEN,
|
|
296
|
+
minGas: 200_000,
|
|
297
|
+
minBridgeAmount: 0.01 ether
|
|
298
|
+
});
|
|
299
|
+
|
|
300
|
+
JBSuckerDeployerConfig[] memory suckerDeployerConfigurations;
|
|
301
|
+
if (block.chainid == 1 || block.chainid == 11_155_111) {
|
|
302
|
+
suckerDeployerConfigurations = new JBSuckerDeployerConfig[](3);
|
|
303
|
+
// OP
|
|
304
|
+
suckerDeployerConfigurations[0] =
|
|
305
|
+
JBSuckerDeployerConfig({deployer: suckers.optimismDeployer, mappings: tokenMappings});
|
|
306
|
+
|
|
307
|
+
suckerDeployerConfigurations[1] =
|
|
308
|
+
JBSuckerDeployerConfig({deployer: suckers.baseDeployer, mappings: tokenMappings});
|
|
309
|
+
|
|
310
|
+
suckerDeployerConfigurations[2] =
|
|
311
|
+
JBSuckerDeployerConfig({deployer: suckers.arbitrumDeployer, mappings: tokenMappings});
|
|
312
|
+
} else {
|
|
313
|
+
suckerDeployerConfigurations = new JBSuckerDeployerConfig[](1);
|
|
314
|
+
// L2 -> Mainnet
|
|
315
|
+
suckerDeployerConfigurations[0] = JBSuckerDeployerConfig({
|
|
316
|
+
deployer: address(suckers.optimismDeployer) != address(0)
|
|
317
|
+
? suckers.optimismDeployer
|
|
318
|
+
: address(suckers.baseDeployer) != address(0) ? suckers.baseDeployer : suckers.arbitrumDeployer,
|
|
319
|
+
mappings: tokenMappings
|
|
320
|
+
});
|
|
321
|
+
|
|
322
|
+
if (address(suckerDeployerConfigurations[0].deployer) == address(0)) {
|
|
323
|
+
revert("L2 > L1 Sucker is not configured");
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
// Specify all sucker deployments.
|
|
328
|
+
REVSuckerDeploymentConfig memory suckerDeploymentConfiguration =
|
|
329
|
+
REVSuckerDeploymentConfig({deployerConfigurations: suckerDeployerConfigurations, salt: SUCKER_SALT});
|
|
330
|
+
|
|
331
|
+
return BannyverseRevnetConfig({
|
|
332
|
+
configuration: revnetConfiguration,
|
|
333
|
+
terminalConfigurations: terminalConfigurations,
|
|
334
|
+
suckerDeploymentConfiguration: suckerDeploymentConfiguration,
|
|
335
|
+
hookConfiguration: REVDeploy721TiersHookConfig({
|
|
336
|
+
baseline721HookConfiguration: JBDeploy721TiersHookConfig({
|
|
337
|
+
name: "Banny Retail",
|
|
338
|
+
symbol: "BANNY",
|
|
339
|
+
baseUri: BASE_URI,
|
|
340
|
+
tokenUriResolver: IJB721TokenUriResolver(address(0)), // This will be replaced once we know the
|
|
341
|
+
// address.
|
|
342
|
+
contractUri: "https://jbm.infura-ipfs.io/ipfs/Qmd2hgb1E4caEB51VvoC3GvonhwkCoVyXjJ3zqsCxHPTKK",
|
|
343
|
+
tiersConfig: JB721InitTiersConfig({
|
|
344
|
+
tiers: tiers, currency: ETH_CURRENCY, decimals: DECIMALS, prices: core.prices
|
|
345
|
+
}),
|
|
346
|
+
reserveBeneficiary: address(0),
|
|
347
|
+
flags: JB721TiersHookFlags({
|
|
348
|
+
noNewTiersWithReserves: false,
|
|
349
|
+
noNewTiersWithVotes: false,
|
|
350
|
+
noNewTiersWithOwnerMinting: false,
|
|
351
|
+
preventOverspending: false
|
|
352
|
+
})
|
|
353
|
+
}),
|
|
354
|
+
salt: HOOK_SALT,
|
|
355
|
+
splitOperatorCanAdjustTiers: true,
|
|
356
|
+
splitOperatorCanUpdateMetadata: true,
|
|
357
|
+
splitOperatorCanMint: true,
|
|
358
|
+
splitOperatorCanIncreaseDiscountPercent: true
|
|
359
|
+
})
|
|
360
|
+
});
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
function deploy() public sphinx {
|
|
364
|
+
// Deploy the Banny URI Resolver.
|
|
365
|
+
Banny721TokenUriResolver resolver;
|
|
366
|
+
|
|
367
|
+
string memory _BANNY_BODY =
|
|
368
|
+
'<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>';
|
|
369
|
+
string memory _DEFAULT_NECKLACE =
|
|
370
|
+
'<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>';
|
|
371
|
+
string memory _DEFAULT_MOUTH =
|
|
372
|
+
'<g class="o"><path d="M183 160v-4h-20v4h-3v3h3v4h24v-7h-4zm-13 3v-3h10v3h-10z" fill="#ad71c8"/><path d="M170 160h10v3h-10z"/></g>';
|
|
373
|
+
string memory _DEFAULT_STANDARD_EYES =
|
|
374
|
+
'<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>';
|
|
375
|
+
string memory _DEFAULT_ALIEN_EYES =
|
|
376
|
+
'<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>';
|
|
377
|
+
{
|
|
378
|
+
// Perform the check for the resolver..
|
|
379
|
+
(address _resolver, bool _resolverIsDeployed) = _isDeployed(
|
|
380
|
+
RESOLVER_SALT,
|
|
381
|
+
type(Banny721TokenUriResolver).creationCode,
|
|
382
|
+
abi.encode(
|
|
383
|
+
_BANNY_BODY,
|
|
384
|
+
_DEFAULT_NECKLACE,
|
|
385
|
+
_DEFAULT_MOUTH,
|
|
386
|
+
_DEFAULT_STANDARD_EYES,
|
|
387
|
+
_DEFAULT_ALIEN_EYES,
|
|
388
|
+
OPERATOR,
|
|
389
|
+
TRUSTED_FORWARDER
|
|
390
|
+
)
|
|
391
|
+
);
|
|
392
|
+
// Deploy it if it has not been deployed yet.
|
|
393
|
+
resolver = !_resolverIsDeployed
|
|
394
|
+
? new Banny721TokenUriResolver{salt: RESOLVER_SALT}(
|
|
395
|
+
_BANNY_BODY,
|
|
396
|
+
_DEFAULT_NECKLACE,
|
|
397
|
+
_DEFAULT_MOUTH,
|
|
398
|
+
_DEFAULT_STANDARD_EYES,
|
|
399
|
+
_DEFAULT_ALIEN_EYES,
|
|
400
|
+
OPERATOR,
|
|
401
|
+
TRUSTED_FORWARDER
|
|
402
|
+
)
|
|
403
|
+
: Banny721TokenUriResolver(_resolver);
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
// Update our config with its address.
|
|
407
|
+
bannyverseConfig.hookConfiguration.baseline721HookConfiguration.tokenUriResolver = resolver;
|
|
408
|
+
|
|
409
|
+
// Deploy the $BANNY Revnet.
|
|
410
|
+
revnet.basic_deployer
|
|
411
|
+
.deployWith721sFor({
|
|
412
|
+
revnetId: 0,
|
|
413
|
+
configuration: bannyverseConfig.configuration,
|
|
414
|
+
terminalConfigurations: bannyverseConfig.terminalConfigurations,
|
|
415
|
+
suckerDeploymentConfiguration: bannyverseConfig.suckerDeploymentConfiguration,
|
|
416
|
+
tiered721HookConfiguration: bannyverseConfig.hookConfiguration,
|
|
417
|
+
allowedPosts: new REVCroptopAllowedPost[](0)
|
|
418
|
+
});
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
function _isDeployed(
|
|
422
|
+
bytes32 salt,
|
|
423
|
+
bytes memory creationCode,
|
|
424
|
+
bytes memory arguments
|
|
425
|
+
)
|
|
426
|
+
internal
|
|
427
|
+
view
|
|
428
|
+
returns (address, bool)
|
|
429
|
+
{
|
|
430
|
+
address _deployedTo = vm.computeCreate2Address({
|
|
431
|
+
salt: salt,
|
|
432
|
+
initCodeHash: keccak256(abi.encodePacked(creationCode, arguments)),
|
|
433
|
+
// Arachnid/deterministic-deployment-proxy address.
|
|
434
|
+
deployer: address(0x4e59b44847b379578588920cA78FbF26c0B4956C)
|
|
435
|
+
});
|
|
436
|
+
|
|
437
|
+
// Return if code is already present at this address.
|
|
438
|
+
return (_deployedTo, address(_deployedTo).code.length != 0);
|
|
439
|
+
}
|
|
440
|
+
}
|