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

# Tron

> This page provides examples of policies governing Tron signing.

Note: see the [language section](/concepts/policies/language#tron) for various approaches on writing Tron policies.

#### Allow TRX transfers under 10,000,000 sun (10 TRX)

The `amount` field is denoted in sun, the lowest denomination of TRX.

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "policyName": "Allow TRX transfers under 10 TRX",
  "effect": "EFFECT_ALLOW",
  "condition": "tron.tx.contract[0].amount < 10000000"
}
```

#### Allow all TRX transfers (`TransferContract`)

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "policyName": "Allow all TRX transfers",
  "effect": "EFFECT_ALLOW",
  "condition": "tron.tx.contract[0].type == 'TransferContract'"
}
```

#### Allow USDT (TRC-20) transfers on Nile testnet

This policy allows `transfer` calls (selector `a9059cbb`) on the Nile testnet USDT contract. The contract address differs between Nile testnet and Tron mainnet — double check before reusing this on mainnet.

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "policyName": "Enable USDT TRC-20 transfers on Nile testnet",
  "effect": "EFFECT_ALLOW",
  "condition": "tron.tx.contract[0].contract_address == 'TG3XXyExBkPp9nzdajDZsozEu4BkaSJozs' && tron.tx.contract[0].data.startsWith('a9059cbb')"
}
```

<Note>
  `tron.tx.contract[0].data` has **no** `0x` prefix (it is stripped for alignment with the examples above); the top-level `tron.tx.data` convenience field keeps the `0x` prefix. See [the language page](/concepts/policies/language#tron) for the full breakdown. The policy language has no substring slicing — use `startsWith` / `endsWith` / `contains` / `matches` instead, as in the examples on this page.
</Note>

#### Restrict a TRC-20 transfer's recipient using the ABI-encoded parameter

An ERC-20-style `transfer(address,uint256)` call encodes as: 4-byte selector + the `to` address left-padded to 32 bytes + the amount. Since the selector and the zero-padding before the address are both fixed, you can pin the recipient with a single `startsWith` check over selector + padding + address (no substring slicing needed). This lets you enforce an allowed recipient even though 0xkey does not decode ABI parameters for Tron.

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "policyName": "Allow USDT transfers only to a specific recipient",
  "effect": "EFFECT_ALLOW",
  "condition": "tron.tx.contract[0].contract_address == 'TG3XXyExBkPp9nzdajDZsozEu4BkaSJozs' && tron.tx.contract[0].data.startsWith('a9059cbb000000000000000000000000<RECIPIENT_ADDRESS_HEX_20_BYTES_NO_0x>')"
}
```

#### Restrict resource delegation to an allowlisted receiver (gasless sponsorship)

Use this on the **sponsor** wallet's policy to ensure `DelegateResourceContract` calls can only grant resources to a specific end-user address and cannot exceed a balance cap. See [Gasless Tron transactions](/reference/tron-gasless-transactions) for the full sponsorship flow.

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "policyName": "Allow delegating resources only to a specific receiver, capped balance",
  "effect": "EFFECT_ALLOW",
  "condition": "tron.tx.contract[0].type == 'DelegateResourceContract' && tron.tx.contract[0].receiver_address == '<RECEIVER_ADDRESS>' && tron.tx.contract[0].balance <= 5000000"
}
```

#### Deny unfreeze operations from the sponsor wallet

Pair with the previous example to prevent a sponsor wallet's policy from allowing it to unstake TRX out from under active delegations.

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "policyName": "Deny unfreeze from the sponsor wallet",
  "effect": "EFFECT_DENY",
  "condition": "tron.tx.contract[0].type == 'UnfreezeBalanceV2Contract'"
}
```
