diff --git a/contracts/exchangeIssuance/FlashMintWrapped.sol b/contracts/exchangeIssuance/FlashMintWrapped.sol index a4c44da8..129c06a4 100644 --- a/contracts/exchangeIssuance/FlashMintWrapped.sol +++ b/contracts/exchangeIssuance/FlashMintWrapped.sol @@ -686,9 +686,6 @@ contract FlashMintWrapped is Ownable, ReentrancyGuard { continue; } - // snapshot balance of required component before swap and wrap operations - uint256 componentBalanceBefore = IERC20(_requiredComponents[i]).balanceOf(address(this)); - // swap input token to underlying token _swapToExact( _inputToken, // input @@ -708,11 +705,7 @@ contract FlashMintWrapped is Ownable, ReentrancyGuard { ); } - // ensure obtained component amount covers required component amount for issuance - // this is not already covered through _swapToExact because it does not take wrapping into consideration - uint256 componentBalanceAfter = IERC20(_requiredComponents[i]).balanceOf(address(this)); - uint256 componentAmountObtained = componentBalanceAfter.sub(componentBalanceBefore); - require(componentAmountObtained >= requiredAmount, "FlashMint: UNDERBOUGHT_COMPONENT"); + require(componentBalanceAfter >= requiredAmount, "FlashMint: INSUFFICIENT_COMPONENT_BALANCE"); } // ensure left over input token amount covers issuance for component if input token is one of the Set components