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

Add safe 1.4 flow #8

Open
wants to merge 92 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
d918653
Add burner wallet creation step
wryonik Aug 24, 2024
0bbbd92
Directory restructuring changes and implement useGetSafeAccountAddres…
wryonik Aug 25, 2024
c21275b
WIP: Integrate burner wallet flow
wryonik Sep 2, 2024
857b2bd
Update universal recovery module address.
wshino Sep 5, 2024
c70055c
Update module address, it's universal module with safe recovery handler.
wshino Sep 8, 2024
159bae2
WIP: Integrate burner wallet flow
wryonik Sep 9, 2024
8cfd860
WIP: Update calldata for complete recovery function
wryonik Sep 9, 2024
104667b
Update calldata
wshino Sep 9, 2024
7930313
Revert "Update calldata"
wshino Sep 9, 2024
55dc61e
Update universalEmailRecoveryModule
wshino Sep 11, 2024
756c1d7
chore
wshino Sep 11, 2024
a8949bb
Update universalEmailRecoveryModule
wshino Sep 11, 2024
ee139d9
Add recoveryDataUtils.ts
wshino Sep 11, 2024
4b4b75c
Update universalEmailRecoveryModule
wshino Sep 11, 2024
f2798d2
WIP
wshino Sep 12, 2024
ae027da
WIP
wshino Sep 12, 2024
e0eb3e7
WIP
wshino Sep 12, 2024
7e025dd
WIP
wshino Sep 12, 2024
87422e2
WIP
wshino Sep 12, 2024
66ce342
Add abi json
wshino Sep 13, 2024
10fafe5
Update newOwners address
wryonik Sep 13, 2024
aef8b89
Flow updates
wryonik Sep 14, 2024
d82cd0b
feat: add guidelines and .github
Bisht13 Sep 14, 2024
c832ea5
Refactoring changes and bug fixes
wryonik Sep 14, 2024
b62acf3
Remove dead code
wryonik Sep 14, 2024
b3f8b54
:hammer: Update rebase changes and flow fixes
wryonik Sep 16, 2024
94a5a44
WIP: fix safe 1.3 flow
wryonik Sep 16, 2024
d8dbd93
Add getRequestsRecoveryCommandForSafe13
wshino Sep 17, 2024
0066e6a
Merge branch 'add-safe-1.4-rebase' of https://github.com/zkemail/emai…
wshino Sep 17, 2024
d98e072
Remove saltNonce
wshino Sep 17, 2024
de9c26a
Add saltNonce into local storage
wshino Sep 17, 2024
066ca68
UX fixes
wryonik Sep 17, 2024
603fd8b
Update ABI
wshino Sep 17, 2024
662d84a
Merge branch 'add-safe-1.4-rebase' of https://github.com/zkemail/emai…
wshino Sep 17, 2024
6929aba
WIP: fix safe 1.3 flow
wryonik Sep 16, 2024
934dc72
Remove saltNonce
wshino Sep 17, 2024
249e92e
Add saltNonce into local storage
wshino Sep 17, 2024
58a47c5
Update ABI
wshino Sep 17, 2024
5158f5d
UX fixes
wryonik Sep 17, 2024
e33bb1d
chore: Code refactoring
wryonik Sep 17, 2024
527a155
chore: apply Prettier formatting across the codebase
wryonik Sep 18, 2024
2113683
chore: max warning 0 in lint workflow
Bisht13 Sep 18, 2024
88aa13d
fix: resolve ESLint issues and improve code quality
wryonik Sep 18, 2024
d95aea7
docs: Add detailed JSDoc comments for public functions
wryonik Sep 18, 2024
8ce5a9a
feat: Dockerize application for production deployment
wryonik Sep 19, 2024
2ba1443
feat: Add /api/ping endpoint
wryonik Sep 19, 2024
9e9ed1e
Update safe4337ModuleAddress and erc7579LaunchpadAddress
wshino Sep 19, 2024
2ee05c5
Add url to retrieve safe4337ModuleAddress
wshino Sep 19, 2024
f5d3805
chore: add detailed comments throughout the flow
wryonik Sep 19, 2024
b36d603
fix: fix dockerfile image
wryonik Sep 19, 2024
dcdc7f2
Merge branch 'add-safe-1.4-rebase' of https://github.com/zkemail/emai…
wshino Sep 20, 2024
f9b0828
fix: Dockerization
Bisht13 Sep 20, 2024
bb44e67
chore: update node version in Dockerfile
Bisht13 Sep 20, 2024
6d4f63e
fix: Add retry mechanism to acceptanceRequest API call
wryonik Sep 20, 2024
de8e704
chore: Update network timeout in Dockerfile
wryonik Sep 23, 2024
dcdea45
feat: Add burner wallet link once created
wryonik Sep 23, 2024
c123612
feat: Moved reset burner wallet mechanism inside burner wallet flow
wryonik Sep 23, 2024
200c8a0
fixed prettier lint issues to test preview deploy
Divide-By-0 Sep 23, 2024
a51e203
WIP: Add cancel recovery feature
wryonik Sep 24, 2024
ffaeb3d
feat: Add cancel recovery feature in safe 1.3 flow
wryonik Sep 26, 2024
02e446f
chore: Copy changes
wryonik Sep 26, 2024
75056bc
feat: Add cancel recovery feature in burner wallet flow
wryonik Sep 27, 2024
9753043
feat: Add logic to add/remove guardians in safe 1.3 flow
wryonik Sep 25, 2024
81bcc1b
feat: Add add/remove guardian flow for burner wallet
wryonik Sep 27, 2024
fd0efb6
fix: UI updates
wryonik Sep 27, 2024
47e0f88
fix: guardians to account linking
wryonik Sep 27, 2024
3ab58ff
fix: Fix loading state in guardian setup page
wryonik Sep 27, 2024
9c70609
ui: Add placeholders in input fields
wryonik Sep 30, 2024
dcc8510
bug: Fix navigation of back button in recovery page
wryonik Sep 30, 2024
49850a7
feat: Add validation for new safe owner
wryonik Sep 30, 2024
4b001b6
component: Add info tooltip in input fields
wryonik Sep 30, 2024
1b0c8af
ux: Add tooltips for clarity and user guidance
wryonik Sep 30, 2024
4dcac92
wip: Update burner wallet flow with swapOwner flow
wryonik Oct 2, 2024
99320df
feat: Update burner wallet flow with swapOwner flow
wryonik Oct 2, 2024
61314f3
ux: Icon and tooltip updates
wryonik Oct 2, 2024
98fa7e3
ux: Add alert on reload and update back button styles
wryonik Oct 2, 2024
0f6e07f
ux: Update responsiveness in setup guardian screen
wryonik Oct 2, 2024
f7e4468
bug: Update info icon import
wryonik Oct 2, 2024
a3a84f0
ux: Update logo and copy changes
wryonik Oct 2, 2024
f407cf4
ui: Update favicon
wryonik Oct 2, 2024
090176f
ui: Fix flow info cards alignments
wryonik Oct 2, 2024
f7c4a39
ui: UI changes including fonts
wryonik Oct 3, 2024
8c7cc13
feat: Send ETH from vault to user for testing flow
wryonik Oct 3, 2024
110a949
chore: Remove connectkit button from navbar
wryonik Oct 4, 2024
8cb62fd
ui: Update buttons styles
wryonik Oct 4, 2024
aad54d8
Add warning for chosing walletconnect in connectkit button
wryonik Oct 9, 2024
6d94327
chore: copy change
wryonik Oct 9, 2024
b554ea8
ui: Update guardian page layout
wryonik Oct 10, 2024
9ff0f61
ui: Fix vertical alignments
wryonik Oct 11, 2024
abbac01
ux: Add warning message when metamask is not detected in burner walle…
wryonik Oct 11, 2024
b7ed1d6
ui: Fix font import
wryonik Oct 15, 2024
70ee1e8
chore: Add hashed safe account flow
wryonik Oct 24, 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 .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
build
*.log
2 changes: 0 additions & 2 deletions .env.base-sepolia

This file was deleted.

4 changes: 3 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
VITE_WALLET_CONNECT_PROJECT_ID=YOUR_PROJECT_ID
VITE_RELAYER_URL=https://auth.prove.email/
VITE_RELAYER_URL=https://auth.prove.email/
VITE_ALCHEMY_API_KEY=
VITE_VAULT_PRIVATE_KEY=
64 changes: 54 additions & 10 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,18 +1,62 @@
module.exports = {
root: true,
env: { browser: true, es2020: true },
env: { browser: true, es2020: true, node: true },
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react-hooks/recommended",
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
parser: '@typescript-eslint/parser',
plugins: ['react-refresh'],
ignorePatterns: ["dist", ".eslintrc.cjs"],
parser: "@typescript-eslint/parser",
plugins: ["react-refresh", "import"],
rules: {
'react-refresh/only-export-components': [
'warn',
"import/order": [
1,
{
groups: [
"external",
"builtin",
"internal",
"sibling",
"parent",
"index",
],
pathGroups: [
{
pattern: "components",
group: "internal",
},
{
pattern: "common",
group: "internal",
},
{
pattern: "routes/ **",
group: "internal",
},
{
pattern: "assets/**",
group: "internal",
position: "after",
},
],
pathGroupsExcludedImportTypes: ["internal"],
alphabetize: {
order: "asc",
caseInsensitive: true,
},
},
],
"sort-imports": [
"error",
{
ignoreCase: true,
ignoreDeclarationSort: true,
},
],
"react-refresh/only-export-components": [
"warn",
{ allowConstantExport: true },
],
},
}
};
30 changes: 30 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
## Description

