Skip to content

Conversation

seongyun-ko
Copy link
Contributor

@seongyun-ko seongyun-ko commented Aug 27, 2025

Note

Introduce a UUPS-upgradeable WeETHWithdrawAdapter enabling withdrawals via weETH (with permit), plus Create2-based deployment and logged artifacts for implementation and proxy.

  • Contracts:
    • src/helpers/WeETHWithdrawAdapter.sol: New UUPS-upgradeable adapter to request withdrawals using weETH.
      • Converts weETHeETH, approves LiquidityPool, and calls requestWithdraw.
      • Adds requestWithdrawWithPermit, role-gated pause/unpause, upgrade auth via RoleRegistry, and basic getters.
    • src/interfaces/IWeETHWithdrawAdapter.sol: New interface incl. PermitInput, requestWithdraw, requestWithdrawWithPermit, and getEETHByWeETH.
  • Deployment & Scripts:
    • script/DeployWeETHWithdrawAdapter.s.sol: Create2 deterministic deployment of implementation and UUPSProxy, initializes owner to timelock, verifies and saves logs.
    • Deployment logs: Added JSON artifacts for WeETHWithdrawAdapter and WeETHWithdrawAdapter_Proxy with factory, salt, constructor args, and deployed addresses.

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

@seongyun-ko seongyun-ko changed the title add a simple adapter contract to support withdrawal from weETH an adapter contract to support withdrawal from weETH Oct 6, 2025
@seongyun-ko seongyun-ko requested a review from solipsis October 6, 2025 15:20
solipsis
solipsis previously approved these changes Oct 6, 2025
cursor[bot]

This comment was marked as outdated.

@seongyun-ko seongyun-ko force-pushed the syko/feature/weETH-withdraw-adapter branch from 63ee206 to 5bb5607 Compare October 14, 2025 20:54

// Call the regular requestWithdraw function
return requestWithdraw(weETHAmount, recipient);
}
Copy link

Choose a reason for hiding this comment

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

Bug: Mismatch Between Permit Value and Transfer Amount

In requestWithdrawWithPermit, the weETH.permit call approves permit.value tokens, but the subsequent safeTransferFrom in requestWithdraw attempts to transfer weETHAmount. If permit.value is less than weETHAmount, the transfer will revert due to insufficient allowance. If permit.value is greater, the user approves more tokens than necessary.

Fix in Cursor Fix in Web

string memory hour = pad(vm.toString((ts % 86400) / 3600));
string memory minute = pad(vm.toString((ts % 3600) / 60));
string memory second = pad(vm.toString(ts % 60));
return string.concat(year, "-", month, "-", day, "-", hour, "-", minute, "-", second);
Copy link

Choose a reason for hiding this comment

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

Bug: Timestamp Calculation Errors in Deployment Logs

The getTimestampString function calculates deployment log timestamps. It incorrectly assumes fixed durations for months (30 days) and years (365 days, ignoring leap years), leading to mathematically inaccurate month and day values in the generated filenames.

Fix in Cursor Fix in Web

Copy link

Sherlock AI Findings

The automated tool completed its analysis of the codebase and found no potential security issues.

Next Steps: No immediate actions are required. Continue monitoring the codebase with future scans.

Full report available at: https://ai.sherlock.xyz/runs/25345e33-4c0b-445d-9de3-7c6a3f866296

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.

2 participants