Skip to content

feat: CoW TWAP ExtensibleFallbackHandler verification + inline hardhat config#135

Open
tamtamchik wants to merge 7 commits intomainfrom
feat/cow-twap
Open

feat: CoW TWAP ExtensibleFallbackHandler verification + inline hardhat config#135
tamtamchik wants to merge 7 commits intomainfrom
feat/cow-twap

Conversation

@tamtamchik
Copy link
Member

Summary

  • Add diffyscan config for verifying the CoW Protocol ExtensibleFallbackHandler at 0x2f55e8b20D0B9FEFA187AA7d00B6Cbe563605bF5 — source (26/26 files identical) and bytecode fully match
  • Add support for inline hardhat_config in JSON configs, so separate .ts files are no longer required for bytecode comparison
  • Update README with inline hardhat config documentation

Details

CoW TWAP verification config

Verifies the ExtensibleFallbackHandler deployed for CoW Protocol TWAP orders against:

  • Parent repo: cowprotocol/composable-cow @ ab3addad
  • EFH submodule: cowdao-grants/extensible-fallback-handler @ e53ffea4
  • OpenZeppelin v4.9.3

Inline hardhat config

New bytecode_comparison.hardhat_config JSON field that auto-generates a temporary Hardhat config at runtime:

"hardhat_config": {
  "solidity_version": "0.8.19",
  "optimizer": true,
  "optimizer_runs": 20000
}

Chain ID is taken from explorer_chain_id. Temp file is cleaned up after the run. Existing hardhat_config_name and --hardhat-path continue to work.

Test plan

  • Source comparison: 26/26 files identical, 0 diffs
  • Bytecode comparison: bytecodes fully match
  • Inline hardhat config generates and cleans up correctly
  • Existing --hardhat-path CLI flag still works
  • Existing hardhat_config_name in JSON still works

@tamtamchik tamtamchik requested a review from a team as a code owner March 10, 2026 17:40
Copilot AI review requested due to automatic review settings March 10, 2026 17:40
Copy link
Contributor

Copilot AI left a comment

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 new verification config for CoW Protocol’s TWAP ExtensibleFallbackHandler and introduces support for embedding Hardhat settings directly in JSON configs by generating a Hardhat config file at runtime.

Changes:

  • Generate a Hardhat .ts config from inline bytecode_comparison.hardhat_config settings and clean it up after the run.
  • Add a new sample config to verify CoW TWAP’s ExtensibleFallbackHandler deployment on Ethereum mainnet.
  • Document inline Hardhat config usage and supported fields in the README.

Reviewed changes

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

File Description
diffyscan/utils/hardhat.py Adds generate_hardhat_config() to emit a Hardhat config from JSON settings.
diffyscan/diffyscan.py Resolves Hardhat config path via inline config or hardhat_config_name, and cleans up generated config.
config_samples/ethereum/mainnet/cow_twap/cow_twap_extensible_fallback_handler.json New sample config for verifying CoW TWAP EFH deployment and bytecode match.
README.md Documents inline hardhat_config and updates usage instructions.

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

- Wrap os.remove in try/except to prevent cleanup masking exceptions
- Fix solidity_version docs to reflect it's optional with default
- Remove unused tempfile import
- Apply evm_version even when optimizer is disabled
# Conflicts:
#	README.md
#	diffyscan/diffyscan.py
#	diffyscan/utils/hardhat.py
@TheDZhon
Copy link
Contributor

TheDZhon commented Mar 13, 2026

no longer hardhatting here 👷 ❌

Copy link
Contributor

@TheDZhon TheDZhon left a comment

Choose a reason for hiding this comment

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

GG, but some small qs

commit: fd81a96f01cc42ef1c9a5399364968d0e07e9e90
relative_root: ""

fail_on_bytecode_comparison_error: false
Copy link
Contributor

Choose a reason for hiding this comment

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

why though?


github_repo:
url: https://github.com/cowprotocol/composable-cow
commit: bd2634dbd2634d3b3b4297402fd3a5ca3f3a5ccbf75aed0
Copy link
Contributor

Choose a reason for hiding this comment

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

is it audited?

dependencies:
lib/safe:
url: https://github.com/rndlabs/safe-contracts
commit: e53ffea42d8547c984c463bf5b7e47f156619a1f
Copy link
Contributor

Choose a reason for hiding this comment

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

audit?

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.

3 participants