From 9f2fdfeb2e0fac44103cdf688bb9712e7754a7d4 Mon Sep 17 00:00:00 2001 From: KOSASIH Date: Sat, 20 Jul 2024 22:42:38 +0700 Subject: [PATCH] Create Owner.sol --- genesis-smart-contracts/Owner.sol | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 genesis-smart-contracts/Owner.sol diff --git a/genesis-smart-contracts/Owner.sol b/genesis-smart-contracts/Owner.sol new file mode 100644 index 000000000..87e3ddc92 --- /dev/null +++ b/genesis-smart-contracts/Owner.sol @@ -0,0 +1,19 @@ +// genesis-smart-contracts/Owner.sol +pragma solidity ^0.8.0; + +contract Owner { + address public owner; + + constructor() public { + owner = msg.sender; + } + + modifier onlyOwner() { + require(msg.sender == owner, "Only the owner can execute this function"); + _; + } + + function transferOwnership(address newOwner) public onlyOwner { + owner = newOwner; + } +}