Skip to content

Commit 64c61b7

Browse files
committed
fixes
1 parent 329dc6d commit 64c61b7

File tree

2 files changed

+13
-57
lines changed

2 files changed

+13
-57
lines changed

claim_contracts/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ deploy-token: ## 🚀 Deploy the token contract
3232

3333

3434
update_token_proxy:
35-
@NEW_TOKEN_PROXY=$$(jq -r '.tokenProxy' "script-out/deployed_contracts.json") && \
35+
@NEW_TOKEN_PROXY=$$(jq -r '.tokenProxy' "script-out/deployed_token_addresses.json") && \
3636
jq --arg new_proxy "$$NEW_TOKEN_PROXY" '.tokenProxy = $$new_proxy' $(CONFIG) > $(CONFIG).tmp \
3737
&& mv $(CONFIG).tmp $(CONFIG) \
3838

claim_contracts/script/DeployAlignedToken.s.sol

Lines changed: 12 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -12,30 +12,17 @@ import {Utils} from "./Utils.sol";
1212
contract DeployAlignedToken is Script {
1313
function run(string memory config) public {
1414
string memory root = vm.projectRoot();
15-
string memory path = string.concat(
16-
root,
17-
"/script-config/config.",
18-
config,
19-
".json"
20-
);
15+
string memory path = string.concat(root, "/script-config/config.", config, ".json");
2116
string memory config_json = vm.readFile(path);
2217

2318
address _safe = stdJson.readAddress(config_json, ".safe");
2419
bytes32 _salt = stdJson.readBytes32(config_json, ".salt");
2520
address _deployer = stdJson.readAddress(config_json, ".deployer");
2621
address _foundation = stdJson.readAddress(config_json, ".foundation");
27-
address _claimSupplier = stdJson.readAddress(
28-
config_json,
29-
".claimSupplier"
30-
);
22+
address _claimSupplier = stdJson.readAddress(config_json, ".claimSupplier");
3123

32-
TransparentUpgradeableProxy _tokenProxy = deployAlignedTokenProxy(
33-
_safe,
34-
_salt,
35-
_deployer,
36-
_foundation,
37-
_claimSupplier
38-
);
24+
TransparentUpgradeableProxy _tokenProxy =
25+
deployAlignedTokenProxy(_safe, _salt, _deployer, _foundation, _claimSupplier);
3926

4027
console.log(
4128
string.concat(
@@ -49,36 +36,14 @@ contract DeployAlignedToken is Script {
4936
);
5037

5138
string memory deployedAddressesJson = "deployedAddressesJson";
39+
vm.serializeAddress(deployedAddressesJson, "tokenProxy", address(_tokenProxy));
40+
vm.serializeAddress(deployedAddressesJson, "proxyAdmin", Utils.getAdminAddress(address(_tokenProxy)));
41+
string memory finalJson = vm.serializeAddress(deployedAddressesJson, "safe", address(_safe));
5242

53-
string memory tokenProxyKey = "tokenProxy";
54-
vm.serializeAddress(
55-
deployedAddressesJson,
56-
tokenProxyKey,
57-
address(_tokenProxy)
58-
);
59-
string memory proxyAdminKey = "proxyAdmin";
60-
vm.serializeAddress(
61-
deployedAddressesJson,
62-
proxyAdminKey,
63-
Utils.getAdminAddress(address(_tokenProxy))
64-
);
65-
string memory safeKey = "safe";
66-
vm.serializeAddress(
67-
deployedAddressesJson,
68-
safeKey,
69-
address(_safe)
70-
);
71-
72-
// serialize all the data
73-
string memory finalJson =
74-
vm.serializeString(deployedAddressesJson, "aligned", "deployed contracts");
75-
76-
vm.writeJson(finalJson, _getOutputPath("deployed_contracts.json"));
43+
vm.writeJson(finalJson, _getOutputPath("deployed_token_addresses.json"));
7744
}
7845

79-
function _getOutputPath(
80-
string memory fileName
81-
) internal returns (string memory) {
46+
function _getOutputPath(string memory fileName) internal returns (string memory) {
8247
string memory outputDir = "script-out/";
8348

8449
// Create output directory if it doesn't exist
@@ -99,18 +64,9 @@ contract DeployAlignedToken is Script {
9964
vm.broadcast();
10065
AlignedToken _token = new AlignedToken();
10166

102-
bytes memory _alignedTokenDeploymentData = Utils
103-
.alignedTokenProxyDeploymentData(
104-
_proxyAdmin,
105-
address(_token),
106-
_foundation,
107-
_claim
108-
);
109-
address _alignedTokenProxy = Utils.deployWithCreate2(
110-
_alignedTokenDeploymentData,
111-
_salt,
112-
_deployer
113-
);
67+
bytes memory _alignedTokenDeploymentData =
68+
Utils.alignedTokenProxyDeploymentData(_proxyAdmin, address(_token), _foundation, _claim);
69+
address _alignedTokenProxy = Utils.deployWithCreate2(_alignedTokenDeploymentData, _salt, _deployer);
11470
return TransparentUpgradeableProxy(payable(_alignedTokenProxy));
11571
}
11672
}

0 commit comments

Comments
 (0)