In MyContract, I am providing special rights to the manager. But after some time and for some reason, I want to invalidate the manager. The following is my approach:
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.0;
contract MyContract{
address manager;
constructor(){
manager = msg.sender;
}
function invalidate() public {
require(msg.sender == manager); // Only manager can invalidate itself
manager = address(0);
}
}
Is the right way of doing this or does this have some loopholes?