diff --git a/blockchain_integration/pi_network/pi-network-interoperability/bridge-contracts/sidra-chain/Owner.sol b/blockchain_integration/pi_network/pi-network-interoperability/bridge-contracts/sidra-chain/Owner.sol new file mode 100644 index 000000000..0292ac2d3 --- /dev/null +++ b/blockchain_integration/pi_network/pi-network-interoperability/bridge-contracts/sidra-chain/Owner.sol @@ -0,0 +1,28 @@ +pragma solidity ^0.8.0; + +contract Owner { + address public owner; + address public newOwner; + + event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); + + modifier onlyOwner() { + require(msg.sender == owner, "Only the owner can call this function"); + _; + } + + constructor() public { + owner = msg.sender; + } + + function transferOwnership(address _newOwner) public onlyOwner { + newOwner = _newOwner; + } + + function acceptOwnership() public { + require(msg.sender == newOwner, "Only the new owner can accept ownership"); + emit OwnershipTransferred(owner, newOwner); + owner = newOwner; + newOwner = address(0); + } +}