Skip to content

Conversation

@subhasishgoswami
Copy link
Contributor

@subhasishgoswami subhasishgoswami commented Nov 10, 2025

Note

Introduces a new TransferHook supporting native/erc20 transfers (with prev-hook amount option), wires it into deployment and checks, and adds unit tests.

  • Hooks:
    • src/hooks/tokens/TransferHook.sol: New hook to transfer ERC20 or native token, optional use of previous hook’s out amount, context-aware inspect/pre/post logic.
    • Tests: test/unit/hooks/tokens/TransferHook.t.sol covering constructor, build (ERC20/native, with/without prev hook), pre/post execute, and inspector.
  • Deployment/Config:
    • script/utils/Constants.sol: Add TRANSFER_HOOK_KEY and native token constants; expose key for deployment.
    • script/DeployV2Core.s.sol:
      • Add transferHook to HookAddresses.
      • Include TransferHook in baseHooks (count 36→37) and deployment pipeline with constructor arg configuration.nativeTokens[chainId].
      • Add check/require for TRANSFER_HOOK_KEY and export assignment.
  • Outputs:
    • New empty deployment result placeholders: script/output/local-cosmin/{1,10,8453}/*-latest.json.

Written by Cursor Bugbot for commit d2152b3. This will update automatically on new commits. Configure here.

- Modified TransferERC20Hook to handle native token transfers (e.g., ETH) alongside ERC20 tokens
- Added immutable NATIVE_TOKEN address configuration passed via constructor to support chain-specific native token representations
- Updated deployment scripts to pass native token configuration during hook initialization
@graphite-app
Copy link
Contributor

graphite-app bot commented Nov 10, 2025

How to use the Graphite Merge Queue

Add the label contracts to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

@graphite-app graphite-app bot requested a review from 0xTimepunk November 10, 2025 09:59
@graphite-app
Copy link
Contributor

graphite-app bot commented Nov 10, 2025

Graphite Automations

"Request reviewers once CI passes" took an action on this PR • (11/10/25)

1 reviewer was added to this PR based on 's automation.

- Separated native token transfer logic from TransferERC20Hook into new SingleTransferHook contract
- Updated TransferERC20Hook to handle only ERC20 tokens, removing native token special case
- Added SingleTransferHook to deployment configuration with proper constructor arguments and array indexing
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

This is the final PR Bugbot will review for you during this billing cycle

Your free Bugbot reviews will reset on December 2

Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

@octane-security-app
Copy link

Summary by Octane

New Contracts

  • TransferHook.sol: "TransferHook smart contract facilitates native/ERC20 token transfers via hooks, supporting dynamic amounts and context inspection."

Updated Contracts

  • DeployV2Core.s.sol: Added "TransferHook" for enhanced transfer functionality, increasing hook count from 36 to 37.
  • Constants.sol: Added "TransferHook" as a new constant in smart contract functionalities.
  • BatchTransferFromHook.sol: Code formatting has been updated by compressing multi-line property assignments into single lines within smart contract struct definitions.

🔗 Commit Hash: c0fc982

@codecov
Copy link

codecov bot commented Nov 10, 2025

Codecov Report

❌ Patch coverage is 96.55172% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/hooks/tokens/TransferHook.sol 96.55% 0 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@octane-security-app
Copy link

Overview

Octane AI analysis has finished. No vulnerabilities were found. Cheers! 🎉🎉🎉


🔗 Commit Hash: c0fc982

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants