You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`underlyingSecondsForPayment`| seconds | The minimum time allowed for an agent to pay for a redemption. |
@@ -46,12 +49,21 @@ From this event, you can obtain the following:
46
49
-`lastUnderlyingBlock` - the last underlying block to submit payment.
47
50
-`lastUnderlyingTimestamp` — the **deadline** on the underlying chain for submitting the redemption payment.
48
51
49
-
You should wait until this deadline is passed and then check whether the agent has paid the redemption payment in the underlying chain.
52
+
You should wait until the deadline is passed and then check whether the agent has paid the redemption payment in the underlying chain.
53
+
The two values work together as a dual safety mechanism: `lastUnderlyingBlock` ensures payment happens within a reasonable number of blocks, while `lastUnderlyingTimestamp` ensures payment occurs within a reasonable amount of time.
54
+
Both constraints must be satisfied for the payment to be considered valid, providing robust protection against timing-based attacks.
55
+
50
56
The [`RedemptionPerformed`](/fassets/reference/IAssetManagerEvents#redemptionperformed) event is emitted by the Asset Manager contract when the redemption payment is completed.
51
57
58
+
:::info
59
+
The simplest way to observe if a redemption payment has been made is to use the [xrpl](https://www.npmjs.com/package/xrpl) Node.js package to monitor the redeemer's account balance.
60
+
Wait until the `underlyingSecondsForPayment` and `underlyingBlocksForPayment` deadlines pass, then check if the account balance has increased by the expected redemption amount.
61
+
To verify the payment is for the correct redemption, compare the memo data in the XRP transaction to the `paymentReference` from the `RedemptionRequested` event.
62
+
:::
63
+
52
64
## Handling Non-Payment
53
65
54
-
If the agent fails to pay the redemption payment in the underlying chain, the redeemer or the executor can start the redemption default process.
66
+
If the agent fails to pay the redemption payment in the XRP Ledger, the redeemer or the executor can start the redemption default process.
55
67
56
68
### Generate the Proof of Payment Non-Existence
57
69
@@ -68,7 +80,11 @@ Use the following parameters:
68
80
-`checkSourceAddresses`: Not used in case of XRP Ledger, always set to false.
69
81
-`sourceAddressesRoot`: Not used in case of XRP Ledger, always set to zero address.
70
82
71
-
With this information, create the attestation request with the Flare Data Connector and wait for the attestation request to be confirmed.
83
+
Create the attestation request with the Flare Data Connector and wait for the attestation request to be confirmed.
84
+
85
+
:::info
86
+
Check the [ReferencedPaymentNonexistence](/fdc/attestation-types/referenced-payment-nonexistence) attestation type for more details, and the [FDC by hand](/fdc/guides/fdc-by-hand) guide for more information on how to create the attestation request.
87
+
:::
72
88
73
89
### Execute the Redemption Default
74
90
@@ -78,13 +94,13 @@ The redeemer or executor can execute the redemption default process by calling t
78
94
79
95
This function requires two parameters:
80
96
81
-
-`_proof`: The proof of payment non-existence of the redemption payment on the XRP Ledger.
82
-
-`_redemptionRequestId`: The request ID of the redemption request.
97
+
-`_proof`: The proof of payment non-existence from the FDC of the redemption payment on the XRP Ledger.
98
+
-`_redemptionRequestId`: The request ID of the redemption request from the `RedemptionRequested` event.
83
99
84
100
It does the following:
85
101
86
102
- Checks if the proof of payment non-existence is valid.
87
-
-Enough time has passed since the redemption request was created.
103
+
-Verifies that both the `underlyingSecondsForPayment` and `underlyingBlocksForPayment` deadlines have passed.
88
104
- Executes the compensation payment to the redeemer or the executor from the agent's collateral.
0 commit comments