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
This guide walks you through the complete process of minting FAssets (e.g., FXRP) on the Flare network.
19
21
20
-
Minting FAssets is the process of wrapping, for instance, XRP from the XRP Ledger into an FAsset, enabling it to be used within the Flare blockchain ecosystem.
22
+
Minting FAssets is the process of wrapping underlying tokens (e.g., XRP from the XRP Ledger) into FAssets, enabling them to be used within the Flare blockchain ecosystem.
21
23
22
24
See the [Minting](/fassets/minting) overview for more details.
23
25
@@ -28,7 +30,7 @@ See the [Minting](/fassets/minting) overview for more details.
28
30
29
31
## Minting Process Steps
30
32
31
-
The minting process is a multi-step process that involves the following steps:
33
+
The minting process involves the following steps:
32
34
33
35
1. Reserve collateral from a suitable agent.
34
36
2. Send the underlying asset (e.g., XRP) to the agent.
@@ -37,13 +39,19 @@ The minting process is a multi-step process that involves the following steps:
37
39
38
40
## Reserve Collateral
39
41
42
+
Reserving collateral is the first step in the minting process.
43
+
44
+
<MintingFees />
45
+
46
+
### Reserve Collateral Script
47
+
40
48
The following code demonstrates how to reserve collateral by calling the [`reserveCollateral`](/fassets/reference/IAssetManager#reservecollateral) function on the AssetManager contract.
1. Install the `xrpl` package — it's not included in the Flare Hardhat Starter Kit by default.
91
+
1. Install the `xrpl` package — it is not included in the Flare Hardhat Starter Kit by default.
77
92
2. Specify the correct constants from the reserve collateral script:
78
93
-`AGENT_ADDRESS` - Agent's XRP Ledger address.
79
94
-`AMOUNT_XRP` - XRP amount to send.
80
-
-`PAYMENT_REFERENCE` - Payment reference from the the reserve collateral script.
95
+
-`PAYMENT_REFERENCE` - Payment reference from the reserve collateral script.
81
96
3. Create a client to connect to the XRP Ledger Testnet.
82
97
4. Load the sender wallet.
83
98
5. Construct the payment transaction.
@@ -103,14 +118,14 @@ This script demonstrates how to retrieve the FDC proof and execute minting.
103
118
2. Set the collateral reservation ID to the previously reserved minting request.
104
119
3. Set the FDC round ID to retrieve the proof.
105
120
4. Provide the FDC request data.
106
-
5.ImporttheAssetmanagercontractartifact.
121
+
5.ImporttheAssetManagercontractartifact.
107
122
6. Define the function to prepare the FDC request.
108
123
7. Create a function to get the proof from the FDC.
109
124
It sends a POST request to the [Flare Data Availability Layer](/fdc/overview#data-availability-layer) and returns a Merkle proof and attestation response from FDC.
110
125
8. Define the function to parse the events.
111
126
9. Retrieve the FDC proof from the Data Availability Layer.
112
127
10. Call the [`executeMinting`](/fassets/reference/IAssetManager#executeminting) function on the AssetManager contract and send a transaction to the Flare network to convert the attested XRP payment into FXRP (minting).
113
-
11. On a successful transaction call `parseExecutemintingEvents` to extract and log events [`RedemptionTicketCreated`](/fassets/reference/IAssetManagerEvents#redemptionticketcreated) and [`MintingExecuted`](/fassets/reference/IAssetManagerEvents#mintingexecuted).
128
+
11. On a successful transaction call the `parseExecutemintingEvents` function to extract and log events [`RedemptionTicketCreated`](/fassets/reference/IAssetManagerEvents#redemptionticketcreated) and [`MintingExecuted`](/fassets/reference/IAssetManagerEvents#mintingexecuted).
@@ -47,13 +49,19 @@ The minting process involves the following steps:
47
49
48
50
## Reserve Collateral
49
51
52
+
Reserving collateral is the first step in the minting process.
53
+
54
+
<MintingFees />
55
+
56
+
### Reserve Collateral Script
57
+
50
58
The following code demonstrates how to reserve collateral by calling the [`reserveCollateral`](/fassets/reference/IAssetManager#reservecollateral) function on the AssetManager contract.
|**Collateral Reservation Fee (CRF)**| Native tokens (FLR/SGB) | Compensates the agent and the collateral pool token (CPT) holders for locking their collateral during the minting process. Defined by governance as a percentage of the minted value. |
8
+
|**Minting Fee**| Underlying currency (e.g., XRP for FXRP) | Main source of revenue for the agents and the CPT holders. Percentage of the minted amount (varies by agent). |
9
+
|**Executor Fee (Optional)**| Native tokens (FLR/SGB) | Incentivizes the executor to process minting requests. Configurable fee denominated in FLR. |
10
+
11
+
:::info[Collateral Reservation Fee (CRF)]
12
+
If minting fails, the Collateral Reservation Fee is not returned to the minter.
13
+
It is distributed to the agent and the pool in the same manner as the minting fee.
|`underlyingSecondsForPayment`| seconds | The minimum time allowed for a minter to pay on the underlying chain |
8
+
|`underlyingBlocksForPayment`| blocks | The number of underlying blocks during which the minter can make the payment |
9
+
10
+
These parameters work together as a dual safety mechanism that ensures payment happens within a reasonable number of blocks and guarantees payment occurs within a reasonable amount of time.
11
+
12
+
Both constraints must be satisfied for the payment to be considered valid.
13
+
14
+
#### Payment Deadline Calculation
15
+
16
+
When you reserve collateral, the system emits the following values in the [`CollateralReserved`](/fassets/reference/IAssetManagerEvents#collateralreserved) event:
17
+
18
+
-`lastUnderlyingBlock`: The final block number for a valid payment.
19
+
-`lastUnderlyingTimestamp`: The deadline timestamp for payment.
20
+
21
+
Valid payments must occur **before both the last block AND the last timestamp**.
22
+
23
+
#### Payment Failure Handling
24
+
25
+
If the minter [fails to pay on the underlying chain](/fassets/minting#payment-failure) within the required timeframe:
26
+
27
+
- The agent must prove [nonpayment](/fdc/attestation-types/referenced-payment-nonexistence) using the [Flare Data Connector](/fdc/overview).
28
+
- After nonpayment is proved, the agent's collateral that was reserved is released.
29
+
- The agent receives the [Collateral Reservation Fee](/fassets/minting#collateral-reservation-fee), which is not returned to the minter.
30
+
- The minter loses the opportunity to mint and must restart the process.
0 commit comments