Files
DLE/backend/contracts/MyContract.sol
2025-02-18 21:56:51 +03:00

20 lines
451 B
Solidity

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract MyContract {
address public owner;
constructor() {
owner = msg.sender;
}
modifier onlyOwner() {
require(msg.sender == owner, "Only owner can call this function");
_;
}
function setOwner(address newOwner) public onlyOwner {
require(newOwner != address(0), "New owner cannot be zero address");
owner = newOwner;
}
}