Skip to content
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

Fix typo in HyperdriveLP.sol comment #423

Merged
merged 7 commits into from
Jul 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions contracts/src/HyperdriveLP.sol
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ abstract contract HyperdriveLP is HyperdriveTWAP {
/// @param _asUnderlying If true the user is paid in underlying if false
/// the contract transfers in yield source directly.
/// Note - for some paths one choice may be disabled or blocked.
/// @return Returns the base out, the lond withdraw shares out and the short withdraw
/// @return Returns the base out, the long withdraw shares out and the short withdraw
/// shares out.
function removeLiquidity(
uint256 _shares,
Expand Down Expand Up @@ -317,8 +317,8 @@ abstract contract HyperdriveLP is HyperdriveTWAP {
);

// Apply the update to the withdrawal pool.
_withdrawPool.readyToWithdraw -= uint128(_shares);
_withdrawPool.proceeds -= uint128(shareProceeds);
_withdrawPool.readyToWithdraw -= _shares.toUint128();
_withdrawPool.proceeds -= shareProceeds.toUint128();

// Withdraw for the user
uint256 proceeds = _withdraw(
Expand Down Expand Up @@ -530,8 +530,8 @@ abstract contract HyperdriveLP is HyperdriveTWAP {
maxSharesReleased
);
}
_withdrawPool.readyToWithdraw += uint128(sharesReleased);
_withdrawPool.proceeds += uint128(withdrawalPoolProceeds);
_withdrawPool.readyToWithdraw += sharesReleased.toUint128();
_withdrawPool.proceeds += withdrawalPoolProceeds.toUint128();

// Remove the withdrawal pool proceeds from the reserves.
_updateLiquidity(-int256(withdrawalPoolProceeds));
Expand Down
5 changes: 2 additions & 3 deletions contracts/test/MockSafeCast.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ pragma solidity ^0.8.18;
import "../src/libraries/SafeCast.sol";

contract MockSafeCast {
function toUint128(uint256 x) external pure returns (uint128) {
uint128 y = SafeCast.toUint128(x);
return y;
function toUint128(uint256 x) external pure returns (uint128 y) {
y = SafeCast.toUint128(x);
}
}
Loading