Skip to content

Feat: Script to find the deployment block and possible transaction(s)#2304

Open
akshay-ap wants to merge 13 commits into
mainfrom
feat/find-block-script
Open

Feat: Script to find the deployment block and possible transaction(s)#2304
akshay-ap wants to merge 13 commits into
mainfrom
feat/find-block-script

Conversation

@akshay-ap

@akshay-ap akshay-ap commented Mar 5, 2026

Copy link
Copy Markdown
Member

This pull request adds a new utility script, find_deployment.py, that helps identify the deployment block and candidate transaction hashes for Safe contracts on Ethereum-compatible blockchains. The script uses a binary search approach to efficiently locate the deployment block by checking for the presence of contract bytecode, and then scans that block for transactions sent to the Safe singleton factory, which are likely deployment transactions.

The script finds and prints the blocks and possible transactions that deployed the code at address.
We can reuse existing workflows to create PR after reviewing the output of this script and hence not included in this script.

@akshay-ap akshay-ap self-assigned this Mar 5, 2026
@coveralls

coveralls commented Mar 5, 2026

Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 22717156949

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.02%) to 94.015%

Files with Coverage Reduction New Missed Lines %
safe_eth/eth/tests/clients/test_etherscan_client_v2.py 1 85.9%
Totals Coverage Status
Change from base Build 22716248314: -0.02%
Covered Lines: 10352
Relevant Lines: 11011

💛 - Coveralls

Comment thread scripts/find_deployment.py
Comment thread scripts/find_deployment.py
Comment thread scripts/find_deployment.py Outdated
Comment thread scripts/find_deployment.py Outdated
@akshay-ap akshay-ap requested a review from Uxio0 May 4, 2026 13:07
Comment thread .gitignore Outdated
Copilot AI review requested due to automatic review settings May 15, 2026 08:17
@akshay-ap akshay-ap requested a review from a team as a code owner May 15, 2026 08:17

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a standalone utility script for locating Safe contract deployment blocks and candidate deployment transactions via JSON-RPC code checks and block scanning.

Changes:

  • Added scripts/find_deployment.py with async RPC helpers, binary-search deployment block detection, and factory transaction scanning.
  • Added a script-specific uv lockfile for the httpx dependency.

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated 6 comments.

File Description
scripts/find_deployment.py New CLI utility to find deployment blocks and possible factory transaction hashes for contract addresses.
scripts/find_deployment.py.lock Locks dependencies for running the standalone script with uv.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread scripts/find_deployment.py Outdated
Comment thread scripts/find_deployment.py
Comment thread scripts/find_deployment.py
Comment thread scripts/find_deployment.py
Comment thread scripts/find_deployment.py Outdated
Comment thread scripts/find_deployment.py Outdated
@akshay-ap akshay-ap force-pushed the feat/find-block-script branch from eef53cd to 320c89f Compare May 15, 2026 08:48
Copilot AI review requested due to automatic review settings May 15, 2026 08:51

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 5 comments.

Comment thread scripts/find_deployment.py
Comment thread scripts/find_deployment.py
Comment thread scripts/find_deployment.py
Comment thread scripts/find_deployment.py
Comment thread scripts/find_deployment.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants