Skip to content

Commit

Permalink
Merge pull request #74 from helix-bridge/xiaoch05-ownership-event
Browse files Browse the repository at this point in the history
add transfer ownership event
  • Loading branch information
xiaoch05 authored May 10, 2024
2 parents 036054c + 3a69d1e commit ed6e1e9
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 ed6e1e9

Please sign in to comment.