diff --git a/contracts/base/RegistryManager.sol b/contracts/base/RegistryManager.sol index 304fbfb4..75eb0be5 100644 --- a/contracts/base/RegistryManager.sol +++ b/contracts/base/RegistryManager.sol @@ -6,7 +6,7 @@ import {ISafeProtocolRegistry} from "../interfaces/Registry.sol"; contract RegistryManager is Ownable2Step { address public registry; - event RegistryChanged(address oldRegistry, address newRegistry); + event RegistryChanged(address indexed oldRegistry, address indexed newRegistry); error ModuleNotPermitted(address module, uint64 listedAt, uint64 flaggedAt); diff --git a/test/SafeProtocolMediator.spec.ts b/test/SafeProtocolMediator.spec.ts index 992d3f51..93b17335 100644 --- a/test/SafeProtocolMediator.spec.ts +++ b/test/SafeProtocolMediator.spec.ts @@ -39,7 +39,16 @@ describe("SafeProtocolMediator", async () => { return { safeProtocolMediator, safe, module, safeProtocolRegistry }; } - describe("Enabling module reverts with ModuleNotPermitted", async () => { + describe("Test enable module", async () => { + it("Should not allow a Safe to enable zero address module", async () => { + const { safeProtocolMediator, safe } = await loadFixture(deployContractsWithModuleFixture); + await safe.setModule(await safeProtocolMediator.getAddress()); + const data = safeProtocolMediator.interface.encodeFunctionData("enableModule", [hre.ethers.ZeroAddress, false]); + await expect(safe.exec(await safeProtocolMediator.getAddress(), 0, data)) + .to.be.revertedWithCustomError(safeProtocolMediator, "InvalidModuleAddress") + .withArgs(hre.ethers.ZeroAddress); + }); + it("Should not allow a Safe to enable module if not added as a component in registry", async () => { const { safeProtocolMediator, safe } = await loadFixture(deployContractsWithModuleFixture); await safe.setModule(await safeProtocolMediator.getAddress()); @@ -62,17 +71,6 @@ describe("SafeProtocolMediator", async () => { "ModuleNotPermitted", ); }); - }); - - describe("Test enable module", async () => { - it("Should not allow a Safe to enable zero address module", async () => { - const { safeProtocolMediator, safe } = await loadFixture(deployContractsWithModuleFixture); - await safe.setModule(await safeProtocolMediator.getAddress()); - const data = safeProtocolMediator.interface.encodeFunctionData("enableModule", [hre.ethers.ZeroAddress, false]); - await expect(safe.exec(await safeProtocolMediator.getAddress(), 0, data)) - .to.be.revertedWithCustomError(safeProtocolMediator, "InvalidModuleAddress") - .withArgs(hre.ethers.ZeroAddress); - }); it("Should not allow a Safe to enable SENTINEL_MODULES module", async () => { const { safeProtocolMediator, safe } = await loadFixture(deployContractsWithModuleFixture);