From 3a69d1e48120c3909254b8da3bf2fdd605fc8b8d Mon Sep 17 00:00:00 2001 From: xiaoch05 Date: Fri, 26 Apr 2024 14:17:41 +0800 Subject: [PATCH] add transfer ownership event --- helix-contract/contracts/utils/AccessController.sol | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/helix-contract/contracts/utils/AccessController.sol b/helix-contract/contracts/utils/AccessController.sol index c74d5fe0..c080c2ab 100644 --- a/helix-contract/contracts/utils/AccessController.sol +++ b/helix-contract/contracts/utils/AccessController.sol @@ -9,6 +9,8 @@ contract AccessController { address public operator; address public pendingDao; + event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); + modifier onlyDao() { require(msg.sender == dao, "!dao"); _; @@ -33,10 +35,12 @@ contract AccessController { } function acceptOwnership() external { + address oldDao = dao; address newDao = msg.sender; require(pendingDao == newDao, "!pendingDao"); delete pendingDao; dao = newDao; + emit OwnershipTransferred(oldDao, newDao); } }