@croptop/core-v6 0.0.3 → 0.0.5
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.toml +1 -1
- package/package.json +8 -7
- package/script/ConfigureFeeProject.s.sol +19 -47
- package/script/Deploy.s.sol +1 -1
- package/script/helpers/CroptopDeploymentLib.sol +1 -1
- package/src/CTDeployer.sol +1 -1
- package/src/CTProjectOwner.sol +1 -1
- package/src/CTPublisher.sol +1 -1
- package/test/CTPublisher.t.sol +2 -2
- package/test/CroptopAttacks.t.sol +2 -2
- package/test/Fork.t.sol +1 -1
package/foundry.toml
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@croptop/core-v6",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
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/
|
|
19
|
+
"@bananapus/721-hook-v6": "^0.0.3",
|
|
20
|
+
"@bananapus/buyback-hook-v6": "^0.0.2",
|
|
21
|
+
"@bananapus/core-v6": "^0.0.4",
|
|
22
22
|
"@bananapus/ownable-v6": "^0.0.2",
|
|
23
|
-
"@bananapus/
|
|
24
|
-
"@bananapus/
|
|
25
|
-
"@bananapus/
|
|
23
|
+
"@bananapus/permission-ids-v6": "^0.0.2",
|
|
24
|
+
"@bananapus/suckers-v6": "^0.0.2",
|
|
25
|
+
"@bananapus/router-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,11 +1,10 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
|
-
pragma solidity 0.8.
|
|
2
|
+
pragma solidity 0.8.26;
|
|
3
3
|
|
|
4
4
|
import "@bananapus/721-hook-v6/script/helpers/Hook721DeploymentLib.sol";
|
|
5
|
-
import "@bananapus/buyback-hook-v6/script/helpers/BuybackDeploymentLib.sol";
|
|
6
5
|
import "@bananapus/core-v6/script/helpers/CoreDeploymentLib.sol";
|
|
7
6
|
import "@bananapus/suckers-v6/script/helpers/SuckerDeploymentLib.sol";
|
|
8
|
-
import "@bananapus/
|
|
7
|
+
import "@bananapus/router-terminal-v6/script/helpers/RouterTerminalDeploymentLib.sol";
|
|
9
8
|
import "@rev-net/core-v6/script/helpers/RevnetCoreDeploymentLib.sol";
|
|
10
9
|
import "./helpers/CroptopDeploymentLib.sol";
|
|
11
10
|
|
|
@@ -28,28 +27,22 @@ import {JBCurrencyIds} from "@bananapus/core-v6/src/libraries/JBCurrencyIds.sol"
|
|
|
28
27
|
import {JBSuckerDeployerConfig} from "@bananapus/suckers-v6/src/structs/JBSuckerDeployerConfig.sol";
|
|
29
28
|
import {JBTokenMapping} from "@bananapus/suckers-v6/src/structs/JBTokenMapping.sol";
|
|
30
29
|
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
30
|
import {REVConfig} from "@rev-net/core-v6/src/structs/REVConfig.sol";
|
|
34
31
|
import {REVCroptopAllowedPost} from "@rev-net/core-v6/src/structs/REVCroptopAllowedPost.sol";
|
|
35
32
|
import {REVDeploy721TiersHookConfig} from "@rev-net/core-v6/src/structs/REVDeploy721TiersHookConfig.sol";
|
|
36
33
|
import {REVDescription} from "@rev-net/core-v6/src/structs/REVDescription.sol";
|
|
37
|
-
import {REVLoanSource} from "@rev-net/core-v6/src/structs/REVLoanSource.sol";
|
|
38
34
|
import {REVStageConfig} from "@rev-net/core-v6/src/structs/REVStageConfig.sol";
|
|
39
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.
|
|
@@ -60,8 +53,8 @@ contract ConfigureFeeProjectScript is Script, Sphinx {
|
|
|
60
53
|
RevnetCoreDeployment revnet;
|
|
61
54
|
/// @notice tracks the deployment of the sucker contracts for the chain we are deploying to.
|
|
62
55
|
SuckerDeployment suckers;
|
|
63
|
-
/// @notice tracks the deployment of the
|
|
64
|
-
|
|
56
|
+
/// @notice tracks the deployment of the router terminal.
|
|
57
|
+
RouterTerminalDeployment routerTerminal;
|
|
65
58
|
|
|
66
59
|
// @notice set this to a non-zero value to re-use an existing projectID. Having it set to 0 will deploy a new
|
|
67
60
|
// fee_project.
|
|
@@ -104,7 +97,7 @@ contract ConfigureFeeProjectScript is Script, Sphinx {
|
|
|
104
97
|
hook = Hook721DeploymentLib.getDeployment(
|
|
105
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
102
|
vm.envOr("REVNET_CORE_DEPLOYMENT_PATH", string("node_modules/@rev-net/core-v6/deployments/"))
|
|
110
103
|
);
|
|
@@ -112,10 +105,11 @@ contract ConfigureFeeProjectScript is Script, Sphinx {
|
|
|
112
105
|
suckers = SuckerDeploymentLib.getDeployment(
|
|
113
106
|
vm.envOr("NANA_SUCKERS_DEPLOYMENT_PATH", string("node_modules/@bananapus/suckers-v6/deployments/"))
|
|
114
107
|
);
|
|
115
|
-
// Get the deployment addresses for the
|
|
116
|
-
|
|
108
|
+
// Get the deployment addresses for the router terminal contracts for this chain.
|
|
109
|
+
routerTerminal = RouterTerminalDeploymentLib.getDeployment(
|
|
117
110
|
vm.envOr(
|
|
118
|
-
"
|
|
111
|
+
"NANA_ROUTER_TERMINAL_DEPLOYMENT_PATH",
|
|
112
|
+
string("node_modules/@bananapus/router-terminal-v6/deployments/")
|
|
119
113
|
)
|
|
120
114
|
);
|
|
121
115
|
|
|
@@ -147,7 +141,7 @@ contract ConfigureFeeProjectScript is Script, Sphinx {
|
|
|
147
141
|
terminalConfigurations[0] =
|
|
148
142
|
JBTerminalConfig({terminal: core.terminal, accountingContextsToAccept: accountingContextsToAccept});
|
|
149
143
|
terminalConfigurations[1] = JBTerminalConfig({
|
|
150
|
-
terminal: IJBTerminal(address(
|
|
144
|
+
terminal: IJBTerminal(address(routerTerminal.registry)),
|
|
151
145
|
accountingContextsToAccept: new JBAccountingContext[](0)
|
|
152
146
|
});
|
|
153
147
|
|
|
@@ -204,33 +198,14 @@ contract ConfigureFeeProjectScript is Script, Sphinx {
|
|
|
204
198
|
extraMetadata: 4 // Allow adding suckers.
|
|
205
199
|
});
|
|
206
200
|
|
|
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
201
|
// The project's revnet configuration
|
|
212
202
|
REVConfig memory revnetConfiguration = REVConfig({
|
|
213
203
|
description: REVDescription(NAME, SYMBOL, PROJECT_URI, ERC20_SALT),
|
|
214
204
|
baseCurrency: ETH_CURRENCY,
|
|
215
205
|
splitOperator: OPERATOR,
|
|
216
|
-
stageConfigurations: stageConfigurations
|
|
217
|
-
loanSources: loanSources,
|
|
218
|
-
loans: address(revnet.loans)
|
|
206
|
+
stageConfigurations: stageConfigurations
|
|
219
207
|
});
|
|
220
208
|
|
|
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
209
|
// Organize the instructions for how this project will connect to other chains.
|
|
235
210
|
JBTokenMapping[] memory tokenMappings = new JBTokenMapping[](1);
|
|
236
211
|
tokenMappings[0] = JBTokenMapping({
|
|
@@ -315,7 +290,6 @@ contract ConfigureFeeProjectScript is Script, Sphinx {
|
|
|
315
290
|
return FeeProjectConfig({
|
|
316
291
|
configuration: revnetConfiguration,
|
|
317
292
|
terminalConfigurations: terminalConfigurations,
|
|
318
|
-
buybackHookConfiguration: buybackHookConfiguration,
|
|
319
293
|
suckerDeploymentConfiguration: suckerDeploymentConfiguration,
|
|
320
294
|
hookConfiguration: REVDeploy721TiersHookConfig({
|
|
321
295
|
baseline721HookConfiguration: JBDeploy721TiersHookConfig({
|
|
@@ -352,16 +326,14 @@ contract ConfigureFeeProjectScript is Script, Sphinx {
|
|
|
352
326
|
core.projects.approve(address(revnet.basic_deployer), FEE_PROJECT_ID);
|
|
353
327
|
|
|
354
328
|
// Deploy the NANA fee project.
|
|
355
|
-
revnet.basic_deployer
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
allowedPosts: feeProjectConfig.allowedPosts
|
|
364
|
-
});
|
|
329
|
+
revnet.basic_deployer.deployWith721sFor({
|
|
330
|
+
revnetId: FEE_PROJECT_ID,
|
|
331
|
+
configuration: feeProjectConfig.configuration,
|
|
332
|
+
terminalConfigurations: feeProjectConfig.terminalConfigurations,
|
|
333
|
+
suckerDeploymentConfiguration: feeProjectConfig.suckerDeploymentConfiguration,
|
|
334
|
+
tiered721HookConfiguration: feeProjectConfig.hookConfiguration,
|
|
335
|
+
allowedPosts: feeProjectConfig.allowedPosts
|
|
336
|
+
});
|
|
365
337
|
}
|
|
366
338
|
|
|
367
339
|
function _isDeployed(
|
package/script/Deploy.s.sol
CHANGED
package/src/CTDeployer.sol
CHANGED
package/src/CTProjectOwner.sol
CHANGED
package/src/CTPublisher.sol
CHANGED
package/test/CTPublisher.t.sol
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
|
-
pragma solidity 0.8.
|
|
2
|
+
pragma solidity 0.8.26;
|
|
3
3
|
|
|
4
4
|
import "forge-std/Test.sol";
|
|
5
5
|
|
|
@@ -9,7 +9,7 @@ import {IJBSplitHook} from "@bananapus/core-v6/src/interfaces/IJBSplitHook.sol";
|
|
|
9
9
|
import {IJBOwnable} from "@bananapus/ownable-v6/src/interfaces/IJBOwnable.sol";
|
|
10
10
|
import {IJB721TiersHook} from "@bananapus/721-hook-v6/src/interfaces/IJB721TiersHook.sol";
|
|
11
11
|
import {IJB721TiersHookStore} from "@bananapus/721-hook-v6/src/interfaces/IJB721TiersHookStore.sol";
|
|
12
|
-
|
|
12
|
+
import {IJB721TiersHook} from "@bananapus/721-hook-v6/src/interfaces/IJB721TiersHook.sol";
|
|
13
13
|
import {JBConstants} from "@bananapus/core-v6/src/libraries/JBConstants.sol";
|
|
14
14
|
import {JBSplit} from "@bananapus/core-v6/src/structs/JBSplit.sol";
|
|
15
15
|
import {JBPermissionIds} from "@bananapus/permission-ids-v6/src/JBPermissionIds.sol";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
|
-
pragma solidity 0.8.
|
|
2
|
+
pragma solidity 0.8.26;
|
|
3
3
|
|
|
4
4
|
import "forge-std/Test.sol";
|
|
5
5
|
|
|
@@ -10,7 +10,7 @@ import {IJBSplitHook} from "@bananapus/core-v6/src/interfaces/IJBSplitHook.sol";
|
|
|
10
10
|
import {IJBOwnable} from "@bananapus/ownable-v6/src/interfaces/IJBOwnable.sol";
|
|
11
11
|
import {IJB721TiersHook} from "@bananapus/721-hook-v6/src/interfaces/IJB721TiersHook.sol";
|
|
12
12
|
import {IJB721TiersHookStore} from "@bananapus/721-hook-v6/src/interfaces/IJB721TiersHookStore.sol";
|
|
13
|
-
|
|
13
|
+
import {IJB721TiersHook} from "@bananapus/721-hook-v6/src/interfaces/IJB721TiersHook.sol";
|
|
14
14
|
import {JB721TierConfig} from "@bananapus/721-hook-v6/src/structs/JB721TierConfig.sol";
|
|
15
15
|
import {JBConstants} from "@bananapus/core-v6/src/libraries/JBConstants.sol";
|
|
16
16
|
import {JBSplit} from "@bananapus/core-v6/src/structs/JBSplit.sol";
|
package/test/Fork.t.sol
CHANGED
|
@@ -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: bytes32(uint256(uint160(
|
|
98
|
+
remoteToken: bytes32(uint256(uint160(JBConstants.NATIVE_TOKEN))),
|
|
99
99
|
minBridgeAmount: 0.001 ether
|
|
100
100
|
});
|
|
101
101
|
|