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/smart-accounts/1-overview.mdx
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@ import ThemedImage from "@theme/ThemedImage";
21
21
importuseBaseUrlfrom"@docusaurus/useBaseUrl";
22
22
23
23
The Flare Smart Accounts is an account abstraction that allows XRPL users to perform actions on the Flare chain without owning any FLR token.
24
-
Each XRPL address is assigned a unique **smart account** on the Flare chain, that only they can control.
24
+
Each XRPL address is assigned a unique **smart account** on the Flare chain, which only it can control.
25
25
They do so through `Payment` transactions on the XRPL.
26
26
The Flare Smart Accounts are especially useful as a way of interacting with the FAssets workflow.
27
27
@@ -36,12 +36,12 @@ The workflow for Flare Smart Accounts is comprised of the following steps.
36
36
37
37
## 1. Instructions on XRPL
38
38
39
-
The Flare Smart Accounts allows XRPL users to perform actions on the Flare chain through instructions on the XRPL.
39
+
The Flare Smart Accounts allow XRPL users to perform actions on the Flare chain through instructions on the XRPL.
40
40
This is done through a `Payment` to an XRPL address, designated by the operator - a backend monitoring incoming transactions and interacting with the Flare chain.
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 instructions code, a byte-representation of a two-digit number.
44
+
The first byte is reserved for the instruction code, a byterepresentation of a two-digit number.
45
45
The remaining 31 bytes are the parameters for the chosen instruction.
46
46
47
47
In practice, the payment receipt should be prepared by a backend, through a web form.
Copy file name to clipboardExpand all lines: docs/smart-accounts/2-fasset-instructions.mdx
+12-12Lines changed: 12 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,23 +20,23 @@ unlisted: false
20
20
importThemedImagefrom"@theme/ThemedImage";
21
21
importuseBaseUrlfrom"@docusaurus/useBaseUrl";
22
22
23
-
In this guide we will take a closer look at the Flare Smart Accounts instructions related to FAssets.
23
+
In this guide, we will take a closer look at the Flare Smart Accounts instructions related to FAssets.
24
24
FAsset is a trustless, over-collateralized bridge between XRPL and the Flare chain.
25
25
The FXRP is a token representation of XRP on the Flare chain.
26
26
FAssets allow XRPL users to partake in Flare's DeFi ecosystem using their XRP assets, without exchanging them for the FLR token.
27
27
28
-
Several steps of the FAsset process are performed as transactions on the Flare chain, which requires users to hold FLR token for paying gas fees.
28
+
Several steps of the FAsset process are performed as transactions on the Flare chain, which requires users to hold FLR tokens for paying gas fees.
29
29
The Flare Smart Accounts sidestep this by allowing XRPL users to trigger these actions through `Payment` transactions on XRPL.
30
30
Thus, they eradicate completely the need for XRPL users to hold any non-XRPL assets.
31
31
32
32
You can learn more about the FAssets in the [dedicated section](/fassets/overview/).
33
33
34
34
## `01` Deposit
35
35
36
-
Deposit an `amount` of FXRP from you account into the Firelight vault `depositVault`.
36
+
Deposit an `amount` of FXRP from your account into the Firelight vault `depositVault`.
37
37
The address `depositVault` is designated by the `MasterAccountController` contract, and the `amount` is read from the last 31 bytes of the payment reference.
38
38
39
-
A deposit payment reference is the 32byte value:
39
+
A deposit payment reference is the 32-byte value:
40
40
41
41
- byte representation of `02` on the first byte,
42
42
- byte representation of the `amount` number on the other 31 bytes.
@@ -66,7 +66,7 @@ The first part of the withdrawal process from a Firelight vault.
66
66
Initiate a withdrawal request of an `amount` of FXRP from the Firelight vault `depositVault`.
67
67
The address `depositVault` is designated by the `MasterAccountController` contract, and the `amount` is read from the last 31 bytes of the payment reference.
68
68
69
-
A withdraw payment reference is the 32byte value:
69
+
A withdraw payment reference is the 32-byte value:
70
70
71
71
- byte representation of `02` on the first byte,
72
72
- byte representation of the `amount` number on the other 31 bytes.
@@ -91,12 +91,12 @@ A withdraw payment reference is the 32 byte value:
91
91
92
92
## `03` Approve (deprecated)
93
93
94
-
_Approval has been made part of the deposit actions and is now deprecated._
94
+
_Approval has been integrated into the deposit action and is now deprecated._
95
95
96
96
Approve the `depositVault` address to withdraw an `amount` of FXRP from your smart account.
97
97
The address `depositVault` is designated by the `MasterAccountController` contract, and the `amount` is read from the last 31 bytes of the payment reference.
98
98
99
-
A withdraw payment reference is the 32byte value:
99
+
A withdraw payment reference is the 32-byte value:
100
100
101
101
- byte representation of `03` on the first byte,
102
102
- byte representation of the `amount` number on the other 31 bytes.
@@ -122,13 +122,13 @@ A withdraw payment reference is the 32 byte value:
122
122
## `04` Redeem
123
123
124
124
Redemption is the process of converting FXRP back to XRP.
125
-
A number of `lots` of FXRP are burned, and the same number of `lots` of XRP in returned to the user's XRPL account.
125
+
A number of `lots` of FXRP are burned, and the same number of `lots` of XRP is returned to the user's XRPL account.
126
126
127
127
The process is performed by an `executor` with `executorFee` (explained in the [minting guide](/fassets/minting#executor-role));
128
128
both of these are defined by the `MasterAccountController` contract.
129
129
The `lots` and `agentVault` values are both read from the payment reference.
130
130
131
-
A redeem payment reference is the 32byte value:
131
+
A redeem payment reference is the 32-byte value:
132
132
133
133
- byte representation of `04` on the first byte,
134
134
- 19 empty bytes,
@@ -155,15 +155,15 @@ A redeem payment reference is the 32 byte value:
155
155
## `05` Reserve collateral
156
156
157
157
Collateral reservation is the first step in the FAssets minting process.
158
-
In anticipation of transfer of XRP to the agent's underlying address on XRPL a portion of its collateral is locked to prevent accidental under-collateralization.
158
+
In anticipation of the transfer of XRP to the agent's underlying address on XRPL, a portion of its collateral is locked to prevent accidental under-collateralization.
159
159
Since this action happens on the Flare chain, the gas fees need to be paid in the native FLR token.
160
160
161
161
The reserveCollateral action reserves a number of `lots` of collateral of the `agentVault`.
162
162
The process is performed by an `executor` with `executorFee` (explained in the [minting guide](/fassets/minting#executor-role));
163
163
both of these are defined by the `MasterAccountController` contract.
164
164
The `lots` and `agentVault` values are both read from the payment reference.
165
165
166
-
A reserveCollateral payment reference is a 32byte value:
166
+
A reserveCollateral payment reference is a 32-byte value:
167
167
168
168
- byte representation of `05` on the first byte,
169
169
-`agentVault` address on the next 20 bytes,
@@ -194,7 +194,7 @@ Claim the pending withdrawal from the Firelight `depositVault`, specified by the
194
194
The assets are transferred to the user's smart account.
195
195
The action can only be performed after one full period has passed.
196
196
197
-
A reserveCollateral payment reference is a 32byte value:
197
+
A reserveCollateral payment reference is a 32-byte value:
Copy file name to clipboardExpand all lines: docs/smart-accounts/3-custom-instruction.mdx
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,12 +20,12 @@ unlisted: false
20
20
importThemedImagefrom"@theme/ThemedImage";
21
21
importuseBaseUrlfrom"@docusaurus/useBaseUrl";
22
22
23
-
Flare Smart Accounts allow users to execute custom function calls on the Flare chain, through instructions on XRPL.
23
+
Flare Smart Accounts allow users to execute custom function calls on the Flare chain through instructions on XRPL.
24
24
The process expands on the workflow for other actions by including an additional step at the beginning.
25
25
26
26
In order for the `MasterAccountController` contract to be able to give a custom instruction to a personal account, the custom action must first be registered with the said contract.
27
-
The custom instruction is stored in a mapper, with its 31byte hash as a key.
28
-
That hash is then sent as payment reference, along with the byte representation of the number 99 in the first byte.
27
+
The custom instruction is stored in a mapper, with its 31-byte hash as a key.
28
+
That hash is then sent as the payment reference, along with the byte representation of the number 99 in the first byte.
29
29
30
30
<div
31
31
style={{
@@ -74,7 +74,7 @@ In Solidity, we can obtain the calldata by doing the following:
where `<functionName>` is the name of the function that we want to call, `<type1>`,`<type2>`, . . . ,`<typeN>` are its argument types, and `<value1>`, `<value2>`, . . . , `<valueN>` their values.
77
+
where `<functionName>` is the name of the function that we want to call, `<type1>`,`<type2>`, . . . ,`<typeN>` are its argument types, and `<value1>`, `<value2>`, . . . , `<valueN>` their values.
78
78
79
79
Only function calls with specific parameter values included can be registered.
80
80
That means that a new custom instruction needs to be registered for each unique action (though this can be done just seconds in advance).
@@ -84,10 +84,10 @@ It is also the reason why special FAsset actions have their own IDs, instead of
84
84
85
85
To produce the custom instructions calldata, we first ABI encode the array of the `IMasterAccountController.CustomInstruction` struct.
86
86
We then take the `keccak256` hash of that value, and drop the last byte.
87
-
That is the call hash that that is provided as the payment reference for the custom action, and the ID under which the custom instructions are stored in the `MasterAccountController` contract.
87
+
That is the call hash that is provided as the payment reference for the custom action, and the ID under which the custom instructions are stored in the `MasterAccountController` contract.
88
88
89
89
## 0. Register custom instructions
90
90
91
91
We register a custom instruction by calling the `registerCustomInstruction` function on the `MasterAccountController` contract.
92
92
The `IMasterAccountController.CustomInstruction` array is provided as an argument.
93
-
It is encoded as described above, and stored to a `CustomInstructions` mapping.
93
+
It is encoded as described above and stored in a `CustomInstructions` mapping.
0 commit comments