Skip to content

Commit 6730fbf

Browse files
committed
added comments
1 parent ff2520d commit 6730fbf

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

src/PaymentsGateway.sol

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,17 @@ contract PaymentsGateway is Ownable, ReentrancyGuard {
207207
return (recovered, valid);
208208
}
209209

210+
211+
/**
212+
The purpose of startTransfer is to be the entrypoint for all thirdweb pay swap / bridge
213+
transactions. This function will allow us to standardize the logging and fee splitting across all providers.
214+
215+
Requirements:
216+
1. Verify the parameters are the same parameters sent from thirdweb pay service by requiring a backend signature
217+
2. Log transfer start allowing us to link onchain and offchain data
218+
3. distribute the fees to all the payees (thirdweb, developer, swap provider??)
219+
4. forward the user funds to the swap provider (forwardAddress)
220+
*/
210221
function startTransfer(
211222
bytes32 clientId,
212223
bytes32 transactionId,
@@ -266,6 +277,16 @@ contract PaymentsGateway is Ownable, ReentrancyGuard {
266277
require(success, "Failed to forward");
267278
}
268279

280+
/**
281+
The purpose of endTransfer is to provide a forwarding contract call
282+
on the destination chain. For LiFi (swap provider), they can only guarantee the toAmount
283+
if we use a contract call. This allows us to call the endTransfer function and forward the
284+
funds to the end user.
285+
286+
Requirements:
287+
1. Log the transfer end
288+
2. forward the user funds
289+
*/
269290
function endTransfer(
270291
bytes32 clientId,
271292
bytes32 transactionId,

0 commit comments

Comments
 (0)