Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/install-dependencies/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ runs:
cache: 'pnpm'
# `lts/*` lags a few days to a week
# up to date LTS can be found here https://endoflife.date/nodejs
node-version: '24.14.0'
node-version: '24.15.0'

- name: Install dependencies
shell: bash
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ _docs
*.bak
_sourcify
_artifacts
_tmp
**/tmp*
_verify
.pnpm-store
.dev.vars
_data
.tmp*
_todo
3 changes: 3 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
shell-emulator=true
node-options='--disable-warning=ExperimentalWarning --disable-warning=DeprecationWarning'
@jsr:registry=https://npm.jsr.io
19 changes: 5 additions & 14 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
{
"typescript.tsdk": "node_modules/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true,
"typescript.preferences.importModuleSpecifierEnding": "js",
"javascript.preferences.importModuleSpecifierEnding": "js",
"typescript.preferences.importModuleSpecifier": "non-relative",
"javascript.preferences.importModuleSpecifier": "non-relative",
"typescript.preferences.autoImportFileExcludePatterns": [
"**/node_modules/**/_*/**"
],
"javascript.preferences.autoImportFileExcludePatterns": [
"js/ts.tsdk.path": "node_modules/typescript/lib",
"js/ts.tsdk.promptToUseWorkspaceVersion": true,
"js/ts.preferences.importModuleSpecifierEnding": "js",
"js/ts.preferences.importModuleSpecifier": "non-relative",
"js/ts.preferences.autoImportFileExcludePatterns": [
"**/node_modules/**/_*/**"
],
"editor.formatOnSave": true,
Expand Down Expand Up @@ -68,10 +63,6 @@
"**/*.claude": true,
"**/.pnpm-store/**": true
},

"markdownlint.config": {
"no-inline-html": false
},
"tailwindCSS.showPixelEquivalents": true,
"tailwindCSS.lint.cssConflict": "warning",
"tailwindCSS.lint.suggestCanonicalClasses": "warning",
Expand Down
23 changes: 2 additions & 21 deletions .zed/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,11 @@
}
}
},
"svg": {
"language_servers": ["biome", "HTML"],
"code_actions_on_format": {
"source.fixAll.biome": true,
"source.organizeImports.biome": true
},
"formatter": {
"language_server": {
"name": "biome"
}
}
},
"MDX": {
"language_servers": ["typescript-language-server", "biome"]
},
"JSON": {
"language_servers": ["biome"],
"language_servers": ["json-language-server", "biome"],
"code_actions_on_format": {
"source.fixAll.biome": true,
"source.organizeImports.biome": true
Expand All @@ -54,7 +42,7 @@
}
},
"JSONC": {
"language_servers": ["biome"],
"language_servers": ["json-language-server", "biome"],
"code_actions_on_format": {
"source.fixAll.biome": true,
"source.organizeImports.biome": true
Expand Down Expand Up @@ -113,12 +101,5 @@
}
}
}
},
"terminal": {
"button": true,
"dock": "bottom",
"toolbar": {
"breadcrumbs": false
}
}
}
9 changes: 9 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,3 +183,12 @@ take_screenshot(filePath="/tmp/frame_01.png")
```

Then sequential screenshots for frames 02-10, combine, and upload.

## Learned User Preferences

* Verify before proposing. Don't hedge with "likely" — run the command, read the source, or fetch the docs to confirm the root cause before suggesting a fix.
* When a check fires (security policy, install failure, deploy validation), investigate why the offending condition exists and whether it can be removed before considering any workaround that weakens or bypasses the check.

## Learned Workspace Facts

* Cloudflare Workers docs pages can be fetched as markdown by appending `.md` to the URL (e.g., `https://developers.cloudflare.com/workers/observability/index.md`). Useful for pulling a specific page into context without the full `llms.txt` / `llms-full.txt`.
5 changes: 5 additions & 0 deletions apps/contract-verification/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,14 @@ CLOUDFLARE_ACCOUNT_ID=""
CLOUDFLARE_DATABASE_ID=""
CLOUDFLARE_D1_TOKEN=""

