From 448ec8c1ae019d2abf34951b2ebd168ba5053ff7 Mon Sep 17 00:00:00 2001 From: Drygin Date: Mon, 24 Jan 2022 20:16:55 +0300 Subject: [PATCH] add MIN_EXT_AMOUNT_LIMIT --- contracts/TornadoPool.sol | 2 ++ 1 file changed, 2 insertions(+) diff --git a/contracts/TornadoPool.sol b/contracts/TornadoPool.sol index 12a379e..e980a54 100644 --- a/contracts/TornadoPool.sol +++ b/contracts/TornadoPool.sol @@ -25,6 +25,7 @@ import "./MerkleTreeWithHistory.sol"; contract TornadoPool is MerkleTreeWithHistory, IERC20Receiver, ReentrancyGuard, CrossChainGuard { int256 public constant MAX_EXT_AMOUNT = 2**248; uint256 public constant MAX_FEE = 2**248; + uint256 public constant MIN_EXT_AMOUNT_LIMIT = 0.5 ether; IVerifier public immutable verifier2; IVerifier public immutable verifier16; @@ -295,6 +296,7 @@ contract TornadoPool is MerkleTreeWithHistory, IERC20Receiver, ReentrancyGuard, } function _configureLimits(uint256 _minimalWithdrawalAmount, uint256 _maximumDepositAmount) internal { + require(_minimalWithdrawalAmount < MIN_EXT_AMOUNT_LIMIT, "minimalWithdrawal over limit"); minimalWithdrawalAmount = _minimalWithdrawalAmount; maximumDepositAmount = _maximumDepositAmount; }