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/3-custom-instruction.mdx
+7-6Lines changed: 7 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -64,9 +64,9 @@ We expand the workflow described in the [Flare Smart Accounts overview](/smart-a
64
64
Custom instructions are an array of the `CustomInstructions.CustomCall` Solidity struct.
65
65
The struct contains three fields:
66
66
67
-
-**targetContract**: the address of the smart contract that will execute the custom function
68
-
-**value**: the amount of FLR paid to the contract
69
-
-**data**: transaction calldata, which includes a function selector and values of the function's arguments
67
+
-`targetContract`: the address of the smart contract that will execute the custom function
68
+
-`value`: the amount of FLR paid to the contract
69
+
-`data`: transaction calldata, which includes a function selector and values of the function's arguments
70
70
71
71
Each of the custom instructions in the array will be performed in order.
72
72
A call to the `targetContract` address is made, with the specified `value` and the calldata `data`.
@@ -108,7 +108,7 @@ function encodeCustomInstruction(
108
108
}
109
109
```
110
110
111
-
Behind the scenes, the `MasterAccountController` contract calls the `encodeCustomInstruction` function of the `CustomInstructions` library..
111
+
Behind the scenes, the `MasterAccountController` contract calls the `encodeCustomInstruction` function of the `CustomInstructions` library.
112
112
113
113
```Solidity
114
114
function encodeCustomInstruction(
@@ -128,6 +128,7 @@ We register a custom instruction by calling the `registerCustomInstruction` func
128
128
The `CustomInstructions.CustomCall` array is provided as an argument.
129
129
It is encoded as described above and stored in a `CustomInstructions` mapping.
130
130
131
-
To obtain the instruction that can be sent as the memo of an XRPL Payment transaction, we do the following.
132
-
We take the call hash, produced by the `encodeCustomInstruction` function, remove the first two bytes, and prepend to it the hexadecimal value `ff` and the `walletId`.
131
+
To obtain the instruction that can be sent as the memo of an XRPL Payment transaction, we take the call hash produced by the `encodeCustomInstruction` function and modify it the following way.
132
+
First, we remove the initial two bytes from this hash.
133
+
Next, we prepend the hexadecimal value `ff` followed by the `walletId`.
@@ -428,7 +427,7 @@ async function waitForCustomInstructionExecutedEvent({
428
427
}
429
428
```
430
429
431
-
The vehicle for bridging the instruction is FDC, which puts a maximum cap of 180 seconds on the process duration.
430
+
The vehicle for bridging the instruction is the [Flare Data Connector](/fdc/overivew), which puts a maximum cap of 180 seconds on the process duration.
0 commit comments