forked from scroll-tech/scroll-contracts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MockERC20.sol
37 lines (29 loc) · 986 Bytes
/
MockERC20.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// SPDX-License-Identifier: MIT
pragma solidity =0.8.24;
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol";
contract MockERC20 is Ownable, ERC20Permit {
uint8 private decimals_;
constructor(
string memory _name,
string memory _symbol,
uint8 _decimals
) ERC20(_name, _symbol) ERC20Permit(_name) {
decimals_ = _decimals;
}
function decimals() public view virtual override returns (uint8) {
return decimals_;
}
function mint(address _recipient, uint256 _amount) external returns (bool) {
_mint(_recipient, _amount);
return true;
}
function burn(uint256 _amount) external returns (bool) {
_burn(msg.sender, _amount);
return true;
}
function burn(address _from, uint256 _amount) public virtual returns (bool) {
_burn(_from, _amount);
return true;
}
}