Skip to content

fix: WEETHModule to use safeTransfer (DEV-1150)#229

Merged
lucas-manuel merged 5 commits intodevfrom
dev-1150-fix-weethModule
Jan 29, 2026
Merged

fix: WEETHModule to use safeTransfer (DEV-1150)#229
lucas-manuel merged 5 commits intodevfrom
dev-1150-fix-weethModule

Conversation

@supercontracts
Copy link
Collaborator

@supercontracts supercontracts commented Jan 29, 2026

Summary by CodeRabbit

  • Refactor

    • Enhanced WETH transfer safety during withdrawals by implementing safer ERC20 transfer semantics, improving protection against non-compliant token implementations.
  • Chores

    • Adjusted internal interface definitions and test configurations to support improved transfer mechanisms.

✏️ Tip: You can customize this high-level summary in your review settings.

@notion-workspace
Copy link

@octane-security-app
Copy link

Summary by Octane

New Contracts

No new contracts were added.

Updated Contracts

  • WeEthModule.sol: The smart contract now uses SafeERC20 for secure token transfers, enhancing safety in token operations.
  • WeETHLib.sol: Removed the getEETHByWeETH function from IWEETHLike interface.

🔗 Commit Hash: f6b20c4

@coderabbitai
Copy link

coderabbitai bot commented Jan 29, 2026

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • 🔍 Trigger a full review

Walkthrough

The changes enhance WETH transfer safety in WeEthModule by implementing SafeERC20 wrappers for ERC20 interactions. The IWEETHLike interface is refactored: the getEETHByWeETH function is removed from the library and re-declared locally in the test file.

Changes

Cohort / File(s) Summary
SafeERC20 Integration
src/WeEthModule.sol
Added SafeERC20 import and applied it to IERC20. Modified WETH transfer during withdrawal to use safeTransfer instead of direct transfer, improving compatibility with non-standard ERC20 implementations.
Interface Refactoring
src/libraries/WeETHLib.sol, test/mainnet-fork/weETH.t.sol
Removed getEETHByWeETH function from IWEETHLike interface in WeETHLib. Added local IWEETHLike interface declaration in test file with eETH() and getEETHByWeETH(uint256) functions to replace the removed library export.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • lucas-manuel

Poem

🐰 SafeERC20 wraps our transfers tight,
No more risky calls in the night!
Interfaces shuffle, tests adapt with grace,
Safety and clarity win the race! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: using safeTransfer in WEETHModule. It follows the required format with 'fix:' prefix and includes the JIRA key (DEV-1150). The changes confirm this is the primary modification across the codebase.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dev-1150-fix-weethModule

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (1)
  • DEV-1150: Entity not found: Issue - Could not find referenced Issue.

Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot]
coderabbitai bot previously approved these changes Jan 29, 2026
@octane-security-app
Copy link

Overview

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


🔗 Commit Hash: f6b20c4

@lucas-manuel lucas-manuel merged commit 7d3b03b into dev Jan 29, 2026
4 checks passed
@lucas-manuel lucas-manuel deleted the dev-1150-fix-weethModule branch January 29, 2026 14:10
@github-actions
Copy link

Coverage after merging dev-1150-fix-weethModule into dev will be

99.40%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
deploy
   ControllerDeploy.sol100%100%100%100%
   ForeignControllerInit.sol100%100%100%100%
   MainnetControllerInit.sol97.37%93.33%100%100%152, 90
src
   ALMProxy.sol100%100%100%100%
   ALMProxyFreezable.sol100%100%100%100%
   ForeignController.sol95.18%87.50%95.65%97.30%128–129, 129, 129, 316–317, 579
   MainnetController.sol99.18%100%98.36%99.24%596–597
   OTCBuffer.sol100%100%100%100%
   RateLimitHelpers.sol100%100%100%100%
   RateLimits.sol100%100%100%100%
   WEETHModule.sol92.86%75%100%100%29, 41
src/libraries
   AaveLib.sol100%100%100%100%
   ApproveLib.sol100%100%100%100%
   CCTPLib.sol100%100%100%100%
   CurveLib.sol100%100%100%100%
   ERC4626Lib.sol97.06%90%100%100%117
   LayerZeroLib.sol100%100%100%100%
   PSMLib.sol100%100%100%100%
   UniswapV4Lib.sol99.32%95.65%100%100%282
   WEETHLib.sol100%100%100%100%

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants