Skip to content

Instantly share code, notes, and snippets.

@jmrocco
Created January 19, 2021 04:24
Show Gist options
  • Save jmrocco/5b3bb78ec9f272ab88fb1648aaeaa670 to your computer and use it in GitHub Desktop.
Save jmrocco/5b3bb78ec9f272ab88fb1648aaeaa670 to your computer and use it in GitHub Desktop.
pragma solidity ^ 0.5.2;
import "openzeppelin-solidity/contracts/access/Roles.sol";
contract someRoles {
using Roles for Roles.Role;
Roles.Role private roleOne;
function onlyRoleOne() public {
//only roleOne can use this function
require(roleOne.has(msg.sender), "You must be roleOne");
}
function anyone() public {
//anyone can use this function
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment