From c746e48b4828304e78ab0ad52bced9b76553382d Mon Sep 17 00:00:00 2001 From: ungaro Date: Mon, 9 Dec 2024 09:29:27 -0500 Subject: [PATCH 1/2] use convertToAssets and convertToShares for previewMint and previewWithdraw functions --- nest/src/ComponentToken.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nest/src/ComponentToken.sol b/nest/src/ComponentToken.sol index cb89485..cb265f1 100644 --- a/nest/src/ComponentToken.sol +++ b/nest/src/ComponentToken.sol @@ -76,7 +76,7 @@ abstract contract ComponentToken is bytes32 public constant UPGRADER_ROLE = keccak256("UPGRADER_ROLE"); /// @notice Base that is used to divide all price inputs in order to represent e.g. 1.000001 as 1000001e12 uint256 internal constant _BASE = 1e18; - + // Events /** From 9ee6d3c5c1380faf9a6a104b169f492de48419b7 Mon Sep 17 00:00:00 2001 From: ungaro Date: Mon, 9 Dec 2024 09:31:57 -0500 Subject: [PATCH 2/2] use convertToAssets and convertToShares functions for previewMint and previewWithdraw --- nest/src/ComponentToken.sol | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nest/src/ComponentToken.sol b/nest/src/ComponentToken.sol index cb265f1..46a8bab 100644 --- a/nest/src/ComponentToken.sol +++ b/nest/src/ComponentToken.sol @@ -527,7 +527,7 @@ abstract contract ComponentToken is if (_getComponentTokenStorage().asyncDeposit) { revert Unimplemented(); } - assets = super.previewDeposit(shares); + assets = convertToAssets(shares); } /** @@ -554,7 +554,7 @@ abstract contract ComponentToken is if (_getComponentTokenStorage().asyncRedeem) { revert Unimplemented(); } - shares = super.previewWithdraw(assets); + shares = convertToShares(assets); } /// @inheritdoc IERC7540