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

# Contracts

> Arc Testnet addresses, claim routing, agent registration, and the attestation verifier.

## Network

```text theme={null}
Chain ID   5042002
Name       Arc Testnet
RPC        https://rpc.testnet.arc.network
Explorer   https://testnet.arcscan.app
Gas        native USDC
Faucet     https://faucet.circle.com
```

Settlement asset is Circle USDC **6 decimals** at `0x3600000000000000000000000000000000000000`. Native gas is a different USDC (18 decimals). Do not mix them.

## Addresses

| Contract              | Address                                      |
| --------------------- | -------------------------------------------- |
| TrustGate             | `0x52E17bC482d00776d73811680CbA9914e83E33CC` |
| AgentRegistry         | `0x73d3cf7f2734C334927f991fe87D06d595d398b4` |
| TrustScoringPlaintext | `0xEb979Dc25396ba4be6cEA41EAfEa894C55772246` |
| USDC (ERC-20, 6 dec)  | `0x3600000000000000000000000000000000000000` |

Sources live in the TrustGate repo under `contracts/`. ABIs are exported from `frontend/src/lib/abi/`.

`TrustAttestationVerifier.sol` is implemented. Deploy it per protocol (constructor: initial issuer). It is not a shared singleton on the table above.

## Read a tier from another contract

```solidity theme={null}
interface ITrustScoring {
    function getTrustTierPlaintext(address account) external view returns (uint8);
    function hasScore(address account) external view returns (bool);
}

contract MyProtocol {
    ITrustScoring public immutable trust;

    constructor(address trustAddr) {
        trust = ITrustScoring(trustAddr);
    }

    modifier onlyHighTrust(address agent) {
        require(trust.hasScore(agent), "unscored");
        require(trust.getTrustTierPlaintext(agent) >= 2, "not high trust");
        _;
    }
}
```

Onchain values: `0 = LOW`, `1 = MEDIUM`, `2 = HIGH`. `HIGH_ELITE` shares `2`. Uncached or expired plaintext reads revert (`TierUncached` / `ScoreExpired`) — fail closed.

<Note>
  These three bands are the payment-routing map. They are not a recommended lending policy. For access control prefer a protocol-owned ladder plus [attestations](/integrate/gating).
</Note>

## Register an agent

An address can only register itself.

```ts theme={null}
await writeContract({
  address: "0x73d3cf7f2734C334927f991fe87D06d595d398b4",
  abi: agentRegistryAbi,
  functionName: "registerAgent",
  args: [connectedWallet, "ipfs://Qm..."], // must equal msg.sender
});
```

Anyone else reverts `CallerMustBeAgent`. The caller is recorded as the agent owner.

Lifecycle after that:

| Function          | Who can call it                        |
| ----------------- | -------------------------------------- |
| `deactivateAgent` | Agent owner                            |
| `updateMetadata`  | Agent owner                            |
| `suspendAgent`    | **Contract owner only** (safety valve) |
| `reactivateAgent` | **Contract owner only**                |

There is no `transferOwnership` on an agent, and the agent owner cannot suspend themselves or anyone else.

## Claim USDC

1. Depositor `deposit(amount)` — USDC pulled into TrustGate.
2. Depositor `setAllowance(agent, cap)`.
3. Agent `claim(depositor, amount)`.
4. Routing:
   * HIGH → transfer now
   * MEDIUM → pending, 24h, then `releaseClaim()`
   * LOW → pending escrow, depositor `approveClaim()` (or `cancelClaim()`)

Scores older than 90 days fail closed. Reentrancy-guarded. Ownable2Step on all contracts. Only the oracle may write plaintext scores; agent owners cannot mint HIGH. The dashboard "Calculate Score" action calls `setTrustScore` and reverts unless the connected wallet is an authorized oracle. Partners read scores; they do not write them.

Dashboard: [trustgated.xyz/dashboard](https://www.trustgated.xyz/dashboard). Product writeup: [Agent payments](/products/agent-payments).

## Verify an attestation onchain

See [Gate with attestations](/integrate/gating) for the EIP-712 types. After `verify(...)` succeeds, apply **your** ladder in your own module. The verifier never sets a borrow limit.
