From a7d0424cadc70186021ed56745e73259bc457ffe Mon Sep 17 00:00:00 2001 From: Brean0 Date: Thu, 8 Aug 2024 13:59:15 +0200 Subject: [PATCH] remove unneeded vars --- .../contracts/beanstalk/silo/ConvertFacet.sol | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/protocol/contracts/beanstalk/silo/ConvertFacet.sol b/protocol/contracts/beanstalk/silo/ConvertFacet.sol index d6f73b9c5a..4bf070d0de 100644 --- a/protocol/contracts/beanstalk/silo/ConvertFacet.sol +++ b/protocol/contracts/beanstalk/silo/ConvertFacet.sol @@ -64,15 +64,11 @@ contract ConvertFacet is Invariable, ReentrancyGuard { nonReentrant returns (int96 toStem, uint256 fromAmount, uint256 toAmount, uint256 fromBdv, uint256 toBdv) { - address toToken; - address fromToken; - // if the convert is a well <> bean convert, cache the state to validate convert. LibPipelineConvert.PipelineConvertData memory pipeData = LibPipelineConvert.getConvertState( convertData ); - uint256 grownStalk; LibConvert.ConvertParams memory cp = LibConvert.convert(convertData); if (cp.decreaseBDV) { @@ -112,11 +108,12 @@ contract ConvertFacet is Invariable, ReentrancyGuard { // If `decreaseBDV` flag is not enabled, set toBDV to the max of the two bdvs. toBdv = (newBdv > fromBdv || cp.decreaseBDV) ? newBdv : fromBdv; - toStem = LibConvert._depositTokensForConvert(cp.toToken, cp.toAmount, toBdv, grownStalk); - - // Retrieve the rest of return parameters from the convert struct. - toAmount = cp.toAmount; - fromAmount = cp.fromAmount; + toStem = LibConvert._depositTokensForConvert( + cp.toToken, + cp.toAmount, + toBdv, + pipeData.grownStalk + ); emit Convert(LibTractor._user(), cp.fromToken, cp.toToken, cp.fromAmount, cp.toAmount); }