Skip to content

Commit

Permalink
feat: add _role to variable
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenvaleri committed Jul 22, 2024
1 parent 254728b commit 58dc5f2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions contracts/PToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@ import {Pausable} from "@openzeppelin/contracts/utils/Pausable.sol";

contract PToken is ERC20, AccessControl, Pausable {
bytes32 public constant PAUSE_ROLE = keccak256("PAUSE_ROLE");
bytes32 public constant SUPPLY_ADMIN = keccak256("SUPPLY_ADMIN_ROLE");
bytes32 public constant SUPPLY_ADMIN_ROLE = keccak256("SUPPLY_ADMIN_ROLE");

constructor(string memory _name, string memory _symbol, uint8 _decimals)
ERC20(_name, _symbol, _decimals)
AccessControl()
{
_grantRole(PAUSE_ROLE, msg.sender);
_grantRole(SUPPLY_ADMIN, msg.sender);
_grantRole(SUPPLY_ADMIN_ROLE, msg.sender);
}

function mint(address to, uint256 value) public virtual onlyRole(SUPPLY_ADMIN) {
function mint(address to, uint256 value) public virtual onlyRole(SUPPLY_ADMIN_ROLE) {
_mint(to, value);
}

function burn(address from, uint256 value) public virtual onlyRole(SUPPLY_ADMIN) {
function burn(address from, uint256 value) public virtual onlyRole(SUPPLY_ADMIN_ROLE) {
_burn(from, value);
}

Expand Down

0 comments on commit 58dc5f2

Please sign in to comment.