-
Notifications
You must be signed in to change notification settings - Fork 11
Release 03-11-2025 #227
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
Release 03-11-2025 #227
Changes from all commits
c41f1fe
107c668
ccb62b4
d1b51c6
f4db5ab
5865209
41060b0
2de19c6
361bd1c
469df39
26b2c88
eae36f8
ba2136d
a7b1674
9460bcd
95fffd7
82b1efd
31e7d21
4cc26ea
efeaca0
210e2ec
e685c14
3c6c89e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,5 +4,6 @@ | |
| "Etherspot", | ||
| "sidechains", | ||
| "Sparknet" | ||
| ] | ||
| ], | ||
| "claudeCodeChat.permissions.yoloMode": false | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,25 +1,24 @@ | ||
| FROM node:18-alpine AS deps | ||
| # Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed. | ||
| RUN apk add --no-cache libc6-compat | ||
| FROM oven/bun:1-alpine AS deps | ||
| RUN apk update && apk add --no-cache g++ nodejs npm musl make musl-dev python3 git py3-setuptools && rm -rf /var/cache/apk/* | ||
| WORKDIR /app | ||
| COPY package.json ./ | ||
| RUN npm install | ||
| COPY package.json bun.lock* ./ | ||
| RUN bun install --frozen-lockfile | ||
|
|
||
| FROM node:18-alpine AS builder | ||
| FROM oven/bun:1-alpine AS builder | ||
| ARG APP_ENV | ||
| WORKDIR /app | ||
| COPY . . | ||
| COPY --from=deps /app/node_modules ./node_modules | ||
| RUN npm run build | ||
| RUN bun run build | ||
|
|
||
| FROM node:18-alpine AS runner | ||
| FROM oven/bun:1-alpine AS runner | ||
| WORKDIR /usr/app | ||
| ARG APP_ENV | ||
| COPY --from=builder /app/build ./build | ||
| COPY ./migrations ./build/migrations | ||
| COPY ./migrations ./migrations | ||
| COPY ./scripts ./scripts | ||
| COPY package.json ./ | ||
| COPY --from=builder /app/config.json.default /usr/app/config.json | ||
| RUN npm install | ||
| USER root | ||
| ENV NODE_ENV="production" | ||
| CMD ["npm", "start"] | ||
| CMD ["bun", "start"] | ||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| require('dotenv').config(); | ||
| const viem = require('viem'); | ||
|
|
||
| async function up({ context: queryInterface }) { | ||
| await queryInterface.sequelize.query(`INSERT INTO "${process.env.DATABASE_SCHEMA_NAME}".multi_token_paymaster ("TOKEN_ADDRESS", "PAYMASTER_ADDRESS", "ORACLE_ADDRESS", "CHAIN_ID", "DECIMALS", "CREATED_AT", "UPDATED_AT", "EP_VERSION") VALUES ('${viem.getAddress('0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85')}', '0x6Ad5796A4B5385bB3A1573C56115BF292Fb78d2F', '0x16a9FA2FDa030272Ce99B29CF780dFA30361E0f3', 10, 6, NOW(), NOW(), 'EPV_08')`); | ||
| await queryInterface.sequelize.query(`INSERT INTO "${process.env.DATABASE_SCHEMA_NAME}".multi_token_paymaster ("TOKEN_ADDRESS", "PAYMASTER_ADDRESS", "ORACLE_ADDRESS", "CHAIN_ID", "DECIMALS", "CREATED_AT", "UPDATED_AT", "EP_VERSION") VALUES ('${viem.getAddress('0x94b008aA00579c1307B0EF2c499aD98a8ce58e58')}', '0x6Ad5796A4B5385bB3A1573C56115BF292Fb78d2F', '0xECef79E109e997bCA29c1c0897ec9d7b03647F5E', 10, 6, NOW(), NOW(), 'EPV_08')`); | ||
| await queryInterface.sequelize.query(`INSERT INTO "${process.env.DATABASE_SCHEMA_NAME}".multi_token_paymaster ("TOKEN_ADDRESS", "PAYMASTER_ADDRESS", "ORACLE_ADDRESS", "CHAIN_ID", "DECIMALS", "CREATED_AT", "UPDATED_AT", "EP_VERSION") VALUES ('${viem.getAddress('0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48')}', '0x6Ad5796A4B5385bB3A1573C56115BF292Fb78d2F', '0x8fFfFfd4AfB6115b954Bd326cbe7B4BA576818f6', 1, 6, NOW(), NOW(), 'EPV_08')`); | ||
| await queryInterface.sequelize.query(`INSERT INTO "${process.env.DATABASE_SCHEMA_NAME}".multi_token_paymaster ("TOKEN_ADDRESS", "PAYMASTER_ADDRESS", "ORACLE_ADDRESS", "CHAIN_ID", "DECIMALS", "CREATED_AT", "UPDATED_AT", "EP_VERSION") VALUES ('${viem.getAddress('0xdAC17F958D2ee523a2206206994597C13D831ec7')}', '0x6Ad5796A4B5385bB3A1573C56115BF292Fb78d2F', '0x3E7d1eAB13ad0104d2750B8863b489D65364e32D', 1, 6, NOW(), NOW(), 'EPV_08')`); | ||
| } | ||
|
Comment on lines
+4
to
+9
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. SQL injection risk and consider using parameterized queries. The schema name from Consider using Sequelize's -async function up({ context: queryInterface }) {
- await queryInterface.sequelize.query(`INSERT INTO "${process.env.DATABASE_SCHEMA_NAME}".multi_token_paymaster ("TOKEN_ADDRESS", "PAYMASTER_ADDRESS", "ORACLE_ADDRESS", "CHAIN_ID", "DECIMALS", "CREATED_AT", "UPDATED_AT", "EP_VERSION") VALUES ('${viem.getAddress('0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85')}', '0x6Ad5796A4B5385bB3A1573C56115BF292Fb78d2F', '0x16a9FA2FDa030272Ce99B29CF780dFA30361E0f3', 10, 6, NOW(), NOW(), 'EPV_08')`);
- await queryInterface.sequelize.query(`INSERT INTO "${process.env.DATABASE_SCHEMA_NAME}".multi_token_paymaster ("TOKEN_ADDRESS", "PAYMASTER_ADDRESS", "ORACLE_ADDRESS", "CHAIN_ID", "DECIMALS", "CREATED_AT", "UPDATED_AT", "EP_VERSION") VALUES ('${viem.getAddress('0x94b008aA00579c1307B0EF2c499aD98a8ce58e58')}', '0x6Ad5796A4B5385bB3A1573C56115BF292Fb78d2F', '0xECef79E109e997bCA29c1c0897ec9d7b03647F5E', 10, 6, NOW(), NOW(), 'EPV_08')`);
- await queryInterface.sequelize.query(`INSERT INTO "${process.env.DATABASE_SCHEMA_NAME}".multi_token_paymaster ("TOKEN_ADDRESS", "PAYMASTER_ADDRESS", "ORACLE_ADDRESS", "CHAIN_ID", "DECIMALS", "CREATED_AT", "UPDATED_AT", "EP_VERSION") VALUES ('${viem.getAddress('0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48')}', '0x6Ad5796A4B5385bB3A1573C56115BF292Fb78d2F', '0x8fFfFfd4AfB6115b954Bd326cbe7B4BA576818f6', 1, 6, NOW(), NOW(), 'EPV_08')`);
- await queryInterface.sequelize.query(`INSERT INTO "${process.env.DATABASE_SCHEMA_NAME}".multi_token_paymaster ("TOKEN_ADDRESS", "PAYMASTER_ADDRESS", "ORACLE_ADDRESS", "CHAIN_ID", "DECIMALS", "CREATED_AT", "UPDATED_AT", "EP_VERSION") VALUES ('${viem.getAddress('0xdAC17F958D2ee523a2206206994597C13D831ec7')}', '0x6Ad5796A4B5385bB3A1573C56115BF292Fb78d2F', '0x3E7d1eAB13ad0104d2750B8863b489D65364e32D', 1, 6, NOW(), NOW(), 'EPV_08')`);
-}
+async function up({ context: queryInterface }) {
+ const tableName = 'multi_token_paymaster';
+ const schema = process.env.DATABASE_SCHEMA_NAME;
+ const now = new Date();
+
+ await queryInterface.bulkInsert(
+ { tableName, schema },
+ [
+ {
+ TOKEN_ADDRESS: viem.getAddress('0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85'),
+ PAYMASTER_ADDRESS: '0x6Ad5796A4B5385bB3A1573C56115BF292Fb78d2F',
+ ORACLE_ADDRESS: '0x16a9FA2FDa030272Ce99B29CF780dFA30361E0f3',
+ CHAIN_ID: 10,
+ DECIMALS: 6,
+ CREATED_AT: now,
+ UPDATED_AT: now,
+ EP_VERSION: 'EPV_08'
+ },
+ {
+ TOKEN_ADDRESS: viem.getAddress('0x94b008aA00579c1307B0EF2c499aD98a8ce58e58'),
+ PAYMASTER_ADDRESS: '0x6Ad5796A4B5385bB3A1573C56115BF292Fb78d2F',
+ ORACLE_ADDRESS: '0xECef79E109e997bCA29c1c0897ec9d7b03647F5E',
+ CHAIN_ID: 10,
+ DECIMALS: 6,
+ CREATED_AT: now,
+ UPDATED_AT: now,
+ EP_VERSION: 'EPV_08'
+ },
+ {
+ TOKEN_ADDRESS: viem.getAddress('0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48'),
+ PAYMASTER_ADDRESS: '0x6Ad5796A4B5385bB3A1573C56115BF292Fb78d2F',
+ ORACLE_ADDRESS: '0x8fFfFfd4AfB6115b954Bd326cbe7B4BA576818f6',
+ CHAIN_ID: 1,
+ DECIMALS: 6,
+ CREATED_AT: now,
+ UPDATED_AT: now,
+ EP_VERSION: 'EPV_08'
+ },
+ {
+ TOKEN_ADDRESS: viem.getAddress('0xdAC17F958D2ee523a2206206994597C13D831ec7'),
+ PAYMASTER_ADDRESS: '0x6Ad5796A4B5385bB3A1573C56115BF292Fb78d2F',
+ ORACLE_ADDRESS: '0x3E7d1eAB13ad0104d2750B8863b489D65364e32D',
+ CHAIN_ID: 1,
+ DECIMALS: 6,
+ CREATED_AT: now,
+ UPDATED_AT: now,
+ EP_VERSION: 'EPV_08'
+ }
+ ]
+ );
+}
🤖 Prompt for AI Agents |
||
|
|
||
| async function down({ context: queryInterface }) { | ||
| await queryInterface.sequelize.query(`DELETE IF EXISTS FROM "${process.env.DATABASE_SCHEMA_NAME}".multi_token_paymaster;`); | ||
| } | ||
|
Comment on lines
+11
to
+13
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Critical: Invalid SQL syntax and unsafe rollback. The down function has two critical issues:
Apply this diff to fix both issues: async function down({ context: queryInterface }) {
- await queryInterface.sequelize.query(`DELETE IF EXISTS FROM "${process.env.DATABASE_SCHEMA_NAME}".multi_token_paymaster;`);
+ const tableName = 'multi_token_paymaster';
+ const schema = process.env.DATABASE_SCHEMA_NAME;
+
+ await queryInterface.bulkDelete(
+ { tableName, schema },
+ {
+ EP_VERSION: 'EPV_08',
+ CHAIN_ID: [1, 10],
+ TOKEN_ADDRESS: [
+ viem.getAddress('0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85'),
+ viem.getAddress('0x94b008aA00579c1307B0EF2c499aD98a8ce58e58'),
+ viem.getAddress('0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48'),
+ viem.getAddress('0xdAC17F958D2ee523a2206206994597C13D831ec7')
+ ]
+ }
+ );
}
|
||
|
|
||
| module.exports = { up, down } | ||
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,6 +1,6 @@ | ||||||||||||
| { | ||||||||||||
| "name": "arka", | ||||||||||||
| "version": "4.1.2", | ||||||||||||
| "version": "4.2.1", | ||||||||||||
| "description": "ARKA - (Albanian for Cashier's case) is the first open source Paymaster as a service software", | ||||||||||||
| "type": "module", | ||||||||||||
| "directories": { | ||||||||||||
|
|
@@ -10,16 +10,17 @@ | |||||||||||
| "lint": "eslint .", | ||||||||||||
| "lint:fix": "eslint . --fix", | ||||||||||||
| "check:types": "tsc --noEmit", | ||||||||||||
| "build": "esbuild `find src \\( -name '*.ts' \\)` --platform=node --outdir=build --resolve-extensions=.js && cp -r ./migrations ./build/", | ||||||||||||
| "build": "bun build src/index.ts --outdir build --target node && cp -r ./migrations ./build/", | ||||||||||||
| "build:docker:prod": "docker build . -t my-fastify-app --build-arg APP_ENV=production", | ||||||||||||
| "start": "node build", | ||||||||||||
| "migrate": "node scripts/migration.cjs", | ||||||||||||
| "dev": "tsx watch src | pino-pretty --colorize", | ||||||||||||
| "pretest": "npm run build", | ||||||||||||
| "test": "jest" | ||||||||||||
| "start": "bun build/index.js", | ||||||||||||
| "migrate": "bun run scripts/migration.cjs", | ||||||||||||
| "dev": "tsx watch src/index.ts | pino-pretty --colorize", | ||||||||||||
| "pretest": "bun run build", | ||||||||||||
| "test": "bun test", | ||||||||||||
| "postinstall": "node -e \"try { require('esbuild/install') } catch (e) { console.log('Using JS fallback for esbuild') }\"" | ||||||||||||
| }, | ||||||||||||
|
Comment on lines
+19
to
21
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Postinstall script breaks Bun-only installs The new Bun-based toolchain (and Bun Docker image) no longer guarantees a Apply this diff: - "test": "bun test",
- "postinstall": "node -e \"try { require('esbuild/install') } catch (e) { console.log('Using JS fallback for esbuild') }\""
+ "test": "bun test"📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||
| "engines": { | ||||||||||||
| "node": ">=16.0.0" | ||||||||||||
| "bun": ">=1.0.0" | ||||||||||||
| }, | ||||||||||||
| "keywords": [ | ||||||||||||
| "nodejs", | ||||||||||||
|
|
@@ -39,7 +40,6 @@ | |||||||||||
| "crypto": "^1.0.1", | ||||||||||||
| "dotenv": "16.0.3", | ||||||||||||
| "env-schema": "5.1.1", | ||||||||||||
| "ethers": "5.7.2", | ||||||||||||
| "fastify": "4.24.3", | ||||||||||||
| "fastify-cron": "1.3.1", | ||||||||||||
| "fastify-healthcheck": "4.4.0", | ||||||||||||
|
|
@@ -49,14 +49,15 @@ | |||||||||||
| "node-fetch": "3.3.2", | ||||||||||||
| "node-pg-migrate": "^7.4.0", | ||||||||||||
| "pg": "^8.12.0", | ||||||||||||
| "pg-hstore": "^2.3.4", | ||||||||||||
| "postgrator": "^7.2.0", | ||||||||||||
| "sequelize": "^6.37.3", | ||||||||||||
| "sqlite": "5.1.1", | ||||||||||||
| "sqlite3": "5.1.7-rc.0", | ||||||||||||
| "ts-node": "^10.9.2", | ||||||||||||
| "typescript": "^5.4.5", | ||||||||||||
| "umzug": "^3.8.1", | ||||||||||||
| "viem": "2.7.6" | ||||||||||||
| "viem": "2.27.0" | ||||||||||||
| }, | ||||||||||||
| "devDependencies": { | ||||||||||||
| "@babel/core": "7.23.2", | ||||||||||||
|
|
||||||||||||
Large diffs are not rendered by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pin APK package versions to improve reproducibility and security.
Floating package versions can pull unintended updates; explicitly pinning versions ensures consistent builds.
Consider also whether
npmis still needed after full migration to Bun.📝 Committable suggestion
🧰 Tools
🪛 Hadolint (2.14.0)
[warning] 2-2: Pin versions in apk add. Instead of
apk add <package>useapk add <package>=<version>(DL3018)
🤖 Prompt for AI Agents