forked from Dapp-Learning-DAO/Dapp-Learning
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSimpleToken.sol
More file actions
28 lines (23 loc) · 765 Bytes
/
SimpleToken.sol
File metadata and controls
28 lines (23 loc) · 765 Bytes
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
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/presets/ERC20PresetMinterPauser.sol";
contract SimpleToken is ERC20PresetMinterPauser {
/**
* @dev Constructor that gives msg.sender all of existing tokens.
*/
uint8 private _decimals;
uint256 public INITIAL_SUPPLY;
function decimals() public view override returns (uint8) {
return _decimals;
}
constructor(
string memory name,
string memory symbol,
uint8 decimals_,
uint256 initial_supply
) ERC20PresetMinterPauser(name, symbol) {
_decimals = decimals_;
INITIAL_SUPPLY = initial_supply * (10**uint256(decimals_));
_mint(msg.sender, INITIAL_SUPPLY);
}
}