|
2 | 2 | sidebar_position: 1 |
3 | 3 | slug: overview |
4 | 4 | title: Flare Smart Accounts |
5 | | -authors: [nikerzetic, filipkoprivec] |
| 5 | +authors: [nikerzetic] |
6 | 6 | description: The Flare Smart Accounts is an account abstraction that performs actions on behalf of XRPL users. |
7 | 7 | tags: [quickstart, ethereum, flare-smart-accounts] |
8 | 8 | keywords: |
@@ -41,82 +41,176 @@ This is done through a `Payment` to an XRPL address, designated by the operator |
41 | 41 | The payment must transfer sufficient funds, as specified by the operator, and must include the proper payment receipt in the memo field. |
42 | 42 |
|
43 | 43 | The payment receipt is a `bytes32` value. |
44 | | -The first byte is reserved for the instruction code, a byte representation of a two-digit number. |
| 44 | +The first byte is reserved for the instruction code. |
| 45 | +The second byte is a wallet identifier; |
| 46 | +this is a number assigned to wallet providers by the Flare Foundation, and should otherwise be `0`. |
45 | 47 | The remaining 31 bytes are the parameters for the chosen instruction. |
46 | 48 |
|
47 | 49 | In practice, the payment receipt should be prepared by a backend, through a web form. |
48 | 50 |
|
| 51 | +The first, instruction code, byte is further subdivided into two half-bytes. |
| 52 | +The first nibble is the instruction type; |
| 53 | +this is either `FXRP`, `Firelight` or `Upshift` (with corresponding type IDS `0`, `1` and `2`). |
| 54 | +The second nibble is the instruction command; the available commands are different for each instruction type. |
| 55 | + |
49 | 56 | <details> |
50 | 57 | <summary>Table of instruction IDs and corresponding actions.</summary> |
51 | | - <table> |
52 | | - <thead> |
53 | | - <tr> |
54 | | - <td> **Instruction ID**</td> |
55 | | - <td>**Action** </td> |
56 | | - <td>**Description** </td> |
57 | | - </tr> |
58 | | - </thead> |
59 | | - <tbody> |
60 | | - <tr> |
61 | | - <td> 01</td> |
62 | | - <td> deposit</td> |
63 | | - <td> |
64 | | - Deposit an `amount` of FXRP into the Firelight vault, designated |
65 | | - by the `MasterAccountController` contract. |
66 | | - </td> |
67 | | - </tr> |
68 | | - <tr> |
69 | | - <td> 02</td> |
70 | | - <td> withdraw</td> |
71 | | - <td> |
72 | | - Withdraw an `amount` of FXRP from the Firelight vault, |
73 | | - designated by the `MasterAccountController` contract. |
74 | | - </td> |
75 | | - </tr> |
76 | | - <tr> |
77 | | - <td> 03</td> |
78 | | - <td> approve</td> |
79 | | - <td> |
80 | | - **Deprecated.** Approve the Firelight vault, designated by the |
81 | | - `MasterAccountController` contract, to spend an `amount` of FXRP from |
82 | | - your account. |
83 | | - </td> |
84 | | - </tr> |
85 | | - <tr> |
86 | | - <td> 04</td> |
87 | | - <td> redeem</td> |
88 | | - <td> |
89 | | - Redeem `lots` of FXRP. The redemption will be handled by the |
90 | | - `executor`, specified by the `MasterAccountController` contract. |
91 | | - </td> |
92 | | - </tr> |
93 | | - <tr> |
94 | | - <td> 05</td> |
95 | | - <td> reserveCollateral</td> |
96 | | - <td> |
97 | | - Reserve `lots` of collateral in the `agentVault`, specified by |
98 | | - the `MasterAccountController` contract. The collateral reservation |
99 | | - will be handled by the `executor`, also specified by the |
100 | | - `MasterAccountController` contract. |
101 | | - </td> |
102 | | - </tr> |
103 | | - <tr> |
104 | | - <td> 06</td> |
105 | | - <td> claimWithdraw</td> |
106 | | - <td> Claim the withdrawal from the Firelight vault.</td> |
107 | | - </tr> |
108 | | - <tr> |
109 | | - <td> 99</td> |
110 | | - <td> custom</td> |
111 | | - <td> |
112 | | - Execute a list of custom function calls. The custom instructions |
113 | | - need to be registered in advance, with the `MasterAccountController` |
114 | | - (`registerCustomInstruction` function). |
115 | | - </td> |
116 | | - </tr> |
117 | | - </tbody> |
118 | | - </table> |
119 | | - <p> </p> |
| 58 | + |
| 59 | +### FXRP |
| 60 | + |
| 61 | +Instructions for interacting with the `FXRP` token. |
| 62 | + |
| 63 | +**Type ID:** `00`. |
| 64 | + |
| 65 | +<table> |
| 66 | + <thead> |
| 67 | + <tr> |
| 68 | + <td> **Command ID**</td> |
| 69 | + <td>**Action** </td> |
| 70 | + <td>**Description** </td> |
| 71 | + </tr> |
| 72 | + </thead> |
| 73 | + <tbody> |
| 74 | + <tr> |
| 75 | + <td> 00</td> |
| 76 | + <td> collateralReservation</td> |
| 77 | + <td> |
| 78 | + Reserve a `value` of lots of collateral in the agent vault, |
| 79 | + registered under the `agentVaultId` with the `MasterAccountController` |
| 80 | + contract. |
| 81 | + </td> |
| 82 | + </tr> |
| 83 | + <tr> |
| 84 | + <td> 01</td> |
| 85 | + <td> transfer</td> |
| 86 | + <td> |
| 87 | + Transfer a `value` (in drops) of FXRP to the `recipientAddress`. |
| 88 | + </td> |
| 89 | + </tr> |
| 90 | + <tr> |
| 91 | + <td> 02</td> |
| 92 | + <td> redeem</td> |
| 93 | + <td> Redeem a `value` of lots of FXRP.</td> |
| 94 | + </tr> |
| 95 | + </tbody> |
| 96 | +</table> |
| 97 | +<p> </p> |
| 98 | + |
| 99 | +### Firelight |
| 100 | + |
| 101 | +Instructions for interacting with a Firelight type vault. |
| 102 | + |
| 103 | +**Type ID:** `01`. |
| 104 | + |
| 105 | +<table> |
| 106 | + <thead> |
| 107 | + <tr> |
| 108 | + <td> **Command ID**</td> |
| 109 | + <td>**Action** </td> |
| 110 | + <td>**Description** </td> |
| 111 | + </tr> |
| 112 | + </thead> |
| 113 | + <tr> |
| 114 | + <td> 00</td> |
| 115 | + <td> collateralReservationAndDeposit</td> |
| 116 | + <td> |
| 117 | + Reserve a `value` of lots of collateral in the agent vault, |
| 118 | + registered under the `agentVaultId` with the `MasterAccountController` |
| 119 | + contract. After successful minting, deposit the FXRP into the Firelight |
| 120 | + type vault, registered under the `vaultId` with the |
| 121 | + `MasterAccountController` contract. Equivalent to sending a |
| 122 | + `collateralReservation` instruction and a Firelight `deposit` instruction. |
| 123 | + </td> |
| 124 | + </tr> |
| 125 | + <tbody> |
| 126 | + <tr> |
| 127 | + <td> 01</td> |
| 128 | + <td> deposit</td> |
| 129 | + <td> |
| 130 | + Deposit a `value` of FXRP into the Firelight type vault, |
| 131 | + registered under the `vaultId` with the `MasterAccountController` |
| 132 | + contract. |
| 133 | + </td> |
| 134 | + </tr> |
| 135 | + <tr> |
| 136 | + <td> 02</td> |
| 137 | + <td> redeem</td> |
| 138 | + <td> |
| 139 | + Start the withdrawal process for a `value` of FXRP from the |
| 140 | + Firelight type vault, registered under the `vaultId` with the |
| 141 | + `MasterAccountController` contract. |
| 142 | + </td> |
| 143 | + </tr> |
| 144 | + <tr> |
| 145 | + <td> 03</td> |
| 146 | + <td> claimWithdraw</td> |
| 147 | + <td> |
| 148 | + Withdraw the `FXRP`, requested in the `value` period, from |
| 149 | + Firelight type vault, registered under the `vaultId` with the |
| 150 | + `MasterAccountController` contract. |
| 151 | + </td> |
| 152 | + </tr> |
| 153 | + </tbody> |
| 154 | +</table> |
| 155 | +<p> </p> |
| 156 | + |
| 157 | +### Upshift |
| 158 | + |
| 159 | +Instructions for interacting with an upshift type vault. |
| 160 | + |
| 161 | +**Type ID:** `02`. |
| 162 | + |
| 163 | + <table> |
| 164 | + <thead> |
| 165 | + <tr> |
| 166 | + <td> **Command ID**</td> |
| 167 | + <td>**Action** </td> |
| 168 | + <td>**Description** </td> |
| 169 | + </tr> |
| 170 | + </thead> |
| 171 | + <tr> |
| 172 | + <td> 00</td> |
| 173 | + <td> collateralReservationAndDeposit</td> |
| 174 | + <td> |
| 175 | + Reserve a `value` of lots of collateral in the agent vault, |
| 176 | + registered under the `agentVaultId` with the `MasterAccountController` |
| 177 | + contract. After successful minting, deposit the FXRP into the Upshift |
| 178 | + type vault, registered under the `vaultId` with the |
| 179 | + `MasterAccountController` contract. Equivalent to sending a |
| 180 | + `collateralReservation` instruction and a Upshift `deposit` instruction. |
| 181 | + </td> |
| 182 | + </tr> |
| 183 | + <tbody> |
| 184 | + <tr> |
| 185 | + <td> 01</td> |
| 186 | + <td> deposit</td> |
| 187 | + <td> |
| 188 | + Deposit a `value` of FXRP into the Upshift type vault, |
| 189 | + registered under the `vaultId` with the `MasterAccountController` |
| 190 | + contract. |
| 191 | + </td> |
| 192 | + </tr> |
| 193 | + <tr> |
| 194 | + <td> 02</td> |
| 195 | + <td> requestRedeem</td> |
| 196 | + <td> |
| 197 | + Start the withdrawal process for a `value` of FXRP from the |
| 198 | + Upshift type vault, registered under the `vaultId` with the |
| 199 | + `MasterAccountController` contract. |
| 200 | + </td> |
| 201 | + </tr> |
| 202 | + <tr> |
| 203 | + <td> 03</td> |
| 204 | + <td> claim</td> |
| 205 | + <td> |
| 206 | + Withdraw the `FXRP`, requested in the `value` period, from |
| 207 | + Upshift type vault, registered under the `vaultId` with the |
| 208 | + `MasterAccountController` contract. |
| 209 | + </td> |
| 210 | + </tr> |
| 211 | + </tbody> |
| 212 | +</table> |
| 213 | +<p> </p> |
120 | 214 | </details> |
121 | 215 |
|
122 | 216 | ## 2. Payment proof on Flare |
|
0 commit comments