Skip to content

Commit

Permalink
add transfer ownership event
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoch05 committed Apr 26, 2024
1 parent 036054c commit 3a69d1e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions helix-contract/contracts/utils/AccessController.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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");
_;
Expand All @@ -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);
}
}

0 comments on commit 3a69d1e

Please sign in to comment.