@croptop/core-v6 0.0.2 → 0.0.3
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 +4 -4
- package/script/ConfigureFeeProject.s.sol +37 -37
- 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.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -16,10 +16,10 @@
|
|
|
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/core-v6": "^0.0.
|
|
20
|
-
"@bananapus/721-hook-v6": "^0.0.
|
|
19
|
+
"@bananapus/core-v6": "^0.0.3",
|
|
20
|
+
"@bananapus/721-hook-v6": "^0.0.2",
|
|
21
21
|
"@bananapus/permission-ids-v6": "^0.0.1",
|
|
22
|
-
"@bananapus/ownable-v6": "^0.0.
|
|
22
|
+
"@bananapus/ownable-v6": "^0.0.2",
|
|
23
23
|
"@bananapus/suckers-v6": "^0.0.1",
|
|
24
24
|
"@bananapus/buyback-hook-v6": "^0.0.1",
|
|
25
25
|
"@bananapus/swap-terminal-v6": "^0.0.2",
|
|
@@ -1,42 +1,42 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
pragma solidity 0.8.23;
|
|
3
3
|
|
|
4
|
-
import "@bananapus/721-hook-
|
|
5
|
-
import "@bananapus/buyback-hook-
|
|
6
|
-
import "@bananapus/core-
|
|
7
|
-
import "@bananapus/suckers-
|
|
8
|
-
import "@bananapus/swap-terminal-
|
|
9
|
-
import "@rev-net/core-
|
|
4
|
+
import "@bananapus/721-hook-v6/script/helpers/Hook721DeploymentLib.sol";
|
|
5
|
+
import "@bananapus/buyback-hook-v6/script/helpers/BuybackDeploymentLib.sol";
|
|
6
|
+
import "@bananapus/core-v6/script/helpers/CoreDeploymentLib.sol";
|
|
7
|
+
import "@bananapus/suckers-v6/script/helpers/SuckerDeploymentLib.sol";
|
|
8
|
+
import "@bananapus/swap-terminal-v6/script/helpers/SwapTerminalDeploymentLib.sol";
|
|
9
|
+
import "@rev-net/core-v6/script/helpers/RevnetCoreDeploymentLib.sol";
|
|
10
10
|
import "./helpers/CroptopDeploymentLib.sol";
|
|
11
11
|
|
|
12
12
|
import {Sphinx} from "@sphinx-labs/contracts/SphinxPlugin.sol";
|
|
13
13
|
import {Script} from "forge-std/Script.sol";
|
|
14
14
|
|
|
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 {REVBuybackHookConfig} from "@rev-net/core-
|
|
32
|
-
import {REVBuybackPoolConfig} from "@rev-net/core-
|
|
33
|
-
import {REVConfig} from "@rev-net/core-
|
|
34
|
-
import {REVCroptopAllowedPost} from "@rev-net/core-
|
|
35
|
-
import {REVDeploy721TiersHookConfig} from "@rev-net/core-
|
|
36
|
-
import {REVDescription} from "@rev-net/core-
|
|
37
|
-
import {REVLoanSource} from "@rev-net/core-
|
|
38
|
-
import {REVStageConfig} from "@rev-net/core-
|
|
39
|
-
import {REVSuckerDeploymentConfig} from "@rev-net/core-
|
|
15
|
+
import {IJB721TokenUriResolver} from "@bananapus/721-hook-v6/src/interfaces/IJB721TokenUriResolver.sol";
|
|
16
|
+
import {JBDeploy721TiersHookConfig} from "@bananapus/721-hook-v6/src/structs/JBDeploy721TiersHookConfig.sol";
|
|
17
|
+
import {JB721InitTiersConfig} from "@bananapus/721-hook-v6/src/structs/JB721InitTiersConfig.sol";
|
|
18
|
+
import {JB721TierConfig} from "@bananapus/721-hook-v6/src/structs/JB721TierConfig.sol";
|
|
19
|
+
import {JB721TiersHookFlags} from "@bananapus/721-hook-v6/src/structs/JB721TiersHookFlags.sol";
|
|
20
|
+
import {IJBPrices} from "@bananapus/core-v6/src/interfaces/IJBPrices.sol";
|
|
21
|
+
import {IJBSplitHook} from "@bananapus/core-v6/src/interfaces/IJBSplitHook.sol";
|
|
22
|
+
import {IJBTerminal} from "@bananapus/core-v6/src/interfaces/IJBTerminal.sol";
|
|
23
|
+
import {JBAccountingContext} from "@bananapus/core-v6/src/structs/JBAccountingContext.sol";
|
|
24
|
+
import {JBTerminalConfig} from "@bananapus/core-v6/src/structs/JBTerminalConfig.sol";
|
|
25
|
+
import {JBConstants} from "@bananapus/core-v6/src/libraries/JBConstants.sol";
|
|
26
|
+
import {JBSplit} from "@bananapus/core-v6/src/structs/JBSplit.sol";
|
|
27
|
+
import {JBCurrencyIds} from "@bananapus/core-v6/src/libraries/JBCurrencyIds.sol";
|
|
28
|
+
import {JBSuckerDeployerConfig} from "@bananapus/suckers-v6/src/structs/JBSuckerDeployerConfig.sol";
|
|
29
|
+
import {JBTokenMapping} from "@bananapus/suckers-v6/src/structs/JBTokenMapping.sol";
|
|
30
|
+
import {REVAutoIssuance} from "@rev-net/core-v6/src/structs/REVAutoIssuance.sol";
|
|
31
|
+
import {REVBuybackHookConfig} from "@rev-net/core-v6/src/structs/REVBuybackHookConfig.sol";
|
|
32
|
+
import {REVBuybackPoolConfig} from "@rev-net/core-v6/src/structs/REVBuybackPoolConfig.sol";
|
|
33
|
+
import {REVConfig} from "@rev-net/core-v6/src/structs/REVConfig.sol";
|
|
34
|
+
import {REVCroptopAllowedPost} from "@rev-net/core-v6/src/structs/REVCroptopAllowedPost.sol";
|
|
35
|
+
import {REVDeploy721TiersHookConfig} from "@rev-net/core-v6/src/structs/REVDeploy721TiersHookConfig.sol";
|
|
36
|
+
import {REVDescription} from "@rev-net/core-v6/src/structs/REVDescription.sol";
|
|
37
|
+
import {REVLoanSource} from "@rev-net/core-v6/src/structs/REVLoanSource.sol";
|
|
38
|
+
import {REVStageConfig} from "@rev-net/core-v6/src/structs/REVStageConfig.sol";
|
|
39
|
+
import {REVSuckerDeploymentConfig} from "@rev-net/core-v6/src/structs/REVSuckerDeploymentConfig.sol";
|
|
40
40
|
|
|
41
41
|
struct FeeProjectConfig {
|
|
42
42
|
REVConfig configuration;
|
|
@@ -87,7 +87,7 @@ contract ConfigureFeeProjectScript is Script, Sphinx {
|
|
|
87
87
|
|
|
88
88
|
function configureSphinx() public override {
|
|
89
89
|
// TODO: Update to contain croptop devs.
|
|
90
|
-
sphinxConfig.projectName = "croptop-core-
|
|
90
|
+
sphinxConfig.projectName = "croptop-core-v6";
|
|
91
91
|
sphinxConfig.mainnets = ["ethereum", "optimism", "base", "arbitrum"];
|
|
92
92
|
sphinxConfig.testnets = ["ethereum_sepolia", "optimism_sepolia", "base_sepolia", "arbitrum_sepolia"];
|
|
93
93
|
}
|
|
@@ -96,26 +96,26 @@ contract ConfigureFeeProjectScript is Script, Sphinx {
|
|
|
96
96
|
// Get the deployment addresses for the nana CORE for this chain.
|
|
97
97
|
// We want to do this outside of the `sphinx` modifier.
|
|
98
98
|
core = CoreDeploymentLib.getDeployment(
|
|
99
|
-
vm.envOr("NANA_CORE_DEPLOYMENT_PATH", string("node_modules/@bananapus/core-
|
|
99
|
+
vm.envOr("NANA_CORE_DEPLOYMENT_PATH", string("node_modules/@bananapus/core-v6/deployments/"))
|
|
100
100
|
);
|
|
101
101
|
// Get the deployment addresses for the croptop contracts for this chain.
|
|
102
102
|
croptop = CroptopDeploymentLib.getDeployment(vm.envOr("CROPTOP_DEPLOYMENT_PATH", string("deployments/")));
|
|
103
103
|
// Get the deployment addresses for the 721 hook contracts for this chain.
|
|
104
104
|
hook = Hook721DeploymentLib.getDeployment(
|
|
105
|
-
vm.envOr("NANA_721_DEPLOYMENT_PATH", string("node_modules/@bananapus/721-hook-
|
|
105
|
+
vm.envOr("NANA_721_DEPLOYMENT_PATH", string("node_modules/@bananapus/721-hook-v6/deployments/"))
|
|
106
106
|
);
|
|
107
107
|
// Get the deployment addresses for the 721 hook contracts for this chain.
|
|
108
108
|
revnet = RevnetCoreDeploymentLib.getDeployment(
|
|
109
|
-
vm.envOr("REVNET_CORE_DEPLOYMENT_PATH", string("node_modules/@rev-net/core-
|
|
109
|
+
vm.envOr("REVNET_CORE_DEPLOYMENT_PATH", string("node_modules/@rev-net/core-v6/deployments/"))
|
|
110
110
|
);
|
|
111
111
|
// Get the deployment addresses for the suckers contracts for this chain.
|
|
112
112
|
suckers = SuckerDeploymentLib.getDeployment(
|
|
113
|
-
vm.envOr("NANA_SUCKERS_DEPLOYMENT_PATH", string("node_modules/@bananapus/suckers-
|
|
113
|
+
vm.envOr("NANA_SUCKERS_DEPLOYMENT_PATH", string("node_modules/@bananapus/suckers-v6/deployments/"))
|
|
114
114
|
);
|
|
115
115
|
// Get the deployment addresses for the 721 hook contracts for this chain.
|
|
116
116
|
swapTerminal = SwapTerminalDeploymentLib.getDeployment(
|
|
117
117
|
vm.envOr(
|
|
118
|
-
"NANA_SWAP_TERMINAL_DEPLOYMENT_PATH", string("node_modules/@bananapus/swap-terminal-
|
|
118
|
+
"NANA_SWAP_TERMINAL_DEPLOYMENT_PATH", string("node_modules/@bananapus/swap-terminal-v6/deployments/")
|
|
119
119
|
)
|
|
120
120
|
);
|
|
121
121
|
|
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
|
-
|
|
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
|
+
|
|
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
|
-
|
|
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
|
+
|
|
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: address(JBConstants.NATIVE_TOKEN),
|
|
98
|
+
remoteToken: bytes32(uint256(uint160(address(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.
|