Skip to content

feat: add Gateway webhook handler with vault deposit and EventLogger on-chain audit trail#35

Open
consumeobeydie wants to merge 3 commits into
circlefin:masterfrom
consumeobeydie:feat/gateway-webhook-handler
Open

feat: add Gateway webhook handler with vault deposit and EventLogger on-chain audit trail#35
consumeobeydie wants to merge 3 commits into
circlefin:masterfrom
consumeobeydie:feat/gateway-webhook-handler

Conversation

@consumeobeydie

Copy link
Copy Markdown

Summary

This PR extends the Circle webhook handler to process Gateway events by automatically depositing received USDC into ArcUSDCVault (ERC-4626) and logging each event on-chain via EventLogger contract.

Changes

app/api/circle/webhook/route.ts

  • Added Gateway event handler for gateway.deposit.finalized, gateway.mint.finalized, gateway.mint.forwarded
  • On Gateway event: approves USDC, deposits into ArcUSDCVault, logs on-chain via EventLogger
  • Added GET handler for webhook endpoint health check
  • Fixed: return 200 instead of 400 when headers missing (for webhook activation)

tsconfig.json

  • Updated TypeScript target from ES2017 to ES2020 for BigInt support

Architecture

Circle Gateway event triggers webhook
deposits USDC into ArcUSDCVault (ERC-4626)
logs event on-chain via EventLogger
creates permanent audit trail

Contracts

ArcUSDCVault: 0x6C13dA317B65474299F6fDee02daDd6626Eb2BFe
EventLogger: 0x9C50765e591663ED541B2fB863626f39fC6C12e0

Live Endpoint

https://arc-fintech-pearl.vercel.app/api/circle/webhook
Status: Active

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant