mirror of
https://github.com/logos-messaging/logos-messaging-rlnv2-contract.git
synced 2026-01-17 21:33:11 +00:00
Use 'Ownable' for access control
This commit is contained in:
parent
88d2232a6d
commit
b811cbbd05
@ -4,16 +4,13 @@ pragma solidity >=0.8.19 <0.9.0;
|
||||
import { BaseScript } from "../script/Base.s.sol";
|
||||
import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
|
||||
import { ERC20Permit } from "@openzeppelin/contracts/token/ERC20/extensions/ERC20Permit.sol";
|
||||
import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";
|
||||
|
||||
contract TestStableToken is ERC20, ERC20Permit {
|
||||
address public immutable owner;
|
||||
|
||||
constructor() ERC20("TestStableToken", "TST") ERC20Permit("TestStableToken") {
|
||||
owner = msg.sender;
|
||||
contract TestStableToken is ERC20, ERC20Permit, Ownable {
|
||||
constructor() ERC20("TestStableToken", "TST") ERC20Permit("TestStableToken") Ownable() {
|
||||
}
|
||||
|
||||
function mint(address to, uint256 amount) external {
|
||||
require(msg.sender == owner, "Only owner can mint");
|
||||
function mint(address to, uint256 amount) external onlyOwner {
|
||||
_mint(to, amount);
|
||||
}
|
||||
}
|
||||
|
||||
@ -768,7 +768,7 @@ contract WakuRlnV2Test is Test {
|
||||
uint256 mintAmount = 1000 ether;
|
||||
|
||||
vm.prank(nonOwner);
|
||||
vm.expectRevert("Only owner can mint");
|
||||
vm.expectRevert("Ownable: caller is not the owner");
|
||||
token.mint(nonOwner, mintAmount);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user