> For the complete documentation index, see [llms.txt](https://docs.seismic.systems/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.seismic.systems/clients/python/abis/src20-abi.md).

# SRC20\_ABI

ABI for the `ISRC20` interface — Seismic's privacy-preserving ERC20 standard. Token amounts use shielded types (`suint256`) and `balanceOf()` takes no arguments (uses `msg.sender` internally).

```python
from seismic_web3 import SRC20_ABI

SRC20_ABI: list[dict[str, Any]]
```

## Functions

| Function       | Parameters                                         | Returns   | Mutability   | Description                       |
| -------------- | -------------------------------------------------- | --------- | ------------ | --------------------------------- |
| `name()`       | —                                                  | `string`  | `view`       | Token name                        |
| `symbol()`     | —                                                  | `string`  | `view`       | Token symbol                      |
| `decimals()`   | —                                                  | `uint8`   | `view`       | Token decimals                    |
| `balanceOf()`  | —                                                  | `uint256` | `view`       | Caller's balance (no address arg) |
| `approve`      | `spender: address`, `amount: suint256`             | `bool`    | `nonpayable` | Approve shielded amount           |
| `transfer`     | `to: address`, `amount: suint256`                  | `bool`    | `nonpayable` | Transfer shielded amount          |
| `transferFrom` | `from: address`, `to: address`, `amount: suint256` | `bool`    | `nonpayable` | Transfer from approved account    |

## Events

| Event      | Indexed Parameters                                              | Data                     |
| ---------- | --------------------------------------------------------------- | ------------------------ |
| `Transfer` | `from: address`, `to: address`, `encryptKeyHash: bytes32`       | `encryptedAmount: bytes` |
| `Approval` | `owner: address`, `spender: address`, `encryptKeyHash: bytes32` | `encryptedAmount: bytes` |

## balanceOf — SRC20 vs ERC20

Standard ERC20:

```solidity
function balanceOf(address account) external view returns (uint256);
```

SRC20:

```solidity
function balanceOf() external view returns (uint256);
```

In SRC20, `balanceOf()` always returns the **caller's** balance. Use `.read` (a signed read that proves identity), not `.tread`.

## Example

```python
import os
from eth_abi import decode
from seismic_web3 import PrivateKey, SEISMIC_TESTNET, SRC20_ABI

pk = PrivateKey.from_hex_str(os.environ["PRIVATE_KEY"])
w3 = SEISMIC_TESTNET.wallet_client(pk)

token = w3.seismic.contract("0xYourTokenAddress", SRC20_ABI)

# Transparent metadata (no auth needed)
name = decode(["string"], bytes(token.tread.name()))[0]
symbol = decode(["string"], bytes(token.tread.symbol()))[0]

# Shielded balance (signed read)
balance = decode(["uint256"], bytes(token.read.balanceOf()))[0]

# Shielded transfer
tx_hash = token.write.transfer("0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", 100)
w3.eth.wait_for_transaction_receipt(tx_hash)
```

## See Also

* [SRC20](/clients/python/src20.md) — Token usage guide
* [Event Watching](/clients/python/src20/event-watching.md) — Decrypt Transfer/Approval events
* [ShieldedContract](/clients/python/contract/shielded-contract.md) — `.read`, `.write`, `.tread` namespaces


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.seismic.systems/clients/python/abis/src20-abi.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
