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

# sauce globals

> List the token symbols, protocol namespaces, interfaces and token functions a program compiled for a chain can use

`sauce globals` lists every name a program compiled for a chain can use without declaring it.

## Synopsis

```bash theme={null}
sauce globals --chain <slug|id> [--tokens] [--protocols] [--protocol <name>] [--stocks] [--search <text>] [--json]
```

## Description

The names come from the SDK's registries, and they are the names `sauce compile` resolves for that chain before the compiler runs ([Names](https://docs.eco.com/sauce/names.md)):

* **Tokens**: each token symbol with its address and decimals. A program writes `USDC.transfer(…)` or uses the symbol as an address; any other token is `Token(0x…)`.
* **Protocols**: each protocol namespace with each contract's address, such as `UniswapV3.Factory`. With `--protocol <name>`, each contract's methods with their parameters, return values and mutability.
* **Interfaces**: ABIs the registry knows that have no fixed address, such as a pool. A program binds one to an address it has: `UniswapV3.Pool(pool).slot0()`.
* **Chains**: the chain names in the registry.
* **Functions**: the `@sauce/token` functions every program can call without an import.

With no filter, the chain's tokenized stocks are counted rather than listed; Ethereum and Solana have over a thousand each. `--stocks` lists them, each with its company name, the underlying's ticker and its issuer. `--search <text>` lists the tokens, stocks included, whose symbol, name or ticker contains the text. A stock token is named like any other token in a program: `SPCXc.balanceOf(…)` on Base, `balanceOf(TSLAx, account)` on Solana.

The command reads no chain and sends nothing. It works on every chain in the registry, preview chains included. [Reference: chains](https://docs.eco.com/sauce-sdk/reference/chains.md) and [Reference: tokens](https://docs.eco.com/sauce-sdk/reference/tokens.md) render the same registry as pages.

## Options

| Option | Description |
| - | - |
| `--chain <slug\|id>` | The chain whose names to list |
| `--tokens` | Only the token symbols |
| `--protocols` | Only the protocol namespaces |
| `--protocol <name>` | One namespace (`UniswapV4`, or its slug), with its methods |
| `--stocks` | Only the chain's tokenized stocks |
| `--search <text>` | Only the tokens, stocks included, whose symbol, name or ticker contains the text |
| `--json` | Print one JSON object instead of text |
| `-h, --help` | Show the help |
| `--no-update-check` | Print no notice of a newer `sauce`, and read no registry for one |

## Output

The text output starts with the chain's name, slug, id and kind, then one section per kind of name.

With `--json`:

| Field | Contents |
| - | - |
| `chain` | `key`, `slug`, `id` and `kind` (`evm` or `svm`) |
| `tokens` | `symbol`, `address`, `decimals`; a stock token also carries `stock`: its issuer, name, ticker and the issuer's list it was copied from |
| `protocols` | Each namespace with its `contracts`, each with `address` and `methods` |
| `interfaces` | Each interface's namespace, name and `methods` |
| `chains` | Every chain in the registry |
| `defines` | The chain id and each contract's address as `Namespace_Contract` |
| `modules` | The zero-import modules and their functions: `@sauce/token` |

Exit codes: `0` on success; `2` for a usage error, such as an unknown chain.

## Examples

### List everything on Base

```bash theme={null}
sauce globals --chain base
```

```text theme={null}
Base: base, chain id 8453 (evm)

Tokens (2): <Sym>.transfer(…), or the symbol as an address
  USDC  0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913  6 decimals
  WETH  0x4200000000000000000000000000000000000006  18 decimals
  And 67 stock tokens, named the same way: --stocks lists them, and --search <text> finds one by symbol, name or ticker
  Any other token: Token(0x…).transfer(…)

Protocols (53): <Namespace>.<Contract>.<method>(…); `sauce globals --protocol <name>` lists the methods
  Aave  (alias over aave-v2, aave-v3, aave-v4)
    EquitiesHub            0xa4d5947Eb727A052bae69C593FfC84247EC9864E  (aave-v4)
    Mag7Spoke              0x17905Db0e4A3514467539956c084180616AE7B8D  (aave-v4)
    Pool                   0xA238Dd80C259a72e81d7e4664a9801593F98d1c5  (aave-v3)
    PoolAddressesProvider  0xe20fCBdBfFC4Dd138cE8b2E6FBb6CB49777ad64D  (aave-v3)
  AaveV3  (Aave V3)
    Pool                   0xA238Dd80C259a72e81d7e4664a9801593F98d1c5  default
    PoolAddressesProvider  0xe20fCBdBfFC4Dd138cE8b2E6FBb6CB49777ad64D
  …

Interfaces (39): an ABI with no fixed address, bound to one the program gives: <Namespace>.<Interface>(<address>).<method>(…)
  Abracadabra.Cauldron  (Abracadabra)
  Aerodrome.Pool  (Aerodrome)
  …

Functions from @sauce/token (no import):
  balanceOf(token: Address, account: Account): Uint256
  totalSupply(token: Address): Uint256
  decimals(token: Address): Uint256
  allowance(token: Address, owner: Address, spender: Address): Uint256
  transfer(token: Address, to: Address, amount: Uint256): void
  transferFrom(token: Address, from: Address, to: Address, amount: Uint256): void
  approve(token: Address, spender: Address, amount: Uint256): void
  …
```

`Aave` is a family namespace: an alias over the registry's `aave-v2`, `aave-v3` and `aave-v4` contracts on the chain. `AaveV3` is one protocol.

### One namespace with its methods

```bash theme={null}
sauce globals --chain base --protocol UniswapV3
```

```text theme={null}
Base: base, chain id 8453 (evm)

UniswapV3  (Uniswap V3)
  Factory                     0x33128a8fC17869897dcE68Ed026d694621f6FDfD
    getPool(tokenA: address, tokenB: address, fee: uint24): (pool: address)  view
    createPool(tokenA: address, tokenB: address, fee: uint24): (pool: address)  nonpayable
  …
  QuoterV2                    0x3d4e44Eb1374240CE5F1B871ab261CD16335B76a
    quoteExactInputSingle(params: { tokenIn: address, tokenOut: address, amountIn: uint256, fee: uint24, sqrtPriceLimitX96: uint160 }): (amountOut: uint256, sqrtPriceX96After: uint160, initializedTicksCrossed: uint32, gasEstimate: uint256)  nonpayable
  …

UniswapV3.Pool(<address>)  interface (Uniswap V3): no fixed address
  slot0(): (sqrtPriceX96: uint160, tick: int24, observationIndex: uint16, observationCardinality: uint16, observationCardinalityNext: uint16, feeProtocol: uint8, unlocked: bool)  view
  liquidity(): (arg0: uint128)  view
  …
```

### Find a tokenized stock

```bash theme={null}
sauce globals --chain base --search spacex
```

```text theme={null}
Base: base, chain id 8453 (evm)

Tokens matching 'spacex' (1): <Sym>.transfer(…), or the symbol as an address
  SPCXc  0xb2000000000000000000007b9fcbd005511aCBd5  8 decimals  Space Exploration Technologies Corp. (SPCX, Coinbase)
  Any other token: Token(0x…).transfer(…)
```

The search matches the company name: the token's own symbol is `SPCXc`.

## Next steps

* [Names](https://docs.eco.com/sauce/names.md): how a program uses token symbols, namespaces and `Token(address)`.
* [Reference: protocols](https://docs.eco.com/sauce-sdk/reference/protocols.md): every protocol in the registry, with its deployments.
* [`sauce pools`](https://docs.eco.com/sauce-sdk/cli/pools): a pair's pools on a chain.
* [`sauce compile`](https://docs.eco.com/sauce-sdk/cli/compile): compile a program that uses these names.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.