ctcc-x402
Deterministic smart-contract control and authority inspection for AI agents on Base Mainnet (eip155:8453), micro-settled via the x402 v2 protocol ($0.01 USDC).
Developed by Cinque Port, the specialist international trade and evidential due-diligence division of Pavilion (Stockport) Ltd (pspt.ltd).
Features
- Deterministic Observations: Raw contract bytecode presence, ERC-20 metadata, owner/admin addresses, pause state, and EIP-1967 proxy mechanisms.
- Dual Engine: High-performance synchronous (
CtccClient) and asynchronous (AsyncCtccClient) interfaces. - Bot-Optimized Caching: Built-in TTL in-memory caching to eliminate redundant on-chain payments in high-frequency trading loops.
- Pydantic Validation: Fully typed dataclasses for strict runtime validation.
Installation
pip install ctcc-x402
Quickstart
1. Synchronous Inspection
from ctcc_x402 import check_token_control
import os
observations = check_token_control(
"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
private_key=os.environ.get("EVM_PRIVATE_KEY")
)
print(f"Address: {observations.address}")
print(f"ERC-20 Symbol: {observations.observations.erc20.symbol}")
print(f"Owner: {observations.observations.control_authorities.owner_address}")
print(f"Paused: {observations.observations.pause_state.is_paused}")
2. High-Frequency Bot with Caching
from ctcc_x402 import CtccClient
import os
client = CtccClient(
private_key=os.environ.get("EVM_PRIVATE_KEY"),
cache_ttl_seconds=300, # 5-minute memory cache
max_retries=3
)
# First query: settles $0.01 USDC
obs1 = client.check_token_control("0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913")
# Second query within 5 minutes: zero-latency cache hit (zero payment)
obs2 = client.check_token_control("0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913")
3. Asynchronous Inspection (LangGraph / Asyncio)
from ctcc_x402 import AsyncCtccClient
import asyncio
import os
async def main():
client = AsyncCtccClient(private_key=os.environ.get("EVM_PRIVATE_KEY"))
try:
obs = await client.check_token_control("0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913")
print("Bytecode size:", obs.observations.bytecode_bytes)
finally:
await client.close()
asyncio.run(main())
Specification & Discovery
- Protected Endpoint:
POST https://cinqueport.net/check - OpenAPI 3.1.0: https://cinqueport.net/openapi.json
- A2A Agent Card: https://cinqueport.net/.well-known/agent.json
- x402 Manifest: https://cinqueport.net/.well-known/x402.json
- LLMs Documentation: https://cinqueport.net/llms.txt
License
MIT © Pavilion (Stockport) Ltd.
Metadata
Release files for ctcc-x402 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ctcc_x402-1.0.0.tar.gz | 6.4 kB | Without provenance | Details for ctcc_x402-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ctcc_x402-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for ctcc_x402-1.0.0-py3-none-any.whl |
Total release size: 12.3 kB
Release files / ctcc_x402-1.0.0.tar.gz
| Download URL | ctcc_x402-1.0.0.tar.gz |
|---|---|
| Size | 6.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
209cd0720fda37906a33372b21e80a3fc9fc7acc065bb260cd1f4e843af6552d
|
|
BLAKE2b-256 checksum How to use checksums |
88df802c673bdc67f909e41b8414c18d94aea9b47c41e0fb2de0babf59909b94
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.4
|
Release files / ctcc_x402-1.0.0-py3-none-any.whl
| Download URL | ctcc_x402-1.0.0-py3-none-any.whl |
|---|---|
| Size | 6.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8b9b9a182a808533a9ad50be022eb83bc97d266397856575d5041642d9b45277
|
|
BLAKE2b-256 checksum How to use checksums |
cef0c058eb3863b4e338ca462649e82822ac7858ffe1eece105c21ed8bf82c91
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.4
|
Security for ctcc-x402 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.