Add x402 integration documentation and Neo X contract listings#11
Add x402 integration documentation and Neo X contract listings#11mialbu wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new x402 integration documentation section to the Neo X docs, and updates the networks page to include Permit2 and the x402 settlement contract addresses for mainnet/testnet.
Changes:
- Introduces new x402 docs (overview, contract model, and quick start flow) under
integrations/x402/. - Updates
development/networks.mdto list Permit2 andx402ExactPermit2Proxyaddresses and adds brief integration context. - Adds x402 to the GitBook table of contents.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| integrations/x402/README.md | Adds x402 integration overview and links to quick start / contracts. |
| integrations/x402/contracts.md | Documents settlement/authorization models and the x402ExactPermit2Proxy trust/behavior notes. |
| integrations/x402/quick-start.md | Provides a step-by-step x402 payment/settlement flow guide. |
| development/networks.md | Adds Permit2 and x402 contract addresses plus a short integration blurb/link. |
| SUMMARY.md | Adds x402 entry to the docs navigation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - an agent, relayer, or backend that can submit transactions on-chain | ||
|
|
||
| If you want to use `settleWithPermit(...)`, the token must also support EIP-2612. |
There was a problem hiding this comment.
The prerequisite claims settleWithPermit(...) requires an EIP-2612 token, but later in this doc you note that a token-side permit() failure does not necessarily prevent settlement if Permit2 approval already exists. Please reconcile this so readers understand when settleWithPermit(...) is usable (e.g., “intended for EIP-2612 tokens to combine approval + settlement, but can still proceed if Permit2 is already approved and the permit attempt fails”).
| * [Oracles](integrations/oracles/README.md) | ||
| * [Supra](integrations/oracles/supra.md) | ||
| * [Neo Oracle Gateway](integrations/oracles/neo-oracle-gateway.md) | ||
| * [x402 (Agent-Driven Payments)](integrations/x402/README.md) |
There was a problem hiding this comment.
Only the x402 README is added to the GitBook SUMMARY, but the new x402 subpages (quick-start.md, contracts.md) aren’t included. Add them as nested entries under the x402 section so they appear in navigation and are discoverable like other integrations.
| * [x402 (Agent-Driven Payments)](integrations/x402/README.md) | |
| * [x402 (Agent-Driven Payments)](integrations/x402/README.md) | |
| * [Quick Start](integrations/x402/quick-start.md) | |
| * [Contracts](integrations/x402/contracts.md) |
|
@mialbu we can include instructions to use the Ax402 Facilitator server, specifically, supporting xGAS. This is one of our goals with all the work we're recently carrying on. |
I didn't want to add xGAS yet as we don't officially have it deployed yet. I'd like to add it once the audit is done and we might redeploy on testnet. But I can add the reference to the ax402 facilitator, yes. |
| <tr> | ||
| <td>Permit2</td> | ||
| <td>Mainnet</td> | ||
| <td>0x000000000022D473030F116dDEE9F6B43aC78BA3</td> |
There was a problem hiding this comment.
It's better if we can verify this on https://neoxscan.ngd.network/ as well, and also other contracts.
There was a problem hiding this comment.
I could not verify the Permit2 contract on neoxscan. The blockscout verifier didn't work.* I tried to verify using Foundry. I have not tried with hardhat. However, since it uses the same verifier, it's likely not making a difference.
The third option is uploading the Standard JSON input directly in the explorer. However, I was unable to select a compiler and since this is a required field this way of verifying it is also not possible.
* Presumably blockscout verification didn't work because the Permit2 has immutable variables. That requires a verification including the init_code instead of just the deployed bytecode. Afaik, blockscout v2 supports this, but I think the blockscout verifier for Neo X only supports v1. I could not use v2 endpoints.
Verifying another contract using the blockscout endpoint worked fine. This is why my conclusion is that the issue potentially is about the immutable field. Here's the verified
x402ExactPermit2Proxycontract – verified using blockscout with foundry: https://neoxscan.ngd.network/address/0x402085c248EeA27D92E8b30b2C58ed07f9E20001#tab=contract
| @@ -0,0 +1,171 @@ | |||
| # x402 Contracts | |||
|
|
|||
| ## Overview | |||
There was a problem hiding this comment.
Should we provide a link or a reference to the original x402 paper/website/proposal?
|
|
||
| This prevents a facilitator or relayer from redirecting funds to a different recipient after the user has signed. | ||
|
|
||
| ## Settlement Paths |
There was a problem hiding this comment.
Maybe figures are preferred here, can we use existing ones as reference? Or call @steven1227 to provide original ones.
|
|
||
| ### 2. Sign the authorization | ||
|
|
||
| The user signs a Permit2-based authorization. |
There was a problem hiding this comment.
Maybe need some example code, I'm not sure.
Adds a new
integrations/x402section (README,contracts,quick-start) covering x402 payment flow, auth models, and settlement paths.Updates docs navigation and
development/networks.mdwithPermit2andx402ExactPermit2Proxyaddresses plus integration context.