Skip to content

Commit

Permalink
Add explaining comment on why for Polygon HTLC redemption the user's …
Browse files Browse the repository at this point in the history
…address is still the sender
  • Loading branch information
sisou committed Oct 22, 2023
1 parent 88ee42a commit 19f7b56
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/request/sign-swap/SignSwapApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 19f7b56

Please sign in to comment.