Skip to content

Commit cc6041c

Browse files
authored
fix: skip admin transfer in deployment scripts when admin is deployer (#457)
1 parent 4b8c89f commit cc6041c

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

scripts/deploy/deterministic/DeployERC20Custody.s.sol

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ contract DeployERC20Custody is Script {
6060
require(address(erc20Custody.gateway()) == gateway, "gateway not set");
6161

6262
// Transfer admin role from deployer to admin
63-
transferAdmin(erc20Custody, msg.sender, admin);
63+
if (msg.sender != admin) {
64+
transferAdmin(erc20Custody, msg.sender, admin);
65+
}
6466

6567
vm.stopBroadcast();
6668
}

scripts/deploy/deterministic/DeployGatewayEVM.s.sol

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,10 @@ contract DeployGatewayEVM is Script {
6060
require(gateway.tssAddress() == tss, "tss not set");
6161
require(gateway.zetaToken() == address(zeta), "zeta token not set");
6262

63-
// Transfer admin role from deployer to admin
64-
transferAdmin(gateway, msg.sender, admin);
65-
63+
// Transfer admin role from deployer to admin if the address is different
64+
if (msg.sender != admin) {
65+
transferAdmin(gateway, msg.sender, admin);
66+
}
6667
vm.stopBroadcast();
6768
}
6869

scripts/deploy/deterministic/DeployGatewayZEVM.s.sol

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ contract DeployGatewayZEVM is Script {
5858
require(gateway.zetaToken() == zeta, "zeta token not set");
5959

6060
// Transfer admin role from deployer to admin
61-
transferAdmin(gateway, msg.sender, admin);
61+
if (msg.sender != admin) {
62+
transferAdmin(gateway, msg.sender, admin);
63+
}
6264

6365
vm.stopBroadcast();
6466
}

0 commit comments

Comments
 (0)