-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit f54de95
Showing
139 changed files
with
21,417 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
node_modules | ||
.envrc | ||
.env | ||
# dependencies, yarn, etc | ||
# yarn / eslint | ||
.yarn/* | ||
!.yarn/patches | ||
!.yarn/plugins | ||
!.yarn/releases | ||
!.yarn/sdks | ||
!.yarn/versions | ||
.eslintcache | ||
.vscode/** | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
# Welcome to Scaffold-ETH 2 Contributing Guide | ||
|
||
Thank you for investing your time in contributing to Scaffold-ETH 2! | ||
|
||
This guide aims to provide an overview of the contribution workflow to help us make the contribution process effective for everyone involved. | ||
|
||
## About the Project | ||
|
||
Scaffold-ETH 2 is a minimal and forkable repo providing builders with a starter kit to build decentralized applications on Ethereum. | ||
|
||
Read the [README](README.md) to get an overview of the project. | ||
|
||
### Vision | ||
|
||
The goal of Scaffold-ETH 2 is to provide the primary building blocks for a decentralized application. | ||
|
||
The repo can be forked to include integrations and more features, but we want to keep the master branch simple and minimal. | ||
|
||
### Project Status | ||
|
||
The project is under active development. | ||
|
||
You can view the open Issues, follow the development process and contribute to the project. | ||
|
||
## Getting started | ||
|
||
You can contribute to this repo in many ways: | ||
|
||
- Solve open issues | ||
- Report bugs or feature requests | ||
- Improve the documentation | ||
|
||
Contributions are made via Issues and Pull Requests (PRs). A few general guidelines for contributions: | ||
|
||
- Search for existing Issues and PRs before creating your own. | ||
- Contributions should only fix/add the functionality in the issue OR address style issues, not both. | ||
- If you're running into an error, please give context. Explain what you're trying to do and how to reproduce the error. | ||
- Please use the same formatting in the code repository. You can configure your IDE to do it by using the prettier / linting config files included in each package. | ||
- If applicable, please edit the README.md file to reflect the changes. | ||
|
||
### Issues | ||
|
||
Issues should be used to report problems, request a new feature, or discuss potential changes before a PR is created. | ||
|
||
#### Solve an issue | ||
|
||
Scan through our [existing issues](https://github.com/scaffold-eth/scaffold-eth-2/issues) to find one that interests you. | ||
|
||
If a contributor is working on the issue, they will be assigned to the individual. If you find an issue to work on, you are welcome to assign it to yourself and open a PR with a fix for it. | ||
|
||
#### Create a new issue | ||
|
||
If a related issue doesn't exist, you can open a new issue. | ||
|
||
Some tips to follow when you are creating an issue: | ||
|
||
- Provide as much context as possible. Over-communicate to give the most details to the reader. | ||
- Include the steps to reproduce the issue or the reason for adding the feature. | ||
- Screenshots, videos etc., are highly appreciated. | ||
|
||
### Pull Requests | ||
|
||
#### Pull Request Process | ||
|
||
We follow the ["fork-and-pull" Git workflow](https://github.com/susam/gitpr) | ||
|
||
1. Fork the repo | ||
2. Clone the project | ||
3. Create a new branch with a descriptive name | ||
4. Commit your changes to the new branch | ||
5. Push changes to your fork | ||
6. Open a PR in our repository and tag one of the maintainers to review your PR | ||
|
||
Here are some tips for a high-quality pull request: | ||
|
||
- Create a title for the PR that accurately defines the work done. | ||
- Structure the description neatly to make it easy to consume by the readers. For example, you can include bullet points and screenshots instead of having one large paragraph. | ||
- Add the link to the issue if applicable. | ||
- Have a good commit message that summarises the work done. | ||
|
||
Once you submit your PR: | ||
|
||
- We may ask questions, request additional information or ask for changes to be made before a PR can be merged. Please note that these are to make the PR clear for everyone involved and aims to create a frictionless interaction process. | ||
- As you update your PR and apply changes, mark each conversation resolved. | ||
|
||
Once the PR is approved, we'll "squash-and-merge" to keep the git commit history clean. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2023 BuidlGuidl | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
# 🏗 Bodhi AI Explorer | ||
|
||
<h4 align="center"> | ||
<a href="https://smart-contract-explorer.movespace.xyz/"> -[ Lanuch App ]- </a> | ||
</h4> | ||
<h4> | ||
Other important links: | ||
<br><br> | ||
* <a href="https://mumbai.polygonscan.com/address/0x9d4716dc798ceac7e40b0b692e7a2fc3a353c4b1">smart contract on Mumbai Network</a> | ||
<br> | ||
* <a href="https://app.embedbase.xyz/datasets/f2e0aabc-a506-4217-8570-4c888d3d3556">VectorDB about Ethereum Smart Contract</a> | ||
<br> | ||
* <a href="https://app.embedbase.xyz/datasets/7740d47b-8ce1-4ae7-8256-049b01fa034d">VectorDB about Ethereum Smart Contract Sliced</a> | ||
<br> | ||
* <a href="https://app.embedbase.xyz/datasets/e4276331-4582-463b-85be-abc8b21ad739">VectorDB about Ethereum Smart Contract Analysis</a> | ||
</h4> | ||
|
||
|
||
See Demo Video: | ||
|
||
> https://youtu.be/zeY9lp2Hcwo | ||
See Deck: | ||
|
||
> https://github.com/NonceGeek/ai-based-smart-contract-explorer/blob/main/AI-based-Smart-Contract-Explorer-Deck.pdf | ||
|
||
|
||
🧪 Bodhi AI Explorer 是一个 基于向量数据库和 LLM 进行 ETH 智能合约代码检索的浏览器,搜索结果包含智能合约原文、出处、代码解析等多维度内容。向量数据库技术是人工智能应用中的一项重要技术,通过 ANN 最似近邻算法,我们可以通过自然语言进行联想式搜索,而非传统的关键字搜索。立项起因是传统搜索代码的浏览器,例如 Etherscan,仅能搜索出原始代码。我们希望通过 AI 赋能,建立关于智能合约代码的全维度搜索,让合约开发者的效率指数倍增。 | ||
|
||
|
||
|
||
## Quickstart | ||
|
||
如果您想快速体验我们的功能请通过:<a href="https://smart-contract-explorer.movespace.xyz/">Lanuch App</a> | ||
|
||
## Frontend | ||
### Requirements | ||
|
||
Before you begin, you need to install the following tools: | ||
|
||
- [Node (v18 LTS)](https://nodejs.org/en/download/) | ||
- Yarn ([v1](https://classic.yarnpkg.com/en/docs/install/) or [v2+](https://yarnpkg.com/getting-started/install)) | ||
- [Git](https://git-scm.com/downloads) | ||
|
||
To get started with Bodhi AI Explorer, follow the steps below: | ||
|
||
1. Clone this repo & install dependencies | ||
|
||
``` | ||
git clone https://github.com/NonceGeek/ai-based-smart-contract-explorer.git | ||
cd ai-based-smart-contract-explorer | ||
yarn install | ||
``` | ||
|
||
2. Run a local network in the first terminal: | ||
|
||
``` | ||
yarn chain | ||
``` | ||
|
||
This command starts a local Ethereum network using Hardhat. The network runs on your local machine and can be used for testing and development. You can customize the network configuration in `hardhat.config.ts`. | ||
|
||
3. On a second terminal, deploy the test contract: | ||
|
||
``` | ||
yarn deploy | ||
``` | ||
|
||
This command deploys a test smart contract to the local network. The contract is located in `packages/hardhat/contracts` and can be modified to suit your needs. The `yarn deploy` command uses the deploy script located in `packages/hardhat/deploy` to deploy the contract to the network. You can also customize the deploy script. | ||
|
||
4. On a third terminal, start your NextJS app: | ||
|
||
``` | ||
yarn start | ||
``` | ||
|
||
Visit your app on: `http://localhost:3000`. You can interact with your smart contract using the contract component or the example ui in the frontend. You can tweak the app config in `packages/nextjs/explorer.config.ts`. | ||
|
||
Run smart contract test with `yarn hardhat:test` | ||
|
||
- Edit your smart contract `VectorDBProposalGovernancer.sol` in `packages/hardhat/contracts` | ||
- Edit your frontend in `packages/nextjs/pages` | ||
- Edit your deployment scripts in `packages/hardhat/deploy` | ||
## Reference | ||
|
||
如果您想了解数据流的实现,请先下载我们实现的client:<a href="https://github.com/NonceGeek/movespace_db_uploader_cli/blob/main/movespace_db_uploader_cli">movespace_db_uploader_cli</a> | ||
|
||
#### 请确保使用变量“EMBEDBASE_KEY” 将您获取的app_key存储在dotenv(.env)中 | ||
|
||
参数列表和类型: | ||
``` | ||
[path: :string, embedbaseid: :string, type: :string, insert: :boolean, delete: :boolean, metadata: :string], | ||
``` | ||
参数别名: | ||
``` | ||
f: :filepath, e: :embedbaseid, t: :type, i: :insert, d: :delete, m: :metadata | ||
``` | ||
使用格式: | ||
``` | ||
./movespace_db_uploader_cli --type [mddoc, code] --path [the_path_for_content] --metadata [the_path_for_metadata] --embedbaseid [embedbase_id] --insert | ||
``` | ||
使用事例: | ||
|
||
``` | ||
$ ./movespace_db_uploader_cli --type mddoc --path example_data/eth/analysis/erc20.md --metadata example_data/eth/analysis/erc20.json --embedbaseid eth-smart-contracts-analysis --insert | ||
$ ./movespace_db_uploader_cli --type code --path example_data/eth/sliced/erc20.json --embedbaseid eth-smart-contracts-sliced --insert | ||
``` | ||
|
||
|
||
|
||
|
||
## Architecture | ||
|
||
 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"folders": [ | ||
{ | ||
"name": "project-root", | ||
"path": "./" | ||
}, | ||
{ | ||
"name": "supabase-functions", | ||
"path": "supabase/functions" | ||
} | ||
], | ||
"settings": { | ||
"files.exclude": { | ||
"supabase/functions/": true | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{ | ||
"name": "se-2", | ||
"version": "0.0.1", | ||
"private": true, | ||
"workspaces": { | ||
"packages": [ | ||
"packages/hardhat", | ||
"packages/nextjs" | ||
] | ||
}, | ||
"scripts": { | ||
"account": "yarn workspace @se-2/hardhat account", | ||
"chain": "yarn workspace @se-2/hardhat chain", | ||
"fork": "yarn workspace @se-2/hardhat fork", | ||
"deploy": "yarn workspace @se-2/hardhat deploy", | ||
"verify": "yarn workspace @se-2/hardhat verify", | ||
"compile": "yarn workspace @se-2/hardhat compile", | ||
"generate": "yarn workspace @se-2/hardhat generate", | ||
"hardhat:lint": "yarn workspace @se-2/hardhat lint", | ||
"hardhat:lint-staged": "yarn workspace @se-2/hardhat lint-staged", | ||
"hardhat:test": "yarn workspace @se-2/hardhat test", | ||
"test": "yarn hardhat:test", | ||
"start": "yarn workspace @se-2/nextjs dev", | ||
"next:lint": "yarn workspace @se-2/nextjs lint", | ||
"next:format": "yarn workspace @se-2/nextjs format", | ||
"next:check-types": "yarn workspace @se-2/nextjs check-types", | ||
"postinstall": "husky install", | ||
"precommit": "lint-staged", | ||
"vercel": "yarn workspace @se-2/nextjs vercel", | ||
"vercel:yolo": "yarn workspace @se-2/nextjs vercel:yolo" | ||
}, | ||
"packageManager": "[email protected]", | ||
"devDependencies": { | ||
"husky": "^8.0.1", | ||
"lint-staged": "^13.0.3" | ||
}, | ||
"resolutions": { | ||
"usehooks-ts@^2.7.2": "patch:usehooks-ts@npm:^2.7.2#./.yarn/patches/usehooks-ts-npm-2.7.2-fceffe0e43.patch" | ||
}, | ||
"dependencies": { | ||
"react-markdown": "^9.0.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Template for Hardhat environment variables. | ||
|
||
# To use this template, copy this file, rename it .env, and fill in the values. | ||
|
||
# If not set, we provide default values (check `hardhat.config.ts`) so developers can start prototyping out of the box, | ||
# but we recommend getting your own API Keys for Production Apps. | ||
|
||
# To access the values stored in this .env file you can use: process.env.VARIABLENAME | ||
ALCHEMY_API_KEY= | ||
DEPLOYER_PRIVATE_KEY= | ||
ETHERSCAN_API_KEY= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# folders | ||
artifacts | ||
cache | ||
contracts | ||
node_modules/ | ||
typechain-types | ||
# files | ||
**/*.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"env": { | ||
"node": true | ||
}, | ||
"parser": "@typescript-eslint/parser", | ||
"extends": ["plugin:prettier/recommended", "plugin:@typescript-eslint/recommended"], | ||
"rules": { | ||
"@typescript-eslint/no-unused-vars": ["error"], | ||
"@typescript-eslint/no-explicit-any": ["off"], | ||
"prettier/prettier": [ | ||
"warn", | ||
{ | ||
"endOfLine": "auto" | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
node_modules | ||
.env | ||
coverage | ||
coverage.json | ||
typechain | ||
typechain-types | ||
temp | ||
|
||
#Hardhat files | ||
cache | ||
artifacts | ||
|
||
#zkSync files | ||
artifacts-zk | ||
cache-zk | ||
|
||
deployments |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"arrowParens": "avoid", | ||
"printWidth": 120, | ||
"tabWidth": 2, | ||
"trailingComma": "all", | ||
"overrides": [ | ||
{ | ||
"files": "*.sol", | ||
"options": { | ||
"printWidth": 80, | ||
"tabWidth": 4, | ||
"useTabs": true, | ||
"singleQuote": false, | ||
"bracketSpacing": true, | ||
"explicitTypes": "always" | ||
} | ||
} | ||
] | ||
} |
Oops, something went wrong.