From 588f79cf2459d6566aa87c0cfa690ebb272efe50 Mon Sep 17 00:00:00 2001 From: ahramy Date: Thu, 31 Oct 2024 21:25:20 -0700 Subject: [PATCH] chore: eliminate redundant assignment (#293) --- contracts/TokenHandler.sol | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/contracts/TokenHandler.sol b/contracts/TokenHandler.sol index 18cde203..7bf1dae8 100644 --- a/contracts/TokenHandler.sol +++ b/contracts/TokenHandler.sol @@ -159,11 +159,8 @@ contract TokenHandler is ITokenHandler, ITokenManagerType, ReentrancyGuard, Crea _transferTokenFrom(tokenAddress, from, to, amount); uint256 diff = IERC20(tokenAddress).balanceOf(to) - balanceBefore; - if (diff < amount) { - amount = diff; - } - return amount; + return diff < amount ? diff : amount; } function _giveInterchainToken(address tokenAddress, address to, uint256 amount) internal {