Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: skip admin transfer in deployment scripts when admin is deployer #457

Merged
merged 1 commit into from
Jan 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading