> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trustgated.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Agent payments

> Onchain USDC settlement routed by trust tier. Instant, 24-hour lock, or escrow. One application of the score, not the scoring policy.

## What it is

Agent payments is the onchain settlement product. A depositor funds a pooled USDC ledger, sets a per-agent allowance, and a registered agent calls `claim()`. `TrustGate.sol` reads the agent's onchain tier from `TrustScoringPlaintext` and routes the USDC.

This is **an application that consumes scores**. It is not TrustGate telling the world how lending or governance should work. Do not copy these bands into a borrow ladder and call them official.

Live surfaces:

* Dashboard: [trustgated.xyz/dashboard](https://www.trustgated.xyz/dashboard)
* Live claims: [trustgated.xyz/agents/live](https://www.trustgated.xyz/agents/live)
* Walkthrough: [trustgated.xyz/demo](https://www.trustgated.xyz/demo)

## The flow

```text theme={null}
Depositor deposits USDC
        │
        ▼
Depositor sets per-agent allowance
        │
        ▼
Agent registers itself on AgentRegistry
        │
        ▼
Agent calls TrustGate.claim(depositor, amount)
        │
        ▼
Contract reads onchain tier and routes
```

## Routing

| Onchain tier | Score band | Path                                                                       |
| ------------ | ---------- | -------------------------------------------------------------------------- |
| HIGH (`2`)   | `>= 75`    | Instant ERC-20 transfer to the agent                                       |
| MEDIUM (`1`) | `40–74`    | Pending claim, 24-hour time-lock, then anyone may `releaseClaim()`         |
| LOW (`0`)    | `< 40`     | Escrow. Only the depositor may `approveClaim()`. `releaseClaim()` reverts. |

`HIGH_ELITE` on the API shares the HIGH payment band. Scores expire after 90 days. Expired scores fail closed at claim time.

## Registration

`AgentRegistry.registerAgent(agent, metadataURI)` requires `agent == msg.sender`. Third-party registration reverts `CallerMustBeAgent`. The caller becomes the agent owner and may `deactivateAgent` or `updateMetadata`. `suspendAgent` / `reactivateAgent` are **contract-owner only**. There is no agent-level `transferOwnership`.

Metadata URI is free-form. Most teams point it at an IPFS document.

## Contracts (Arc Testnet)

Chain ID `5042002`. Explorer: [testnet.arcscan.app](https://testnet.arcscan.app)

| Contract              | Address                                      |
| --------------------- | -------------------------------------------- |
| TrustGate             | `0x52E17bC482d00776d73811680CbA9914e83E33CC` |
| AgentRegistry         | `0x73d3cf7f2734C334927f991fe87D06d595d398b4` |
| TrustScoringPlaintext | `0xEb979Dc25396ba4be6cEA41EAfEa894C55772246` |
| USDC (6 decimals)     | `0x3600000000000000000000000000000000000000` |

Gas on Arc is native USDC. Settlement USDC is the 6-decimal ERC-20 at the address above. Do not mix the two decimals.

Oracle writes only. Agent owners cannot mint a HIGH score onto themselves.

Integration: [Contracts](/integrate/contracts).
