From 7dfea8b1c8f2c9cdbd86b5417edf11ed265fe9c0 Mon Sep 17 00:00:00 2001 From: 0xKoaj Date: Tue, 7 Jan 2025 16:20:30 -0300 Subject: [PATCH 1/5] chore: grantRole to admin, and renounceRole to deployer --- script/DeployCore.sol | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/script/DeployCore.sol b/script/DeployCore.sol index 7e8c615..8f55ae7 100644 --- a/script/DeployCore.sol +++ b/script/DeployCore.sol @@ -36,7 +36,11 @@ contract DeployCore is BaseDeploy, DeployStrategyRegistry, DeployNFTDescriptor, /// will renounce later below firewallAccess.grantRole(FIREWALL_ADMIN_ROLE, msg.sender); firewallAccess.grantRole(PROTOCOL_ADMIN_ROLE, msg.sender); - + + firewallAccess.grantRole(DEFAULT_ADMIN_ROLE, admin); + firewallAccess.grantRole(PROTOCOL_ADMIN_ROLE, admin); + firewallAccess.grantRole(FIREWALL_ADMIN_ROLE, admin); + /// let protected contract execute checkpoints on the external firewall firewallAccess.grantRole(CHECKPOINT_EXECUTOR_ROLE, vault); firewallAccess.grantRole(CHECKPOINT_EXECUTOR_ROLE, firewallRouter); @@ -51,5 +55,6 @@ contract DeployCore is BaseDeploy, DeployStrategyRegistry, DeployNFTDescriptor, firewallAccess.renounceRole(FIREWALL_ADMIN_ROLE, msg.sender); firewallAccess.renounceRole(PROTOCOL_ADMIN_ROLE, msg.sender); + firewallAccess.renounceRole(DEFAULT_ADMIN_ROLE, msg.sender); } } From 9badfb87b9b250a8fa82c6be04c576f0442a1ace Mon Sep 17 00:00:00 2001 From: 0xKoaj Date: Tue, 7 Jan 2025 16:22:34 -0300 Subject: [PATCH 2/5] chore: fix lint --- script/DeployCore.sol | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script/DeployCore.sol b/script/DeployCore.sol index 8f55ae7..38ee4b3 100644 --- a/script/DeployCore.sol +++ b/script/DeployCore.sol @@ -36,11 +36,11 @@ contract DeployCore is BaseDeploy, DeployStrategyRegistry, DeployNFTDescriptor, /// will renounce later below firewallAccess.grantRole(FIREWALL_ADMIN_ROLE, msg.sender); firewallAccess.grantRole(PROTOCOL_ADMIN_ROLE, msg.sender); - + firewallAccess.grantRole(DEFAULT_ADMIN_ROLE, admin); firewallAccess.grantRole(PROTOCOL_ADMIN_ROLE, admin); firewallAccess.grantRole(FIREWALL_ADMIN_ROLE, admin); - + /// let protected contract execute checkpoints on the external firewall firewallAccess.grantRole(CHECKPOINT_EXECUTOR_ROLE, vault); firewallAccess.grantRole(CHECKPOINT_EXECUTOR_ROLE, firewallRouter); From c6e3309dcd53002a8273e274e3c4f01f5ba6ca40 Mon Sep 17 00:00:00 2001 From: 0xKoaj Date: Tue, 7 Jan 2025 16:25:04 -0300 Subject: [PATCH 3/5] chore: fix import --- script/DeployCore.sol | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/script/DeployCore.sol b/script/DeployCore.sol index 38ee4b3..91b1b6d 100644 --- a/script/DeployCore.sol +++ b/script/DeployCore.sol @@ -7,7 +7,8 @@ import { FirewallAccess, FIREWALL_ADMIN_ROLE, PROTOCOL_ADMIN_ROLE, - CHECKPOINT_EXECUTOR_ROLE + CHECKPOINT_EXECUTOR_ROLE, + DEFAULT_ADMIN_ROLE } from "@forta/firewall/FirewallAccess.sol"; import { Checkpoint, Activation } from "@forta/firewall/interfaces/Checkpoint.sol"; import { BaseDeploy } from "./BaseDeploy.sol"; From 432ff616064be85cd305e5f77cf2a9a57887085d Mon Sep 17 00:00:00 2001 From: 0xKoaj Date: Tue, 7 Jan 2025 17:22:02 -0300 Subject: [PATCH 4/5] chore: grant and revoke admin --- script/DeployCore.sol | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/script/DeployCore.sol b/script/DeployCore.sol index 91b1b6d..1d59561 100644 --- a/script/DeployCore.sol +++ b/script/DeployCore.sol @@ -7,8 +7,7 @@ import { FirewallAccess, FIREWALL_ADMIN_ROLE, PROTOCOL_ADMIN_ROLE, - CHECKPOINT_EXECUTOR_ROLE, - DEFAULT_ADMIN_ROLE + CHECKPOINT_EXECUTOR_ROLE } from "@forta/firewall/FirewallAccess.sol"; import { Checkpoint, Activation } from "@forta/firewall/interfaces/Checkpoint.sol"; import { BaseDeploy } from "./BaseDeploy.sol"; @@ -33,7 +32,8 @@ contract DeployCore is BaseDeploy, DeployStrategyRegistry, DeployNFTDescriptor, FirewallAccess firewallAccess = FirewallAccess(getDeployedAddress("V1_FACCESS")); ExternalFirewall externalFirewall = ExternalFirewall(getDeployedAddress("V1_FEXTERNAL")); address vault = getDeployedAddress("V1_VAULT"); - + bytes32 DEFAULT_ADMIN_ROLE = firewallAccess.DEFAULT_ADMIN_ROLE(); + /// will renounce later below firewallAccess.grantRole(FIREWALL_ADMIN_ROLE, msg.sender); firewallAccess.grantRole(PROTOCOL_ADMIN_ROLE, msg.sender); From 8622863f20ec0ceba236076bfe9115ee920074a9 Mon Sep 17 00:00:00 2001 From: 0xKoaj Date: Tue, 7 Jan 2025 17:39:54 -0300 Subject: [PATCH 5/5] chore: fix lint --- script/DeployCore.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/DeployCore.sol b/script/DeployCore.sol index 1d59561..098eef8 100644 --- a/script/DeployCore.sol +++ b/script/DeployCore.sol @@ -33,7 +33,7 @@ contract DeployCore is BaseDeploy, DeployStrategyRegistry, DeployNFTDescriptor, ExternalFirewall externalFirewall = ExternalFirewall(getDeployedAddress("V1_FEXTERNAL")); address vault = getDeployedAddress("V1_VAULT"); bytes32 DEFAULT_ADMIN_ROLE = firewallAccess.DEFAULT_ADMIN_ROLE(); - + /// will renounce later below firewallAccess.grantRole(FIREWALL_ADMIN_ROLE, msg.sender); firewallAccess.grantRole(PROTOCOL_ADMIN_ROLE, msg.sender);