Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AST import statement analysis and content hash replacement #2

Open
1 task
Tracked by #1 ...
serapath opened this issue Aug 16, 2019 · 0 comments
Open
1 task
Tracked by #1 ...

AST import statement analysis and content hash replacement #2

serapath opened this issue Aug 16, 2019 · 0 comments

Comments

@serapath
Copy link
Member

serapath commented Aug 16, 2019

@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:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant