solhint icon indicating copy to clipboard operation
solhint copied to clipboard

SolHint - Updating grammar for accepting underscores in Integers

Open PedroReyes opened this issue 2 years ago • 0 comments

Hello,

❌ Error For the next code:

// SPDX-License-Identifier: MIT
pragma solidity 0.8.10;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";

contract BUSD is ERC20 {
    uint256 public INITIAL_SUPPLY = 100_000_000e18;

    constructor() ERC20("BUSD", "BUSD") {
        _mint(msg.sender, INITIAL_SUPPLY);
    }
}

when running npx hardhat check I get the next result:

$ npx hardhat check
line 7:39 extraneous input '_000_000e18' expecting ';'

ℹ Expected This way of typing numbers (100_000_000e18) in solidity is quite useful and accepted. What about updating SolHint in this regard for not identifying this symbol as extraneous input?

Source: Rational and Integer Literals

Best regards, Pedro Reyes.

PedroReyes avatar Jun 23 '22 20:06 PedroReyes