Build Cloudflare Worker orchestration layer for ERC20 + multi-agent ecosystem - #4
Draft
creatingfire2026 with Copilot wants to merge 5 commits into
Draft
Build Cloudflare Worker orchestration layer for ERC20 + multi-agent ecosystem#4creatingfire2026 with Copilot wants to merge 5 commits into
creatingfire2026 with Copilot wants to merge 5 commits into
Conversation
Copilot
AI
changed the title
[WIP] Add Cloudflare Worker orchestration configuration
Build Cloudflare Worker orchestration layer for ERC20 + multi-agent ecosystem
Jul 22, 2026
creatingfire2026
requested changes
Aug 2, 2026
creatingfire2026
left a comment
Owner
There was a problem hiding this comment.
Pilot security gate — do not merge or deploy this branch yet.
Required before reconsideration:
- Remove automatic production deployment on every push to
main. Use a staging environment first, GitHub Environment protection, and an explicit manual approval for production. - Change the default network from
mainnetto a test network or local simulation. No token deployment or burn transaction may target mainnet during the pilot. - Do not expose a generic transaction relay.
/token/deployand/token/burncurrently accept caller-supplied signed transactions and broadcast them without proving that the transaction matches the requested operation, expected chain, approved contract, sender, value, or calldata. Decode and validate every transaction, bind it to an allowlisted chain/contract/function, and add replay/idempotency protection. - Replace wildcard CORS with an explicit origin allowlist. Add rate limiting, request-size limits, structured input validation, audit identifiers, and secure error handling.
- Separate read-only agent routes from privileged write/transaction routes. Use scoped credentials rather than one bearer secret for all capabilities.
- Add tests for authentication failures, malformed input, RPC failures, transaction validation, replay attempts, wrong-chain requests, wrong-contract requests, and unauthorized state access.
- Replace placeholder Cloudflare resource IDs and prove a complete staging deployment before production configuration is introduced.
- Pin third-party GitHub Actions to immutable commit SHAs and add dependency/security scanning.
The architecture may continue as an isolated staging prototype, but production deployment and financial transaction execution remain outside the authorized pilot scope.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a production-oriented Cloudflare orchestration layer that unifies token operations from
Cf-with Theodore’s multi-agent endpoints behind a single authenticated Worker API. It also aligns infra/config/docs so the Worker, on-chain interactions, and CI deployment flow are wired end-to-end.Worker orchestration API (
src/worker.js){ success, data, timestamp }.POST /token/deploy(JSON-RPC deploy viaeth_sendRawTransaction/eth_sendTransaction)GET /token/status(name,symbol,totalSupplyviaeth_call)POST /token/burn(burnTokens(amount)transaction flow)POST /agent/financePOST /agent/jobsPOST /agent/toolchainGET /agent/statusPOST /cron(manual trigger)scheduledhandler (hourly pipeline execution and KV state updates)Agent modules (independently importable)
src/agents/finance.js: token analysis, market snapshot placeholder, KV snapshot store/read (1h TTL).src/agents/jobs.js: job search placeholder, KV result store, D1 application read/write.src/agents/toolchain.js: repo analysis suggestions, audit persistence/retrieval.src/agents/tokenRpc.js: shared token ABI + JSON-RPC helpers used by Worker and finance agent.Cloudflare + data-plane configuration
wrangler.toml:name = "creatingfire-orchestrator"main = "src/worker.js"AGENT_STATE,TOKEN_CACHETHEODORE_DB0 * * * *NETWORK=mainnetsrc/db/schema.sql:job_applicationstoken_eventsagent_runssystem_configHardhat/runtime config updates
hardhat.config.jswithdotenv, networks (mainnet,sepolia,polygon,localhost), gas reporter toggle, and etherscan key config.MAINNET_RPC_URL,SEPOLIA_RPC_URL,POLYGON_RPC_URL) withRPC_URLfallback.package.json:worker:devworker:deployCI/CD + documentation
.github/workflows/deploy.ymlformain:test(npm test)lint(npm run lint)deploy-worker(wrangler deploy) gated on both checks and using Cloudflare secrets.Example route structure now exposed by the orchestrator: