From c410d3c4e70bc29a3a85b30684d4060f22649fd5 Mon Sep 17 00:00:00 2001 From: Mariusz Jasuwienas Date: Fri, 10 Jan 2025 16:37:35 +0100 Subject: [PATCH] fix: adding more context to the comments and renaming method for clarity, avoiding double guard (#80) Signed-off-by: Mariusz Jasuwienas --- contracts/HtsSystemContract.sol | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/contracts/HtsSystemContract.sol b/contracts/HtsSystemContract.sol index 04f79d6..e0a0ad9 100644 --- a/contracts/HtsSystemContract.sol +++ b/contracts/HtsSystemContract.sol @@ -140,6 +140,10 @@ contract HtsSystemContract is IHederaTokenService, IERC20Events, IERC721Events { require(accountId.length > 0, "transferTokens: missing recipients"); require(amount.length == accountId.length, "transferTokens: inconsistent input"); for (uint256 i = 0; i < accountId.length; i++) { + // FIXME it does not necessarily have to be msg.sender who sends the token... + // 2 rows will be send - -1 on account A, +1 on account B means that it is account A sending to B... + // This scenario should work anyway by mistake (A will send to msg.sender, msg.sender will forward to B), + // But this method should support more complicated scenarios as well, which at this time it DOES NOT :( transferToken(token, msg.sender, accountId[i], amount[i]); } responseCode = 22; // HederaResponseCodes.SUCCESS