Skip to content

Commit

Permalink
Optimization
Browse files Browse the repository at this point in the history
Co-authored-by: Parv Garg <parv3213@gmail.com>
  • Loading branch information
TechnoGeek01 and parv3213 authored May 2, 2024
1 parent 5dd57ac commit f56ec84
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions contracts/buyback/YieldReserve.sol
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,8 @@ contract YieldReserve is ReentrancyGuard, Ownable {
nonReentrant
{
Helpers._isNonZeroAddr(_receiver);
TokenData storage srcTokenData = tokenData[_srcToken];
TokenData storage dstTokenData = tokenData[_dstToken];
if (!srcTokenData.srcAllowed) revert InvalidSourceToken();
if (!dstTokenData.dstAllowed) revert InvalidDestinationToken();
if (!tokenData[_srcToken].srcAllowed) revert InvalidSourceToken();
if (!tokenData[_dstToken].dstAllowed) revert InvalidDestinationToken();
uint256 amountToSend = getTokenBForTokenA(_srcToken, _dstToken, _amountIn);
if (amountToSend < _minAmountOut) {
revert Helpers.MinSlippageError(amountToSend, _minAmountOut);
Expand Down

0 comments on commit f56ec84

Please sign in to comment.