@croptop/core-v6 0.0.50 → 0.0.51
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/package.json +1 -1
- package/remappings.txt +0 -1
- package/script/ConfigureFeeProject.s.sol +73 -5
package/package.json
CHANGED
package/remappings.txt
CHANGED
|
@@ -8,18 +8,18 @@ import {
|
|
|
8
8
|
RouterTerminalDeployment,
|
|
9
9
|
RouterTerminalDeploymentLib
|
|
10
10
|
} from "@bananapus/router-terminal-v6/script/helpers/RouterTerminalDeploymentLib.sol";
|
|
11
|
-
import {
|
|
12
|
-
RevnetCoreDeployment,
|
|
13
|
-
RevnetCoreDeploymentLib
|
|
14
|
-
} from "@rev-net/core-v6/script/helpers/RevnetCoreDeploymentLib.sol";
|
|
15
11
|
import {CroptopDeployment, CroptopDeploymentLib} from "./helpers/CroptopDeploymentLib.sol";
|
|
16
12
|
|
|
13
|
+
import {SphinxConstants, NetworkInfo} from "@sphinx-labs/contracts/contracts/foundry/SphinxConstants.sol";
|
|
17
14
|
import {Sphinx} from "@sphinx-labs/contracts/contracts/foundry/SphinxPlugin.sol";
|
|
18
|
-
import {Script} from "forge-std/Script.sol";
|
|
15
|
+
import {Script, stdJson} from "forge-std/Script.sol";
|
|
16
|
+
import {Vm} from "forge-std/Vm.sol";
|
|
19
17
|
|
|
18
|
+
import {IJB721TiersHook} from "@bananapus/721-hook-v6/src/interfaces/IJB721TiersHook.sol";
|
|
20
19
|
import {IJB721TokenUriResolver} from "@bananapus/721-hook-v6/src/interfaces/IJB721TokenUriResolver.sol";
|
|
21
20
|
import {JB721InitTiersConfig} from "@bananapus/721-hook-v6/src/structs/JB721InitTiersConfig.sol";
|
|
22
21
|
import {JB721TierConfig} from "@bananapus/721-hook-v6/src/structs/JB721TierConfig.sol";
|
|
22
|
+
import {IJBDirectory} from "@bananapus/core-v6/src/interfaces/IJBDirectory.sol";
|
|
23
23
|
import {IJBSplitHook} from "@bananapus/core-v6/src/interfaces/IJBSplitHook.sol";
|
|
24
24
|
import {IJBTerminal} from "@bananapus/core-v6/src/interfaces/IJBTerminal.sol";
|
|
25
25
|
import {JBAccountingContext} from "@bananapus/core-v6/src/structs/JBAccountingContext.sol";
|
|
@@ -47,6 +47,74 @@ struct FeeProjectConfig {
|
|
|
47
47
|
REVCroptopAllowedPost[] allowedPosts;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
+
interface IREVDeployerForCroptopFeeProject {
|
|
51
|
+
function DIRECTORY() external view returns (IJBDirectory);
|
|
52
|
+
|
|
53
|
+
function deployFor(
|
|
54
|
+
uint256 revnetId,
|
|
55
|
+
REVConfig memory configuration,
|
|
56
|
+
JBTerminalConfig[] memory terminalConfigurations,
|
|
57
|
+
REVSuckerDeploymentConfig memory suckerDeploymentConfiguration,
|
|
58
|
+
REVDeploy721TiersHookConfig memory tiered721HookConfiguration,
|
|
59
|
+
REVCroptopAllowedPost[] memory allowedPosts
|
|
60
|
+
)
|
|
61
|
+
external
|
|
62
|
+
returns (uint256, IJB721TiersHook hook);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
struct RevnetCoreDeployment {
|
|
66
|
+
IREVDeployerForCroptopFeeProject basicDeployer;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
library RevnetCoreDeploymentLib {
|
|
70
|
+
address internal constant VM_ADDRESS = address(uint160(uint256(keccak256("hevm cheat code"))));
|
|
71
|
+
// forge-lint: disable-next-line(screaming-snake-case-const)
|
|
72
|
+
Vm internal constant vm = Vm(VM_ADDRESS);
|
|
73
|
+
|
|
74
|
+
function getDeployment(string memory path) internal returns (RevnetCoreDeployment memory deployment) {
|
|
75
|
+
uint256 chainId = block.chainid;
|
|
76
|
+
SphinxConstants sphinxConstants = new SphinxConstants();
|
|
77
|
+
NetworkInfo[] memory networks = sphinxConstants.getNetworkInfoArray();
|
|
78
|
+
|
|
79
|
+
for (uint256 i; i < networks.length; i++) {
|
|
80
|
+
if (networks[i].chainId == chainId) return getDeployment({path: path, networkName: networks[i].name});
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
revert("ChainID is not (currently) supported by Sphinx.");
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function getDeployment(
|
|
87
|
+
string memory path,
|
|
88
|
+
string memory networkName
|
|
89
|
+
)
|
|
90
|
+
internal
|
|
91
|
+
view
|
|
92
|
+
returns (RevnetCoreDeployment memory deployment)
|
|
93
|
+
{
|
|
94
|
+
deployment.basicDeployer = IREVDeployerForCroptopFeeProject(
|
|
95
|
+
_getDeploymentAddress({
|
|
96
|
+
path: path, projectName: "revnet-core-v6", networkName: networkName, contractName: "REVDeployer"
|
|
97
|
+
})
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function _getDeploymentAddress(
|
|
102
|
+
string memory path,
|
|
103
|
+
string memory projectName,
|
|
104
|
+
string memory networkName,
|
|
105
|
+
string memory contractName
|
|
106
|
+
)
|
|
107
|
+
private
|
|
108
|
+
view
|
|
109
|
+
returns (address)
|
|
110
|
+
{
|
|
111
|
+
string memory deploymentJson =
|
|
112
|
+
// forge-lint: disable-next-line(unsafe-cheatcode)
|
|
113
|
+
vm.readFile(string.concat(path, projectName, "/", networkName, "/", contractName, ".json"));
|
|
114
|
+
return stdJson.readAddress({json: deploymentJson, key: ".address"});
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
50
118
|
contract ConfigureFeeProjectScript is Script, Sphinx {
|
|
51
119
|
/// @notice tracks the deployment of the core contracts for the chain we are deploying to.
|
|
52
120
|
CoreDeployment core;
|