forked from ethereum-optimism/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCustomSuperchainToken.sol
39 lines (30 loc) · 1.01 KB
/
CustomSuperchainToken.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
38
39
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.25;
import {SuperchainERC20} from "./SuperchainERC20.sol";
import {Ownable} from "@solady/auth/Ownable.sol";
contract CustomSuperchainToken is SuperchainERC20, Ownable {
string private _name;
string private _symbol;
uint8 private immutable _decimals;
constructor(address owner_, string memory name_, string memory symbol_, uint8 decimals_) {
_name = name_;
_symbol = symbol_;
_decimals = decimals_;
_initializeOwner(owner_);
}
function name() public view virtual override returns (string memory) {
return _name;
}
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
function decimals() public view override returns (uint8) {
return _decimals;
}
function mintTo(address to_, uint256 amount_) external onlyOwner {
_mint(to_, amount_);
}
function faucet() external {
_mint(msg.sender, 10**_decimals);
}
}