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
Copy file name to clipboardExpand all lines: docs/fassets/reference/IAssetManager.mdx
+107Lines changed: 107 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,6 +36,113 @@ function getAgentInfo(address _agentVault)
36
36
returns (AgentInfo.Info memory);
37
37
```
38
38
39
+
### `reserveCollateral`
40
+
41
+
Reserves collateral for minting FAssets.
42
+
Before paying underlying assets for minting, the minter must reserve collateral and pay a collateral reservation fee.
43
+
44
+
Parameters:
45
+
46
+
-`_agentVault`: Agent vault address
47
+
-`_lots`: Number of lots for which to reserve collateral
48
+
-`_maxMintingFeeBIPS`: Maximum minting fee (BIPS) that can be charged by the agent - best practice is to copy the current agent's published fee; used to prevent agent from front-running reservation request and increasing fee
49
+
-`_executor`: Account that is allowed to execute minting (besides minter and agent)
50
+
-`_minterUnderlyingAddresses`: Array of minter's underlying addresses - needed only if handshake is required
51
+
52
+
```solidity
53
+
function reserveCollateral(
54
+
address _agentVault,
55
+
uint256 _lots,
56
+
uint256 _maxMintingFeeBIPS,
57
+
address payable _executor,
58
+
string[] calldata _minterUnderlyingAddresses
59
+
) external payable;
60
+
```
61
+
62
+
### `approveCollateralReservation`
63
+
64
+
Agent approves the collateral reservation request after checking the minter's identity.
65
+
66
+
Parameters:
67
+
68
+
-`_collateralReservationId`: Collateral reservation ID
69
+
70
+
```solidity
71
+
function approveCollateralReservation(
72
+
uint256 _collateralReservationId
73
+
) external notEmergencyPaused;
74
+
```
75
+
76
+
### `rejectCollateralReservation`
77
+
78
+
Agent rejects the collateral reservation request after checking the minter's identity.
79
+
The collateral reservation fee is returned to the minter.
80
+
81
+
Parameters:
82
+
83
+
-`_collateralReservationId`: Collateral reservation ID
84
+
85
+
```solidity
86
+
function rejectCollateralReservation(
87
+
uint256 _collateralReservationId
88
+
) external nonReentrant;
89
+
```
90
+
91
+
### `cancelCollateralReservation`
92
+
93
+
Minter cancels the collateral reservation request if the agent didn't respond in time.
94
+
The collateral reservation fee is returned to the minter.
95
+
96
+
Parameters:
97
+
98
+
-`_collateralReservationId`: Collateral reservation ID
99
+
100
+
```solidity
101
+
function cancelCollateralReservation(
102
+
uint256 _collateralReservationId
103
+
) external nonReentrant;
104
+
```
105
+
106
+
### `collateralReservationFee`
107
+
108
+
Returns the collateral reservation fee amount.
109
+
110
+
Parameters:
111
+
112
+
-`_lots`: The number of lots for which to reserve collateral
113
+
114
+
Returns:
115
+
116
+
-`_reservationFeeNATWei`: The amount of reservation fee in NAT wei
Sourced from `IAssetManagerEvents.sol` on [GitHub](https://github.com/flare-labs-ltd/fassets/blob/main/contracts/userInterfaces/IAssetManagerEvents.sol).
10
10
11
+
// ... existing code ...
12
+
13
+
## Events
14
+
15
+
### `CollateralReserved`
16
+
17
+
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.
18
+
19
+
Parameters:
20
+
21
+
-`agentVault`: Address of the agent vault
22
+
-`minter`: Address of the minter
23
+
-`collateralReservationId`: ID of the collateral reservation
24
+
-`valueUBA`: Value in underlying base amount
25
+
-`feeUBA`: Fee in underlying base amount
26
+
-`firstUnderlyingBlock`: First block number on the underlying chain
27
+
-`lastUnderlyingBlock`: Last block number on the underlying chain
28
+
-`lastUnderlyingTimestamp`: Last timestamp on the underlying chain
29
+
-`paymentAddress`: Address for payment
30
+
-`paymentReference`: Reference for payment
31
+
-`executor`: Address of the executor
32
+
-`executorFeeNatWei`: Fee for the executor in NAT wei
33
+
34
+
```solidity
35
+
event CollateralReserved(
36
+
address indexed agentVault,
37
+
address indexed minter,
38
+
uint256 indexed collateralReservationId,
39
+
uint256 valueUBA,
40
+
uint256 feeUBA,
41
+
uint256 firstUnderlyingBlock,
42
+
uint256 lastUnderlyingBlock,
43
+
uint256 lastUnderlyingTimestamp,
44
+
string paymentAddress,
45
+
bytes32 paymentReference,
46
+
address executor,
47
+
uint256 executorFeeNatWei
48
+
);
49
+
```
50
+
51
+
### `CollateralReservationRejected`
52
+
53
+
Emitted when an agent rejects the collateral reservation request due to the minter's identity. The reserved collateral is released.
54
+
55
+
Parameters:
56
+
57
+
-`agentVault`: Address of the agent vault
58
+
-`minter`: Address of the minter
59
+
-`collateralReservationId`: ID of the collateral reservation
60
+
61
+
```solidity
62
+
event CollateralReservationRejected(
63
+
address indexed agentVault,
64
+
address indexed minter,
65
+
uint256 indexed collateralReservationId
66
+
);
67
+
```
68
+
69
+
### `CollateralReservationCancelled`
70
+
71
+
Emitted when a minter cancels the collateral reservation request due to agent inactivity. The reserved collateral is released.
72
+
73
+
Parameters:
74
+
75
+
-`agentVault`: Address of the agent vault
76
+
-`minter`: Address of the minter
77
+
-`collateralReservationId`: ID of the collateral reservation
78
+
79
+
```solidity
80
+
event CollateralReservationCancelled(
81
+
address indexed agentVault,
82
+
address indexed minter,
83
+
uint256 indexed collateralReservationId
84
+
);
85
+
```
86
+
87
+
### `MintingExecuted`
88
+
89
+
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.
90
+
91
+
Parameters:
92
+
93
+
-`agentVault`: Address of the agent vault
94
+
-`collateralReservationId`: ID of the collateral reservation
95
+
-`mintedAmountUBA`: Amount of FAssets minted in underlying base amount
96
+
-`agentFeeUBA`: Fee paid to the agent in underlying base amount
97
+
-`poolFeeUBA`: Fee paid to the pool in underlying base amount
98
+
99
+
```solidity
100
+
event MintingExecuted(
101
+
address indexed agentVault,
102
+
uint256 indexed collateralReservationId,
103
+
uint256 mintedAmountUBA,
104
+
uint256 agentFeeUBA,
105
+
uint256 poolFeeUBA
106
+
);
107
+
```
108
+
109
+
### `MintingPaymentDefault`
110
+
111
+
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.
112
+
113
+
Parameters:
114
+
115
+
-`agentVault`: Address of the agent vault
116
+
-`minter`: Address of the minter
117
+
-`collateralReservationId`: ID of the collateral reservation
118
+
-`reservedAmountUBA`: Amount that was reserved in underlying base amount
119
+
120
+
```solidity
121
+
event MintingPaymentDefault(
122
+
address indexed agentVault,
123
+
address indexed minter,
124
+
uint256 indexed collateralReservationId,
125
+
uint256 reservedAmountUBA
126
+
);
127
+
```
128
+
129
+
### `CollateralReservationDeleted`
130
+
131
+
Emitted when both the minter and agent fail to present any proof within the attestation time window, and the agent calls `unstickMinting` to release the reserved collateral.
132
+
133
+
Parameters:
134
+
135
+
-`agentVault`: Address of the agent vault
136
+
-`minter`: Address of the minter
137
+
-`collateralReservationId`: ID of the collateral reservation
138
+
-`reservedAmountUBA`: Amount that was reserved in underlying base amount
139
+
140
+
```solidity
141
+
event CollateralReservationDeleted(
142
+
address indexed agentVault,
143
+
address indexed minter,
144
+
uint256 indexed collateralReservationId,
145
+
uint256 reservedAmountUBA
146
+
);
147
+
```
148
+
11
149
### `RedemptionRequested`
12
150
13
151
An event is emitted when the redeemer starts the redemption process.
0 commit comments