@@ -12,30 +12,17 @@ import {Utils} from "./Utils.sol";
1212contract 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