From 6850d6a6c4ffc608d74af9a187c9dac0812f6108 Mon Sep 17 00:00:00 2001 From: poma Date: Sun, 21 Mar 2021 00:56:39 +0300 Subject: [PATCH] Fix CVF-55, CVF-54 --- contracts/TornadoProxy.sol | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contracts/TornadoProxy.sol b/contracts/TornadoProxy.sol index a0f26d3..44e9745 100644 --- a/contracts/TornadoProxy.sol +++ b/contracts/TornadoProxy.sol @@ -106,19 +106,19 @@ contract TornadoProxy { function rescueTokens( IERC20 _token, address payable _to, - uint256 _balance + uint256 _amount ) external onlyGovernance { require(_to != address(0), "TORN: can not send to zero address"); if (_token == IERC20(0)) { // for Ether uint256 totalBalance = address(this).balance; - uint256 balance = _balance == 0 ? totalBalance : Math.min(totalBalance, _balance); + uint256 balance = Math.min(totalBalance, _amount); _to.transfer(balance); } else { // any other erc20 uint256 totalBalance = _token.balanceOf(address(this)); - uint256 balance = _balance == 0 ? totalBalance : Math.min(totalBalance, _balance); + uint256 balance = Math.min(totalBalance, _amount); require(balance > 0, "TORN: trying to send 0 balance"); _token.safeTransfer(_to, balance); }