DEV Community

rakhmad aulad alie
rakhmad aulad alie

Posted on Edited on

Building Nexus Gateway: M2M Legal-Code Engine with Polygon EIP-712 & Free Solidity Security Checker

Nexus Gateway: Bridging Legal Contracts & Smart Contracts

Smart contract code and off-chain legal contracts are often disconnected. A legal document might state "only the project owner can mint tokens," but if the Solidity code misses an onlyOwner modifier, a breach occurs with zero programmatic enforcement.

Nexus Gateway solves this by using a Digital Twin v3.1 parser that maps legal clauses directly to Solidity function signatures, visibility, modifiers, and breach conditions.


Key Features

  1. Free Solidity Security Checker (Dry-Run)

    • Simulates 7 breach scenarios (BS-001 to BS-007) without registration or API keys.
    • Evaluates deployability, risk levels (Low, Medium, Critical), and actionable recommendations.
  2. Machine-to-Machine (M2M) API Billing

    • Built on Polygon PoS using EIP-712 pull-payment permits.
    • No manual subscription management; clients sign off-chain permits, and the gateway executes micro-transactions in USDC.
  3. Legal-Code Mapping

    • Generates bilingual (English/Indonesian) legal contracts side-by-side with compiled Solidity modules (ERC-20, ERC-721, Escrow).

Try the Security Checker Right Now

You can test the dry-run endpoint directly from your terminal using curl:

curl -X POST https://xibzsthfrbomefnvbicb.supabase.co/functions/v1/hello-world/gateway/dry-run \
  -H "Content-Type: application/json" \
  -d '{"source_code": "pragma solidity ^0.8.20; contract Token { function mint(address to, uint256 amount) public {} }"}'
Enter fullscreen mode Exit fullscreen mode

Or use the interactive playground (no terminal needed): https://rakhmadaa-gif.github.io/nexus-core-gateway/


SDK

TypeScript: npm install nexus-gateway-sdk (136 downloads)
Python: pip install nexus-gateway-sdk (498 downloads)

Both SDKs ship with native tool wrappers for AI agent frameworks (LangChain, CrewAI, Vercel AI SDK).


Production Verified: 17/17 Checks PASS

  • ✅ All 7 gateway endpoints live
  • ✅ ERC-8004 on-chain identity (Agent #636, Polygon Mainnet)
  • ✅ EIP-712 USDC pull payment contract deployed
  • ✅ npm + PyPI packages live
  • ✅ OpenAPI 3.0.3 spec with M2M x-extensions
  • ✅ A2A discovery manifest (.well-known/agent.json)

Links

Top comments (0)