Skip to content

Add x402 integration documentation and Neo X contract listings#11

Open
mialbu wants to merge 1 commit into
mainfrom
docs/x402-integration
Open

Add x402 integration documentation and Neo X contract listings#11
mialbu wants to merge 1 commit into
mainfrom
docs/x402-integration

Conversation

@mialbu
Copy link
Copy Markdown
Member

@mialbu mialbu commented Apr 22, 2026

Adds a new integrations/x402 section (README, contracts, quick-start) covering x402 payment flow, auth models, and settlement paths.
Updates docs navigation and development/networks.md with Permit2 and x402ExactPermit2Proxy addresses plus integration context.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.md to list Permit2 and x402ExactPermit2Proxy addresses 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.

Comment on lines +10 to +12
- an agent, relayer, or backend that can submit transactions on-chain

If you want to use `settleWithPermit(...)`, the token must also support EIP-2612.
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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”).

Copilot uses AI. Check for mistakes.
Comment thread SUMMARY.md
* [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)
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
* [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)

Copilot uses AI. Check for mistakes.
@gsmachado
Copy link
Copy Markdown
Member

gsmachado commented Apr 22, 2026

@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.

@mialbu
Copy link
Copy Markdown
Member Author

mialbu commented Apr 22, 2026

@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.

Comment thread development/networks.md
<tr>
<td>Permit2</td>
<td>Mainnet</td>
<td>0x000000000022D473030F116dDEE9F6B43aC78BA3</td>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better if we can verify this on https://neoxscan.ngd.network/ as well, and also other contracts.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 x402ExactPermit2Proxy contract – verified using blockscout with foundry: https://neoxscan.ngd.network/address/0x402085c248EeA27D92E8b30b2C58ed07f9E20001#tab=contract

@@ -0,0 +1,171 @@
# x402 Contracts

## Overview
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe need some example code, I'm not sure.

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.

4 participants