From 037e6d6797ff08ebe2c873393ed2d02e8abd30c1 Mon Sep 17 00:00:00 2001 From: Reinis Martinsons Date: Mon, 17 Jun 2024 15:07:01 +0000 Subject: [PATCH] fix[oval-audit-n-14]: avoid duplicate event emission Signed-off-by: Reinis Martinsons --- src/controllers/BaseController.sol | 2 ++ src/controllers/MutableUnlockersController.sol | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/controllers/BaseController.sol b/src/controllers/BaseController.sol index 36a30dd..7750d45 100644 --- a/src/controllers/BaseController.sol +++ b/src/controllers/BaseController.sol @@ -23,6 +23,8 @@ abstract contract BaseController is Ownable, Oval { * @param allowed The unlocker status to set. */ function setUnlocker(address unlocker, bool allowed) public onlyOwner { + require(unlockers[unlocker] != allowed, "Unlocker not changed"); + unlockers[unlocker] = allowed; emit UnlockerSet(unlocker, allowed); diff --git a/src/controllers/MutableUnlockersController.sol b/src/controllers/MutableUnlockersController.sol index a7acf13..4dd3e3d 100644 --- a/src/controllers/MutableUnlockersController.sol +++ b/src/controllers/MutableUnlockersController.sol @@ -36,6 +36,8 @@ abstract contract MutableUnlockersController is Ownable, Oval { * @param allowed The unlocker status to set. */ function setUnlocker(address unlocker, bool allowed) public onlyOwner { + require(unlockers[unlocker] != allowed, "Unlocker not changed"); + unlockers[unlocker] = allowed; emit UnlockerSet(unlocker, allowed);