Skip to content

Commit

Permalink
devop: working example of eip7702
Browse files Browse the repository at this point in the history
  • Loading branch information
kvhnuke committed Oct 8, 2024
1 parent 9141edb commit e6638dc
Show file tree
Hide file tree
Showing 23 changed files with 1,196 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
root = true

[*.{yml,yaml,js,mjs,cjs,ts,mts,cts,json,json5,sql,md,html,hbs,ejs,njk}]
charset = utf-8
end_of_line = lf
indent_size = 2
tab_width = 2
indent_style = tab
insert_final_newline = true
trim_trailing_whitespace = true
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v22.9.0
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
./build
./src/**/generated
./src/**/*.generated.*
12 changes: 12 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"arrowParens": "avoid",
"bracketSameLine": true,
"bracketSpacing": false,
"endOfLine": "lf",
"printWidth": 120,
"semi": false,
"singleQuote": true,
"tabWidth": 2,
"useTabs": true,
"trailingComma": "all"
}
19 changes: 19 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Attach by Process ID",
"processId": "${command:PickProcess}",
"request": "attach",
"continueOnAttach": true,
"restart": true,
"skipFiles": [
"<node_internals>/**"
],
"type": "node",
}
]
}
35 changes: 35 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
},
"[javascriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
},
"[json]": {
"editor.quickSuggestions": {
"strings": true
},
"editor.suggest.insertMode": "replace"
},
"[json5]": {
"editor.quickSuggestions": {
"strings": true
},
"editor.suggest.insertMode": "replace"
},
"files.associations": {
"*.ejs": "html",
"*.njk": "html",
"*.hbs": "handlebars",
}
}
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
# EIP-7702

Examples for EIP-7702 Transactions

Since some of the libraries are no publicly released you have to clone
https://github.com/ethereumjs/ethereumjs-monorepo/tree/master
locally and build it, then refrence it in the package.json
11 changes: 11 additions & 0 deletions TestContract.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// SPDX-License-Identifier: GPL-3.0

pragma solidity >=0.7.0 <0.9.0;

contract SimpleTest {
event Deposit(address indexed _from, bytes32 indexed _id, uint _value);

function doAnEvent() public {
emit Deposit(address(this), blockhash(block.number), block.number);
}
}
23 changes: 23 additions & 0 deletions build/authorization-signer.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions build/authorization-signer.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions build/configs.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions build/configs.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 39 additions & 0 deletions build/main.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions build/main.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions build/types.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions build/types.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 29 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"private": true,
"type": "module",
"scripts": {
"dev": "pnpm clean && pnpm build && concurrently -n \"build,run\" \"pnpm build:watch\" \"pnpm start:watch\"",
"start": "node --env-file ./.env --enable-source-maps --disable-proto=throw --disallow-code-generation-from-strings ./build/main.js",
"start:watch": "nodemon --delay 0.1 -w ./build -w ./views ./queries -w ./.env -w ./package.json -e .js,.mjs,.cts,.json,.sql,.html,.hbs,.ejs,.njk -x \"pnpm start\"",
"build": "tsc -p ./tsconfig.json",
"build:watch": "pnpm build --watch --preserveWatchOutput",
"clean": "rimraf ./build"
},
"devDependencies": {
"@types/node": "^22.7.4",
"concurrently": "^9.0.1",
"nodemon": "^3.1.7",
"prettier": "^3.3.3",
"rimraf": "^6.0.1",
"typescript": "^5.6.2"
},
"dependencies": {
"@ethereumjs/common": "link:../ethereumjs-monorepo/packages/common",
"@ethereumjs/tx": "link:../ethereumjs-monorepo/packages/tx",
"@ethereumjs/util": "link:../ethereumjs-monorepo/packages/util",
"ethers": "^6.13.3",
"pino": "^9.4.0",
"pino-pretty": "^11.2.2",
"tslib": "^2.7.0"
}
}
Loading

0 comments on commit e6638dc

Please sign in to comment.