Skip to content

Commit 7340390

Browse files
committed
fix: don't deploy ProxyAdmin in DeployAll
1 parent e88941d commit 7340390

File tree

1 file changed

+21
-14
lines changed

1 file changed

+21
-14
lines changed

claim_contracts/script/DeployAll.s.sol

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,24 @@ import "forge-std/Script.sol";
99
import {Utils} from "./Utils.sol";
1010

1111
contract DeployAll is Script {
12-
function run() public {
12+
function run(string memory config) public {
1313
string memory root = vm.projectRoot();
14-
string memory path = string.concat(root, "/script-config/config.json");
14+
string memory path = string.concat(
15+
root,
16+
"/script-config/config.",
17+
config,
18+
".json"
19+
);
1520
string memory config_json = vm.readFile(path);
1621

1722
address _safe = stdJson.readAddress(config_json, ".safe");
1823
bytes32 _salt = stdJson.readBytes32(config_json, ".salt");
1924
address _deployer = stdJson.readAddress(config_json, ".deployer");
2025
address _foundation = stdJson.readAddress(config_json, ".foundation");
21-
address _claim = stdJson.readAddress(config_json, ".claim");
26+
address _claim = stdJson.readAddress(config_json, ".claimSupplier");
2227
uint256 _claimPrivateKey = stdJson.readUint(
2328
config_json,
24-
".claimPrivateKey"
29+
".claimSupplierPrivateKey"
2530
);
2631
uint256 _limitTimestampToClaim = stdJson.readUint(
2732
config_json,
@@ -32,19 +37,16 @@ contract DeployAll is Script {
3237
".claimMerkleRoot"
3338
);
3439

35-
ProxyAdmin _proxyAdmin = deployProxyAdmin(_safe, _salt, _deployer);
36-
3740
TransparentUpgradeableProxy _tokenProxy = deployAlignedTokenProxy(
38-
address(_proxyAdmin),
41+
address(_safe),
3942
_salt,
4043
_deployer,
41-
_safe,
4244
_foundation,
4345
_claim
4446
);
4547

4648
TransparentUpgradeableProxy _airdropProxy = deployClaimableAirdropProxy(
47-
address(_proxyAdmin),
49+
address(_safe),
4850
_safe,
4951
_foundation,
5052
_salt,
@@ -88,10 +90,9 @@ contract DeployAll is Script {
8890
}
8991

9092
function deployAlignedTokenProxy(
91-
address _proxyAdmin,
93+
address _proxyOwner,
9294
bytes32 _salt,
9395
address _deployer,
94-
address _owner,
9596
address _foundation,
9697
address _claim
9798
) internal returns (TransparentUpgradeableProxy) {
@@ -100,7 +101,7 @@ contract DeployAll is Script {
100101

101102
bytes memory _alignedTokenDeploymentData = Utils
102103
.alignedTokenProxyDeploymentData(
103-
_proxyAdmin,
104+
_proxyOwner,
104105
address(_token),
105106
_foundation,
106107
_claim
@@ -111,13 +112,16 @@ contract DeployAll is Script {
111112
_deployer
112113
);
113114

115+
address _proxyAdmin = Utils.getAdminAddress(_alignedTokenProxy);
116+
114117
console.log(
115118
"AlignedToken proxy deployed with address: ",
116119
_alignedTokenProxy,
117120
" and admin: ",
118121
_proxyAdmin
119122
);
120123
vm.serializeAddress("alignedToken", "address", _alignedTokenProxy);
124+
vm.serializeAddress("alignedTokenAdmin", "address", _proxyAdmin);
121125
vm.serializeBytes(
122126
"alignedToken",
123127
"deploymentData",
@@ -128,7 +132,7 @@ contract DeployAll is Script {
128132
}
129133

130134
function deployClaimableAirdropProxy(
131-
address _proxyAdmin,
135+
address _proxyOwner,
132136
address _owner,
133137
address _tokenOwner,
134138
bytes32 _salt,
@@ -142,7 +146,7 @@ contract DeployAll is Script {
142146

143147
bytes memory _airdropDeploymentData = Utils
144148
.claimableAirdropProxyDeploymentData(
145-
_proxyAdmin,
149+
_proxyOwner,
146150
address(_airdrop),
147151
_owner,
148152
_token,
@@ -156,13 +160,16 @@ contract DeployAll is Script {
156160
_deployer
157161
);
158162

163+
address _proxyAdmin = Utils.getAdminAddress(_airdropProxy);
164+
159165
console.log(
160166
"ClaimableAirdrop proxy deployed with address:",
161167
_airdropProxy,
162168
"and admin:",
163169
_proxyAdmin
164170
);
165171
vm.serializeAddress("claimableAirdrop", "address", _airdropProxy);
172+
vm.serializeAddress("claimableAirdropAdmin", "address", _proxyAdmin);
166173
vm.serializeBytes(
167174
"claimableAirdrop",
168175
"deploymentData",

0 commit comments

Comments
 (0)