Skip to content

Commit c191887

Browse files
committed
docs: enhance IAssetManagerEvents documentation with event categories and add redemption events
1 parent cc13660 commit c191887

File tree

1 file changed

+180
-16
lines changed

1 file changed

+180
-16
lines changed

docs/fassets/reference/IAssetManagerEvents.mdx

Lines changed: 180 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,31 @@ sidebar_position: 3
77

88
`IAssetManagerEvents` is an interface that defines the events emitted by the [`IAssetManager`](/fassets/reference/IAssetManager) contract.
99

10-
Sourced from `IAssetManagerEvents.sol` on [GitHub](https://github.com/flare-foundation/fassets/blob/main/contracts/userInterfaces/IAssetManagerEvents.sol).
10+
Sourced from `IAssetManagerEvents.sol` on [GitHub](https://github.com/flare-foundation/fassets/blob/main/contracts/userInterfaces/IAssetManagerEvents.sol).ā
1111

12-
## Events
12+
## Event Categories
13+
14+
The events are organized into the following categories:
15+
16+
- **[Minting Events](#minting-events)** - Events related to the FAssets minting process.
17+
- **[Redemption Events](#redemption-events)** - All events related to the FAssets redemption process, including requests, tickets, outcomes, and failures.
18+
19+
## Minting Events
20+
21+
Events related to the FAssets minting process, including collateral reservation, execution, and defaults.
1322

1423
### `CollateralReserved`
1524

16-
Emitted when a minter has reserved collateral, paid the reservation fee, and is expected to pay the underlying funds. The agent's collateral is reserved at this point.
25+
Emitted when a minter has reserved collateral, paid the reservation fee, and is expected to pay the underlying funds.
26+
The agent's collateral is reserved at this point.
1727

1828
Parameters:
1929

2030
- `agentVault`: Address of the agent vault
2131
- `minter`: Address of the minter
2232
- `collateralReservationId`: ID of the collateral reservation
23-
- `valueUBA`: Value in underlying base amount
24-
- `feeUBA`: Fee in underlying base amount
33+
- `valueUBA`: Value in the underlying base amount
34+
- `feeUBA`: Fee in the underlying base amount
2535
- `firstUnderlyingBlock`: First block number on the underlying chain
2636
- `lastUnderlyingBlock`: Last block number on the underlying chain
2737
- `lastUnderlyingTimestamp`: Last timestamp on the underlying chain
@@ -49,7 +59,8 @@ event CollateralReserved(
4959

5060
### `CollateralReservationRejected`
5161

52-
Emitted when an agent rejects the collateral reservation request due to the minter's identity. The reserved collateral is released.
62+
Emitted when an agent rejects the collateral reservation request due to the minter's identity.
63+
The reserved collateral is released.
5364

5465
Parameters:
5566

@@ -67,7 +78,8 @@ event CollateralReservationRejected(
6778

6879
### `CollateralReservationCancelled`
6980

70-
Emitted when a minter cancels the collateral reservation request due to agent inactivity. The reserved collateral is released.
81+
Emitted when a minter cancels the collateral reservation request due to agent inactivity.
82+
The reserved collateral is released.
7183

7284
Parameters:
7385

@@ -85,15 +97,16 @@ event CollateralReservationCancelled(
8597

8698
### `MintingExecuted`
8799

88-
Emitted when a minter has successfully paid the underlying funds in time and received the FAssets. The agent's collateral is locked at this point.
100+
Emitted when a minter has successfully paid the underlying funds in time and received the FAssets.
101+
The agent's collateral is locked at this point.
89102

90103
Parameters:
91104

92105
- `agentVault`: Address of the agent vault
93106
- `collateralReservationId`: ID of the collateral reservation
94-
- `mintedAmountUBA`: Amount of FAssets minted in underlying base amount
95-
- `agentFeeUBA`: Fee paid to the agent in underlying base amount
96-
- `poolFeeUBA`: Fee paid to the pool in underlying base amount
107+
- `mintedAmountUBA`: Amount of FAssets minted in the underlying base amount
108+
- `agentFeeUBA`: Fee paid to the agent in the underlying base amount
109+
- `poolFeeUBA`: Fee paid to the pool in the underlying base amount
97110

98111
```solidity
99112
event MintingExecuted(
@@ -107,14 +120,15 @@ event MintingExecuted(
107120

108121
### `MintingPaymentDefault`
109122

110-
Emitted when a minter fails to pay the underlying funds in time. The collateral reservation fee is paid to the agent and the reserved collateral is released.
123+
Emitted when a minter fails to pay the underlying funds in time.
124+
The collateral reservation fee is paid to the agent, and the reserved collateral is released.
111125

112126
Parameters:
113127

114128
- `agentVault`: Address of the agent vault
115129
- `minter`: Address of the minter
116130
- `collateralReservationId`: ID of the collateral reservation
117-
- `reservedAmountUBA`: Amount that was reserved in underlying base amount
131+
- `reservedAmountUBA`: Amount that was reserved in the underlying base amount
118132

119133
```solidity
120134
event MintingPaymentDefault(
@@ -134,7 +148,7 @@ Parameters:
134148
- `agentVault`: Address of the agent vault
135149
- `minter`: Address of the minter
136150
- `collateralReservationId`: ID of the collateral reservation
137-
- `reservedAmountUBA`: Amount that was reserved in underlying base amount
151+
- `reservedAmountUBA`: Amount that was reserved in the underlying base amount
138152

139153
```solidity
140154
event CollateralReservationDeleted(
@@ -145,6 +159,10 @@ event CollateralReservationDeleted(
145159
);
146160
```
147161

162+
## Redemption Events
163+
164+
All events related to the FAssets redemption process, including redemption requests, ticket management, successful redemptions, failures, defaults, and fee distributions.
165+
148166
### `RedemptionRequested`
149167

150168
An event is emitted when the redeemer starts the redemption process.
@@ -167,7 +185,7 @@ event RedemptionRequested(
167185

168186
### `RedemptionTicketCreated`
169187

170-
Event emitted when a redemption ticket is created when a minting transaction is executed.
188+
This event is emitted when a redemption ticket is created, when a minting transaction is executed.
171189

172190
Parameters:
173191

@@ -186,7 +204,7 @@ Parameters:
186204

187205
- `agentVault`: The address of the agent vault that will redeem the FAssets.
188206
- `redemptionTicketId`: The ID of the redemption ticket.
189-
- `ticketValueUBA`: The value of the redemption ticket in underlying chain currency.
207+
- `ticketValueUBA`: The value of the redemption ticket in the underlying chain currency.
190208

191209
```solidity
192210
event RedemptionTicketUpdated(
@@ -208,3 +226,149 @@ event RedemptionPerformed(
208226
uint256 redemptionAmountUBA,
209227
int256 spentUnderlyingUBA);
210228
```
229+
230+
### `RedemptionRejected`
231+
232+
Emitted when an agent rejects a redemption request due to an invalid redeemer address.
233+
234+
Parameters:
235+
236+
- `agentVault`: Address of the agent vault that rejected the redemption.
237+
- `redeemer`: Address of the user attempting to redeem (invalid address).
238+
- `requestId`: Unique identifier for the redemption request.
239+
- `redemptionAmountUBA`: Amount of FAssets that were requested for redemption.
240+
241+
```solidity
242+
event RedemptionRejected(
243+
address indexed agentVault,
244+
address indexed redeemer,
245+
uint256 indexed requestId,
246+
uint256 redemptionAmountUBA
247+
);
248+
```
249+
250+
### `RedemptionRequestIncomplete`
251+
252+
Emitted when a redemption request cannot be fully processed due to insufficient tickets or exceeding allowed redemption limits.
253+
254+
Parameters:
255+
256+
- `redeemer`: Address of the user who requested the redemption.
257+
- `remainingLots`: Number of FAsset lots that could not be redeemed and are returned to the redeemer.
258+
259+
```solidity
260+
event RedemptionRequestIncomplete(
261+
address indexed redeemer,
262+
uint256 remainingLots
263+
);
264+
```
265+
266+
### `RedemptionDefault`
267+
268+
Emitted when a redemption payment times out and the redeemer is compensated with collateral instead.
269+
270+
Parameters:
271+
272+
- `agentVault`: Address of the agent vault that failed to complete the payment.
273+
- `redeemer`: Address of the user who requested the redemption.
274+
- `requestId`: Unique identifier for the redemption request.
275+
- `redemptionAmountUBA`: Amount of FAssets that were requested for redemption.
276+
- `redeemedVaultCollateralWei`: Amount of collateral paid from the agent's vault.
277+
- `redeemedPoolCollateralWei`: Amount of collateral paid from the collateral pool.
278+
279+
```solidity
280+
event RedemptionDefault(
281+
address indexed agentVault,
282+
address indexed redeemer,
283+
uint256 indexed requestId,
284+
uint256 redemptionAmountUBA,
285+
uint256 redeemedVaultCollateralWei,
286+
uint256 redeemedPoolCollateralWei
287+
);
288+
```
289+
290+
### `RedemptionPaymentBlocked`
291+
292+
Emitted when a redemption payment fails due to the redeemer's address being blocked or gas limit issues.
293+
294+
Parameters:
295+
296+
- `agentVault`: Address of the agent vault that attempted the payment.
297+
- `redeemer`: Address of the user who requested the redemption.
298+
- `requestId`: Unique identifier for the redemption request.
299+
- `transactionHash`: Hash of the failed transaction on the underlying chain.
300+
- `redemptionAmountUBA`: Amount of FAssets that were requested for redemption.
301+
- `spentUnderlyingUBA`: Amount of underlying currency spent in the failed attempt (negative value).
302+
303+
```solidity
304+
event RedemptionPaymentBlocked(
305+
address indexed agentVault,
306+
address indexed redeemer,
307+
uint256 indexed requestId,
308+
bytes32 transactionHash,
309+
uint256 redemptionAmountUBA,
310+
int256 spentUnderlyingUBA
311+
);
312+
```
313+
314+
### `RedemptionPaymentFailed`
315+
316+
Emitted when a redemption payment fails due to the agent's own error.
317+
318+
Parameters:
319+
320+
- `agentVault`: Address of the agent vault that failed the payment.
321+
- `redeemer`: Address of the user who requested the redemption.
322+
- `requestId`: Unique identifier for the redemption request.
323+
- `transactionHash`: Hash of the failed transaction on the underlying chain.
324+
- `spentUnderlyingUBA`: Amount of underlying currency spent in the failed attempt (negative value).
325+
- `failureReason`: Human-readable description of why the payment failed.
326+
327+
```solidity
328+
event RedemptionPaymentFailed(
329+
address indexed agentVault,
330+
address indexed redeemer,
331+
uint256 indexed requestId,
332+
bytes32 transactionHash,
333+
int256 spentUnderlyingUBA,
334+
string failureReason
335+
);
336+
```
337+
338+
### `RedemptionPoolFeeMinted`
339+
340+
Emitted when part of the redemption fee is re-minted as FAssets and paid to the agent's collateral pool.
341+
342+
Parameters:
343+
344+
- `agentVault`: Address of the agent vault that completed the redemption.
345+
- `requestId`: Unique identifier for the redemption request.
346+
- `poolFeeUBA`: Amount of FAssets re-minted and paid as a fee to the collateral pool.
347+
348+
```solidity
349+
event RedemptionPoolFeeMinted(
350+
address indexed agentVault,
351+
uint256 indexed requestId,
352+
uint256 poolFeeUBA
353+
);
354+
```
355+
356+
### `RedeemedInCollateral`
357+
358+
Emitted when FAssets are redeemed in collateral during a self-close exit process.
359+
360+
Parameters:
361+
362+
- `agentVault`: Address of the agent vault that processed the redemption.
363+
- `redeemer`: Address of the user who requested the redemption.
364+
- `redemptionAmountUBA`: Amount of FAssets that were redeemed.
365+
- `paidVaultCollateralWei`: Amount of collateral paid from the agent's vault.
366+
367+
```solidity
368+
event RedeemedInCollateral(
369+
address indexed agentVault,
370+
address indexed redeemer,
371+
uint256 redemptionAmountUBA,
372+
uint256 paidVaultCollateralWei
373+
);
374+
```

0 commit comments

Comments
 (0)