MyContractOwnable.sol 405 B

1234567891011121314151617
  1. // SPDX-License-Identifier: MIT
  2. pragma solidity ^0.8.20;
  3. import {Ownable} from "../../../access/Ownable.sol";
  4. contract MyContract is Ownable {
  5. constructor(address initialOwner) Ownable(initialOwner) {}
  6. function normalThing() public {
  7. // anyone can call this normalThing()
  8. }
  9. function specialThing() public onlyOwner {
  10. // only the owner can call specialThing()!
  11. }
  12. }