add custom decimals to ERC20

This commit is contained in:
0xb337r007 2023-06-23 10:53:08 +02:00
parent ac18c0424a
commit 4eac7f1a69
1 changed files with 7 additions and 0 deletions

View File

@ -15,12 +15,16 @@ contract CommunityERC20 is
*/
uint256 public maxSupply;
uint8 private customDecimals;
constructor(
string memory _name,
string memory _symbol,
uint8 _decimals,
uint256 _maxSupply
) ERC20(_name, _symbol) {
maxSupply = _maxSupply;
customDecimals = _decimals;
}
// Events
@ -48,6 +52,9 @@ contract CommunityERC20 is
}
// Public functions
function decimals() public view virtual override returns (uint8) {
return customDecimals;
}
// Internal functions