Skip to content

Commit d59306b

Browse files
authored
Improve ERC20.decimals documentation (#3933)
1 parent a28aafd commit d59306b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

contracts/token/ERC20/ERC20.sol

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ import "../../utils/Context.sol";
1818
* https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How
1919
* to implement supply mechanisms].
2020
*
21+
* The default value of {decimals} is 18. To change this, you should override
22+
* this function so it returns a different value.
23+
*
2124
* We have followed general OpenZeppelin Contracts guidelines: functions revert
2225
* instead returning `false` on failure. This behavior is nonetheless
2326
* conventional and does not conflict with the expectations of ERC20
@@ -45,9 +48,6 @@ contract ERC20 is Context, IERC20, IERC20Metadata {
4548
/**
4649
* @dev Sets the values for {name} and {symbol}.
4750
*
48-
* The default value of {decimals} is 18. To select a different value for
49-
* {decimals} you should overload it.
50-
*
5151
* All two of these values are immutable: they can only be set once during
5252
* construction.
5353
*/
@@ -77,8 +77,8 @@ contract ERC20 is Context, IERC20, IERC20Metadata {
7777
* be displayed to a user as `5.05` (`505 / 10 ** 2`).
7878
*
7979
* Tokens usually opt for a value of 18, imitating the relationship between
80-
* Ether and Wei. This is the value {ERC20} uses, unless this function is
81-
* overridden;
80+
* Ether and Wei. This is the default value returned by this function, unless
81+
* it's overridden.
8282
*
8383
* NOTE: This information is only used for _display_ purposes: it in
8484
* no way affects any of the arithmetic of the contract, including

0 commit comments

Comments
 (0)