diff --git a/README.md b/README.md index 0426c250ab..d8e99dba3c 100644 --- a/README.md +++ b/README.md @@ -123,7 +123,7 @@ See the [Printer documentation](https://github.com/crytic/slither/wiki/Printer-d - `slither-check-upgradeability`: [Review `delegatecall`-based upgradeability](https://github.com/crytic/slither/wiki/Upgradeability-Checks) - `slither-prop`: [Automatic unit tests and properties generation](https://github.com/crytic/slither/wiki/Properties-generation) - `slither-flat`: [Flatten a codebase](https://github.com/crytic/slither/wiki/Contract-Flattening) -- `slither-erc`: [Check the ERC's conformance](https://github.com/crytic/slither/wiki/ERC-Conformance) +- `slither-check-erc`: [Check the ERC's conformance](https://github.com/crytic/slither/wiki/ERC-Conformance) - `slither-format`: [Automatic patches generation](https://github.com/crytic/slither/wiki/Slither-format) See the [Tool documentation](https://github.com/crytic/slither/wiki/Tool-Documentation) for additional tools. diff --git a/slither/slithir/variables/constant.py b/slither/slithir/variables/constant.py index 5de70d0a97..f0ab9b4a07 100644 --- a/slither/slithir/variables/constant.py +++ b/slither/slithir/variables/constant.py @@ -25,12 +25,16 @@ def __init__(self, val, type=None, subdenomination=None): if val.startswith('0x') or val.startswith('0X'): self._val = int(val, 16) else: - if 'e' in val: - base, expo = val.split('e') - self._val = int(Decimal(base) * (10 ** int(expo))) - elif 'E' in val: - base, expo = val.split('E') - self._val = int(Decimal(base) * (10 ** int(expo))) + if 'e' in val or 'E' in val: + base, expo = val.split('e') if 'e' in val else val.split('E') + base, expo = Decimal(base), int(expo) + if expo > 80: + if base != Decimal(0): + raise ValueError("exponent is too large to fit in any Solidity integer size") + else: + self._val = 0 + else: + self._val = int(Decimal(base) * Decimal(10 ** expo)) else: self._val = int(Decimal(val)) elif type.type == 'bool': diff --git a/slither/tools/erc_conformance/__main__.py b/slither/tools/erc_conformance/__main__.py index 449ae86694..bb98842e29 100644 --- a/slither/tools/erc_conformance/__main__.py +++ b/slither/tools/erc_conformance/__main__.py @@ -31,7 +31,7 @@ def parse_args(): :return: Returns the arguments for the program. """ parser = argparse.ArgumentParser( - description="Check the ERC 20 conformance", usage="slither-erc project contractName" + description="Check the ERC 20 conformance", usage="slither-check-erc project contractName" ) parser.add_argument("project", help="The codebase to be tested.")