From 03213dc1eb386418d74d9ea41a6f93c490aa530c Mon Sep 17 00:00:00 2001 From: Madhav Goyal <88841339+hydrogenbond007@users.noreply.github.com> Date: Wed, 20 Dec 2023 22:31:02 +0530 Subject: [PATCH] Update Multihop.sol added error when out of funds --- skipper-go/contracts/src/Multihop.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/skipper-go/contracts/src/Multihop.sol b/skipper-go/contracts/src/Multihop.sol index 6e86d6e..bb8e4c2 100644 --- a/skipper-go/contracts/src/Multihop.sol +++ b/skipper-go/contracts/src/Multihop.sol @@ -39,7 +39,7 @@ contract Multihop is Ownable { ) external onlyOwner { // Get the initial balance of the token uint256 initialBalance = IERC20(fromToken).balanceOf(address(this)); - + require(initialBalance >= fromAmount, "Insufficient contract balance for the swap"); if (fromAmount > initialBalance) { fromAmount = initialBalance; }