Skip to content

Commit fc13637

Browse files
committed
v0.2.2: cross-framework test, 2 new services, CI pipeline
- Cross-framework test: 5 tests proving ElizaOS ↔ G.A.M.E ↔ SDK payments - Contract Audit Agent: 10 rule-based checks, /audit - MEV Scanner: DexScreener API, /bin/zsh.10/scan, 10s cache - GitHub Actions CI: forge tests + TS build + happy-path harness on anvil - All packages aligned at v0.2.2
1 parent 1c64ea2 commit fc13637

16 files changed

Lines changed: 7629 additions & 30 deletions

File tree

.github/workflows/ci.yml

Lines changed: 100 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,45 +7,124 @@ on:
77
branches: [main]
88

99
jobs:
10-
contracts:
10+
solidity-tests:
11+
name: Solidity Tests
1112
runs-on: ubuntu-latest
1213
steps:
1314
- uses: actions/checkout@v4
1415
with:
1516
submodules: recursive
1617
- uses: foundry-rs/foundry-toolchain@v1
17-
- run: cd contracts && forge test
18-
- run: cd contracts && forge build
18+
- name: Run forge test
19+
working-directory: contracts
20+
run: forge test
1921

20-
sdk:
22+
typescript-build:
23+
name: TypeScript Build
2124
runs-on: ubuntu-latest
2225
steps:
2326
- uses: actions/checkout@v4
2427
- uses: actions/setup-node@v4
2528
with:
2629
node-version: 22
27-
- run: npm ci
28-
- run: cd sdk && npm run build
29-
- run: cd sdk && npx tsc --noEmit
30+
- name: Build SDK
31+
working-directory: sdk
32+
run: |
33+
npm install
34+
npm run build
35+
- name: Build CLI
36+
working-directory: cli
37+
run: |
38+
npm install
39+
npm run build
3040
31-
cli:
41+
happy-path-integration:
42+
name: Happy-Path Integration
3243
runs-on: ubuntu-latest
44+
needs:
45+
- solidity-tests
46+
- typescript-build
3347
steps:
3448
- uses: actions/checkout@v4
35-
- uses: actions/setup-node@v4
3649
with:
37-
node-version: 22
38-
- run: npm ci
39-
- run: cd cli && npm run build
40-
- run: cd cli && npm test
41-
42-
adapters:
43-
runs-on: ubuntu-latest
44-
steps:
45-
- uses: actions/checkout@v4
50+
submodules: recursive
51+
- uses: foundry-rs/foundry-toolchain@v1
4652
- uses: actions/setup-node@v4
4753
with:
4854
node-version: 22
49-
- run: npm ci
50-
- run: cd adapters/eliza && npm run build
51-
- run: cd adapters/game && npm run build
55+
- name: Install workspace dependencies
56+
run: npm install
57+
- name: Build SDK
58+
working-directory: sdk
59+
run: npm run build
60+
- name: Start anvil
61+
run: |
62+
anvil --host 0.0.0.0 --port 8545 --chain-id 31337 > /tmp/anvil.log 2>&1 &
63+
echo "Waiting for anvil..."
64+
for i in $(seq 1 30); do
65+
if curl -s -X POST -H "Content-Type: application/json" \
66+
-d '{"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":1}' \
67+
http://localhost:8545 > /dev/null 2>&1; then
68+
echo "Anvil is ready"
69+
exit 0
70+
fi
71+
sleep 1
72+
done
73+
echo "Anvil failed to start"
74+
cat /tmp/anvil.log
75+
exit 1
76+
- name: Deploy contracts
77+
working-directory: contracts
78+
run: |
79+
mkdir -p deployments
80+
forge script script/Deploy.s.sol --rpc-url http://localhost:8545 --broadcast 2>&1 | tee /tmp/forge-output.txt
81+
- name: Parse deployed addresses
82+
run: |
83+
MOCK_USDC=$(grep -oP 'MOCK_USDC=\s*\K0x[a-fA-F0-9]+' /tmp/forge-output.txt)
84+
PAYMENT_CHANNEL=$(grep -oP 'PAYMENT_CHANNEL=\s*\K0x[a-fA-F0-9]+' /tmp/forge-output.txt)
85+
SERVICE_REGISTRY=$(grep -oP 'SERVICE_REGISTRY=\s*\K0x[a-fA-F0-9]+' /tmp/forge-output.txt)
86+
SPENDING_POLICY=$(grep -oP 'SPENDING_POLICY=\s*\K0x[a-fA-F0-9]+' /tmp/forge-output.txt)
87+
CHAIN_ID=$(grep -oP 'CHAIN_ID=\s*\K[0-9]+' /tmp/forge-output.txt)
88+
89+
cat > contracts/deployments/local.json <<JSONEOF
90+
{
91+
"chainId": $CHAIN_ID,
92+
"mockUSDC": "$MOCK_USDC",
93+
"paymentChannel": "$PAYMENT_CHANNEL",
94+
"serviceRegistry": "$SERVICE_REGISTRY",
95+
"spendingPolicy": "$SPENDING_POLICY"
96+
}
97+
JSONEOF
98+
99+
echo "USDC_ADDRESS=$MOCK_USDC" >> "$GITHUB_ENV"
100+
echo "PAYMENT_CHANNEL_ADDRESS=$PAYMENT_CHANNEL" >> "$GITHUB_ENV"
101+
102+
echo "=== deployments/local.json ==="
103+
cat contracts/deployments/local.json
104+
- name: Start price-feed server
105+
working-directory: services/price-feed
106+
env:
107+
CHAIN: local
108+
RPC_URL: http://localhost:8545
109+
run: |
110+
npx tsx src/server.ts > /tmp/price-feed.log 2>&1 &
111+
echo "Waiting for price-feed server..."
112+
for i in $(seq 1 30); do
113+
if curl -s http://localhost:3000/health 2>/dev/null | grep -q '"ok"'; then
114+
echo "Price-feed server is ready"
115+
exit 0
116+
fi
117+
sleep 1
118+
done
119+
echo "Price-feed server failed to start"
120+
echo "=== server log ==="
121+
cat /tmp/price-feed.log
122+
exit 1
123+
- name: Run happy-path harness
124+
working-directory: services/price-feed
125+
env:
126+
PRIVATE_KEY: 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
127+
PAYEE_PRIVATE_KEY: 0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d
128+
RPC_URL: http://localhost:8545
129+
BASE_URL: http://localhost:3000
130+
run: node scripts/happy-path.mjs

