add custom decimals to ERC20
This commit is contained in:
parent
ac18c0424a
commit
4eac7f1a69
|
@ -15,12 +15,16 @@ contract CommunityERC20 is
|
||||||
*/
|
*/
|
||||||
uint256 public maxSupply;
|
uint256 public maxSupply;
|
||||||
|
|
||||||
|
uint8 private customDecimals;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
string memory _name,
|
string memory _name,
|
||||||
string memory _symbol,
|
string memory _symbol,
|
||||||
|
uint8 _decimals,
|
||||||
uint256 _maxSupply
|
uint256 _maxSupply
|
||||||
) ERC20(_name, _symbol) {
|
) ERC20(_name, _symbol) {
|
||||||
maxSupply = _maxSupply;
|
maxSupply = _maxSupply;
|
||||||
|
customDecimals = _decimals;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Events
|
// Events
|
||||||
|
@ -48,6 +52,9 @@ contract CommunityERC20 is
|
||||||
}
|
}
|
||||||
|
|
||||||
// Public functions
|
// Public functions
|
||||||
|
function decimals() public view virtual override returns (uint8) {
|
||||||
|
return customDecimals;
|
||||||
|
}
|
||||||
|
|
||||||
// Internal functions
|
// Internal functions
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue