-
Notifications
You must be signed in to change notification settings - Fork 3
feat: add native token support to TransferERC20Hook #831
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
feat: add native token support to TransferERC20Hook #831
Conversation
- 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
How to use the Graphite Merge QueueAdd 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 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
There was a problem hiding this 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.
Summary by OctaneNew Contracts
Updated Contracts
🔗 Commit Hash: c0fc982 |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
OverviewOctane AI analysis has finished. No vulnerabilities were found. Cheers! 🎉🎉🎉 🔗 Commit Hash: c0fc982 |
Note
Introduces a new TransferHook supporting native/erc20 transfers (with prev-hook amount option), wires it into deployment and checks, and adds unit tests.
src/hooks/tokens/TransferHook.sol: New hook to transferERC20or native token, optional use of previous hook’s out amount, context-aware inspect/pre/post logic.test/unit/hooks/tokens/TransferHook.t.solcovering constructor, build (ERC20/native, with/without prev hook), pre/post execute, and inspector.script/utils/Constants.sol: AddTRANSFER_HOOK_KEYand native token constants; expose key for deployment.script/DeployV2Core.s.sol:transferHooktoHookAddresses.TransferHookinbaseHooks(count 36→37) and deployment pipeline with constructor argconfiguration.nativeTokens[chainId].TRANSFER_HOOK_KEYand export assignment.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.