Merge pull request #799 from crytic/dev-gwei

Add gwei support
pull/810/head
Feist Josselin 4 years ago committed by GitHub
commit ea640a04ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      slither/utils/arithmetic.py

@ -2,7 +2,7 @@ from decimal import Decimal
from slither.exceptions import SlitherException from slither.exceptions import SlitherException
# pylint: disable=too-many-branches
def convert_subdenomination( def convert_subdenomination(
value: str, sub: str value: str, sub: str
) -> int: # pylint: disable=too-many-return-statements ) -> int: # pylint: disable=too-many-return-statements
@ -14,6 +14,8 @@ def convert_subdenomination(
decimal_value = Decimal(value) decimal_value = Decimal(value)
if sub == "wei": if sub == "wei":
return int(decimal_value) return int(decimal_value)
if sub == "gwei":
return int(decimal_value * int(1e9))
if sub == "szabo": if sub == "szabo":
return int(decimal_value * int(1e12)) return int(decimal_value * int(1e12))
if sub == "finney": if sub == "finney":

Loading…
Cancel
Save