ABI definition for Seismic's privacy-preserving SRC20 token standard.
Overview
SRC20_ABI is a Python list containing the complete ABI for the ISRC20 interface, which defines Seismic's privacy-preserving ERC20-compatible token standard. Unlike standard ERC20, SRC20 uses shielded types (suint256) for amounts to preserve balance and transfer privacy.
The SRC20 standard maintains the familiar ERC20 API while adding privacy features:
Token amounts are shielded using suint256 types
balanceOf() takes no arguments and returns the caller's own balance
Transfer and approval events emit encrypted amounts
Import
from seismic_web3 importSRC20_ABI
Type
SRC20_ABI: list[dict[str, Any]]
ABI Contents
The ABI includes the following functions and events:
Functions
Function
Parameters
Returns
Description
name()
None
string
Token name (view)
symbol()
None
string
Token symbol (view)
decimals()
None
uint8
Token decimals (view)
balanceOf()
None
uint256
Caller's token balance (view)
approve(address, suint256)
spender, amount
bool
Approve spender for shielded amount
transfer(address, suint256)
to, amount
bool
Transfer shielded amount to recipient
transferFrom(address, address, suint256)
from, to, amount
bool
Transfer shielded amount from approved account
Events
Event
Parameters
Description
Transfer
from (indexed), to (indexed), encryptKeyHash (indexed), encryptedAmount
from seismic_web3 import Suint256
# Transfer from approved account
owner = "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4"
recipient = "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"
amount = Suint256(50 * 10**18)
tx_hash = token.write.transferFrom(owner, recipient, amount)
print(f"TransferFrom tx: {tx_hash.hex()}")
# Get recent transfer events
events = token.events.Transfer.get_logs(from_block="latest" - 1000)
for event in events:
print(f"Transfer from {event.args['from']} to {event.args['to']}")
print(f"Encrypted amount: {event.args['encryptedAmount'].hex()}")
print(f"Key hash: {event.args['encryptKeyHash'].hex()}")
function balanceOf(address account) external view returns (uint256);
function balanceOf() external view returns (uint256);
# Use Suint256 wrapper for shielded amounts
from seismic_web3 import Suint256
amount = Suint256(100 * 10**18) # 100 tokens
token.write.transfer(recipient, amount)
from seismic_web3 import DIRECTORY_ABI, DIRECTORY_ADDRESS, Suint256
# Register viewing key
directory = w3.eth.contract(address=DIRECTORY_ADDRESS, abi=DIRECTORY_ABI)
viewing_key = Suint256(...) # Your AES-256 key as suint256
tx_hash = directory.functions.setKey(viewing_key).transact()