@croptop/core-v6 0.0.2 → 0.0.4
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/foundry.lock +11 -0
- package/package.json +8 -7
- package/script/ConfigureFeeProject.s.sol +44 -73
- package/script/Deploy.s.sol +7 -7
- package/script/helpers/CroptopDeploymentLib.sol +3 -3
- package/src/CTPublisher.sol +1 -1
- package/src/interfaces/ICTPublisher.sol +1 -0
- package/src/structs/CTPost.sol +1 -1
- package/test/CTPublisher.t.sol +11 -11
- package/test/CroptopAttacks.t.sol +13 -13
- package/test/Fork.t.sol +10 -10
- package/test/Test_MetadataGeneration.t.sol +2 -2
package/foundry.lock
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@croptop/core-v6",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -16,16 +16,17 @@
|
|
|
16
16
|
"artifacts": "source ./.env && npx sphinx artifacts --org-id 'ea165b21-7cdc-4d7b-be59-ecdd4c26bee4' --project-name 'croptop-core-v5'"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@bananapus/
|
|
20
|
-
"@bananapus/
|
|
21
|
-
"@bananapus/
|
|
22
|
-
"@bananapus/ownable-v6": "^0.0.
|
|
23
|
-
"@bananapus/
|
|
24
|
-
"@bananapus/
|
|
19
|
+
"@bananapus/721-hook-v6": "^0.0.3",
|
|
20
|
+
"@bananapus/buyback-hook-v6": "^0.0.2",
|
|
21
|
+
"@bananapus/core-v6": "^0.0.4",
|
|
22
|
+
"@bananapus/ownable-v6": "^0.0.2",
|
|
23
|
+
"@bananapus/permission-ids-v6": "^0.0.2",
|
|
24
|
+
"@bananapus/suckers-v6": "^0.0.2",
|
|
25
25
|
"@bananapus/swap-terminal-v6": "^0.0.2",
|
|
26
26
|
"@openzeppelin/contracts": "^5.2.0"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
+
"@rev-net/core-v6": "^0.0.2",
|
|
29
30
|
"@sphinx-labs/plugins": "^0.33.1"
|
|
30
31
|
}
|
|
31
32
|
}
|
|
@@ -1,55 +1,48 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
pragma solidity 0.8.23;
|
|
3
3
|
|
|
4
|
-
import "@bananapus/721-hook-
|
|
5
|
-
import "@bananapus/
|
|
6
|
-
import "@bananapus/
|
|
7
|
-
import "@bananapus/
|
|
8
|
-
import "@
|
|
9
|
-
import "@rev-net/core-v5/script/helpers/RevnetCoreDeploymentLib.sol";
|
|
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 "@bananapus/swap-terminal-v6/script/helpers/SwapTerminalDeploymentLib.sol";
|
|
8
|
+
import "@rev-net/core-v6/script/helpers/RevnetCoreDeploymentLib.sol";
|
|
10
9
|
import "./helpers/CroptopDeploymentLib.sol";
|
|
11
10
|
|
|
12
11
|
import {Sphinx} from "@sphinx-labs/contracts/SphinxPlugin.sol";
|
|
13
12
|
import {Script} from "forge-std/Script.sol";
|
|
14
13
|
|
|
15
|
-
import {IJB721TokenUriResolver} from "@bananapus/721-hook-
|
|
16
|
-
import {JBDeploy721TiersHookConfig} from "@bananapus/721-hook-
|
|
17
|
-
import {JB721InitTiersConfig} from "@bananapus/721-hook-
|
|
18
|
-
import {JB721TierConfig} from "@bananapus/721-hook-
|
|
19
|
-
import {JB721TiersHookFlags} from "@bananapus/721-hook-
|
|
20
|
-
import {IJBPrices} from "@bananapus/core-
|
|
21
|
-
import {IJBSplitHook} from "@bananapus/core-
|
|
22
|
-
import {IJBTerminal} from "@bananapus/core-
|
|
23
|
-
import {JBAccountingContext} from "@bananapus/core-
|
|
24
|
-
import {JBTerminalConfig} from "@bananapus/core-
|
|
25
|
-
import {JBConstants} from "@bananapus/core-
|
|
26
|
-
import {JBSplit} from "@bananapus/core-
|
|
27
|
-
import {JBCurrencyIds} from "@bananapus/core-
|
|
28
|
-
import {JBSuckerDeployerConfig} from "@bananapus/suckers-
|
|
29
|
-
import {JBTokenMapping} from "@bananapus/suckers-
|
|
30
|
-
import {REVAutoIssuance} from "@rev-net/core-
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {REVLoanSource} from "@rev-net/core-v5/src/structs/REVLoanSource.sol";
|
|
38
|
-
import {REVStageConfig} from "@rev-net/core-v5/src/structs/REVStageConfig.sol";
|
|
39
|
-
import {REVSuckerDeploymentConfig} from "@rev-net/core-v5/src/structs/REVSuckerDeploymentConfig.sol";
|
|
14
|
+
import {IJB721TokenUriResolver} from "@bananapus/721-hook-v6/src/interfaces/IJB721TokenUriResolver.sol";
|
|
15
|
+
import {JBDeploy721TiersHookConfig} from "@bananapus/721-hook-v6/src/structs/JBDeploy721TiersHookConfig.sol";
|
|
16
|
+
import {JB721InitTiersConfig} from "@bananapus/721-hook-v6/src/structs/JB721InitTiersConfig.sol";
|
|
17
|
+
import {JB721TierConfig} from "@bananapus/721-hook-v6/src/structs/JB721TierConfig.sol";
|
|
18
|
+
import {JB721TiersHookFlags} from "@bananapus/721-hook-v6/src/structs/JB721TiersHookFlags.sol";
|
|
19
|
+
import {IJBPrices} from "@bananapus/core-v6/src/interfaces/IJBPrices.sol";
|
|
20
|
+
import {IJBSplitHook} from "@bananapus/core-v6/src/interfaces/IJBSplitHook.sol";
|
|
21
|
+
import {IJBTerminal} from "@bananapus/core-v6/src/interfaces/IJBTerminal.sol";
|
|
22
|
+
import {JBAccountingContext} from "@bananapus/core-v6/src/structs/JBAccountingContext.sol";
|
|
23
|
+
import {JBTerminalConfig} from "@bananapus/core-v6/src/structs/JBTerminalConfig.sol";
|
|
24
|
+
import {JBConstants} from "@bananapus/core-v6/src/libraries/JBConstants.sol";
|
|
25
|
+
import {JBSplit} from "@bananapus/core-v6/src/structs/JBSplit.sol";
|
|
26
|
+
import {JBCurrencyIds} from "@bananapus/core-v6/src/libraries/JBCurrencyIds.sol";
|
|
27
|
+
import {JBSuckerDeployerConfig} from "@bananapus/suckers-v6/src/structs/JBSuckerDeployerConfig.sol";
|
|
28
|
+
import {JBTokenMapping} from "@bananapus/suckers-v6/src/structs/JBTokenMapping.sol";
|
|
29
|
+
import {REVAutoIssuance} from "@rev-net/core-v6/src/structs/REVAutoIssuance.sol";
|
|
30
|
+
import {REVConfig} from "@rev-net/core-v6/src/structs/REVConfig.sol";
|
|
31
|
+
import {REVCroptopAllowedPost} from "@rev-net/core-v6/src/structs/REVCroptopAllowedPost.sol";
|
|
32
|
+
import {REVDeploy721TiersHookConfig} from "@rev-net/core-v6/src/structs/REVDeploy721TiersHookConfig.sol";
|
|
33
|
+
import {REVDescription} from "@rev-net/core-v6/src/structs/REVDescription.sol";
|
|
34
|
+
import {REVStageConfig} from "@rev-net/core-v6/src/structs/REVStageConfig.sol";
|
|
35
|
+
import {REVSuckerDeploymentConfig} from "@rev-net/core-v6/src/structs/REVSuckerDeploymentConfig.sol";
|
|
40
36
|
|
|
41
37
|
struct FeeProjectConfig {
|
|
42
38
|
REVConfig configuration;
|
|
43
39
|
JBTerminalConfig[] terminalConfigurations;
|
|
44
|
-
REVBuybackHookConfig buybackHookConfiguration;
|
|
45
40
|
REVSuckerDeploymentConfig suckerDeploymentConfiguration;
|
|
46
41
|
REVDeploy721TiersHookConfig hookConfiguration;
|
|
47
42
|
REVCroptopAllowedPost[] allowedPosts;
|
|
48
43
|
}
|
|
49
44
|
|
|
50
45
|
contract ConfigureFeeProjectScript is Script, Sphinx {
|
|
51
|
-
/// @notice tracks the deployment of the buyback hook.
|
|
52
|
-
BuybackDeployment buybackHook;
|
|
53
46
|
/// @notice tracks the deployment of the core contracts for the chain we are deploying to.
|
|
54
47
|
CoreDeployment core;
|
|
55
48
|
/// @notice tracks the latest croptop deployment.
|
|
@@ -87,7 +80,7 @@ contract ConfigureFeeProjectScript is Script, Sphinx {
|
|
|
87
80
|
|
|
88
81
|
function configureSphinx() public override {
|
|
89
82
|
// TODO: Update to contain croptop devs.
|
|
90
|
-
sphinxConfig.projectName = "croptop-core-
|
|
83
|
+
sphinxConfig.projectName = "croptop-core-v6";
|
|
91
84
|
sphinxConfig.mainnets = ["ethereum", "optimism", "base", "arbitrum"];
|
|
92
85
|
sphinxConfig.testnets = ["ethereum_sepolia", "optimism_sepolia", "base_sepolia", "arbitrum_sepolia"];
|
|
93
86
|
}
|
|
@@ -96,26 +89,26 @@ contract ConfigureFeeProjectScript is Script, Sphinx {
|
|
|
96
89
|
// Get the deployment addresses for the nana CORE for this chain.
|
|
97
90
|
// We want to do this outside of the `sphinx` modifier.
|
|
98
91
|
core = CoreDeploymentLib.getDeployment(
|
|
99
|
-
vm.envOr("NANA_CORE_DEPLOYMENT_PATH", string("node_modules/@bananapus/core-
|
|
92
|
+
vm.envOr("NANA_CORE_DEPLOYMENT_PATH", string("node_modules/@bananapus/core-v6/deployments/"))
|
|
100
93
|
);
|
|
101
94
|
// Get the deployment addresses for the croptop contracts for this chain.
|
|
102
95
|
croptop = CroptopDeploymentLib.getDeployment(vm.envOr("CROPTOP_DEPLOYMENT_PATH", string("deployments/")));
|
|
103
96
|
// Get the deployment addresses for the 721 hook contracts for this chain.
|
|
104
97
|
hook = Hook721DeploymentLib.getDeployment(
|
|
105
|
-
vm.envOr("NANA_721_DEPLOYMENT_PATH", string("node_modules/@bananapus/721-hook-
|
|
98
|
+
vm.envOr("NANA_721_DEPLOYMENT_PATH", string("node_modules/@bananapus/721-hook-v6/deployments/"))
|
|
106
99
|
);
|
|
107
|
-
// Get the deployment addresses for the
|
|
100
|
+
// Get the deployment addresses for the revnet contracts for this chain.
|
|
108
101
|
revnet = RevnetCoreDeploymentLib.getDeployment(
|
|
109
|
-
vm.envOr("REVNET_CORE_DEPLOYMENT_PATH", string("node_modules/@rev-net/core-
|
|
102
|
+
vm.envOr("REVNET_CORE_DEPLOYMENT_PATH", string("node_modules/@rev-net/core-v6/deployments/"))
|
|
110
103
|
);
|
|
111
104
|
// Get the deployment addresses for the suckers contracts for this chain.
|
|
112
105
|
suckers = SuckerDeploymentLib.getDeployment(
|
|
113
|
-
vm.envOr("NANA_SUCKERS_DEPLOYMENT_PATH", string("node_modules/@bananapus/suckers-
|
|
106
|
+
vm.envOr("NANA_SUCKERS_DEPLOYMENT_PATH", string("node_modules/@bananapus/suckers-v6/deployments/"))
|
|
114
107
|
);
|
|
115
|
-
// Get the deployment addresses for the
|
|
108
|
+
// Get the deployment addresses for the swap terminal contracts for this chain.
|
|
116
109
|
swapTerminal = SwapTerminalDeploymentLib.getDeployment(
|
|
117
110
|
vm.envOr(
|
|
118
|
-
"NANA_SWAP_TERMINAL_DEPLOYMENT_PATH", string("node_modules/@bananapus/swap-terminal-
|
|
111
|
+
"NANA_SWAP_TERMINAL_DEPLOYMENT_PATH", string("node_modules/@bananapus/swap-terminal-v6/deployments/")
|
|
119
112
|
)
|
|
120
113
|
);
|
|
121
114
|
|
|
@@ -204,33 +197,14 @@ contract ConfigureFeeProjectScript is Script, Sphinx {
|
|
|
204
197
|
extraMetadata: 4 // Allow adding suckers.
|
|
205
198
|
});
|
|
206
199
|
|
|
207
|
-
// The projects loan configuration.
|
|
208
|
-
REVLoanSource[] memory loanSources = new REVLoanSource[](1);
|
|
209
|
-
loanSources[0] = REVLoanSource({token: JBConstants.NATIVE_TOKEN, terminal: core.terminal});
|
|
210
|
-
|
|
211
200
|
// The project's revnet configuration
|
|
212
201
|
REVConfig memory revnetConfiguration = REVConfig({
|
|
213
202
|
description: REVDescription(NAME, SYMBOL, PROJECT_URI, ERC20_SALT),
|
|
214
203
|
baseCurrency: ETH_CURRENCY,
|
|
215
204
|
splitOperator: OPERATOR,
|
|
216
|
-
stageConfigurations: stageConfigurations
|
|
217
|
-
loanSources: loanSources,
|
|
218
|
-
loans: address(revnet.loans)
|
|
205
|
+
stageConfigurations: stageConfigurations
|
|
219
206
|
});
|
|
220
207
|
|
|
221
|
-
REVBuybackHookConfig memory buybackHookConfiguration;
|
|
222
|
-
{
|
|
223
|
-
// The project's buyback hook configuration.
|
|
224
|
-
REVBuybackPoolConfig[] memory buybackPoolConfigurations = new REVBuybackPoolConfig[](1);
|
|
225
|
-
buybackPoolConfigurations[0] =
|
|
226
|
-
REVBuybackPoolConfig({token: JBConstants.NATIVE_TOKEN, fee: 10_000, twapWindow: 2 days});
|
|
227
|
-
buybackHookConfiguration = REVBuybackHookConfig({
|
|
228
|
-
dataHook: buybackHook.registry,
|
|
229
|
-
hookToConfigure: buybackHook.hook,
|
|
230
|
-
poolConfigurations: buybackPoolConfigurations
|
|
231
|
-
});
|
|
232
|
-
}
|
|
233
|
-
|
|
234
208
|
// Organize the instructions for how this project will connect to other chains.
|
|
235
209
|
JBTokenMapping[] memory tokenMappings = new JBTokenMapping[](1);
|
|
236
210
|
tokenMappings[0] = JBTokenMapping({
|
|
@@ -315,7 +289,6 @@ contract ConfigureFeeProjectScript is Script, Sphinx {
|
|
|
315
289
|
return FeeProjectConfig({
|
|
316
290
|
configuration: revnetConfiguration,
|
|
317
291
|
terminalConfigurations: terminalConfigurations,
|
|
318
|
-
buybackHookConfiguration: buybackHookConfiguration,
|
|
319
292
|
suckerDeploymentConfiguration: suckerDeploymentConfiguration,
|
|
320
293
|
hookConfiguration: REVDeploy721TiersHookConfig({
|
|
321
294
|
baseline721HookConfiguration: JBDeploy721TiersHookConfig({
|
|
@@ -352,16 +325,14 @@ contract ConfigureFeeProjectScript is Script, Sphinx {
|
|
|
352
325
|
core.projects.approve(address(revnet.basic_deployer), FEE_PROJECT_ID);
|
|
353
326
|
|
|
354
327
|
// Deploy the NANA fee project.
|
|
355
|
-
revnet.basic_deployer
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
allowedPosts: feeProjectConfig.allowedPosts
|
|
364
|
-
});
|
|
328
|
+
revnet.basic_deployer.deployWith721sFor({
|
|
329
|
+
revnetId: FEE_PROJECT_ID,
|
|
330
|
+
configuration: feeProjectConfig.configuration,
|
|
331
|
+
terminalConfigurations: feeProjectConfig.terminalConfigurations,
|
|
332
|
+
suckerDeploymentConfiguration: feeProjectConfig.suckerDeploymentConfiguration,
|
|
333
|
+
tiered721HookConfiguration: feeProjectConfig.hookConfiguration,
|
|
334
|
+
allowedPosts: feeProjectConfig.allowedPosts
|
|
335
|
+
});
|
|
365
336
|
}
|
|
366
337
|
|
|
367
338
|
function _isDeployed(
|
package/script/Deploy.s.sol
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
pragma solidity 0.8.23;
|
|
3
3
|
|
|
4
|
-
import "@bananapus/721-hook-
|
|
5
|
-
import "@bananapus/core-
|
|
6
|
-
import "@bananapus/suckers-
|
|
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
7
|
|
|
8
8
|
import {Sphinx} from "@sphinx-labs/contracts/SphinxPlugin.sol";
|
|
9
9
|
import {Script} from "forge-std/Script.sol";
|
|
@@ -31,7 +31,7 @@ contract DeployScript is Script, Sphinx {
|
|
|
31
31
|
address TRUSTED_FORWARDER;
|
|
32
32
|
|
|
33
33
|
function configureSphinx() public override {
|
|
34
|
-
sphinxConfig.projectName = "croptop-core-
|
|
34
|
+
sphinxConfig.projectName = "croptop-core-v6";
|
|
35
35
|
sphinxConfig.mainnets = ["ethereum", "optimism", "base", "arbitrum"];
|
|
36
36
|
sphinxConfig.testnets = ["ethereum_sepolia", "optimism_sepolia", "base_sepolia", "arbitrum_sepolia"];
|
|
37
37
|
}
|
|
@@ -40,15 +40,15 @@ contract DeployScript is Script, Sphinx {
|
|
|
40
40
|
// Get the deployment addresses for the nana CORE for this chain.
|
|
41
41
|
// We want to do this outside of the `sphinx` modifier.
|
|
42
42
|
core = CoreDeploymentLib.getDeployment(
|
|
43
|
-
vm.envOr("NANA_CORE_DEPLOYMENT_PATH", string("node_modules/@bananapus/core-
|
|
43
|
+
vm.envOr("NANA_CORE_DEPLOYMENT_PATH", string("node_modules/@bananapus/core-v6/deployments/"))
|
|
44
44
|
);
|
|
45
45
|
// Get the deployment addresses for the 721 hook contracts for this chain.
|
|
46
46
|
hook = Hook721DeploymentLib.getDeployment(
|
|
47
|
-
vm.envOr("NANA_721_DEPLOYMENT_PATH", string("node_modules/@bananapus/721-hook-
|
|
47
|
+
vm.envOr("NANA_721_DEPLOYMENT_PATH", string("node_modules/@bananapus/721-hook-v6/deployments/"))
|
|
48
48
|
);
|
|
49
49
|
// Get the deployment addresses for the suckers contracts for this chain.
|
|
50
50
|
suckers = SuckerDeploymentLib.getDeployment(
|
|
51
|
-
vm.envOr("NANA_SUCKERS_DEPLOYMENT_PATH", string("node_modules/@bananapus/suckers-
|
|
51
|
+
vm.envOr("NANA_SUCKERS_DEPLOYMENT_PATH", string("node_modules/@bananapus/suckers-v6/deployments/"))
|
|
52
52
|
);
|
|
53
53
|
|
|
54
54
|
// We use the same trusted forwarder as the core deployment.
|
|
@@ -47,10 +47,10 @@ library CroptopDeploymentLib {
|
|
|
47
47
|
view
|
|
48
48
|
returns (CroptopDeployment memory deployment)
|
|
49
49
|
{
|
|
50
|
-
deployment.publisher = CTPublisher(_getDeploymentAddress(path, "croptop-core-
|
|
51
|
-
deployment.deployer = CTDeployer(_getDeploymentAddress(path, "croptop-core-
|
|
50
|
+
deployment.publisher = CTPublisher(_getDeploymentAddress(path, "croptop-core-v6", network_name, "CTPublisher"));
|
|
51
|
+
deployment.deployer = CTDeployer(_getDeploymentAddress(path, "croptop-core-v6", network_name, "CTDeployer"));
|
|
52
52
|
deployment.project_owner =
|
|
53
|
-
CTProjectOwner(_getDeploymentAddress(path, "croptop-core-
|
|
53
|
+
CTProjectOwner(_getDeploymentAddress(path, "croptop-core-v6", network_name, "CTProjectOwner"));
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
/// @notice Get the address of a contract that was deployed by the Deploy script.
|
package/src/CTPublisher.sol
CHANGED
|
@@ -333,7 +333,7 @@ contract CTPublisher is JBPermissioned, ERC2771Context, ICTPublisher {
|
|
|
333
333
|
|
|
334
334
|
// Add the new tiers.
|
|
335
335
|
// slither-disable-next-line reentrancy-events
|
|
336
|
-
hook.adjustTiers({
|
|
336
|
+
hook.adjustTiers({tiersToAdd: tiersToAdd, tierIdsToRemove: new uint256[](0)});
|
|
337
337
|
|
|
338
338
|
// Keep a reference to the metadata ID target.
|
|
339
339
|
address metadataIdTarget = hook.METADATA_ID_TARGET();
|
|
@@ -45,6 +45,7 @@ interface ICTPublisher {
|
|
|
45
45
|
/// @return minimumPrice The minimum price a poster must pay to publish a new NFT.
|
|
46
46
|
/// @return minimumTotalSupply The minimum total supply a poster must set for a new NFT.
|
|
47
47
|
/// @return maximumTotalSupply The maximum total supply allowed for a new NFT. 0 means no limit.
|
|
48
|
+
/// @return maximumSplitPercent The maximum split percent allowed for a new NFT.
|
|
48
49
|
/// @return allowedAddresses The addresses allowed to post. Empty if all addresses are allowed.
|
|
49
50
|
function allowanceFor(
|
|
50
51
|
address hook,
|
package/src/structs/CTPost.sol
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
pragma solidity ^0.8.0;
|
|
3
3
|
|
|
4
|
-
import {JBSplit} from "@bananapus/core-
|
|
4
|
+
import {JBSplit} from "@bananapus/core-v6/src/structs/JBSplit.sol";
|
|
5
5
|
|
|
6
6
|
/// @notice A post to be published.
|
|
7
7
|
/// @custom:member encodedIPFSUri The encoded IPFS URI of the post that is being published.
|
package/test/CTPublisher.t.sol
CHANGED
|
@@ -3,16 +3,16 @@ pragma solidity 0.8.23;
|
|
|
3
3
|
|
|
4
4
|
import "forge-std/Test.sol";
|
|
5
5
|
|
|
6
|
-
import {IJBPermissions} from "@bananapus/core-
|
|
7
|
-
import {IJBDirectory} from "@bananapus/core-
|
|
8
|
-
import {IJBSplitHook} from "@bananapus/core-
|
|
9
|
-
import {IJBOwnable} from "@bananapus/ownable-
|
|
10
|
-
import {IJB721TiersHook} from "@bananapus/721-hook-
|
|
11
|
-
import {IJB721TiersHookStore} from "@bananapus/721-hook-
|
|
12
|
-
import {
|
|
13
|
-
import {JBConstants} from "@bananapus/core-
|
|
14
|
-
import {JBSplit} from "@bananapus/core-
|
|
15
|
-
import {JBPermissionIds} from "@bananapus/permission-ids-
|
|
6
|
+
import {IJBPermissions} from "@bananapus/core-v6/src/interfaces/IJBPermissions.sol";
|
|
7
|
+
import {IJBDirectory} from "@bananapus/core-v6/src/interfaces/IJBDirectory.sol";
|
|
8
|
+
import {IJBSplitHook} from "@bananapus/core-v6/src/interfaces/IJBSplitHook.sol";
|
|
9
|
+
import {IJBOwnable} from "@bananapus/ownable-v6/src/interfaces/IJBOwnable.sol";
|
|
10
|
+
import {IJB721TiersHook} from "@bananapus/721-hook-v6/src/interfaces/IJB721TiersHook.sol";
|
|
11
|
+
import {IJB721TiersHookStore} from "@bananapus/721-hook-v6/src/interfaces/IJB721TiersHookStore.sol";
|
|
12
|
+
import {IJB721TiersHook} from "@bananapus/721-hook-v6/src/interfaces/IJB721TiersHook.sol";
|
|
13
|
+
import {JBConstants} from "@bananapus/core-v6/src/libraries/JBConstants.sol";
|
|
14
|
+
import {JBSplit} from "@bananapus/core-v6/src/structs/JBSplit.sol";
|
|
15
|
+
import {JBPermissionIds} from "@bananapus/permission-ids-v6/src/JBPermissionIds.sol";
|
|
16
16
|
|
|
17
17
|
import {CTPublisher} from "../src/CTPublisher.sol";
|
|
18
18
|
import {CTAllowedPost} from "../src/structs/CTAllowedPost.sol";
|
|
@@ -41,7 +41,7 @@ contract TestCTPublisher is Test {
|
|
|
41
41
|
vm.mockCall(hookAddr, abi.encodeWithSelector(IJBOwnable.owner.selector), abi.encode(hookOwner));
|
|
42
42
|
|
|
43
43
|
// Mock hook.PROJECT_ID() for permission checks.
|
|
44
|
-
vm.mockCall(hookAddr, abi.encodeWithSelector(
|
|
44
|
+
vm.mockCall(hookAddr, abi.encodeWithSelector(IJB721TiersHook.PROJECT_ID.selector), abi.encode(hookProjectId));
|
|
45
45
|
|
|
46
46
|
// Mock hook.STORE().
|
|
47
47
|
vm.mockCall(hookAddr, abi.encodeWithSelector(IJB721TiersHook.STORE.selector), abi.encode(hookStoreAddr));
|
|
@@ -3,18 +3,18 @@ pragma solidity 0.8.23;
|
|
|
3
3
|
|
|
4
4
|
import "forge-std/Test.sol";
|
|
5
5
|
|
|
6
|
-
import {IJBPermissions} from "@bananapus/core-
|
|
7
|
-
import {IJBDirectory} from "@bananapus/core-
|
|
8
|
-
import {IJBTerminal} from "@bananapus/core-
|
|
9
|
-
import {IJBSplitHook} from "@bananapus/core-
|
|
10
|
-
import {IJBOwnable} from "@bananapus/ownable-
|
|
11
|
-
import {IJB721TiersHook} from "@bananapus/721-hook-
|
|
12
|
-
import {IJB721TiersHookStore} from "@bananapus/721-hook-
|
|
13
|
-
import {
|
|
14
|
-
import {JB721TierConfig} from "@bananapus/721-hook-
|
|
15
|
-
import {JBConstants} from "@bananapus/core-
|
|
16
|
-
import {JBSplit} from "@bananapus/core-
|
|
17
|
-
import {JBPermissionIds} from "@bananapus/permission-ids-
|
|
6
|
+
import {IJBPermissions} from "@bananapus/core-v6/src/interfaces/IJBPermissions.sol";
|
|
7
|
+
import {IJBDirectory} from "@bananapus/core-v6/src/interfaces/IJBDirectory.sol";
|
|
8
|
+
import {IJBTerminal} from "@bananapus/core-v6/src/interfaces/IJBTerminal.sol";
|
|
9
|
+
import {IJBSplitHook} from "@bananapus/core-v6/src/interfaces/IJBSplitHook.sol";
|
|
10
|
+
import {IJBOwnable} from "@bananapus/ownable-v6/src/interfaces/IJBOwnable.sol";
|
|
11
|
+
import {IJB721TiersHook} from "@bananapus/721-hook-v6/src/interfaces/IJB721TiersHook.sol";
|
|
12
|
+
import {IJB721TiersHookStore} from "@bananapus/721-hook-v6/src/interfaces/IJB721TiersHookStore.sol";
|
|
13
|
+
import {IJB721TiersHook} from "@bananapus/721-hook-v6/src/interfaces/IJB721TiersHook.sol";
|
|
14
|
+
import {JB721TierConfig} from "@bananapus/721-hook-v6/src/structs/JB721TierConfig.sol";
|
|
15
|
+
import {JBConstants} from "@bananapus/core-v6/src/libraries/JBConstants.sol";
|
|
16
|
+
import {JBSplit} from "@bananapus/core-v6/src/structs/JBSplit.sol";
|
|
17
|
+
import {JBPermissionIds} from "@bananapus/permission-ids-v6/src/JBPermissionIds.sol";
|
|
18
18
|
|
|
19
19
|
import {CTPublisher} from "../src/CTPublisher.sol";
|
|
20
20
|
import {CTAllowedPost} from "../src/structs/CTAllowedPost.sol";
|
|
@@ -45,7 +45,7 @@ contract CroptopAttacks is Test {
|
|
|
45
45
|
// Mock hook.owner().
|
|
46
46
|
vm.mockCall(hookAddr, abi.encodeWithSelector(IJBOwnable.owner.selector), abi.encode(hookOwner));
|
|
47
47
|
// Mock hook.PROJECT_ID().
|
|
48
|
-
vm.mockCall(hookAddr, abi.encodeWithSelector(
|
|
48
|
+
vm.mockCall(hookAddr, abi.encodeWithSelector(IJB721TiersHook.PROJECT_ID.selector), abi.encode(hookProjectId));
|
|
49
49
|
// Mock hook.STORE().
|
|
50
50
|
vm.mockCall(hookAddr, abi.encodeWithSelector(IJB721TiersHook.STORE.selector), abi.encode(hookStoreAddr));
|
|
51
51
|
|
package/test/Fork.t.sol
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
pragma solidity ^0.8.17;
|
|
3
3
|
|
|
4
|
-
import "@bananapus/721-hook-
|
|
5
|
-
import "@bananapus/core-
|
|
6
|
-
import "@bananapus/suckers-
|
|
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
7
|
|
|
8
8
|
import "./../src/CTDeployer.sol";
|
|
9
|
-
import {JBConstants} from "@bananapus/core-
|
|
10
|
-
import {JBSuckerDeployerConfig} from "@bananapus/suckers-
|
|
11
|
-
import {JBTokenMapping} from "@bananapus/suckers-
|
|
9
|
+
import {JBConstants} from "@bananapus/core-v6/src/libraries/JBConstants.sol";
|
|
10
|
+
import {JBSuckerDeployerConfig} from "@bananapus/suckers-v6/src/structs/JBSuckerDeployerConfig.sol";
|
|
11
|
+
import {JBTokenMapping} from "@bananapus/suckers-v6/src/structs/JBTokenMapping.sol";
|
|
12
12
|
import {CTProjectOwner} from "./../src/CTProjectOwner.sol";
|
|
13
13
|
import {CTPublisher} from "./../src/CTPublisher.sol";
|
|
14
14
|
|
|
@@ -34,15 +34,15 @@ contract ForkTest is Test {
|
|
|
34
34
|
// Get the deployment addresses for the nana CORE for this chain.
|
|
35
35
|
// We want to do this outside of the `sphinx` modifier.
|
|
36
36
|
core = CoreDeploymentLib.getDeployment(
|
|
37
|
-
vm.envOr("NANA_CORE_DEPLOYMENT_PATH", string("node_modules/@bananapus/core-
|
|
37
|
+
vm.envOr("NANA_CORE_DEPLOYMENT_PATH", string("node_modules/@bananapus/core-v6/deployments/"))
|
|
38
38
|
);
|
|
39
39
|
// Get the deployment addresses for the 721 hook contracts for this chain.
|
|
40
40
|
hook = Hook721DeploymentLib.getDeployment(
|
|
41
|
-
vm.envOr("NANA_721_DEPLOYMENT_PATH", string("node_modules/@bananapus/721-hook-
|
|
41
|
+
vm.envOr("NANA_721_DEPLOYMENT_PATH", string("node_modules/@bananapus/721-hook-v6/deployments/"))
|
|
42
42
|
);
|
|
43
43
|
// Get the deployment addresses for the suckers contracts for this chain.
|
|
44
44
|
suckers = SuckerDeploymentLib.getDeployment(
|
|
45
|
-
vm.envOr("NANA_SUCKERS_DEPLOYMENT_PATH", string("node_modules/@bananapus/suckers-
|
|
45
|
+
vm.envOr("NANA_SUCKERS_DEPLOYMENT_PATH", string("node_modules/@bananapus/suckers-v6/deployments/"))
|
|
46
46
|
);
|
|
47
47
|
|
|
48
48
|
// We use the same trusted forwarder as the core deployment.
|
|
@@ -95,7 +95,7 @@ contract ForkTest is Test {
|
|
|
95
95
|
tokens[0] = JBTokenMapping({
|
|
96
96
|
localToken: address(JBConstants.NATIVE_TOKEN),
|
|
97
97
|
minGas: 200_000,
|
|
98
|
-
remoteToken:
|
|
98
|
+
remoteToken: bytes32(uint256(uint160(JBConstants.NATIVE_TOKEN))),
|
|
99
99
|
minBridgeAmount: 0.001 ether
|
|
100
100
|
});
|
|
101
101
|
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
pragma solidity ^0.8.17;
|
|
3
3
|
|
|
4
4
|
import "forge-std/Test.sol";
|
|
5
|
-
import {JBMetadataResolver} from "@bananapus/core-
|
|
5
|
+
import {JBMetadataResolver} from "@bananapus/core-v6/src/libraries/JBMetadataResolver.sol";
|
|
6
6
|
|
|
7
|
-
import {MetadataResolverHelper} from "@bananapus/core-
|
|
7
|
+
import {MetadataResolverHelper} from "@bananapus/core-v6/test/helpers/MetadataResolverHelper.sol";
|
|
8
8
|
|
|
9
9
|
/// @notice Quick test to assert the creation of metadata while minting
|
|
10
10
|
/// @dev This test is not meant to be exhaustive, but to ensure that the metadata is valid.
|