Adding MetaMask Liquid Staking Integration Tests and Adapter#138
Adding MetaMask Liquid Staking Integration Tests and Adapter#138
Conversation
There was a problem hiding this comment.
Bug: Infinite Allowance Overflow Bug
The _ensureAllowance function attempts to set an infinite allowance for the withdrawalQueue using stETH.safeIncreaseAllowance(address(withdrawalQueue), type(uint256).max). However, safeIncreaseAllowance adds the specified amount to the existing allowance. If the current allowance is already greater than zero, this operation will cause an arithmetic overflow and revert, as currentAllowance + type(uint256).max exceeds type(uint256).max. The intended behavior was likely to set the allowance to type(uint256).max, which should be achieved using safeApprove.
src/helpers/LiquidStakingAdapter.sol#L175-L181
delegation-framework/src/helpers/LiquidStakingAdapter.sol
Lines 175 to 181 in 1db0f3a
Bug: Permit Value Mismatch Causes Transfer Failures
In the requestWithdrawalsWithPermit function, the permit call uses _permit.value while the subsequent safeTransferFrom uses totalAmount_ (calculated as the sum of _amounts). If _permit.value does not exactly match totalAmount_, the transfer will either fail due to insufficient allowance or grant excessive allowance.
src/helpers/LiquidStakingAdapter.sol#L115-L135
delegation-framework/src/helpers/LiquidStakingAdapter.sol
Lines 115 to 135 in 1db0f3a
BugBot free trial expires on July 22, 2025
You have used $0.00 of your $50.00 spend limit so far. Manage your spend limit in the Cursor dashboard.
Was this report helpful? Give feedback by reacting with 👍 or 👎
|
This PR needs an RPC URL secret on github to work |
What?
Why?