Skip to content

Commit

Permalink
Second commit
Browse files Browse the repository at this point in the history
  • Loading branch information
MakisChristou committed Nov 9, 2023
1 parent 987baa9 commit 398378c
Show file tree
Hide file tree
Showing 74 changed files with 25,885 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[submodule "token-bound-accounts"]
path = token-bound-accounts
url = [email protected]:vechainfoundation/token-bound-accounts.git
[submodule "account-abstraction"]
path = account-abstraction
url = [email protected]:vechainfoundation/account-abstraction.git
[submodule "hardhat-plugins"]
path = hardhat-plugins
url = [email protected]:vechainfoundation/hardhat-plugins.git
[submodule "bundler"]
path = bundler
url = [email protected]:vechainfoundation/4337-bundler.git
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 Vechain Foundation

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.
70 changes: 70 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# eip-4337-debug_traceCall

## Setup
0. Initialize submodules `git submodule update --init --recursive`
1. Clone latest [`thor`](https://github.com/vechain/thor) and run with flag ` --api-allow-custom-tracer`
2. Deploy Contracts
```bash
cd account-abstraction
yarn install && yarn run hardhat test test/deploy-contracts.test.ts --network vechain
cd ..
```
Sample output:
```
Contract: Deployments
TestUtils address: 0xC0a5459871aD8Ff4c9f5EeE7b41eE394ed415EB3
EntryPoint address: 0x1B433B67cE2CF743673a04268a088C8615413084
SimpleAccountFactory address: 0x29D17a4bdF64EeC4f05c27e9afA7556E4a9208ff
FakeSimpleAccountFactory address: 0xEf3d1eeD859f88215475C3d77F6503EEf7f8D985
```
3. Build `web3-providers-connex` with [`debug_traceCall`](./web3-providers-connex/src/provider.ts#L66) support
```bash
cd web3-providers-connex
npm install && npm run build
cd ..
```
4. Build `hardhat-plugins` with [local web3-providers-connex dependency](./hardhat-plugins/packages/vechain/package.json#33)
```bash
cd hardhat-plugins
yarn install && yarn build
cd ..
```
**Note: When performing changes in `web3-providers-connex` you need to run `yarn updatupgrade web3-providers-connex`**
5. Build `bundler` with [local hardhat-plugins dependency](./bundler/packages/bundler/package.json#54-55)
```bash
cd bundler
yarn && yarn preprocess
```
**Note: When performing changes in `web3-providers-connex` you need to `yarn upgrade @vechain/hardhat-vechain`**
6. Copy `EntryPoint address` value from [deployment output](./README.md#15) to [bundler/localconfig/bundler.config.json](./bundler/packages/bundler/localconfig/bundler.config.json#5)
7. Run bundler
```bash
yarn run bundler
```
The bundler should now run in safe mode which supports `debug_traceCall`

8. Change the config under `account-abstraction/test/config.ts` with your `EntryPoint` and `SimpleAccountFactory` addresses.

9. Run the funding script (make sure you change the account in the script to your SimpleAccount address, you can get that when running either Trampoline or Stackup)

```bash
cd account-abstraction
yarn run hardhat test test/test_custom.ts --network vechain
cd ..
```

## Using Stackup as client

1. Navigate to the stackup directory and follow the readme

2. Start the server by running `yarn run server` on a separate terminal

3. Navigate to the demo folder and run it on a separate terminal

```bash
cd demo-eip-4337
npm install
npm start
```

4. Your browser should pop-up with the front-end running
1 change: 1 addition & 0 deletions account-abstraction
Submodule account-abstraction added at da4767
1 change: 1 addition & 0 deletions bundler
Submodule bundler added at 2015e3
23 changes: 23 additions & 0 deletions demo-eip-4337/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
70 changes: 70 additions & 0 deletions demo-eip-4337/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Getting Started with Create React App

This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).

## Available Scripts

In the project directory, you can run:

### `npm start`

Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in your browser.

The page will reload when you make changes.\
You may also see any lint errors in the console.

### `npm test`

Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.

### `npm run build`

Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.

### `npm run eject`

**Note: this is a one-way operation. Once you `eject`, you can't go back!**

If you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.

Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.

You don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.

## Learn More

You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).

To learn React, check out the [React documentation](https://reactjs.org/).

### Code Splitting

This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)

### Analyzing the Bundle Size

This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)

### Making a Progressive Web App

This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)

### Advanced Configuration

This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)

### Deployment

This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)

### `npm run build` fails to minify

This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)
Loading

0 comments on commit 398378c

Please sign in to comment.