Skip to content

Commit 6591206

Browse files
refactor(docs): rename
1 parent 8da6504 commit 6591206

6 files changed

Lines changed: 34 additions & 15 deletions

File tree

docs/smart-accounts/3-custom-instruction.mdx renamed to docs/smart-accounts/3-full-custom-instruction.mdx

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
22
sidebar_position: 1
3-
slug: custom-instruction
4-
title: Custom Instruction
3+
slug: full-custom-instruction
4+
title: Full Custom Instruction
55
authors: [nikerzetic]
6-
description: Performing custom function calls in the Flare Smart Accounts.
6+
description: Performing custom function calls in the Flare Smart Accounts by carrying the full PackedUserOperation in the XRPL memo (0xFF).
77
tags: [intermediate, ethereum, flare-smart-accounts]
88
keywords:
99
[
@@ -19,17 +19,32 @@ keywords:
1919
import ThemedImage from "@theme/ThemedImage";
2020
import useBaseUrl from "@docusaurus/useBaseUrl";
2121

22-
Flare Smart Accounts let an XRPL user execute arbitrary contract calls on Flare trough the [`Payment`](https://xrpl.org/docs/references/protocol/transactions/types/payment) transaction on the XRPL blockchain.
22+
Flare Smart Accounts let an XRPL user execute arbitrary contract calls on Flare through an XRPL [`Payment`](https://xrpl.org/docs/references/protocol/transactions/types/payment) transaction.
2323
Each personal account exposes an [EIP-4337](https://eips.ethereum.org/EIPS/eip-4337) style `executeUserOp` entry point that the [`MasterAccountController`](/smart-accounts/reference/IMasterAccountController) invokes when it processes a custom instruction memo.
2424

25-
Custom instructions carry the full call payload in the XRPL **memo** field.
26-
The user signs a `PackedUserOperation`, ships it on XRPL, and the smart account replays it on the Flare blockchain.
25+
The **full** custom instruction (memo opcode `0xFF`) carries the entire ABI-encoded `PackedUserOperation` in the XRPL memo immediately after a 10-byte header.
26+
The user signs an XRPL `Payment`, ships the payload on XRPL, and the smart account replays the user operation on Flare with no further off-chain data.
27+
For the alternative that ships only a 32-byte hash of the user operation and lets an executor deliver the bytes on Flare, see the [Hash Custom Instruction](/smart-accounts/hash-custom-instruction); the [comparison guide](/smart-accounts/custom-instruction-comparison) covers when to pick which.
2728

2829
:::warning No destination tags
2930
XRPL transactions targeting smart accounts must not use a destination tag.
3031
A destination tag forces [FAssets direct minting](/fassets/direct-minting) to credit the tag-holder, which would let an unrelated party front-run the user operation.
3132
:::
3233

34+
## Memo layout
35+
36+
The XRPL memo carries a 10-byte instruction header followed by the ABI-encoded `PackedUserOperation`:
37+
38+
| Bytes | Field | Meaning |
39+
| ----- | ---------------- | ------------------------------------------------------------------------ |
40+
| `0` | `instructionId` | `0xFF` — full custom instruction |
41+
| `1` | `walletId` | One-byte wallet identifier assigned by Flare; `0` if not registered |
42+
| `2-9` | `executorFeeUBA` | Executor fee in the FAsset's smallest unit, big-endian `uint64` |
43+
| `10+` | `userOpData` | `abi.encode(PackedUserOperation)` — the call payload the facet decodes |
44+
45+
The total memo length is `10 + len(abi.encode(userOp))` bytes.
46+
The XRPL caps each memo at roughly `1024` bytes, so large or repetitive call batches may need to be split across multiple XRPL payments.
47+
3348
## User operation payload
3449

3550
The custom instruction payload has two layers: the outer EIP-4337 [`PackedUserOperation`](https://eips.ethereum.org/EIPS/eip-4337#useroperation) carried in the XRPL memo, and the inner [`executeUserOp(Call[])`](/smart-accounts/reference/IPersonalAccount#executeuserop) that the personal account runs once the controller dispatches it.
File renamed without changes.

docs/smart-accounts/guides/typescript-viem/02-custom-instruction.mdx renamed to docs/smart-accounts/guides/typescript-viem/02-full-custom-instruction.mdx

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
22
sidebar_position: 2
3-
slug: custom-instruction-ts
4-
title: Custom Instruction
3+
slug: full-custom-instruction-ts
4+
title: Full Custom Instruction
55
authors: [nikerzetic]
6-
description: Sending custom smart account instructions using Viem.
6+
description: Sending the full PackedUserOperation in an XRPL memo with Viem (0xFF flow).
77
tags: [quickstart, ethereum, flare-smart-accounts]
88
keywords:
99
[
@@ -20,8 +20,10 @@ unlisted: false
2020
import CodeBlock from "@theme/CodeBlock";
2121
import CustomInstructionsScript from "!!raw-loader!/examples/developer-hub-javascript/smart-accounts/custom-instructions.ts";
2222

23-
The [Custom Instruction overview](/smart-accounts/custom-instruction) explains how Flare smart accounts replay an [EIP-4337](https://eips.ethereum.org/EIPS/eip-4337) `PackedUserOperation` carried in an XRPL `Payment` memo.
24-
This guide walks through a TypeScript script that builds the user operation with Viem library, sends a payment transaction with the user operation on XRPL, and waits for the [`UserOperationExecuted`](/smart-accounts/reference/IMasterAccountController#useroperationexecuted) event on Flare.
23+
The [Full Custom Instruction overview](/smart-accounts/full-custom-instruction) explains how Flare smart accounts replay an [EIP-4337](https://eips.ethereum.org/EIPS/eip-4337) `PackedUserOperation` carried in full in an XRPL `Payment` memo (opcode `0xFF`).
24+
This guide walks through a TypeScript script that builds the user operation with the Viem library, sends a payment transaction with the user operation on XRPL, and waits for the [`UserOperationExecuted`](/smart-accounts/reference/IMasterAccountController#useroperationexecuted) event on Flare.
25+
26+
If your batch overflows the XRPL memo cap, or you want to keep call payloads off the public XRPL ledger, see the [Hash Custom Instruction guide](/smart-accounts/guides/typescript-viem/hash-custom-instruction-ts) for the 0xFE variant that ships only `keccak256(userOp)` in the memo.
2527

2628
The script executes three calls on three example smart contracts on the Flare blockchain.
2729
Because the XRPL memo field is capped at roughly `1024` bytes, the calls are split into two user operations sent in sequence.
@@ -477,6 +479,8 @@ Memo-only amount (XRP, fees only): 0.0011
477479
To continue your Flare Smart Accounts development journey, you can:
478480

479481
- Get the smart account state using the [State Lookup guide](/smart-accounts/guides/typescript-viem/state-lookup-ts).
480-
- Explore the [Custom Instruction](/smart-accounts/custom-instruction) overview.
482+
- Explore the [Full Custom Instruction overview](/smart-accounts/full-custom-instruction).
483+
- Compare the full and hash variants in the [Custom Instruction Comparison](/smart-accounts/custom-instruction-comparison).
484+
- Try the hash variant with the [Hash Custom Instruction guide](/smart-accounts/guides/typescript-viem/hash-custom-instruction-ts).
481485
- Dig into the `IMasterAccountController` [reference](/smart-accounts/reference/IMasterAccountController).
482486
:::

docs/smart-accounts/guides/typescript-viem/03-cross-chain-mint.mdx renamed to docs/smart-accounts/guides/typescript-viem/04-cross-chain-mint.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
sidebar_position: 3
2+
sidebar_position: 4
33
slug: cross-chain-mint-ts
44
title: Cross-Chain Mint
55
authors: [nikerzetic]

docs/smart-accounts/guides/typescript-viem/04-cross-chain-redeem.mdx renamed to docs/smart-accounts/guides/typescript-viem/05-cross-chain-redeem.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
sidebar_position: 4
2+
sidebar_position: 5
33
slug: cross-chain-redeem-ts
44
title: Cross-Chain Redeem
55
authors: [nikerzetic]

docs/smart-accounts/guides/typescript-viem/05-cross-chain-redeem-to-tag.mdx renamed to docs/smart-accounts/guides/typescript-viem/06-cross-chain-redeem-to-tag.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
sidebar_position: 5
2+
sidebar_position: 6
33
slug: cross-chain-redeem-to-tag-ts
44
title: Cross-Chain Redeem to Tag
55
authors: [nikerzetic]

0 commit comments

Comments
 (0)