openzeppelin-contracts
openzeppelin-contracts copied to clipboard
ERC20.sol "decimals" variable description left in comments from prev versions
The decimals variable comment is left from previous versions:

💻 Environment
📝 Details
🔢 Code to reproduce bug
Hello @ivan-kyuchukov
That is not a mistake.
This contract include a decimal function.
function decimals() public view virtual override returns (uint8) {
return 18;
}
If someone wants to change the decimal, the process is to override the decimals() function. We left a comment here, because devs coming from a 3.x version would be looking to customize that in the constructor → this message tells them that the upgrade is done elsewhere.
Maybe the documentation is confusing because it's in the constructor. We could move the part about decimals to the contract-level docs.