Skip to content

AST import statement analysis and content hash replacement #2

Description

@serapath

@todo:

  • write AST analysis + hashing + code rewrite module, for source code data types

if there are smart contracts with circular imports, but otherwise any imports in general

  1. i want to run an analysis tool which starts to analyse a given main solidity contract
  2. walks the source code and finds all imports in the contracts without an endless loop because of circular imports
  3. decides on a deterministic order of imports (e.g. breadth first search or depth first search, etc...)
  4. removes redundant imports
  5. hashes contracts with no imports or only hash imports and saves that contract under it's <hashname>
  6. replaces all imports in other contracts names to <hashname>
  7. continue to hash contracts with no imports or only hash imports and do the same as in step 5. and 6.
  8. at some point arrives at the given main contract which has now only hash name imports and hashes it and saves it under it's hash name too

resources:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions