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

backport main into dev #15

Merged
merged 25 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
f2b929d
Initialize subgraph
verkhohliad Jul 22, 2024
5f71008
remove chiado from subgraph slug
verkhohliad Jul 23, 2024
c99a5b5
new wip version of the graph for chiadO
verkhohliad Jul 24, 2024
45e2c1f
integrate theGraph usage, handling subgraph link with selected chain,…
verkhohliad Jul 25, 2024
6bd2ce1
change validator registry query to querying subgraph
verkhohliad Jul 30, 2024
cd4beaf
integrate zustand for store management, create persisted store for va…
verkhohliad Jul 31, 2024
10ade91
Initialize subgraph
verkhohliad Jul 31, 2024
4189e01
deploy and integrate gnosis subgraph, make workaround thegraph limita…
verkhohliad Aug 1, 2024
074814c
remove abandoned skip logic for querying graph
verkhohliad Aug 1, 2024
7b544c6
minor fixes
verkhohliad Aug 1, 2024
6f8036a
Merge pull request #12 from gnosischain/feat/add-sub-graphs
verkhohliad Aug 2, 2024
872ea5f
add missing dependency
verkhohliad Aug 2, 2024
54bd75a
handle incorrect validator registration message, fix finding next shu…
verkhohliad Aug 14, 2024
5fb65e6
add theGraph secret to deployment script
verkhohliad Aug 14, 2024
4a597ac
Merge pull request #13 from gnosischain/fix/shutter-timer-error-handling
verkhohliad Aug 15, 2024
0bd7015
feat: control waiting for new epochs if in next one there is no shutt…
verkhohliad Aug 29, 2024
7365828
fix: recalculate epoch and waiting status for switching between chain…
verkhohliad Aug 30, 2024
c6d44d4
patch: add .nvmrc file
verkhohliad Aug 30, 2024
eb440ee
chore: setup prettier, commitlint conventional, husky, lint-staged, r…
verkhohliad Aug 30, 2024
f6559ee
chore: run eslint fix with prettier
verkhohliad Aug 30, 2024
c2f3a54
chore: resetup typescript checks
verkhohliad Aug 30, 2024
7a40f97
fix: fix ui issue with tip regarding using brave wallet on mobile
verkhohliad Aug 30, 2024
5488e0c
docs: write readme
verkhohliad Aug 30, 2024
1bd3e7c
Merge pull request #14 from gnosischain/improvements/validator-match-ui
verkhohliad Sep 2, 2024
cc33b8f
fix: fix Web3ModalProvider, remove extra exports
verkhohliad Sep 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .commitlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": ["@commitlint/config-conventional"]
}
3 changes: 2 additions & 1 deletion .env-example
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
VITE_WALLET_CONNECT_PROJECT_ID=
VITE_WALLET_CONNECT_PROJECT_ID=
VITE_THE_GRAPH_API_KEY=
11 changes: 9 additions & 2 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,22 @@ module.exports = {
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
'prettier',
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
ignorePatterns: ['dist', '.eslintrc.cjs', 'thegraph', 'public'],
parser: '@typescript-eslint/parser',
plugins: ['react-refresh'],
plugins: [
'react-refresh',
'react',
'@typescript-eslint',
'prettier'
],
rules: {
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
'@typescript-eslint/no-explicit-any': 'off',
"prettier/prettier": ["error"],
},
}
1 change: 1 addition & 0 deletions .github/workflows/dev_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ concurrency:

env:
VITE_WALLET_CONNECT_PROJECT_ID: ${{ secrets.VITE_WALLET_CONNECT_PROJECT_ID }}
VITE_THE_GRAPH_API_KEY: ${{ secrets.VITE_THE_GRAPH_API_KEY }}

jobs:
deploy:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/prod_deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ concurrency:

