Skip to content

Commit 70c2ff4

Browse files
Deploy and Sign transactions from browser (#193)
This is the very basic setup to prove that the new SDK can be imported into an app for the SSO deployment and signing. It took a number of iterations to keep the tests independant, and there were some contract and test changes during this that also conflicted. --------- Co-authored-by: jackpooleyml <186731786+jackpooleyml@users.noreply.github.com>
1 parent 40ae7d7 commit 70c2ff4

File tree

15 files changed

+2006
-44
lines changed

15 files changed

+2006
-44
lines changed

.github/workflows/ci-rust.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,6 @@ jobs:
173173
missing=()
174174
files=(
175175
"out/IERC7579Account.sol/IERC7579Account.json"
176-
"out/SimpleAccountFactory.sol/SimpleAccountFactory.json"
177-
"out/SimpleAccount.sol/SimpleAccount.json"
178176
"out/EntryPoint.sol/EntryPoint.json"
179177
)
180178
for f in "${files[@]}"; do
@@ -241,8 +239,6 @@ jobs:
241239
missing=()
242240
files=(
243241
"out/IERC7579Account.sol/IERC7579Account.json"
244-
"out/SimpleAccountFactory.sol/SimpleAccountFactory.json"
245-
"out/SimpleAccount.sol/SimpleAccount.json"
246242
"out/EntryPoint.sol/EntryPoint.json"
247243
)
248244
for f in "${files[@]}"; do

.github/workflows/ci.yml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,96 @@ jobs:
113113
path: examples/demo-app/playwright-report/
114114
retention-days: 3
115115

116+
e2e-demo-app-erc4337:
117+
runs-on: ubuntu-latest
118+
permissions:
119+
contents: read
120+
pull-requests: write
121+
defaults:
122+
run:
123+
working-directory: ./
124+
steps:
125+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
126+
with:
127+
submodules: recursive
128+
129+
# Start node
130+
- name: Era Test Node Action
131+
uses: dutterbutter/era-test-node-action@36ffd2eefd46dc16e7e2a8e1715124400ec0a3ba # v1
132+
133+
- name: Setup pnpm
134+
uses: pnpm/action-setup@v4
135+
with:
136+
version: 9.11.0
137+
138+
- name: Use Node.js
139+
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4
140+
with:
141+
node-version: lts/Iron
142+
cache: pnpm
143+
144+
- name: Setup Rust toolchain
145+
uses: dtolnay/rust-toolchain@stable
146+
with:
147+
toolchain: stable
148+
targets: wasm32-unknown-unknown
149+
150+
- name: Install wasm-pack
151+
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
152+
153+
# Install standard foundry (for Anvil and regular EVM deployments)
154+
- name: Install foundry
155+
uses: foundry-rs/foundry-toolchain@v1.5.0
156+
157+
# Start Anvil for ERC-4337 contract deployments (standard EVM on port 8545)
158+
- name: Start Anvil
159+
run: |
160+
anvil --port 8545 --block-time 1 &
161+
echo "Waiting for Anvil to be ready..."
162+
timeout 30 bash -c 'until cast client --rpc-url http://localhost:8545 > /dev/null 2>&1; do sleep 1; done'
163+
echo "Anvil is ready!"
164+
165+
# Install dependencies for repo
166+
- name: Install dependencies
167+
run: pnpm install -r --frozen-lockfile
168+
169+
# Web SDK depends on ERC-4337 contracts for WASM build
170+
- name: Install ERC-4337 contract dependencies
171+
run: forge soldeer install
172+
working-directory: packages/erc4337-contracts
173+
174+
- name: Build ERC-4337 contracts
175+
run: forge build
176+
working-directory: packages/erc4337-contracts
177+
178+
- name: Build SDK with ERC-4337
179+
run: |
180+
pnpm nx build sdk
181+
pnpm nx build web-sdk
182+
pnpm nx build connector-export
183+
pnpm nx build:erc4337 demo-app
184+
185+
- name: Deploy Demo-App ERC-4337 contracts
186+
continue-on-error: true
187+
run: pnpm nx deploy-msa-factory demo-app
188+
189+
- name: Run tests
190+
run: pnpm test
191+
working-directory: packages/sdk-platforms/web
192+
193+
# Run E2E tests
194+
- name: Install Playwright Chromium Browser
195+
run: pnpm exec playwright install chromium
196+
working-directory: examples/demo-app
197+
- name: Run e2e tests
198+
run: pnpm nx e2e:erc4337 demo-app
199+
- uses: actions/upload-artifact@v4
200+
if: ${{ !cancelled() }}
201+
with:
202+
name: demo-app-4337-playwright-report
203+
path: examples/demo-app/playwright-report/
204+
retention-days: 3
205+
116206
e2e-nft-quest:
117207
runs-on: ubuntu-latest
118208
defaults:

0 commit comments

Comments
 (0)