-
Notifications
You must be signed in to change notification settings - Fork 220
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
add (un)/wrapping for steth #317
Conversation
contracts/base/RouterImmutables.sol
Outdated
@@ -34,6 +37,10 @@ contract RouterImmutables { | |||
/// @dev WETH9 address | |||
IWETH9 internal immutable WETH9; | |||
|
|||
ERC20 internal immutable STETH; |
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.
nit: add @ dev comments
contracts/libraries/Commands.sol
Outdated
@@ -70,5 +70,8 @@ library Commands { | |||
uint256 constant SEAPORT_V1_4 = 0x20; | |||
uint256 constant EXECUTE_SUB_PLAN = 0x21; | |||
uint256 constant APPROVE_ERC20 = 0x22; | |||
uint256 constant WRAP_STETH = 0x23; | |||
uint256 constant UNWRAP_STETH = 0x24; | |||
|
|||
// COMMAND_PLACEHOLDER for 0x23 to 0x3f (all unused) |
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.
nit: change comment for new command values
contracts/modules/Payments.sol
Outdated
@@ -137,4 +137,45 @@ abstract contract Payments is RouterImmutables { | |||
} | |||
} | |||
} | |||
|
|||
/// @notice Wrap an amount of stETH into wstETH | |||
/// @param recipient The recipient of the stETH |
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.
nit: wstETH
contracts/modules/Payments.sol
Outdated
|
||
/// @notice Unwraps all of the contract's wstETH into stETH | ||
/// @param recipient The recipient of the stETH | ||
/// @param amountMinimum The minimum amount of ETH desired |
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.
nit: amount of stETH desired
const { wethBalanceBefore, wethBalanceAfter } = await executeRouter(planner) | ||
const stethBalanceAfter = await stethContract.balanceOf(bob.address) | ||
|
||
expect(stethBalanceBefore.sub(stethBalanceAfter)).to.eq(amountInSTETH.sub(STETH_DUST)) |
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.
i'm a little confused on what this balance check is checking and what STETH_DUST represents, so when we wrap into wSETH, there's some dust that is lost that we have to account for here?
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.
yah, wheneverrrrr STETH is tranferred there's always 1 wei dust 😓
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.
whatt that's crazy
} else { | ||
// placeholder area for commands 0x22-0x3f | ||
// placeholder area for commands 0x25-0x3f |
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.
added 2 commands but this number increased by 3? Seems it switched from inclusive to exclusive
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.
It looks like this was just forgotten in a past PR
* Revert "add (un)/wrapping for steth (#317)" This reverts commit bdb2942. * Revert "deploy UniversalRouter v1.3 to mainnet and goerli (#320)" This reverts commit 0250714. * fix: fixup steth leftovers * feat: update snaps * fix: eric comments * fix: fixed readme --------- Co-authored-by: Austin Adams <[email protected]>
* Revert "add (un)/wrapping for steth (#317)" This reverts commit bdb2942. * Revert "deploy UniversalRouter v1.3 to mainnet and goerli (#320)" This reverts commit 0250714. * fix: fixup steth leftovers * feat: update snaps * fix: eric comments * fix: fixed readme * fix: updated v2 factories sepolia does not need upgrading * fixed base's checksum --------- Co-authored-by: Mark Toda <[email protected]>
* Revert "add (un)/wrapping for steth (#317)" This reverts commit bdb2942. * Revert "deploy UniversalRouter v1.3 to mainnet and goerli (#320)" This reverts commit 0250714. * fix: fixup steth leftovers * feat: update snaps * fix: eric comments * fix: fixed readme * fix: updated v2 factories sepolia does not need upgrading * fixed base's checksum --------- Co-authored-by: Mark Toda <[email protected]>
No description provided.