Here is simple smart contract with owner:
pragma ^0.7.2
contract simple {
address owner;
constructor() public {
//do something
}
modifier() {
require(
owner == msg.sender,
'No sufficient right'
)
}
function setOwner() ownerOnly external {
owner = msg.sender;
}
}
My question is how to securely set owner address to the address of the smart contract owner?