adapters/eliza/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@valuepacket/adapter-eliza",
3-
"version": "0.2.0",
3+
"version": "0.2.2",
44
"description": "ElizaOS plugin adapter for ValuePacket — add payment channels to your ElizaOS agents",
55
"main": "dist/index.js",
66
"module": "dist/index.mjs",
@@ -21,7 +21,7 @@
2121
"src"
2222
],
2323
"dependencies": {
24-
"@valuepacket/sdk": "^0.2.0"
24+
"@valuepacket/sdk": "^0.2.2"
2525
},
2626
"peerDependencies": {
2727
"@elizaos/core": "^0.25.0"

adapters/game/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@valuepacket/adapter-game",
3-
"version": "0.2.0",
3+
"version": "0.2.2",
44
"description": "G.A.M.E framework adapter for ValuePacket — add payment channels to your G.A.M.E agents",
55
"main": "dist/index.js",
66
"module": "dist/index.mjs",
@@ -21,7 +21,7 @@
2121
"src"
2222
],
2323
"dependencies": {
24-
"@valuepacket/sdk": "^0.2.0"
24+
"@valuepacket/sdk": "^0.2.2"
2525
},
2626
"license": "MIT",
2727
"repository": {

cli/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@valuepacket/cli",
3-
"version": "0.2.1",
3+
"version": "0.2.2",
44
"description": "ValuePacket CLI — the payment protocol for autonomous agents",
55
"type": "module",
66
"main": "dist/index.js",
@@ -63,7 +63,7 @@
6363
"access": "public"
6464
},
6565
"dependencies": {
66-
"@valuepacket/sdk": "^0.2.0",
66+
"@valuepacket/sdk": "^0.2.2",
6767
"commander": "^13.0.0",
6868
"viem": "^2.17.0"
6969
},

0 commit comments

Comments
 (0)