env:
VITE_WALLET_CONNECT_PROJECT_ID: ${{ secrets.VITE_WALLET_CONNECT_PROJECT_ID }}
VITE_THE_GRAPH_API_KEY: ${{ secrets.VITE_THE_GRAPH_API_KEY }}

jobs:
deploy:
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,7 @@ dist-ssr
.env
.vite
.firebaserc
.firebase
.firebase

--fix
tsconfig.tsbuildinfo
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx lint-staged
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
22.3.0
41 changes: 41 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# next.js
/.next/
/out/

# production
/build
/dist

# misc
.DS_Store
*.d.ts
.eslintrc.js
.eslintignore
.prettierrc.js
.prettierignore
tsconfig.json
next.config.js

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env
.env.local
.env.development.local
.env.test.local
.env.production.local

# Files generated by next-on-netlify command
/out_publish/
/out_functions/
7 changes: 7 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default {
bracketSpacing: true,
printWidth: 100,
semi: true,
singleQuote: true,
trailingComma: 'all',
}
81 changes: 60 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,69 @@
# React + TypeScript + Vite
# Gnosis Shutter App

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
## Overview

Currently, two official plugins are available:
Gnosis Shutter enhances transaction privacy and security on the Gnosis Chain. It allows users to encrypt their transactions to prevent frontrunning and censorship, with decryption and execution only occurring when they are ready to be included in a blockchain block.

- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
## Features

## Expanding the ESLint configuration
- **Encryption of Transactions**: Users can encrypt transactions using a public 'eon key' before submission.
- **Decentralized Decryption**: Managed by a group of nodes called keypers, who ensure secure transaction decryption.
- **Enhanced Security**: Transactions are decrypted only when they are ready to be included in a block, enhancing security and privacy.
- **Opt-in System**: Users can choose between sending encrypted transactions or using the standard plaintext format.
- **Shutter Timer**: Track when next shutter validator will include transactions from sequencer to the block.

If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
![img.png](./public/shutter-architecture.png)

- Configure the top-level `parserOptions` property like this:
![img.png](public/app-screenshot.png)

```js
export default {
// other rules...
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: ['./tsconfig.json', './tsconfig.node.json'],
tsconfigRootDir: __dirname,
},
}
## Getting Started

### Prerequisites

- Node.js (version 22.3.0)
- A compatible wallet (e.g., Brave Wallet)

### Installation

1. Clone the repository:
```bash
git clone https://github.com/yourusername/gnosis-shutter.git
cd gnosis-shutter
```

2. Install dependencies:
```bash
npm install
```

3. Configure environment variables:
```bash
cp .env.example .env
```

Running the Application
To start the application, run the following command:
```bash
npm run dev
```

- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked`
- Optionally add `plugin:@typescript-eslint/stylistic-type-checked`
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list
## Usage
To submit an encrypted transaction:

1. Connect your Brave Wallet.
2. Select the Gnosis Chain or Chiado.
3. Choose transfer tokens or advanced transaction (you need to copy build transaction from metamask)
4. Sign transaction.
5. Submit transaction to shutter sequencer contract.

Transactions will be encrypted client-side and sent to the Sequencer Contract for processing.

## Documentation
For more detailed information about the Gnosis Shutter system and its components, visit the following links:
* [Shutter Network](https://www.shutter.network/).
* [Shutterized Gnosis Chain -- High Level Overview](https://github.com/gnosischain/specs/blob/master/shutter/high-level.md)
* [Shutterized Gnosis Chain -- Low Level Specification](https://github.com/gnosischain/specs/blob/master/shutter/low-level.md)

## Support

If you need help or have any questions, please file an issue [here](https://github.com/gnosischain/shutter-encryption/issues).
17 changes: 0 additions & 17 deletions firebase.json

This file was deleted.

2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/gnosis.svg" />
<link rel="icon" type="image/svg+xml" href="/gnosisGreen.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Gnosis Shutter</title>
</head>
Expand Down
Loading
Loading