Skip to main content

Python library for managing Ethswarm smart contract deployment data across all versions and networks

Project description

ethswarm-deployments

Python library for managing Ethswarm smart contract deployment data across all versions and networks.

Overview

This library ingests Swarm smart contract deployment data from the ethersphere/storage-incentives GitHub repository and provides a clean Python interface for accessing deployment information across:

  • Multiple contract versions (v0.4.0 through v0.9.4+)
  • Multiple networks (mainnet, testnet)
  • Both legacy and hardhat-deploy format contracts

Features

  • Multi-network support: Query deployments on Gnosis Chain mainnet and Sepolia testnet
  • Version tracking: Access any version of deployed contracts
  • Backward compatible: Supports both legacy (staking) and canonical (StakeRegistry) contract names
  • Persistent caching: Local cache with block timestamp optimization
  • Rich metadata: Includes ABIs, bytecode, constructor args, and transaction hashes

Installation

pip install ethswarm-deployments

Quick Start

from ethswarm_deployments import DeploymentManager

# Initialize (uses cached data at ~/.ethswarm-deployments/deployments.json)
mgr = DeploymentManager()

# Get latest deployment on mainnet (default)
deployment = mgr.deployment("StakeRegistry")
print(f"StakeRegistry at {deployment.address}")

# Get specific version on testnet
deployment = mgr.deployment("Redistribution", version="v0.9.2", network="testnet")

# List all versions
versions = mgr.versions()

# Get all deployments of a contract across versions
all_staking = mgr.all_deployments("StakeRegistry")

Regenerating Cache

The cache can be regenerated from GitHub:

from ethswarm_deployments import regenerate_from_github

# Regenerate cache (requires RPC endpoints)
regenerate_from_github(
    mainnet_rpc_url="https://rpc.gnosischain.com",
    testnet_rpc_url="https://ethereum-sepolia-rpc.publicnode.com"
)

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ethswarm_deployments-0.2.0.tar.gz (81.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ethswarm_deployments-0.2.0-py3-none-any.whl (14.1 kB view details)

Uploaded Python 3

File details

Details for the file ethswarm_deployments-0.2.0.tar.gz.

File metadata

  • Download URL: ethswarm_deployments-0.2.0.tar.gz
  • Upload date:
  • Size: 81.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for ethswarm_deployments-0.2.0.tar.gz
Algorithm Hash digest
SHA256 054a9a113324a9f113366262ef720692f2e20b530b5b5fa3a4daa2686e16019f
MD5 887bd9c536ed72ebf9f11335bb772e8c
BLAKE2b-256 044dcbb1e2533e9ff2ee0f80c983fea36f4eff2f814b7f6a4c2288f7f09391d9

See more details on using hashes here.

File details

Details for the file ethswarm_deployments-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ethswarm_deployments-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3b8ca3e9bd9d6658519c1460f6275c2418b88565f1ff3f07ad3270bd80dac1e9
MD5 072be878f896a4b95a2cc5f3a0a69e8b
BLAKE2b-256 ace9317a5b216784ab3bde15ce8f6601f01f1144d98caad87793a3cc635c0924

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page