diff --git a/scripts/deploy/deterministic/DeployERC20Custody.s.sol b/scripts/deploy/deterministic/DeployERC20Custody.s.sol index 64cabfcb..2571e0e7 100644 --- a/scripts/deploy/deterministic/DeployERC20Custody.s.sol +++ b/scripts/deploy/deterministic/DeployERC20Custody.s.sol @@ -60,7 +60,9 @@ contract DeployERC20Custody is Script { require(address(erc20Custody.gateway()) == gateway, "gateway not set"); // Transfer admin role from deployer to admin - transferAdmin(erc20Custody, msg.sender, admin); + if (msg.sender != admin) { + transferAdmin(erc20Custody, msg.sender, admin); + } vm.stopBroadcast(); } diff --git a/scripts/deploy/deterministic/DeployGatewayEVM.s.sol b/scripts/deploy/deterministic/DeployGatewayEVM.s.sol index 8d2ce140..953c430f 100644 --- a/scripts/deploy/deterministic/DeployGatewayEVM.s.sol +++ b/scripts/deploy/deterministic/DeployGatewayEVM.s.sol @@ -60,9 +60,10 @@ contract DeployGatewayEVM is Script { require(gateway.tssAddress() == tss, "tss not set"); require(gateway.zetaToken() == address(zeta), "zeta token not set"); - // Transfer admin role from deployer to admin - transferAdmin(gateway, msg.sender, admin); - + // Transfer admin role from deployer to admin if the address is different + if (msg.sender != admin) { + transferAdmin(gateway, msg.sender, admin); + } vm.stopBroadcast(); } diff --git a/scripts/deploy/deterministic/DeployGatewayZEVM.s.sol b/scripts/deploy/deterministic/DeployGatewayZEVM.s.sol index 21582bfd..403080f3 100644 --- a/scripts/deploy/deterministic/DeployGatewayZEVM.s.sol +++ b/scripts/deploy/deterministic/DeployGatewayZEVM.s.sol @@ -58,7 +58,9 @@ contract DeployGatewayZEVM is Script { require(gateway.zetaToken() == zeta, "zeta token not set"); // Transfer admin role from deployer to admin - transferAdmin(gateway, msg.sender, admin); + if (msg.sender != admin) { + transferAdmin(gateway, msg.sender, admin); + } vm.stopBroadcast(); }