Add AccessManager guide (#4691)

Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
Co-authored-by: Eric Lau <ericglau@outlook.com>
Co-authored-by: Zack Reneau-Wedeen <z.reneau.wedeen@gmail.com>
This commit is contained in:
Ernesto García
2023-11-09 15:09:05 +00:00
committed by GitHub
parent f1f427ddaf
commit cb1ef861e5
9 changed files with 487 additions and 75 deletions

View File

@ -0,0 +1,17 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import {Ownable} from "../../../access/Ownable.sol";
contract MyContract is Ownable {
constructor(address initialOwner) Ownable(initialOwner) {}
function normalThing() public {
// anyone can call this normalThing()
}
function specialThing() public onlyOwner {
// only the owner can call specialThing()!
}
}