id int64 0 458k | file_name stringlengths 4 119 | file_path stringlengths 14 227 | content stringlengths 24 9.96M | size int64 24 9.96M | language stringclasses 1
value | extension stringclasses 14
values | total_lines int64 1 219k | avg_line_length float64 2.52 4.63M | max_line_length int64 5 9.91M | alphanum_fraction float64 0 1 | repo_name stringlengths 7 101 | repo_stars int64 100 139k | repo_forks int64 0 26.4k | repo_open_issues int64 0 2.27k | repo_license stringclasses 12
values | repo_extraction_date stringclasses 433
values |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2,286,000 | contract.py | NioTheFirst_ScType/slither/printers/summary/contract.py | """
Module printing summary of the contract
"""
import collections
from slither.printers.abstract_printer import AbstractPrinter
from slither.utils import output
from slither.utils.colors import blue, green, magenta
class ContractSummary(AbstractPrinter):
ARGUMENT = "contract-summary"
HELP = "Print a summ... | 3,327 | Python | .py | 75 | 30.333333 | 95 | 0.54039 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,001 | slithir_ssa.py | NioTheFirst_ScType/slither/printers/summary/slithir_ssa.py | """
Module printing summary of the contract
"""
from slither.printers.abstract_printer import AbstractPrinter
class PrinterSlithIRSSA(AbstractPrinter):
ARGUMENT = "slithir-ssa"
HELP = "Print the slithIR representation of the functions"
WIKI = "https://github.com/trailofbits/slither/wiki/Printer-doc... | 1,711 | Python | .py | 41 | 27.585366 | 90 | 0.491882 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,002 | constructor_calls.py | NioTheFirst_ScType/slither/printers/summary/constructor_calls.py | """
Module printing summary of the contract
"""
from slither.core.source_mapping.source_mapping import Source
from slither.printers.abstract_printer import AbstractPrinter
from slither.utils import output
class ConstructorPrinter(AbstractPrinter):
WIKI = "https://github.com/crytic/slither/wiki/Printe... | 2,292 | Python | .py | 47 | 35.87234 | 92 | 0.545985 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,003 | function_ids.py | NioTheFirst_ScType/slither/printers/summary/function_ids.py | """
Module printing summary of the contract
"""
from slither.printers.abstract_printer import AbstractPrinter
from slither.utils.function import get_function_id
from slither.utils.myprettytable import MyPrettyTable
class FunctionIds(AbstractPrinter):
ARGUMENT = "function-id"
HELP = "Print the keccak256 s... | 1,698 | Python | .py | 39 | 32.769231 | 90 | 0.606667 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,004 | inheritance_graph.py | NioTheFirst_ScType/slither/printers/inheritance/inheritance_graph.py | """
Module printing the inheritance graph
The inheritance graph shows the relation between the contracts
and their functions/modifiers/public variables.
The output is a dot file named filename.dot
"""
from slither.core.declarations.contract import Contract
from slither.core.solidity_types.user_defined... | 8,331 | Python | .py | 176 | 37.517045 | 145 | 0.613074 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,005 | inheritance.py | NioTheFirst_ScType/slither/printers/inheritance/inheritance.py | """
Module printing the inheritance relation
The inheritance shows the relation between the contracts
"""
from slither.printers.abstract_printer import AbstractPrinter
from slither.utils.colors import blue, green
class PrinterInheritance(AbstractPrinter):
ARGUMENT = "inheritance"
HELP = "Print the i... | 3,117 | Python | .py | 61 | 39.229508 | 99 | 0.56997 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,006 | call_graph.py | NioTheFirst_ScType/slither/printers/call/call_graph.py | """
Module printing the call graph
The call graph shows for each function,
what are the contracts/functions called.
The output is a dot file named filename.dot
"""
from collections import defaultdict
from slither.printers.abstract_printer import AbstractPrinter
from slither.core.declarations.solidity_v... | 7,767 | Python | .py | 209 | 28.779904 | 99 | 0.635612 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,007 | dominator.py | NioTheFirst_ScType/slither/printers/functions/dominator.py | from slither.printers.abstract_printer import AbstractPrinter
class Dominator(AbstractPrinter):
ARGUMENT = "dominator"
HELP = "Export the dominator tree of each functions"
WIKI = "https://github.com/trailofbits/slither/wiki/Printer-documentation#dominator"
def output(self, filename):
"""
... | 1,153 | Python | .py | 27 | 31.777778 | 89 | 0.607335 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,008 | authorization.py | NioTheFirst_ScType/slither/printers/functions/authorization.py | """
Module printing summary of the contract
"""
from slither.printers.abstract_printer import AbstractPrinter
from slither.core.declarations.function import Function
from slither.utils.myprettytable import MyPrettyTable
class PrinterWrittenVariablesAndAuthorization(AbstractPrinter):
ARGUMENT = "vars-and-aut... | 2,412 | Python | .py | 56 | 32.125 | 114 | 0.607768 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,009 | cfg.py | NioTheFirst_ScType/slither/printers/functions/cfg.py | from slither.printers.abstract_printer import AbstractPrinter
class CFG(AbstractPrinter):
ARGUMENT = "cfg"
HELP = "Export the CFG of each functions"
WIKI = "https://github.com/trailofbits/slither/wiki/Printer-documentation#cfg"
def output(self, filename):
"""
_filename is not used
... | 1,271 | Python | .py | 31 | 29.290323 | 89 | 0.573864 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,010 | echidna.py | NioTheFirst_ScType/slither/printers/guidance/echidna.py | import json
from collections import defaultdict
from typing import Dict, List, Set, Tuple, NamedTuple, Union
from slither.analyses.data_dependency.data_dependency import is_dependent
from slither.core.cfg.node import Node
from slither.core.declarations import Function
from slither.core.declarations.solidity_variables ... | 16,864 | Python | .py | 381 | 33.356955 | 107 | 0.607341 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,011 | evm_cfg_builder.py | NioTheFirst_ScType/slither/analyses/evm/evm_cfg_builder.py | import logging
from slither.exceptions import SlitherError
logger = logging.getLogger("ConvertToEVM")
def load_evm_cfg_builder():
try:
# Avoiding the addition of evm_cfg_builder as permanent dependency
# pylint: disable=import-outside-toplevel
from evm_cfg_builder.cfg import CFG
... | 689 | Python | .py | 15 | 39.333333 | 80 | 0.720896 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,012 | convert.py | NioTheFirst_ScType/slither/analyses/evm/convert.py | import logging
from slither.core.declarations import Contract, Function
from slither.core.cfg.node import Node
from slither.utils.function import get_function_id
from slither.exceptions import SlitherError
from slither.analyses.evm.evm_cfg_builder import load_evm_cfg_builder
logger = logging.getLogger("ConvertToEVM")
... | 7,797 | Python | .py | 160 | 40.125 | 107 | 0.656876 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,013 | data_dependency.py | NioTheFirst_ScType/slither/analyses/data_dependency/data_dependency.py | """
Compute the data depenency between all the SSA variables
"""
from collections import defaultdict
from typing import Union, Set, Dict, TYPE_CHECKING
from slither.core.declarations import (
Contract,
Enum,
Function,
SolidityFunction,
SolidityVariable,
SolidityVariableComposed,
Structu... | 15,186 | Python | .py | 382 | 33.431937 | 100 | 0.62131 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,014 | are_variables_written.py | NioTheFirst_ScType/slither/analyses/write/are_variables_written.py | """
Detect if all the given variables are written in all the paths of the function
"""
from collections import defaultdict
from typing import Dict, Set, List
from slither.core.cfg.node import NodeType, Node
from slither.core.declarations import SolidityFunction
from slither.core.variables.variable import Variable
... | 3,910 | Python | .py | 94 | 34.223404 | 103 | 0.666404 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,015 | __main__.py | NioTheFirst_ScType/slither/tools/upgradeability/__main__.py | import argparse
import inspect
import json
import logging
import sys
from typing import List, Any, Type, Dict, Tuple, Union, Sequence, Optional
from crytic_compile import cryticparser
from slither import Slither
from slither.core.declarations import Contract
from slither.exceptions import SlitherException
from slith... | 13,249 | Python | .py | 317 | 33.741325 | 141 | 0.608753 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,016 | command_line.py | NioTheFirst_ScType/slither/tools/upgradeability/utils/command_line.py | from typing import List, Union, Dict, Type
from slither.tools.upgradeability.checks.abstract_checks import classification_txt, AbstractCheck
from slither.utils.myprettytable import MyPrettyTable
def output_wiki(detector_classes: List[Type[AbstractCheck]], filter_wiki: str) -> None:
# Sort by impact, confidence, ... | 4,819 | Python | .py | 125 | 29.176 | 127 | 0.600769 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,017 | variable_initialization.py | NioTheFirst_ScType/slither/tools/upgradeability/checks/variable_initialization.py | from slither.tools.upgradeability.checks.abstract_checks import (
CheckClassification,
AbstractCheck,
)
class VariableWithInit(AbstractCheck):
ARGUMENT = "variables-initialized"
IMPACT = CheckClassification.HIGH
HELP = "State variables with an initial value"
WIKI = "https://github.com/crytic/... | 1,415 | Python | .py | 39 | 30.974359 | 112 | 0.710526 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,018 | abstract_checks.py | NioTheFirst_ScType/slither/tools/upgradeability/checks/abstract_checks.py | import abc
from logging import Logger
from typing import Optional, List, Dict, Union, Callable
from slither.core.declarations import Contract
from slither.utils.colors import green, yellow, red
from slither.utils.comparable_enum import ComparableEnum
from slither.utils.output import Output, SupportedOutput
class Inc... | 5,037 | Python | .py | 128 | 30.382813 | 110 | 0.631331 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,019 | initialization.py | NioTheFirst_ScType/slither/tools/upgradeability/checks/initialization.py | import logging
from slither.core.declarations import Function
from slither.slithir.operations import InternalCall
from slither.tools.upgradeability.checks.abstract_checks import (
AbstractCheck,
CheckClassification,
)
from slither.utils.colors import red
logger = logging.getLogger("Slither-check-upgradeabilit... | 12,131 | Python | .py | 318 | 31.647799 | 136 | 0.68661 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,020 | variables_order.py | NioTheFirst_ScType/slither/tools/upgradeability/checks/variables_order.py | from slither.tools.upgradeability.checks.abstract_checks import (
CheckClassification,
AbstractCheck,
)
class MissingVariable(AbstractCheck):
ARGUMENT = "missing-variables"
IMPACT = CheckClassification.MEDIUM
HELP = "Variable missing in the v2"
WIKI = "https://github.com/crytic/slither/wiki/U... | 8,456 | Python | .py | 244 | 27.979508 | 124 | 0.665154 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,021 | functions_ids.py | NioTheFirst_ScType/slither/tools/upgradeability/checks/functions_ids.py | from slither.exceptions import SlitherError
from slither.tools.upgradeability.checks.abstract_checks import (
AbstractCheck,
CheckClassification,
)
from slither.utils.function import get_function_id
def get_signatures(c):
functions = c.functions
functions = [
f.full_name
for f in funct... | 5,427 | Python | .py | 145 | 28.765517 | 127 | 0.618948 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,022 | constant.py | NioTheFirst_ScType/slither/tools/upgradeability/checks/constant.py | from slither.tools.upgradeability.checks.abstract_checks import (
AbstractCheck,
CheckClassification,
)
class WereConstant(AbstractCheck):
ARGUMENT = "were-constant"
IMPACT = CheckClassification.HIGH
HELP = "Variables that should be constant"
WIKI = "https://github.com/crytic/slither/wiki/Upg... | 5,612 | Python | .py | 143 | 29.839161 | 111 | 0.616461 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,023 | all_checks.py | NioTheFirst_ScType/slither/tools/upgradeability/checks/all_checks.py | # pylint: disable=unused-import
from slither.tools.upgradeability.checks.initialization import (
InitializablePresent,
InitializableInherited,
InitializableInitializer,
MissingInitializerModifier,
MissingCalls,
MultipleCalls,
InitializeTarget,
)
from slither.tools.upgradeability.checks.func... | 769 | Python | .py | 20 | 34.85 | 92 | 0.849664 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,024 | __main__.py | NioTheFirst_ScType/slither/tools/properties/__main__.py | import argparse
import logging
import sys
from typing import Any
from crytic_compile import cryticparser
from slither import Slither
from slither.tools.properties.properties.erc20 import generate_erc20, ERC20_PROPERTIES
from slither.tools.properties.addresses.address import (
Addresses,
OWNER_ADDRESS,
USE... | 4,232 | Python | .py | 120 | 29.016667 | 115 | 0.659147 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,025 | utils.py | NioTheFirst_ScType/slither/tools/properties/utils.py | import logging
from pathlib import Path
from slither.utils.colors import green, yellow
logger = logging.getLogger("Slither")
def write_file(
output_dir: Path,
filename: str,
content: str,
allow_overwrite: bool = True,
discard_if_exist: bool = False,
) -> None:
"""
Write the content into ... | 1,130 | Python | .py | 32 | 29.5625 | 115 | 0.670018 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,026 | generate_properties.py | NioTheFirst_ScType/slither/tools/properties/solidity/generate_properties.py | import logging
from pathlib import Path
from typing import Tuple
from slither.core.declarations import Contract
from slither.tools.properties.addresses.address import Addresses
from slither.tools.properties.utils import write_file
logger = logging.getLogger("Slither")
def generate_solidity_properties(
contract:... | 3,009 | Python | .py | 63 | 43.301587 | 120 | 0.713798 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,027 | address.py | NioTheFirst_ScType/slither/tools/properties/addresses/address.py | from typing import Optional
# These are the default values in truffle
# https://www.trufflesuite.com/docs/truffle/getting-started/using-truffle-develop-and-the-console
OWNER_ADDRESS = "0x627306090abaB3A6e1400e9345bC60c78a8BEf57"
USER_ADDRESS = "0xf17f52151EbEF6C7334FAD080c5704D77216b732"
ATTACKER_ADDRESS = "0xC5fdf407... | 740 | Python | .py | 16 | 41.0625 | 97 | 0.747573 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,028 | properties.py | NioTheFirst_ScType/slither/tools/properties/properties/properties.py | from enum import Enum
from typing import NamedTuple
class PropertyType(Enum):
CODE_QUALITY = 1
LOW_SEVERITY = 2
MEDIUM_SEVERITY = 3
HIGH_SEVERITY = 4
class PropertyReturn(Enum):
SUCCESS = 1
FAIL_OR_THROW = 2
FAIL = 3
THROW = 4
class PropertyCaller(Enum):
OWNER = 1
SENDER = ... | 929 | Python | .py | 29 | 27.655172 | 96 | 0.706742 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,029 | erc20.py | NioTheFirst_ScType/slither/tools/properties/properties/erc20.py | import logging
from collections import namedtuple
from pathlib import Path
from typing import Tuple, List
from crytic_compile.platform.abstract_platform import AbstractPlatform
from crytic_compile.platform import Type as PlatformType
from slither.core.declarations import Contract
from slither.tools.properties.address... | 8,234 | Python | .py | 172 | 42.383721 | 120 | 0.727386 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,030 | mint.py | NioTheFirst_ScType/slither/tools/properties/properties/ercs/erc20/properties/mint.py | from slither.tools.properties.properties.properties import (
PropertyType,
PropertyReturn,
Property,
PropertyCaller,
)
ERC20_NotMintable = [
Property(
name="crytic_supply_constant_ERC20PropertiesNotMintable()",
description="The total supply does not increase.",
content="""
\... | 565 | Python | .py | 19 | 24.052632 | 67 | 0.693578 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,031 | mint_and_burn.py | NioTheFirst_ScType/slither/tools/properties/properties/ercs/erc20/properties/mint_and_burn.py | from slither.tools.properties.properties.properties import (
Property,
PropertyType,
PropertyReturn,
PropertyCaller,
)
ERC20_NotMintableNotBurnable = [
Property(
name="crytic_supply_constant_ERC20PropertiesNotMintableNotBurnable()",
description="The total supply does not change.",
... | 585 | Python | .py | 19 | 25.105263 | 78 | 0.704425 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,032 | initialization.py | NioTheFirst_ScType/slither/tools/properties/properties/ercs/erc20/properties/initialization.py | from slither.tools.properties.properties.properties import (
Property,
PropertyType,
PropertyReturn,
PropertyCaller,
)
ERC20_CONFIG = [
Property(
name="init_total_supply()",
description="The total supply is correctly initialized.",
content="""
\t\treturn this.totalSupply() >... | 2,656 | Python | .py | 75 | 28.373333 | 130 | 0.657752 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,033 | transfer.py | NioTheFirst_ScType/slither/tools/properties/properties/ercs/erc20/properties/transfer.py | from slither.tools.properties.properties.properties import (
Property,
PropertyType,
PropertyReturn,
PropertyCaller,
)
ERC20_Transferable = [
Property(
name="crytic_zero_always_empty_ERC20Properties()",
description="The address 0x0 should not receive tokens.",
content="""
\t... | 8,295 | Python | .py | 215 | 32.465116 | 130 | 0.681565 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,034 | burn.py | NioTheFirst_ScType/slither/tools/properties/properties/ercs/erc20/properties/burn.py | from slither.tools.properties.properties.properties import (
Property,
PropertyType,
PropertyReturn,
PropertyCaller,
)
ERC20_NotBurnable = [
Property(
name="crytic_supply_constant_ERC20PropertiesNotBurnable()",
description="The total supply does not decrease.",
content="""
\... | 1,058 | Python | .py | 35 | 24.571429 | 67 | 0.684314 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,035 | truffle.py | NioTheFirst_ScType/slither/tools/properties/properties/ercs/erc20/unit_tests/truffle.py | import logging
from pathlib import Path
from typing import List
from slither.core.declarations import Contract
from slither.tools.properties.addresses.address import Addresses
from slither.tools.properties.platforms.truffle import (
generate_migration,
generate_unit_test,
)
from slither.tools.properties.proper... | 1,507 | Python | .py | 43 | 29.930233 | 97 | 0.714089 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,036 | echidna.py | NioTheFirst_ScType/slither/tools/properties/platforms/echidna.py | from pathlib import Path
from slither.tools.properties.addresses.address import Addresses
from slither.tools.properties.utils import write_file
def generate_echidna_config(output_dir: Path, addresses: Addresses) -> str:
"""
Generate the echidna configuration file
:param output_dir:
:param addresses:
... | 683 | Python | .py | 18 | 33.666667 | 75 | 0.706949 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,037 | truffle.py | NioTheFirst_ScType/slither/tools/properties/platforms/truffle.py | import logging
import re
from pathlib import Path
from typing import List
from slither.tools.properties.addresses.address import Addresses
from slither.tools.properties.properties.properties import (
PropertyReturn,
Property,
PropertyCaller,
)
from slither.tools.properties.utils import write_file
PATTERN_... | 5,766 | Python | .py | 148 | 31.756757 | 127 | 0.622095 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,038 | __main__.py | NioTheFirst_ScType/slither/tools/slither_format/__main__.py | import sys
import argparse
import logging
from crytic_compile import cryticparser
from slither import Slither
from slither.utils.command_line import read_config_file
from slither.tools.slither_format.slither_format import slither_format
logging.basicConfig()
logging.getLogger("Slither").setLevel(logging.INFO)
# Slit... | 2,975 | Python | .py | 92 | 26.304348 | 99 | 0.636173 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,039 | slither_format.py | NioTheFirst_ScType/slither/tools/slither_format/slither_format.py | import logging
from pathlib import Path
from typing import Type, List, Dict
from slither import Slither
from slither.detectors.abstract_detector import AbstractDetector
from slither.detectors.variables.unused_state_variables import UnusedStateVars
from slither.detectors.attributes.incorrect_solc import IncorrectSolc
f... | 6,791 | Python | .py | 141 | 40.985816 | 100 | 0.571795 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,040 | __main__.py | NioTheFirst_ScType/slither/tools/demo/__main__.py | import argparse
import logging
from crytic_compile import cryticparser
from slither import Slither
logging.basicConfig()
logging.getLogger("Slither").setLevel(logging.INFO)
logger = logging.getLogger("Slither-demo")
def parse_args() -> argparse.Namespace:
"""
Parse the underlying arguments for the program.
... | 927 | Python | .py | 26 | 31.538462 | 88 | 0.727477 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,041 | __main__.py | NioTheFirst_ScType/slither/tools/erc_conformance/__main__.py | import argparse
import logging
from collections import defaultdict
from typing import Any, Dict, List
from crytic_compile import cryticparser
from slither import Slither
from slither.utils.erc import ERCS
from slither.utils.output import output_to_json
from .erc.ercs import generic_erc_checks
from .erc.erc20 import ch... | 3,000 | Python | .py | 80 | 31.85 | 134 | 0.682918 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,042 | ercs.py | NioTheFirst_ScType/slither/tools/erc_conformance/erc/ercs.py | import logging
from typing import Dict, List, Optional, Set
from slither.core.declarations import Contract
from slither.slithir.operations import EventCall
from slither.utils import output
from slither.utils.erc import ERC, ERC_EVENT
from slither.utils.type import (
export_nested_types_from_variable,
export_re... | 7,555 | Python | .py | 173 | 32.50289 | 107 | 0.58455 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,043 | erc20.py | NioTheFirst_ScType/slither/tools/erc_conformance/erc/erc20.py | import logging
from slither.utils import output
logger = logging.getLogger("Slither-conformance")
def approval_race_condition(contract, ret):
increaseAllowance = contract.get_function_from_signature("increaseAllowance(address,uint256)")
if not increaseAllowance:
increaseAllowance = contract.get_fun... | 1,220 | Python | .py | 28 | 36.535714 | 98 | 0.71162 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,044 | erc1155.py | NioTheFirst_ScType/slither/tools/erc_conformance/erc/erc1155.py | import logging
from slither.slithir.operations import EventCall
from slither.utils import output
logger = logging.getLogger("Slither-conformance")
def events_safeBatchTransferFrom(contract, ret):
function = contract.get_function_from_signature(
"safeBatchTransferFrom(address,address,uint256[],uint256[],... | 1,945 | Python | .py | 46 | 33.717391 | 86 | 0.651298 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,045 | analysis.py | NioTheFirst_ScType/slither/tools/kspec_coverage/analysis.py | import re
import logging
from typing import Set, Tuple
from slither.core.declarations import Function
from slither.core.variables.variable import Variable
from slither.utils.colors import yellow, green, red
from slither.utils import output
logging.basicConfig(level=logging.WARNING)
logger = logging.getLogge... | 6,090 | Python | .py | 142 | 33.577465 | 111 | 0.628101 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,046 | __main__.py | NioTheFirst_ScType/slither/tools/kspec_coverage/__main__.py | import sys
import logging
import argparse
from crytic_compile import cryticparser
from slither.tools.kspec_coverage.kspec_coverage import kspec_coverage
logging.basicConfig()
logger = logging.getLogger("Slither.kspec")
logger.setLevel(logging.INFO)
ch = logging.StreamHandler()
ch.setLevel(logging.INFO)
formatter = lo... | 1,820 | Python | .py | 57 | 26.807018 | 88 | 0.65389 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,047 | kspec_coverage.py | NioTheFirst_ScType/slither/tools/kspec_coverage/kspec_coverage.py | import argparse
from slither.tools.kspec_coverage.analysis import run_analysis
from slither import Slither
def kspec_coverage(args: argparse.Namespace) -> None:
contract = args.contract
kspec = args.kspec
slither = Slither(contract, **vars(args))
compilation_units = slither.compilatio... | 534 | Python | .py | 13 | 34.769231 | 63 | 0.722986 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,048 | __main__.py | NioTheFirst_ScType/slither/tools/similarity/__main__.py | #!/usr/bin/env python3
import argparse
import logging
import sys
from crytic_compile import cryticparser
from slither.tools.similarity.info import info
from slither.tools.similarity.test import test
from slither.tools.similarity.train import train
from slither.tools.similarity.plot import plot
logging.basicConfig()... | 2,701 | Python | .py | 77 | 29.493506 | 132 | 0.563391 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,049 | test.py | NioTheFirst_ScType/slither/tools/similarity/test.py | import logging
import operator
import sys
import traceback
from slither.tools.similarity.encode import encode_contract, load_and_encode, parse_target
from slither.tools.similarity.model import load_model
from slither.tools.similarity.similarity import similarity
logger = logging.getLogger("Slither-simil")
def test(... | 1,775 | Python | .py | 40 | 36.475 | 98 | 0.632618 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,050 | similarity.py | NioTheFirst_ScType/slither/tools/similarity/similarity.py | import sys
try:
import numpy as np
except ImportError:
print("ERROR: in order to use slither-simil, you need to install numpy:")
print("$ pip3 install numpy --user\n")
sys.exit(-1)
def similarity(v1, v2):
n1 = np.linalg.norm(v1)
n2 = np.linalg.norm(v2)
return np.dot(v1, v2) / n1 / n2
| 316 | Python | .py | 11 | 24.909091 | 77 | 0.665563 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,051 | cache.py | NioTheFirst_ScType/slither/tools/similarity/cache.py | import sys
try:
import numpy as np
except ImportError:
print("ERROR: in order to use slither-simil, you need to install numpy")
print("$ pip3 install numpy --user\n")
sys.exit(-1)
def load_cache(infile, nsamples=None):
cache = {}
with np.load(infile, allow_pickle=True) as data:
array ... | 552 | Python | .py | 18 | 24.444444 | 76 | 0.61553 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,052 | train.py | NioTheFirst_ScType/slither/tools/similarity/train.py | import argparse
import logging
import os
import sys
import traceback
from slither.tools.similarity.cache import save_cache
from slither.tools.similarity.encode import encode_contract, load_contracts
from slither.tools.similarity.model import train_unsupervised
logger = logging.getLogger("Slither-simil")
def train(a... | 2,018 | Python | .py | 44 | 36.068182 | 96 | 0.625064 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,053 | plot.py | NioTheFirst_ScType/slither/tools/similarity/plot.py | import argparse
import logging
import random
import sys
import traceback
try:
import numpy as np
except ImportError:
print("ERROR: in order to use slither-simil, you need to install numpy:")
print("$ pip3 install numpy --user\n")
sys.exit(-1)
from slither.tools.similarity.encode import load_and_encode... | 2,542 | Python | .py | 68 | 29.470588 | 108 | 0.612785 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,054 | encode.py | NioTheFirst_ScType/slither/tools/similarity/encode.py | import logging
import os
from slither import Slither
from slither.core.declarations import (
Structure,
Enum,
SolidityVariableComposed,
SolidityVariable,
Function,
)
from slither.core.solidity_types import (
ElementaryType,
ArrayType,
MappingType,
UserDefinedType,
)
from slither.cor... | 7,643 | Python | .py | 222 | 27.711712 | 92 | 0.64678 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,055 | model.py | NioTheFirst_ScType/slither/tools/similarity/model.py | import sys
try:
# pylint: disable=unused-import
from fastText import load_model
from fastText import train_unsupervised
except ImportError:
print("ERROR: in order to use slither-simil, you need to install fastText 0.2.0:")
print("$ pip3 install https://github.com/facebookresearch/fastText/archive/0... | 357 | Python | .py | 9 | 35.888889 | 99 | 0.740634 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,056 | info.py | NioTheFirst_ScType/slither/tools/similarity/info.py | import argparse
import logging
import sys
import os.path
import traceback
from .model import load_model
from .encode import parse_target, encode_contract
logging.basicConfig()
logger = logging.getLogger("Slither-simil")
def info(args: argparse.Namespace) -> None:
try:
model = args.model
if os.... | 1,538 | Python | .py | 42 | 28.261905 | 93 | 0.61969 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,057 | __main__.py | NioTheFirst_ScType/slither/tools/flattening/__main__.py | import argparse
import logging
import sys
from crytic_compile import cryticparser
from crytic_compile.utils.zip import ZIP_TYPES_ACCEPTED
from slither import Slither
from slither.tools.flattening.flattening import (
Flattening,
Strategy,
STRATEGIES_NAMES,
DEFAULT_EXPORT_PATH,
)
logging.basicConfig()
... | 3,903 | Python | .py | 112 | 27.508929 | 110 | 0.64318 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,058 | flattening.py | NioTheFirst_ScType/slither/tools/flattening/flattening.py | import logging
import re
import uuid
from collections import namedtuple
from enum import Enum as PythonEnum
from pathlib import Path
from typing import List, Set, Dict, Optional, Sequence
from slither.core.compilation_unit import SlitherCompilationUnit
from slither.core.declarations import SolidityFunction, EnumContra... | 19,871 | Python | .py | 407 | 34.837838 | 141 | 0.569139 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,059 | export.py | NioTheFirst_ScType/slither/tools/flattening/export/export.py | import json
import logging
# https://docs.python.org/3/library/zipfile.html#zipfile-objects
import zipfile
from collections import namedtuple
from typing import List
ZIP_TYPES_ACCEPTED = {
"lzma": zipfile.ZIP_LZMA,
"stored": zipfile.ZIP_STORED,
"deflated": zipfile.ZIP_DEFLATED,
"bzip2": zipfile.ZIP_BZ... | 1,459 | Python | .py | 45 | 26.888889 | 80 | 0.644793 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,060 | __main__.py | NioTheFirst_ScType/slither/tools/possible_paths/__main__.py | import sys
import logging
from argparse import ArgumentParser, Namespace
from crytic_compile import cryticparser
from slither import Slither
from slither.core.declarations import FunctionContract
from slither.utils.colors import red
from slither.tools.possible_paths.possible_paths import (
find_target_paths,
... | 2,844 | Python | .py | 72 | 34 | 119 | 0.687137 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,061 | possible_paths.py | NioTheFirst_ScType/slither/tools/possible_paths/possible_paths.py | from typing import List, Tuple, Union, Optional, Set
from slither import Slither
from slither.core.declarations import Function, FunctionContract
from slither.core.slither_core import SlitherCore
class ResolveFunctionException(Exception):
pass
def resolve_function(slither: SlitherCore, contract_name: str, func... | 6,290 | Python | .py | 131 | 40.259542 | 114 | 0.680914 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,062 | __main__.py | NioTheFirst_ScType/slither/tools/doctor/__main__.py | import argparse
import logging
import sys
from crytic_compile import cryticparser
from slither.tools.doctor.utils import report_section
from slither.tools.doctor.checks import ALL_CHECKS
def parse_args() -> argparse.Namespace:
"""
Parse the underlying arguments for the program.
:return: Returns the argu... | 1,017 | Python | .py | 29 | 30.172414 | 75 | 0.717949 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,063 | utils.py | NioTheFirst_ScType/slither/tools/doctor/utils.py | from contextlib import contextmanager
import logging
from typing import Optional
from slither.utils.colors import bold, yellow, red
@contextmanager
def snip_section(message: Optional[str]) -> None:
if message:
print(red(message), end="\n\n")
print(yellow("---- snip 8< ----"))
yield
print(yell... | 774 | Python | .py | 23 | 28.26087 | 135 | 0.656836 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,064 | versions.py | NioTheFirst_ScType/slither/tools/doctor/checks/versions.py | from importlib import metadata
import json
from typing import Optional
import urllib
from packaging.version import parse, Version
from slither.utils.colors import yellow, green
def get_installed_version(name: str) -> Optional[Version]:
try:
return parse(metadata.version(name))
except metadata.Packag... | 1,816 | Python | .py | 50 | 28.54 | 106 | 0.619373 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,065 | __init__.py | NioTheFirst_ScType/slither/tools/doctor/checks/__init__.py | from typing import Callable, List
from dataclasses import dataclass
from slither.tools.doctor.checks.paths import check_slither_path
from slither.tools.doctor.checks.platform import compile_project, detect_platform
from slither.tools.doctor.checks.versions import show_versions
@dataclass
class Check:
title: str
... | 585 | Python | .py | 15 | 36.066667 | 81 | 0.785841 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,066 | platform.py | NioTheFirst_ScType/slither/tools/doctor/checks/platform.py | import logging
from pathlib import Path
from crytic_compile import crytic_compile
from slither.tools.doctor.utils import snip_section
from slither.utils.colors import red, yellow, green
def detect_platform(project: str, **kwargs) -> None:
path = Path(project)
if path.is_file():
print(
ye... | 2,249 | Python | .py | 48 | 39.375 | 171 | 0.661187 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,067 | paths.py | NioTheFirst_ScType/slither/tools/doctor/checks/paths.py | from pathlib import Path
from typing import List, Optional, Tuple
import shutil
import sys
import sysconfig
from slither.utils.colors import yellow, green, red
def path_is_relative_to(path: Path, relative_to: Path) -> bool:
"""
Check if a path is relative to another one.
Compatibility wrapper for Path.i... | 2,857 | Python | .py | 68 | 34.088235 | 112 | 0.638889 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,068 | __main__.py | NioTheFirst_ScType/slither/tools/documentation/__main__.py | import argparse
import logging
import uuid
from typing import Optional, Dict, List
from crytic_compile import cryticparser
from slither import Slither
from slither.core.compilation_unit import SlitherCompilationUnit
from slither.core.declarations import Function
from slither.formatters.utils.patches import create_patc... | 8,245 | Python | .py | 222 | 28.959459 | 99 | 0.620841 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,069 | __main__.py | NioTheFirst_ScType/slither/tools/mutator/__main__.py | import argparse
import inspect
import logging
import sys
from typing import Type, List, Any
from crytic_compile import cryticparser
from slither import Slither
from slither.tools.mutator.mutators import all_mutators
from .mutators.abstract_mutator import AbstractMutator
from .utils.command_line import output_mutators... | 2,565 | Python | .py | 62 | 36.870968 | 101 | 0.516142 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,070 | generic_patching.py | NioTheFirst_ScType/slither/tools/mutator/utils/generic_patching.py | from typing import Dict
from slither.core.declarations import Contract
from slither.core.variables.variable import Variable
from slither.formatters.utils.patches import create_patch
def remove_assignement(variable: Variable, contract: Contract, result: Dict):
"""
Remove the variable's initial assignement
... | 944 | Python | .py | 29 | 27.172414 | 77 | 0.703744 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,071 | command_line.py | NioTheFirst_ScType/slither/tools/mutator/utils/command_line.py | from slither.utils.myprettytable import MyPrettyTable
def output_mutators(mutators_classes):
mutators_list = []
for detector in mutators_classes:
argument = detector.NAME
help_info = detector.HELP
fault_class = detector.FAULTCLASS.name
fault_nature = detector.FAULTNATURE.name
... | 826 | Python | .py | 17 | 42.235294 | 99 | 0.687345 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,072 | MIA.py | NioTheFirst_ScType/slither/tools/mutator/mutators/MIA.py | from slither.core.cfg.node import NodeType
from slither.formatters.utils.patches import create_patch
from slither.tools.mutator.mutators.abstract_mutator import AbstractMutator, FaultNature, FaultClass
class MIA(AbstractMutator): # pylint: disable=too-few-public-methods
NAME = "MIA"
HELP = '"if" construct ar... | 1,382 | Python | .py | 26 | 38.038462 | 100 | 0.594796 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,073 | MVIE.py | NioTheFirst_ScType/slither/tools/mutator/mutators/MVIE.py | from slither.core.expressions import Literal
from slither.tools.mutator.mutators.abstract_mutator import AbstractMutator, FaultNature, FaultClass
from slither.tools.mutator.utils.generic_patching import remove_assignement
class MVIE(AbstractMutator): # pylint: disable=too-few-public-methods
NAME = "MVIE"
HEL... | 1,336 | Python | .py | 24 | 43.291667 | 100 | 0.676132 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,074 | MVIV.py | NioTheFirst_ScType/slither/tools/mutator/mutators/MVIV.py | from slither.core.expressions import Literal
from slither.tools.mutator.mutators.abstract_mutator import AbstractMutator, FaultNature, FaultClass
from slither.tools.mutator.utils.generic_patching import remove_assignement
class MVIV(AbstractMutator): # pylint: disable=too-few-public-methods
NAME = "MVIV"
HEL... | 1,322 | Python | .py | 24 | 42.708333 | 100 | 0.674166 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,075 | abstract_mutator.py | NioTheFirst_ScType/slither/tools/mutator/mutators/abstract_mutator.py | import abc
import logging
from enum import Enum
from typing import Optional, Dict
from slither import Slither
from slither.formatters.utils.patches import apply_patch, create_diff
logger = logging.getLogger("Slither")
class IncorrectMutatorInitialization(Exception):
pass
class FaultClass(Enum):
Assignemen... | 2,856 | Python | .py | 73 | 29.849315 | 100 | 0.609121 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,076 | all_mutators.py | NioTheFirst_ScType/slither/tools/mutator/mutators/all_mutators.py | # pylint: disable=unused-import
from slither.tools.mutator.mutators.MVIV import MVIV
from slither.tools.mutator.mutators.MVIE import MVIE
from slither.tools.mutator.mutators.MIA import MIA
| 189 | Python | .py | 4 | 46.25 | 52 | 0.854054 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,077 | __main__.py | NioTheFirst_ScType/slither/tools/read_storage/__main__.py | """
Tool to read on-chain storage from EVM
"""
import json
import argparse
from crytic_compile import cryticparser
from slither import Slither
from slither.tools.read_storage.read_storage import SlitherReadStorage
def parse_args() -> argparse.Namespace:
"""Parse the underlying arguments for the program.
Ret... | 5,119 | Python | .py | 137 | 29.89781 | 123 | 0.63561 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,078 | read_storage.py | NioTheFirst_ScType/slither/tools/read_storage/read_storage.py | import logging
import sys
from math import floor
from typing import Callable, Optional, Tuple, Union, List, Dict, Any
try:
from web3 import Web3
from eth_typing.evm import ChecksumAddress
from eth_abi import decode_single, encode_abi
from eth_utils import keccak
from .utils import (
get_off... | 25,335 | Python | .py | 551 | 34.61343 | 147 | 0.587785 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,079 | utils.py | NioTheFirst_ScType/slither/tools/read_storage/utils/utils.py | from typing import Union
from eth_typing.evm import ChecksumAddress
from eth_utils import to_int, to_text, to_checksum_address
def get_offset_value(hex_bytes: bytes, offset: int, size: int) -> bytes:
"""
Trims slot data to only contain the target variable's.
Args:
hex_bytes (HexBytes): String rep... | 2,448 | Python | .py | 64 | 31.921875 | 92 | 0.655158 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,080 | slither_compilation_unit_solc.py | NioTheFirst_ScType/slither/solc_parsing/slither_compilation_unit_solc.py | import json
import logging
import os
import re
from pathlib import Path
from typing import List, Dict
from slither.analyses.data_dependency.data_dependency import compute_dependency
from slither.core.compilation_unit import SlitherCompilationUnit
from slither.core.declarations import Contract
from slither.core.declara... | 33,230 | Python | .py | 628 | 40.302548 | 163 | 0.601417 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,081 | exceptions.py | NioTheFirst_ScType/slither/solc_parsing/exceptions.py | from slither.exceptions import SlitherException
class ParsingError(SlitherException):
pass
class VariableNotFound(SlitherException):
pass
| 150 | Python | .py | 5 | 26.6 | 47 | 0.858156 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,082 | find_variable.py | NioTheFirst_ScType/slither/solc_parsing/expressions/find_variable.py | from typing import TYPE_CHECKING, Optional, Union, List, Tuple
from slither.core.declarations import Event, Enum, Structure
from slither.core.declarations.contract import Contract
from slither.core.declarations.custom_error import CustomError
from slither.core.declarations.function import Function
from slither.core.de... | 16,780 | Python | .py | 390 | 36.305128 | 114 | 0.700814 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,083 | expression_parsing.py | NioTheFirst_ScType/slither/solc_parsing/expressions/expression_parsing.py | import logging
import re
from typing import Dict, TYPE_CHECKING
from slither.core.declarations.solidity_variables import (
SOLIDITY_VARIABLES_COMPOSED,
SolidityVariableComposed,
)
from slither.core.expressions.assignment_operation import (
AssignmentOperation,
AssignmentOperationType,
)
from slither.co... | 27,069 | Python | .py | 574 | 36.940767 | 110 | 0.605271 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,084 | type_parsing.py | NioTheFirst_ScType/slither/solc_parsing/solidity_types/type_parsing.py | import logging
import re
from typing import List, TYPE_CHECKING, Union, Dict, ValuesView
from slither.core.declarations.custom_error_contract import CustomErrorContract
from slither.core.declarations.custom_error_top_level import CustomErrorTopLevel
from slither.core.declarations.function_contract import FunctionContr... | 20,012 | Python | .py | 433 | 35.734411 | 146 | 0.624917 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,085 | node.py | NioTheFirst_ScType/slither/solc_parsing/cfg/node.py | from typing import Optional, Dict
from slither.core.cfg.node import Node
from slither.core.cfg.node import NodeType
from slither.core.expressions.assignment_operation import (
AssignmentOperation,
AssignmentOperationType,
)
from slither.core.expressions.identifier import Identifier
from slither.solc_parsing.ex... | 2,761 | Python | .py | 55 | 39.690909 | 97 | 0.665306 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,086 | structure_variable.py | NioTheFirst_ScType/slither/solc_parsing/variables/structure_variable.py | from typing import Dict
from slither.solc_parsing.variables.variable_declaration import VariableDeclarationSolc
from slither.core.variables.structure_variable import StructureVariable
class StructureVariableSolc(VariableDeclarationSolc):
def __init__(self, variable: StructureVariable, variable_data: Dict):
... | 583 | Python | .py | 11 | 47.636364 | 87 | 0.778169 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,087 | variable_declaration.py | NioTheFirst_ScType/slither/solc_parsing/variables/variable_declaration.py | import logging
import re
from typing import Dict
from slither.solc_parsing.declarations.caller_context import CallerContextExpression
from slither.solc_parsing.expressions.expression_parsing import parse_expression
from slither.core.variables.variable import Variable
from slither.solc_parsing.solidity_types.type_par... | 8,123 | Python | .py | 179 | 33.407821 | 101 | 0.597749 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,088 | local_variable_init_from_tuple.py | NioTheFirst_ScType/slither/solc_parsing/variables/local_variable_init_from_tuple.py | from typing import Dict
from slither.solc_parsing.variables.variable_declaration import VariableDeclarationSolc
from slither.core.variables.local_variable_init_from_tuple import LocalVariableInitFromTuple
class LocalVariableInitFromTupleSolc(VariableDeclarationSolc):
def __init__(self, variable: LocalVariableIni... | 689 | Python | .py | 12 | 51.75 | 94 | 0.783061 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,089 | state_variable.py | NioTheFirst_ScType/slither/solc_parsing/variables/state_variable.py | from typing import Dict
from slither.solc_parsing.variables.variable_declaration import VariableDeclarationSolc
from slither.core.variables.state_variable import StateVariable
class StateVariableSolc(VariableDeclarationSolc):
def __init__(self, variable: StateVariable, variable_data: Dict):
super().__ini... | 559 | Python | .py | 11 | 45.454545 | 87 | 0.768382 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,090 | top_level_variable.py | NioTheFirst_ScType/slither/solc_parsing/variables/top_level_variable.py | from typing import Dict, TYPE_CHECKING
from slither.core.variables.top_level_variable import TopLevelVariable
from slither.solc_parsing.variables.variable_declaration import VariableDeclarationSolc
from slither.solc_parsing.declarations.caller_context import CallerContextExpression
if TYPE_CHECKING:
from slither.... | 1,438 | Python | .py | 32 | 38.78125 | 93 | 0.748747 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,091 | function_type_variable.py | NioTheFirst_ScType/slither/solc_parsing/variables/function_type_variable.py | from typing import Dict
from slither.solc_parsing.variables.variable_declaration import VariableDeclarationSolc
from slither.core.variables.function_type_variable import FunctionTypeVariable
class FunctionTypeVariableSolc(VariableDeclarationSolc):
def __init__(self, variable: FunctionTypeVariable, variable_data:... | 602 | Python | .py | 11 | 49.363636 | 87 | 0.783646 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,092 | local_variable.py | NioTheFirst_ScType/slither/solc_parsing/variables/local_variable.py | from typing import Dict
from slither.solc_parsing.variables.variable_declaration import VariableDeclarationSolc
from slither.core.variables.local_variable import LocalVariable
class LocalVariableSolc(VariableDeclarationSolc):
def __init__(self, variable: LocalVariable, variable_data: Dict):
super().__ini... | 1,252 | Python | .py | 27 | 37.296296 | 87 | 0.679245 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,093 | event_variable.py | NioTheFirst_ScType/slither/solc_parsing/variables/event_variable.py | from typing import Dict
from slither.solc_parsing.variables.variable_declaration import VariableDeclarationSolc
from slither.core.variables.event_variable import EventVariable
class EventVariableSolc(VariableDeclarationSolc):
def __init__(self, variable: EventVariable, variable_data: Dict):
super().__ini... | 983 | Python | .py | 21 | 39.571429 | 87 | 0.718325 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,094 | parse_yul.py | NioTheFirst_ScType/slither/solc_parsing/yul/parse_yul.py | import abc
import json
from typing import Optional, Dict, List, Union
from slither.core.cfg.node import NodeType, Node, link_nodes
from slither.core.cfg.scope import Scope
from slither.core.compilation_unit import SlitherCompilationUnit
from slither.core.declarations import (
Function,
SolidityFunction,
Co... | 29,865 | Python | .py | 687 | 35.953421 | 109 | 0.63456 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,095 | evm_functions.py | NioTheFirst_ScType/slither/solc_parsing/yul/evm_functions.py | from slither.core.declarations.solidity_variables import SOLIDITY_FUNCTIONS
from slither.core.expressions import BinaryOperationType, UnaryOperationType
# taken from https://github.com/ethereum/solidity/blob/356cc91084114f840da66804b2a9fc1ac2846cff/libevmasm/Instruction.cpp#L180
evm_opcodes = [
"STOP",
"ADD",
... | 5,287 | Python | .py | 258 | 15.577519 | 126 | 0.542373 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,096 | structure_contract.py | NioTheFirst_ScType/slither/solc_parsing/declarations/structure_contract.py | """
Structure module
"""
from typing import TYPE_CHECKING, Dict
from slither.core.declarations.structure import Structure
from slither.core.variables.structure_variable import StructureVariable
from slither.solc_parsing.variables.structure_variable import StructureVariableSolc
if TYPE_CHECKING:
from slither.s... | 1,909 | Python | .py | 46 | 33.26087 | 92 | 0.662703 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,097 | function.py | NioTheFirst_ScType/slither/solc_parsing/declarations/function.py | import logging
from typing import Dict, Optional, Union, List, TYPE_CHECKING
from slither.core.cfg.node import NodeType, link_nodes, insert_node, Node
from slither.core.cfg.scope import Scope
from slither.core.declarations.contract import Contract
from slither.core.declarations.function import (
Function,
Modi... | 60,777 | Python | .py | 1,215 | 36.478189 | 115 | 0.547858 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,098 | event.py | NioTheFirst_ScType/slither/solc_parsing/declarations/event.py | """
Event module
"""
from typing import TYPE_CHECKING, Dict
from slither.core.variables.event_variable import EventVariable
from slither.solc_parsing.variables.event_variable import EventVariableSolc
from slither.core.declarations.event import Event
if TYPE_CHECKING:
from slither.solc_parsing.declarations.con... | 2,087 | Python | .py | 48 | 32.916667 | 100 | 0.612426 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,099 | custom_error.py | NioTheFirst_ScType/slither/solc_parsing/declarations/custom_error.py | from typing import TYPE_CHECKING, Dict
from slither.core.declarations.custom_error import CustomError
from slither.core.declarations.custom_error_contract import CustomErrorContract
from slither.core.declarations.custom_error_top_level import CustomErrorTopLevel
from slither.core.variables.local_variable import LocalV... | 4,157 | Python | .py | 88 | 38.579545 | 110 | 0.678704 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |