Skip to content

Commit

Permalink
fix: skip admin transfer in deployment scripts when admin is deployer (
Browse files Browse the repository at this point in the history
  • Loading branch information
lumtis authored Jan 31, 2025
1 parent 4b8c89f commit cc6041c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
4 changes: 3 additions & 1 deletion scripts/deploy/deterministic/DeployERC20Custody.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
7 changes: 4 additions & 3 deletions scripts/deploy/deterministic/DeployGatewayEVM.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down
4 changes: 3 additions & 1 deletion scripts/deploy/deterministic/DeployGatewayZEVM.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit cc6041c

Please sign in to comment.