├── .circleci
└── config.yml
├── .github
├── FUNDING.yml
└── workflows
│ ├── codeql.yml
│ └── dependency-review.yml
├── .gitignore
├── .husky
└── pre-commit
├── .idea
├── .gitignore
├── dataSources.xml
├── evm.iml
├── golinter.xml
├── inspectionProfiles
│ └── Project_Default.xml
├── modules.xml
└── vcs.xml
├── .prettierignore
├── .prettierrc.json
├── Dockerfile
├── LICENSE
├── Pipfile
├── Pipfile.lock
├── README.md
├── build.sh
├── lerna.json
├── opcode.json
├── package.json
├── packages
├── contracts
│ ├── .env.example
│ ├── .eslintignore
│ ├── .eslintrc.js
│ ├── .gitignore
│ ├── .npmignore
│ ├── .prettierignore
│ ├── .prettierrc
│ ├── .solhint.json
│ ├── .solhintignore
│ ├── README.md
│ ├── contracts
│ │ ├── Greeter.sol
│ │ └── Merkle.sol
│ ├── hardhat.config.ts
│ ├── package-lock.json
│ ├── package.json
│ ├── pnpm-lock.yaml
│ ├── scripts
│ │ └── deploy.ts
│ ├── test
│ │ └── index.ts
│ └── tsconfig.json
├── disassembler
│ ├── disassembler.py
│ ├── evm.py
│ ├── output (example)
│ └── server.py
├── rust_server
│ ├── .gitignore
│ ├── .gitkeep
│ ├── Cargo.lock
│ ├── Cargo.toml
│ ├── Dockerfile
│ ├── README.md
│ └── src
│ │ └── main.rs
├── util
│ └── convert_bytecode.py
└── web
│ ├── .eslintrc.json
│ ├── .gitignore
│ ├── README.md
│ ├── next-env.d.ts
│ ├── next.config.js
│ ├── package.json
│ ├── pages
│ ├── _app.tsx
│ └── index.tsx
│ ├── pnpm-lock.yaml
│ ├── public
│ ├── favicon.ico
│ └── vercel.svg
│ ├── styles
│ ├── Home.module.css
│ └── globals.css
│ └── tsconfig.json
├── pnpm-lock.yaml
├── requirements.txt
├── rust_toolchain
└── yarn.lock
/.circleci/config.yml:
--------------------------------------------------------------------------------
1 | version: 2.1
2 |
3 | orbs:
4 | python: circleci/python@2.1.1
5 |
6 | jobs:
7 | format:
8 | docker:
9 | - image: node:18
10 | resource_class: large
11 | parallelism: 10
12 |
13 | steps:
14 | - checkout
15 | - restore_cache:
16 | name: Restore pnpm Package Cache
17 | keys:
18 | - pnpm-packages-{{ checksum "pnpm-lock.yaml" }}
19 | - run:
20 | name: Install pnpm package manager
21 | command: |
22 | curl -L https://pnpm.js.org/pnpm.js | node - add --global pnpm@7
23 | - run:
24 | name: Install Dependencies
25 | command: |
26 | pnpm install
27 | - run:
28 | name: Run Prettier
29 | command: |
30 | pnpm prettier --write .
31 | - save_cache:
32 | name: Save pnpm Package Cache
33 | key: pnpm-packages-{{ checksum "pnpm-lock.yaml" }}
34 | paths:
35 | - node_modules
36 |
37 | evm:
38 | docker:
39 | - image: python:3.9-alpine
40 | resource_class: large
41 | parallelism: 10
42 |
43 | steps:
44 | - checkout
45 | - run:
46 | name: install deps
47 | command: pip install -r requirements.txt
48 |
49 | - run:
50 | name: build
51 | command: chmod +x ./build.sh && ./build.sh
52 | workflows:
53 | format:
54 | jobs:
55 | - format
56 | evm:
57 | jobs:
58 | - evm
59 |
--------------------------------------------------------------------------------
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | github: anddddrew
2 |
--------------------------------------------------------------------------------
/.github/workflows/codeql.yml:
--------------------------------------------------------------------------------
1 | name: "CodeQL"
2 |
3 | on:
4 | push:
5 | branches: ["main"]
6 | pull_request:
7 | # The branches below must be a subset of the branches above
8 | branches: ["main"]
9 | schedule:
10 | - cron: "37 20 * * 2"
11 |
12 | jobs:
13 | analyze:
14 | name: Analyze
15 | runs-on: ubuntu-latest
16 | permissions:
17 | actions: read
18 | contents: read
19 | security-events: write
20 |
21 | strategy:
22 | fail-fast: false
23 | matrix:
24 | language: ["javascript", "python"]
25 | # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
26 | # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
27 |
28 | steps:
29 | - name: Checkout repository
30 | uses: actions/checkout@v3
31 |
32 | # Initializes the CodeQL tools for scanning.
33 | - name: Initialize CodeQL
34 | uses: github/codeql-action/init@v2
35 | with:
36 | languages: ${{ matrix.language }}
37 | # If you wish to specify custom queries, you can do so here or in a config file.
38 | # By default, queries listed here will override any specified in a config file.
39 | # Prefix the list here with "+" to use these queries and those in the config file.
40 |
41 | # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
42 | # queries: security-extended,security-and-quality
43 |
44 | # Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
45 | # If this step fails, then you should remove it and run the build manually (see below)
46 | - name: Autobuild
47 | uses: github/codeql-action/autobuild@v2
48 |
49 | # ℹ️ Command-line programs to run using the OS shell.
50 | # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
51 |
52 | # If the Autobuild fails above, remove it and uncomment the following three lines.
53 | # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
54 |
55 | # - run: |
56 | # echo "Run, Build Application using script"
57 | # ./location_of_script_within_repo/buildscript.sh
58 |
59 | - name: Perform CodeQL Analysis
60 | uses: github/codeql-action/analyze@v2
61 | with:
62 | category: "/language:${{matrix.language}}"
63 |
--------------------------------------------------------------------------------
/.github/workflows/dependency-review.yml:
--------------------------------------------------------------------------------
1 | version: 2
2 | updates:
3 | - package-ecosystem: npm
4 | directory: "/"
5 | schedule:
6 | interval: "daily"
7 | target-branch: main
8 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Nix
2 | result/**
3 |
4 | # Direnv
5 | .envrc
6 | .direnv/**
7 |
8 | # Byte-compiled / optimized / DLL files
9 | __pycache__/
10 | *.py[cod]
11 | *$py.class
12 |
13 | # C extensions
14 | *.so
15 |
16 | ida/
17 | # Distribution / packaging
18 | .Python
19 | build/
20 | develop-eggs/
21 | dist/
22 | downloads/
23 | eggs/
24 | .eggs/
25 | lib/
26 | lib64/
27 | parts/
28 | sdist/
29 | var/
30 | wheels/
31 | share/python-wheels/
32 | *.egg-info/
33 | .installed.cfg
34 | *.egg
35 | MANIFEST
36 |
37 | # PyInstaller
38 | # Usually these files are written by a python script from a template
39 | # before PyInstaller builds the exe, so as to inject date/other infos into it.
40 | *.manifest
41 | *.spec
42 |
43 | # Installer logs
44 | pip-log.txt
45 | pip-delete-this-directory.txt
46 |
47 | # Unit test / coverage reports
48 | htmlcov/
49 | .tox/
50 | .nox/
51 | .coverage
52 | .coverage.*
53 | .cache
54 | nosetests.xml
55 | coverage.xml
56 | *.cover
57 | *.py,cover
58 | .hypothesis/
59 | .pytest_cache/
60 | cover/
61 |
62 | # Translations
63 | *.mo
64 | *.pot
65 |
66 | # Django stuff:
67 | *.log
68 | local_settings.py
69 | db.sqlite3
70 | db.sqlite3-journal
71 |
72 | # Flask stuff:
73 | instance/
74 | .webassets-cache
75 |
76 | # Scrapy stuff:
77 | .scrapy
78 |
79 | # Sphinx documentation
80 | docs/_build/
81 |
82 | # PyBuilder
83 | .pybuilder/
84 | target/
85 |
86 | # Jupyter Notebook
87 | .ipynb_checkpoints
88 |
89 | /node_modules
90 |
91 | # IPython
92 | profile_default/
93 | ipython_config.py
94 |
95 | # pyenv
96 | # For a library or package, you might want to ignore these files since the code is
97 | # intended to run in multiple environments; otherwise, check them in:
98 | # .python-version
99 |
100 | # pipenv
101 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
102 | # However, in case of collaboration, if having platform-specific dependencies or dependencies
103 | # having no cross-platform support, pipenv may install dependencies that don't work, or not
104 | # install all needed dependencies.
105 | #Pipfile.lock
106 |
107 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow
108 | __pypackages__/
109 |
110 | # Celery stuff
111 | celerybeat-schedule
112 | celerybeat.pid
113 |
114 | # SageMath parsed files
115 | *.sage.py
116 |
117 | # Environments
118 | .env
119 | .venv
120 | env/
121 | venv/
122 | ENV/
123 | env.bak/
124 | venv.bak/
125 |
126 | # Spyder project settings
127 | .spyderproject
128 | .spyproject
129 |
130 | # Rope project settings
131 | .ropeproject
132 |
133 | # mkdocs documentation
134 | /site
135 |
136 | # mypy
137 | .mypy_cache/
138 | .dmypy.json
139 | dmypy.json
140 |
141 | # Pyre type checker
142 | .pyre/
143 |
144 | # pytype static type analyzer
145 | .pytype/
146 |
147 | # Cython debug symbols
148 | cython_debug/
149 |
--------------------------------------------------------------------------------
/.husky/pre-commit:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 | . "$(dirname -- "$0")/_/husky.sh"
3 |
4 | pnpm prettier --write .
5 |
--------------------------------------------------------------------------------
/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 | # Editor-based HTTP Client requests
5 | /httpRequests/
6 | # Datasource local storage ignored files
7 | /dataSources/
8 | /dataSources.local.xml
9 |
--------------------------------------------------------------------------------
/.idea/dataSources.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | postgresql
6 | true
7 | org.postgresql.Driver
8 | jdbc:postgresql://localhost:5432/kiwi
9 | $ProjectFileDir$
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/evm.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/.idea/golinter.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/inspectionProfiles/Project_Default.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.prettierignore:
--------------------------------------------------------------------------------
1 | build
2 | node_modules
3 | .abi
4 | .pyc
5 |
6 | pnpm-lock.yaml
7 | .next
8 |
--------------------------------------------------------------------------------
/.prettierrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "useTabs": true,
3 | "semi": true,
4 | "singleQuote": false,
5 | "endOfLine": "lf"
6 | }
7 |
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM ubuntu:latest
2 |
3 | LABEL maintainer="andrewnijmeh1@gmail.com"
4 | LABEL description="EVM disassembly via bytecode in Python"
5 |
6 | WORKDIR /evm
7 |
8 | COPY . .
9 |
10 | RUN apt-get update && apt-get install -y python3-pip nodejs npm yarn curl gcc git
11 |
12 | COPY . .
13 |
14 | RUN pip3 install -r requirements.txt
15 |
16 | RUN chmod +x ./build
17 |
18 | RUN ./build
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright [yyyy] [name of copyright owner]
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/Pipfile:
--------------------------------------------------------------------------------
1 | [[source]]
2 | url = "https://pypi.org/simple"
3 | verify_ssl = true
4 | name = "pypi"
5 |
6 | [packages]
7 | interval3 = "*"
8 | certifi = "*"
9 | ipaddr = "*"
10 | idna = "*"
11 | websocket-client = "*"
12 | six = "*"
13 | socketio-client = "*"
14 | requests = "*"
15 | click = "*"
16 | python-engineio = "*"
17 | python-socketio = "*"
18 | hexdump = "*"
19 | werkzeug = "*"
20 | flask = "*"
21 |
22 | [dev-packages]
23 |
24 | [requires]
25 | python_version = "3.10"
26 |
--------------------------------------------------------------------------------
/Pipfile.lock:
--------------------------------------------------------------------------------
1 | {
2 | "_meta": {
3 | "hash": {
4 | "sha256": "5dac6ba5165528e7cd64cbe47f26aecea2d611a3a75058e40e2ec8ac0255ebad"
5 | },
6 | "pipfile-spec": 6,
7 | "requires": {
8 | "python_version": "3.10"
9 | },
10 | "sources": [
11 | {
12 | "name": "pypi",
13 | "url": "https://pypi.org/simple",
14 | "verify_ssl": true
15 | }
16 | ]
17 | },
18 | "default": {
19 | "bidict": {
20 | "hashes": [
21 | "sha256:415126d23a0c81e1a8c584a8fb1f6905ea090c772571803aeee0a2242e8e7ba0",
22 | "sha256:5c826b3e15e97cc6e615de295756847c282a79b79c5430d3bfc909b1ac9f5bd8"
23 | ],
24 | "markers": "python_version >= '3.7'",
25 | "version": "==0.22.0"
26 | },
27 | "capstone": {
28 | "hashes": [
29 | "sha256:0d65ffe8620920976ceadedc769f22318f6f150a592368d8a735612367ac8a1a",
30 | "sha256:2842913092c9b69fd903744bc1b87488e1451625460baac173056e1808ec1c66",
31 | "sha256:9d1a9096c5f875b11290317722ed44bb6e7c52e50cc79d791f142bce968c49aa",
32 | "sha256:c3d9b443d1adb40ee2d9a4e7341169b76476ddcf3a54c03793b16cdc7cd35c5a",
33 | "sha256:da442f979414cf27e4621e70e835880878c858ea438c4f0e957e132593579e37"
34 | ],
35 | "index": "pypi",
36 | "version": "==4.0.2"
37 | },
38 | "certifi": {
39 | "hashes": [
40 | "sha256:0d9c601124e5a6ba9712dbc60d9c53c21e34f5f641fe83002317394311bdce14",
41 | "sha256:90c1a32f1d68f940488354e36370f6cca89f0f106db09518524c88d6ed83f382"
42 | ],
43 | "index": "pypi",
44 | "version": "==2022.9.24"
45 | },
46 | "charset-normalizer": {
47 | "hashes": [
48 | "sha256:5a3d016c7c547f69d6f81fb0db9449ce888b418b5b9952cc5e6e66843e9dd845",
49 | "sha256:83e9a75d1911279afd89352c68b45348559d1fc0506b054b346651b5e7fee29f"
50 | ],
51 | "markers": "python_version >= '3.6'",
52 | "version": "==2.1.1"
53 | },
54 | "click": {
55 | "hashes": [
56 | "sha256:7682dc8afb30297001674575ea00d1814d808d6a36af415a82bd481d37ba7b8e",
57 | "sha256:bb4d8133cb15a609f44e8213d9b391b0809795062913b383c62be0ee95b1db48"
58 | ],
59 | "index": "pypi",
60 | "version": "==8.1.3"
61 | },
62 | "flask": {
63 | "hashes": [
64 | "sha256:642c450d19c4ad482f96729bd2a8f6d32554aa1e231f4f6b4e7e5264b16cca2b",
65 | "sha256:b9c46cc36662a7949f34b52d8ec7bb59c0d74ba08ba6cb9ce9adc1d8676d9526"
66 | ],
67 | "index": "pypi",
68 | "version": "==2.2.2"
69 | },
70 | "hexdump": {
71 | "hashes": [
72 | "sha256:d781a43b0c16ace3f9366aade73e8ad3a7bd5137d58f0b45ab2d3f54876f20db"
73 | ],
74 | "index": "pypi",
75 | "version": "==3.3"
76 | },
77 | "idna": {
78 | "hashes": [
79 | "sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4",
80 | "sha256:90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2"
81 | ],
82 | "index": "pypi",
83 | "version": "==3.4"
84 | },
85 | "interval3": {
86 | "hashes": [
87 | "sha256:4e33356f59928cf0d7d4c36ffe5fc37ff45ac10ce180d0f539b5866f9bf6e8a1"
88 | ],
89 | "index": "pypi",
90 | "version": "==2.0.0"
91 | },
92 | "ipaddr": {
93 | "hashes": [
94 | "sha256:4092dfe667588d16aa12b59acb7c8a4024e5dcb23a681cd0b0b602373eca88d6"
95 | ],
96 | "index": "pypi",
97 | "version": "==2.2.0"
98 | },
99 | "itsdangerous": {
100 | "hashes": [
101 | "sha256:2c2349112351b88699d8d4b6b075022c0808887cb7ad10069318a8b0bc88db44",
102 | "sha256:5dbbc68b317e5e42f327f9021763545dc3fc3bfe22e6deb96aaf1fc38874156a"
103 | ],
104 | "markers": "python_version >= '3.7'",
105 | "version": "==2.1.2"
106 | },
107 | "jinja2": {
108 | "hashes": [
109 | "sha256:31351a702a408a9e7595a8fc6150fc3f43bb6bf7e319770cbc0db9df9437e852",
110 | "sha256:6088930bfe239f0e6710546ab9c19c9ef35e29792895fed6e6e31a023a182a61"
111 | ],
112 | "markers": "python_version >= '3.7'",
113 | "version": "==3.1.2"
114 | },
115 | "markupsafe": {
116 | "hashes": [
117 | "sha256:0212a68688482dc52b2d45013df70d169f542b7394fc744c02a57374a4207003",
118 | "sha256:089cf3dbf0cd6c100f02945abeb18484bd1ee57a079aefd52cffd17fba910b88",
119 | "sha256:10c1bfff05d95783da83491be968e8fe789263689c02724e0c691933c52994f5",
120 | "sha256:33b74d289bd2f5e527beadcaa3f401e0df0a89927c1559c8566c066fa4248ab7",
121 | "sha256:3799351e2336dc91ea70b034983ee71cf2f9533cdff7c14c90ea126bfd95d65a",
122 | "sha256:3ce11ee3f23f79dbd06fb3d63e2f6af7b12db1d46932fe7bd8afa259a5996603",
123 | "sha256:421be9fbf0ffe9ffd7a378aafebbf6f4602d564d34be190fc19a193232fd12b1",
124 | "sha256:43093fb83d8343aac0b1baa75516da6092f58f41200907ef92448ecab8825135",
125 | "sha256:46d00d6cfecdde84d40e572d63735ef81423ad31184100411e6e3388d405e247",
126 | "sha256:4a33dea2b688b3190ee12bd7cfa29d39c9ed176bda40bfa11099a3ce5d3a7ac6",
127 | "sha256:4b9fe39a2ccc108a4accc2676e77da025ce383c108593d65cc909add5c3bd601",
128 | "sha256:56442863ed2b06d19c37f94d999035e15ee982988920e12a5b4ba29b62ad1f77",
129 | "sha256:671cd1187ed5e62818414afe79ed29da836dde67166a9fac6d435873c44fdd02",
130 | "sha256:694deca8d702d5db21ec83983ce0bb4b26a578e71fbdbd4fdcd387daa90e4d5e",
131 | "sha256:6a074d34ee7a5ce3effbc526b7083ec9731bb3cbf921bbe1d3005d4d2bdb3a63",
132 | "sha256:6d0072fea50feec76a4c418096652f2c3238eaa014b2f94aeb1d56a66b41403f",
133 | "sha256:6fbf47b5d3728c6aea2abb0589b5d30459e369baa772e0f37a0320185e87c980",
134 | "sha256:7f91197cc9e48f989d12e4e6fbc46495c446636dfc81b9ccf50bb0ec74b91d4b",
135 | "sha256:86b1f75c4e7c2ac2ccdaec2b9022845dbb81880ca318bb7a0a01fbf7813e3812",
136 | "sha256:8dc1c72a69aa7e082593c4a203dcf94ddb74bb5c8a731e4e1eb68d031e8498ff",
137 | "sha256:8e3dcf21f367459434c18e71b2a9532d96547aef8a871872a5bd69a715c15f96",
138 | "sha256:8e576a51ad59e4bfaac456023a78f6b5e6e7651dcd383bcc3e18d06f9b55d6d1",
139 | "sha256:96e37a3dc86e80bf81758c152fe66dbf60ed5eca3d26305edf01892257049925",
140 | "sha256:97a68e6ada378df82bc9f16b800ab77cbf4b2fada0081794318520138c088e4a",
141 | "sha256:99a2a507ed3ac881b975a2976d59f38c19386d128e7a9a18b7df6fff1fd4c1d6",
142 | "sha256:a49907dd8420c5685cfa064a1335b6754b74541bbb3706c259c02ed65b644b3e",
143 | "sha256:b09bf97215625a311f669476f44b8b318b075847b49316d3e28c08e41a7a573f",
144 | "sha256:b7bd98b796e2b6553da7225aeb61f447f80a1ca64f41d83612e6139ca5213aa4",
145 | "sha256:b87db4360013327109564f0e591bd2a3b318547bcef31b468a92ee504d07ae4f",
146 | "sha256:bcb3ed405ed3222f9904899563d6fc492ff75cce56cba05e32eff40e6acbeaa3",
147 | "sha256:d4306c36ca495956b6d568d276ac11fdd9c30a36f1b6eb928070dc5360b22e1c",
148 | "sha256:d5ee4f386140395a2c818d149221149c54849dfcfcb9f1debfe07a8b8bd63f9a",
149 | "sha256:dda30ba7e87fbbb7eab1ec9f58678558fd9a6b8b853530e176eabd064da81417",
150 | "sha256:e04e26803c9c3851c931eac40c695602c6295b8d432cbe78609649ad9bd2da8a",
151 | "sha256:e1c0b87e09fa55a220f058d1d49d3fb8df88fbfab58558f1198e08c1e1de842a",
152 | "sha256:e72591e9ecd94d7feb70c1cbd7be7b3ebea3f548870aa91e2732960fa4d57a37",
153 | "sha256:e8c843bbcda3a2f1e3c2ab25913c80a3c5376cd00c6e8c4a86a89a28c8dc5452",
154 | "sha256:efc1913fd2ca4f334418481c7e595c00aad186563bbc1ec76067848c7ca0a933",
155 | "sha256:f121a1420d4e173a5d96e47e9a0c0dcff965afdf1626d28de1460815f7c4ee7a",
156 | "sha256:fc7b548b17d238737688817ab67deebb30e8073c95749d55538ed473130ec0c7"
157 | ],
158 | "markers": "python_version >= '3.7'",
159 | "version": "==2.1.1"
160 | },
161 | "python-engineio": {
162 | "hashes": [
163 | "sha256:7454314a529bba20e745928601ffeaf101c1b5aca9a6c4e48ad397803d10ea0c",
164 | "sha256:d8d8b072799c36cadcdcc2b40d2a560ce09797ab3d2d596b2ad519a5e4df19ae"
165 | ],
166 | "index": "pypi",
167 | "version": "==4.3.4"
168 | },
169 | "python-socketio": {
170 | "hashes": [
171 | "sha256:92395062d9db3c13d30e7cdedaa0e1330bba78505645db695415f9a3c628d097",
172 | "sha256:d9a9f047e6fdd306c852fbac36516f4b495c2096f8ad9ceb8803b8e5ff5622e3"
173 | ],
174 | "index": "pypi",
175 | "version": "==5.7.2"
176 | },
177 | "requests": {
178 | "hashes": [
179 | "sha256:7c5599b102feddaa661c826c56ab4fee28bfd17f5abca1ebbe3e7f19d7c97983",
180 | "sha256:8fefa2a1a1365bf5520aac41836fbee479da67864514bdb821f31ce07ce65349"
181 | ],
182 | "index": "pypi",
183 | "version": "==2.28.1"
184 | },
185 | "six": {
186 | "hashes": [
187 | "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926",
188 | "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"
189 | ],
190 | "index": "pypi",
191 | "version": "==1.16.0"
192 | },
193 | "socketio-client": {
194 | "hashes": [
195 | "sha256:64cd84fba79cf97f28c11e64d1fc42a2221f2d7a4fada05ab381e2d73d74d2c1"
196 | ],
197 | "index": "pypi",
198 | "version": "==0.7.2"
199 | },
200 | "urllib3": {
201 | "hashes": [
202 | "sha256:47cc05d99aaa09c9e72ed5809b60e7ba354e64b59c9c173ac3018642d8bb41fc",
203 | "sha256:c083dd0dce68dbfbe1129d5271cb90f9447dea7d52097c6e0126120c521ddea8"
204 | ],
205 | "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5'",
206 | "version": "==1.26.13"
207 | },
208 | "websocket-client": {
209 | "hashes": [
210 | "sha256:d6b06432f184438d99ac1f456eaf22fe1ade524c3dd16e661142dc54e9cba574",
211 | "sha256:d6e8f90ca8e2dd4e8027c4561adeb9456b54044312dba655e7cae652ceb9ae59"
212 | ],
213 | "index": "pypi",
214 | "version": "==1.4.2"
215 | },
216 | "werkzeug": {
217 | "hashes": [
218 | "sha256:7ea2d48322cc7c0f8b3a215ed73eabd7b5d75d0b50e31ab006286ccff9e00b8f",
219 | "sha256:f979ab81f58d7318e064e99c4506445d60135ac5cd2e177a2de0089bfd4c9bd5"
220 | ],
221 | "index": "pypi",
222 | "version": "==2.2.2"
223 | }
224 | },
225 | "develop": {}
226 | }
227 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # EVM
2 |
3 | [](https://github.com/anddddrew/evm/actions/workflows/build.yml)
4 | [](https://github.com/anddddrew/evm/actions/workflows/format.yml)
5 |
6 | An EVM disassembler codded in python, you can disasemble with bytecode.
7 |
8 | ## Using
9 |
10 | Clone the repo
11 | `git clone https://github.com/anddddrew/evm.git`
12 |
13 | Change directories
14 |
15 | ```
16 | cd evm
17 | ```
18 |
19 | Run script
20 |
21 | ```
22 | python disassembler.py
23 | ```
24 |
25 | After this you should have a prompt to enter your operands.
26 |
27 | _NOTE: all disassembly output from the script will be in a file called "output"_
28 |
--------------------------------------------------------------------------------
/build.sh:
--------------------------------------------------------------------------------
1 | pip3 install -r requirements.txt
2 |
3 | python3 packages/disassembler/disassembler.py
4 |
--------------------------------------------------------------------------------
/lerna.json:
--------------------------------------------------------------------------------
1 | {
2 | "packages": ["packages/*"],
3 | "version": "0.0.0"
4 | }
5 |
--------------------------------------------------------------------------------
/opcode.json:
--------------------------------------------------------------------------------
1 | {
2 | "0": "*STOP",
3 | "1": "ADD",
4 | "2": "MUL",
5 | "3": "SUB",
6 | "4": "DIV",
7 | "5": "SDIV",
8 | "6": "MOD",
9 | "7": "SMOD",
10 | "8": "ADDMOD",
11 | "9": "MULMOD",
12 | "10": "EXP",
13 | "11": "SIGNEXTEND",
14 | "16": "LT",
15 | "17": "GT",
16 | "18": "SLT",
17 | "19": "SGT",
18 | "20": "EQ",
19 | "21": "ISZERO",
20 | "22": "AND",
21 | "23": "OR",
22 | "24": "XOR",
23 | "25": "NOT",
24 | "26": "BYTE",
25 | "27": "SHL",
26 | "28": "SHR",
27 | "29": "SAR",
28 | "30": "ADDRESS",
29 | "31": "BALANCE",
30 | "32": "SHA3",
31 | "48": "ADDRESS",
32 | "49": "BALANCE",
33 | "50": "ORIGIN",
34 | "51": "CALLER",
35 | "52": "CALLVALUE",
36 | "53": "CALLDATALOAD",
37 | "54": "CALLDATASIZE",
38 | "55": "CALLDATACOPY",
39 | "56": "CODESIZE",
40 | "57": "CODECOPY",
41 | "58": "GASPRICE",
42 | "59": "EXTCODESIZE",
43 | "60": "EXTCODECOPY",
44 | "61": "RETURNDATASIZE",
45 | "62": "RETURNDATACOPY",
46 | "63": "EXTCODEHASH",
47 | "64": "BLOCKHASH",
48 | "65": "COINBASE",
49 | "66": "TIMESTAMP",
50 | "67": "NUMBER",
51 | "68": "DIFFICULTY",
52 | "69": "GASLIMIT",
53 | "80": "POP",
54 | "81": "MLOAD",
55 | "82": "MSTORE",
56 | "83": "MSTORE8",
57 | "84": "SLOAD",
58 | "85": "SSTORE",
59 | "86": "*JUMP",
60 | "87": "*JUMPI",
61 | "88": "PC",
62 | "89": "MSIZE",
63 | "90": "GAS",
64 | "91": "JUMPDEST",
65 | "96": "PUSH1",
66 | "97": "PUSH2",
67 | "98": "PUSH3",
68 | "99": "PUSH4",
69 | "100": "PUSH5",
70 | "101": "PUSH6",
71 | "102": "PUSH7",
72 | "103": "PUSH8",
73 | "104": "PUSH9",
74 | "105": "PUSH10",
75 | "106": "PUSH11",
76 | "107": "PUSH12",
77 | "108": "PUSH13",
78 | "109": "PUSH14",
79 | "110": "PUSH15",
80 | "111": "PUSH16",
81 | "112": "PUSH17",
82 | "113": "PUSH18",
83 | "114": "PUSH19",
84 | "115": "PUSH20",
85 | "116": "PUSH21",
86 | "117": "PUSH22",
87 | "118": "PUSH23",
88 | "119": "PUSH24",
89 | "120": "PUSH25",
90 | "121": "PUSH26",
91 | "122": "PUSH27",
92 | "123": "PUSH28",
93 | "124": "PUSH29",
94 | "125": "PUSH30",
95 | "126": "PUSH31",
96 | "127": "PUSH32",
97 | "128": "DUP1",
98 | "129": "DUP2",
99 | "130": "DUP3",
100 | "131": "DUP4",
101 | "132": "DUP5",
102 | "133": "DUP6",
103 | "134": "DUP7",
104 | "135": "DUP8",
105 | "136": "DUP9",
106 | "137": "DUP10",
107 | "138": "DUP11",
108 | "139": "DUP12",
109 | "140": "DUP13",
110 | "141": "DUP14",
111 | "142": "DUP15",
112 | "143": "DUP16",
113 | "144": "SWAP1",
114 | "145": "SWAP2",
115 | "146": "SWAP3",
116 | "147": "SWAP4",
117 | "148": "SWAP5",
118 | "149": "SWAP6",
119 | "150": "SWAP7",
120 | "151": "SWAP8",
121 | "152": "SWAP9",
122 | "153": "SWAP10",
123 | "154": "SWAP11",
124 | "155": "SWAP12",
125 | "156": "SWAP13",
126 | "157": "SWAP14",
127 | "158": "SWAP15",
128 | "159": "SWAP16",
129 | "160": "LOG0",
130 | "161": "LOG1",
131 | "162": "LOG2",
132 | "163": "LOG3",
133 | "164": "LOG4",
134 | "176": "PUSH",
135 | "177": "DUP",
136 | "178": "SWAP",
137 | "240": "CREATE",
138 | "241": "CALL",
139 | "242": "CALLCODE",
140 | "243": "*RETURN",
141 | "244": "DELEGATECALL",
142 | "245": "CREATE2",
143 | "250": "STATICCALL",
144 | "253": "*REVERT",
145 | "255": "*SELFDESTRUCT"
146 | }
147 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "evm",
3 | "version": "1.0.0",
4 | "main": "index.js",
5 | "repository": "git@github.com:anddddrew/evm.git",
6 | "author": "Andrew ",
7 | "license": "MIT",
8 | "dependencies": {
9 | "prettier": "2.6.2"
10 | },
11 | "devDependencies": {
12 | "husky": "^8.0.0",
13 | "lerna": "^4.0.0"
14 | },
15 | "scripts": {
16 | "prepare": "husky install"
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/packages/contracts/.env.example:
--------------------------------------------------------------------------------
1 | ETHERSCAN_API_KEY=ABC123ABC123ABC123ABC123ABC123ABC1
2 | ROPSTEN_URL=https://eth-ropsten.alchemyapi.io/v2/
3 | PRIVATE_KEY=0xabc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc1
4 |
--------------------------------------------------------------------------------
/packages/contracts/.eslintignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | artifacts
3 | cache
4 | coverage
5 |
--------------------------------------------------------------------------------
/packages/contracts/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | env: {
3 | browser: false,
4 | es2021: true,
5 | mocha: true,
6 | node: true,
7 | },
8 | plugins: ["@typescript-eslint"],
9 | extends: [
10 | "standard",
11 | "plugin:prettier/recommended",
12 | "plugin:node/recommended",
13 | ],
14 | parser: "@typescript-eslint/parser",
15 | parserOptions: {
16 | ecmaVersion: 12,
17 | },
18 | rules: {
19 | "node/no-unsupported-features/es-syntax": [
20 | "error",
21 | { ignores: ["modules"] },
22 | ],
23 | },
24 | };
25 |
--------------------------------------------------------------------------------
/packages/contracts/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .env
3 | coverage
4 | coverage.json
5 | typechain
6 |
7 | #Hardhat files
8 | cache
9 | artifacts
10 |
--------------------------------------------------------------------------------
/packages/contracts/.npmignore:
--------------------------------------------------------------------------------
1 | hardhat.config.ts
2 | scripts
3 | test
4 |
--------------------------------------------------------------------------------
/packages/contracts/.prettierignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | artifacts
3 | cache
4 | coverage*
5 | gasReporterOutput.json
6 |
--------------------------------------------------------------------------------
/packages/contracts/.prettierrc:
--------------------------------------------------------------------------------
1 | {}
2 |
--------------------------------------------------------------------------------
/packages/contracts/.solhint.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "solhint:recommended",
3 | "rules": {
4 | "compiler-version": ["error", "^0.8.0"],
5 | "func-visibility": ["warn", { "ignoreConstructors": true }]
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/packages/contracts/.solhintignore:
--------------------------------------------------------------------------------
1 | node_modules
2 |
--------------------------------------------------------------------------------
/packages/contracts/README.md:
--------------------------------------------------------------------------------
1 | # Advanced Sample Hardhat Project
2 |
3 | This project demonstrates an advanced Hardhat use case, integrating other tools commonly used alongside Hardhat in the ecosystem.
4 |
5 | The project comes with a sample contract, a test for that contract, a sample script that deploys that contract, and an example of a task implementation, which simply lists the available accounts. It also comes with a variety of other tools, preconfigured to work with the project code.
6 |
7 | Try running some of the following tasks:
8 |
9 | ```shell
10 | npx hardhat accounts
11 | npx hardhat compile
12 | npx hardhat clean
13 | npx hardhat test
14 | npx hardhat node
15 | npx hardhat help
16 | REPORT_GAS=true npx hardhat test
17 | npx hardhat coverage
18 | npx hardhat run scripts/deploy.ts
19 | TS_NODE_FILES=true npx ts-node scripts/deploy.ts
20 | npx eslint '**/*.{js,ts}'
21 | npx eslint '**/*.{js,ts}' --fix
22 | npx prettier '**/*.{json,sol,md}' --check
23 | npx prettier '**/*.{json,sol,md}' --write
24 | npx solhint 'contracts/**/*.sol'
25 | npx solhint 'contracts/**/*.sol' --fix
26 | ```
27 |
28 | # Etherscan verification
29 |
30 | To try out Etherscan verification, you first need to deploy a contract to an Ethereum network that's supported by Etherscan, such as Ropsten.
31 |
32 | In this project, copy the .env.example file to a file named .env, and then edit it to fill in the details. Enter your Etherscan API key, your Ropsten node URL (eg from Alchemy), and the private key of the account which will send the deployment transaction. With a valid .env file in place, first deploy your contract:
33 |
34 | ```shell
35 | hardhat run --network ropsten scripts/deploy.ts
36 | ```
37 |
38 | Then, copy the deployment address and paste it in to replace `DEPLOYED_CONTRACT_ADDRESS` in this command:
39 |
40 | ```shell
41 | npx hardhat verify --network ropsten DEPLOYED_CONTRACT_ADDRESS "Hello, Hardhat!"
42 | ```
43 |
44 | # Performance optimizations
45 |
46 | For faster runs of your tests and scripts, consider skipping ts-node's type checking by setting the environment variable `TS_NODE_TRANSPILE_ONLY` to `1` in hardhat's environment. For more details see [the documentation](https://hardhat.org/guides/typescript.html#performance-optimizations).
47 |
--------------------------------------------------------------------------------
/packages/contracts/contracts/Greeter.sol:
--------------------------------------------------------------------------------
1 | //SPDX-License-Identifier: Unlicense
2 | pragma solidity ^0.8.0;
3 |
4 | import "hardhat/console.sol";
5 |
6 | contract Greeter {
7 | string private greeting;
8 |
9 | constructor(string memory _greeting) {
10 | console.log("Deploying a Greeter with greeting:", _greeting);
11 | greeting = _greeting;
12 | }
13 |
14 | function greet() public view returns (string memory) {
15 | return greeting;
16 | }
17 |
18 | function setGreeting(string memory _greeting) public {
19 | console.log("Changing greeting from '%s' to '%s'", greeting, _greeting);
20 | greeting = _greeting;
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/packages/contracts/contracts/Merkle.sol:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: MIT
2 | pragma solidity ^0.8.0;
3 |
4 | contract Merkle {
5 | function verify(
6 | bytes32[] memory proof,
7 | bytes32 root,
8 | bytes32 leaf,
9 | uint index
10 | ) public pure returns(bool) {
11 | // idk here
12 | }
13 |
14 | }
--------------------------------------------------------------------------------
/packages/contracts/hardhat.config.ts:
--------------------------------------------------------------------------------
1 | import * as dotenv from "dotenv";
2 |
3 | import { HardhatUserConfig, task } from "hardhat/config";
4 | import "@nomiclabs/hardhat-etherscan";
5 | import "@nomiclabs/hardhat-waffle";
6 | import "@typechain/hardhat";
7 | import "hardhat-gas-reporter";
8 | import "solidity-coverage";
9 |
10 | dotenv.config();
11 |
12 | // This is a sample Hardhat task. To learn how to create your own go to
13 | // https://hardhat.org/guides/create-task.html
14 | task("accounts", "Prints the list of accounts", async (taskArgs, hre) => {
15 | const accounts = await hre.ethers.getSigners();
16 |
17 | for (const account of accounts) {
18 | console.log(account.address);
19 | }
20 | });
21 |
22 | // You need to export an object to set up your config
23 | // Go to https://hardhat.org/config/ to learn more
24 |
25 | const config: HardhatUserConfig = {
26 | solidity: "0.8.4",
27 | networks: {
28 | ropsten: {
29 | url: process.env.ROPSTEN_URL || "",
30 | accounts:
31 | process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [],
32 | },
33 | },
34 | gasReporter: {
35 | enabled: process.env.REPORT_GAS !== undefined,
36 | currency: "USD",
37 | },
38 | etherscan: {
39 | apiKey: process.env.ETHERSCAN_API_KEY,
40 | },
41 | };
42 |
43 | export default config;
44 |
--------------------------------------------------------------------------------
/packages/contracts/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "hardhat-project",
3 | "devDependencies": {
4 | "@nomiclabs/hardhat-ethers": "^2.2.1",
5 | "@nomiclabs/hardhat-etherscan": "^3.1.2",
6 | "@nomiclabs/hardhat-waffle": "^2.0.3",
7 | "@typechain/ethers-v5": "^7.2.0",
8 | "@typechain/hardhat": "^2.3.1",
9 | "@types/chai": "^4.3.4",
10 | "@types/mocha": "^9.1.1",
11 | "@types/node": "^12.20.55",
12 | "@typescript-eslint/eslint-plugin": "^4.33.0",
13 | "@typescript-eslint/parser": "^4.33.0",
14 | "chai": "^4.3.7",
15 | "dotenv": "^16.0.3",
16 | "eslint": "^7.32.0",
17 | "eslint-config-prettier": "^8.5.0",
18 | "eslint-config-standard": "^16.0.3",
19 | "eslint-plugin-import": "^2.26.0",
20 | "eslint-plugin-node": "^11.1.0",
21 | "eslint-plugin-prettier": "^3.4.1",
22 | "eslint-plugin-promise": "^5.2.0",
23 | "ethereum-waffle": "^3.4.4",
24 | "ethers": "^5.7.2",
25 | "hardhat": "^2.12.2",
26 | "hardhat-gas-reporter": "^1.0.9",
27 | "prettier": "^2.7.1",
28 | "prettier-plugin-solidity": "^1.0.0-rc.1",
29 | "solhint": "^3.3.7",
30 | "solidity-coverage": "^0.7.22",
31 | "ts-node": "^10.9.1",
32 | "typechain": "^5.2.0",
33 | "typescript": "^4.8.4"
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/packages/contracts/scripts/deploy.ts:
--------------------------------------------------------------------------------
1 | // We require the Hardhat Runtime Environment explicitly here. This is optional
2 | // but useful for running the script in a standalone fashion through `node