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.1.tar.gz (82.3 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.1-py3-none-any.whl (14.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for ethswarm_deployments-0.2.1.tar.gz
Algorithm Hash digest
SHA256 680997fcbe1b442be051fa44f21c48575507a14fe82496339e737879ae7634b6
MD5 557467ba7193d3b9da5d186689f87af7
BLAKE2b-256 5f58177697aeaf9a7cbf5a41724bc817fba8eb83d48d0432d879bdea03483137

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ethswarm_deployments-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b30ddbe342bf5c64311d84fe19cdf157af734a06c9aafbf2c42e54e742825ea8
MD5 1f601ff4584e0a5cbff163891e93baaa
BLAKE2b-256 a465e32015bd8be7a4e380be91fa2a2b033ce877775c2e293b9381896c4fb0f2

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