VITE_VERIFIER_URL="https://contracts.tempo.xyz"

# Logging level: debug, error, fatal, info, trace, warning
VITE_LOG_LEVEL="debug"

VITE_BASE_URL="http://localhost:6969"

WRANGLER_SEND_METRICS=false
DOCKER_DEFAULT_PLATFORM="linux/amd64"

CONTAINER_MAX_INSTANCES=10
38 changes: 22 additions & 16 deletions apps/contract-verification/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# syntax=docker/dockerfile:1
FROM oven/bun AS build
FROM oven/bun AS builder

RUN apt-get update \
&& apt-get install --yes libz1 \
RUN apt-get update --yes \
&& apt-get install --yes --no-install-recommends libz1 \
&& apt-get clean --yes \
&& rm -rf /var/lib/apt/lists/*

ENV NODE_ENV="production"
ARG NODE_ENV="production"
ENV NODE_ENV=${NODE_ENV}

WORKDIR /usr/src/app

Expand All @@ -19,25 +21,29 @@ RUN bun build \
/usr/src/app/gg/index.ts

# Pull x86_64 libs for cross-arch QEMU execution of amd64 solc/vyper compilers
FROM --platform=linux/amd64 debian:trixie-slim AS amd64-libs
RUN apt-get update && apt-get install -y --no-install-recommends zlib1g && rm -rf /var/lib/apt/lists/*
FROM --platform=linux/amd64 debian:trixie-slim AS amd64-libs-provider
RUN apt-get update --yes \
&& apt-get install --yes --no-install-recommends zlib1g \
&& apt-get clean --yes \
&& rm -rf /var/lib/apt/lists/*

FROM gcr.io/distroless/base
FROM gcr.io/distroless/base AS runtime

WORKDIR /usr/src/app

COPY --from=build /usr/src/app/container /usr/src/app/container
COPY --from=builder /usr/src/app/container /usr/src/app/container
# x86_64 dynamic linker + libc + libz for amd64 solc/vyper on arm64 hosts via QEMU
COPY --from=amd64-libs /lib64/ld-linux-x86-64.so.2 /lib64/ld-linux-x86-64.so.2
COPY --from=amd64-libs /lib/x86_64-linux-gnu/libc.so.6 /lib/x86_64-linux-gnu/libc.so.6
COPY --from=amd64-libs /lib/x86_64-linux-gnu/libm.so.6 /lib/x86_64-linux-gnu/libm.so.6
COPY --from=amd64-libs /lib/x86_64-linux-gnu/libz.so.1 /lib/x86_64-linux-gnu/libz.so.1
COPY --from=amd64-libs /lib/x86_64-linux-gnu/libdl.so.2 /lib/x86_64-linux-gnu/libdl.so.2
COPY --from=amd64-libs /lib/x86_64-linux-gnu/libpthread.so.0 /lib/x86_64-linux-gnu/libpthread.so.0
COPY --from=amd64-libs-provider /lib64/ld-linux-x86-64.so.2 /lib64/ld-linux-x86-64.so.2
COPY --from=amd64-libs-provider /lib/x86_64-linux-gnu/libc.so.6 /lib/x86_64-linux-gnu/libc.so.6
COPY --from=amd64-libs-provider /lib/x86_64-linux-gnu/libm.so.6 /lib/x86_64-linux-gnu/libm.so.6
COPY --from=amd64-libs-provider /lib/x86_64-linux-gnu/libz.so.1 /lib/x86_64-linux-gnu/libz.so.1
COPY --from=amd64-libs-provider /lib/x86_64-linux-gnu/libdl.so.2 /lib/x86_64-linux-gnu/libdl.so.2
COPY --from=amd64-libs-provider /lib/x86_64-linux-gnu/libpthread.so.0 /lib/x86_64-linux-gnu/libpthread.so.0
# native-arch libz for any native binaries that need it
COPY --from=build /usr/lib/*-linux-gnu/libz.so.1 /usr/local/lib/
COPY --from=builder /usr/lib/*-linux-gnu/libz.so.1 /usr/local/lib/

ENV NODE_ENV="production"
ARG NODE_ENV="production"
ENV NODE_ENV=${NODE_ENV}
ENV LD_LIBRARY_PATH="/usr/local/lib"

EXPOSE $PORT
Expand Down
3 changes: 3 additions & 0 deletions apps/contract-verification/env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ interface EnvironmentVariables {
readonly CLOUDFLARE_DATABASE_ID: string
readonly CLOUDFLARE_D1_TOKEN: string
readonly CLOUDFLARE_D1_ENVIRONMENT: 'local' | (string & {})

readonly CONTAINER_MAX_INSTANCES: string
MINIFLARE_CONTAINER_EGRESS_IMAGE: string
}

// Node.js `process.env` auto-completion
Expand Down
30 changes: 13 additions & 17 deletions apps/contract-verification/openapi.json

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

9 changes: 3 additions & 6 deletions apps/contract-verification/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,21 @@
"gen:types": "wrangler types --env-interface='CloudflareBindings' --env-file='.env.example'"
},
"dependencies": {
"@cloudflare/containers": "^0.2.3",
"@cloudflare/containers": "^0.3.2",
"@hono/zod-validator": "catalog:",
"@logtape/config": "catalog:",
"@logtape/drizzle-orm": "catalog:",
"@logtape/hono": "catalog:",
"@logtape/logtape": "catalog:",
"@logtape/pretty": "catalog:",
"@logtape/redaction": "catalog:",
"@std/semver": "npm:@jsr/std__semver",
"@wagmi/core": "catalog:",
"cbor-x": "^1.6.4",
"drizzle-orm": "^0.45.2",
"hono": "catalog:",
"hono-rate-limiter": "catalog:",
"ox": "catalog:",
"semver": "^7.7.4",
"viem": "catalog:",
"wagmi": "catalog:",
"zod": "catalog:"
Expand All @@ -55,17 +55,14 @@
"@cloudflare/vitest-pool-workers": "catalog:",
"@cloudflare/workers-types": "catalog:",
"@total-typescript/ts-reset": "catalog:",
"@types/bun": "^1.3.11",
"@types/bun": "^1.3.12",
"@types/node": "catalog:",
"@types/semver": "^7.7.1",
"@vitest/coverage-istanbul": "4.1.0",
"@vitest/ui": "catalog:",
"dotenv": "catalog:",
"drizzle-kit": "^0.31.10",
"esbuild": "catalog:",
"typescript": "catalog:",
"vite": "catalog:",
"vite-plugin-devtools-json": "catalog:",
"vitest": "catalog:",
"wrangler": "catalog:"
},
Expand Down
8 changes: 5 additions & 3 deletions apps/contract-verification/scripts/verify-via-curl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ fi

echo -e "\n=== LOOKUP VERIFIED CONTRACT ===\n"

curl --silent \
"${VERIFIER_URL}/v2/contract/${CHAIN_ID}/${CONTRACT_ADDRESS}?fields=all" \
| jq '{ match, creationMatch, runtimeMatch, name, chainId, address, compiler, compilerVersion, language, deployment, abi }'
ADDRESS=$(curl --silent "$VERIFIER_URL/v2/verify/$VERIFICATION_ID" | jq --raw-output '.contract.address')

echo "Verified contract address: $ADDRESS"

echo -e "\n=== https://explore.$CHAIN_ID.tempo.xyz/address/$ADDRESS?tab=contract ===\n"
2 changes: 1 addition & 1 deletion apps/contract-verification/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ app.use('*', requestId({ headerName: 'X-Tempo-Request-Id' }))
app.use(async (context, next) => {
await withContext(
{
requestId: context.get('requestId') as string | undefined,
requestId: context.get('requestId'),
method: context.req.method,
path: context.req.path,
},
Expand Down
Loading
Loading