From 0831c664146cb1f4458be16fb5d83f6fa10d1060 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren?= Date: Sun, 22 Oct 2023 16:04:08 +0200 Subject: [PATCH] Add explaining comment on why for Polygon HTLC redemption the user's address is still the sender --- src/request/sign-swap/SignSwapApi.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/request/sign-swap/SignSwapApi.js b/src/request/sign-swap/SignSwapApi.js index 2c223fac3..6b593ab40 100644 --- a/src/request/sign-swap/SignSwapApi.js +++ b/src/request/sign-swap/SignSwapApi.js @@ -230,6 +230,11 @@ class SignSwapApi extends PolygonRequestParserMixin(BitcoinRequestParserMixin(To const polygonAddress = parsedRequest.fund.type === 'USDC' ? parsedRequest.fund.request.from : parsedRequest.redeem.type === 'USDC' + // Even for redeeming, the user's address is the `from` address, + // because in EVM, redeeming is still an interaction with a contract. + // Triggering the payout means calling a function on the HTLC contract, + // that's why the sender (`from`) is the user and the recipient (`to`) + // is the contract. ? parsedRequest.redeem.request.from : undefined; if (polygonAddress) {