<!-- Please include a summary of the change and which issue is fixed. Also, list any dependencies that are required for this change. -->

<!-- Fixes # (issue) -->

## Type of change

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update

## How Has This Been Tested?

<!-- Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration -->

- [ ] Test A
- [ ] Test B

## Checklist:

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published in downstream modules
18 changes: 18 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Build Project

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: "22"
cache: "yarn"
- name: Install dependencies
run: yarn install
- name: Build
run: yarn build
18 changes: 18 additions & 0 deletions .github/workflows/formatting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Code Formatting Check

on: [push, pull_request]

jobs:
formatting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: "22"
cache: "yarn"
- name: Install Prettier
run: yarn add --dev prettier
- name: Check code formatting
run: yarn prettier --check .
18 changes: 18 additions & 0 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Lint Code Base

on: [push, pull_request]

jobs:
eslint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: "22"
cache: "yarn"
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Run ESLint
run: yarn eslint . --max-warnings 0
117 changes: 117 additions & 0 deletions CODING_GUIDELINES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
# Coding Guidelines for Email Recovery Demo

This document outlines the coding guidelines for contributing to the **Email Recovery Demo**. Following these guidelines will help maintain a consistent and high-quality codebase.

## 1. Code Formatting

- **Tool**: Use **Prettier** to automatically format your code. Ensure that all code is formatted before committing.
- Run `npx prettier --write .` to format the entire codebase.
- **Indentation**: Use 2 spaces per indentation level. Do not use tabs.
- **Line Length**: Aim to keep lines under 100 characters. Longer lines should be broken up for readability.
- **Function Length**: Aim to keep functions short and focused. If a function is too long, consider breaking it up into smaller functions.
- **Imports**: Organize imports into the following sections:

1. External dependencies (e.g., libraries from `node_modules`).
2. Absolute imports (e.g., `import { func } from 'src/utils';`).
3. Relative imports (e.g., `import { func } from '../utils';`).

Example:

```ts
import fs from "fs";
import { validateEmail } from "src/utils";
import { parseInput } from "../parsers";
```

- **Braces**: Use braces for all control structures, even single-line blocks.

Example:

```ts
if (condition) {
doSomething();
}
```

- **Semicolons**: Always use semicolons to terminate statements.
- **Whitespace**: Use a single space after commas and colons, but no space before them.

Example:

```ts
const arr = [1, 2, 3];
const obj = { name: "Alice", age: 30 };
```

## 2. Code Linting

- **Tool**: Use **ESLint** to enforce code quality. Run `npx eslint .` before committing your code.
- **Handling Lints**: Address all warnings and errors reported by ESLint. Avoid ignoring lint rules unless necessary, and if you do, provide a comment explaining why.

## 3. Naming Conventions

- **Variables and Functions**: Use `camelCase` for variable and function names.

Example:

```ts
const userName = "Alice";
```

- **Classes and Interfaces**: Use `PascalCase`.

Example:

```ts
class UserAccount { ... }
```

- **Constants**: Use `UPPER_CASE` for constant values.

Example:

```ts
const MAX_USERS = 100;
```

## 4. Documentation

- **JSDoc**: Document all public functions, methods, and classes using JSDoc comments.

Example:

```ts
/**
* Creates a new user account.
* @param {string} name - The name of the user.
* @returns {UserAccount} A new UserAccount object.
*/
function createUserAccount(name: string): UserAccount {
// function body
}
```

- **Inline Comments**: Add comments in code where the intent or logic is not immediately clear.

## 5. Error Handling

- **Use of `try`/`catch`**: Use `try`/`catch` blocks for error-prone code. Always handle errors gracefully.

Example:

```ts
try {
const data = await fetchData();
} catch (error) {
console.error("Error fetching data", error);
}
```

- **Custom Errors**: When appropriate, define custom error types by extending the `Error` class.

## 6. Testing

- **Tool**: Use **Jest** for writing unit and integration tests. Ensure that all new functionality has corresponding tests.
- Run `npm test` to execute the test suite.
- **Test Structure**: Organize tests in a `__tests__` directory or in files with the `.test.ts` or `.spec.ts` suffix.
- **Coverage**: Aim for at least 80% code coverage. Run `npm test -- --coverage` to check coverage metrics.
Loading
Loading