Skip to content

Commit 5cafdfc

Browse files
feat(docs): add mint to any address guide (#1099)
2 parents 898ecdd + b97dfe8 commit 5cafdfc

File tree

1 file changed

+112
-0
lines changed

1 file changed

+112
-0
lines changed
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
---
2+
sidebar_position: 1
3+
slug: mint-and-transfer
4+
title: Mint to any address
5+
authors: [nikerzetic]
6+
description: Mint FXRP and transfer it to a Flare address using the Flare Smart Accounts CLI.
7+
tags: [quickstart, ethereum, flare-smart-accounts]
8+
keywords:
9+
[
10+
flare-fdc,
11+
ethereum,
12+
flare-smart-accounts,
13+
evm,
14+
flare-network,
15+
account-abstraction,
16+
]
17+
unlisted: false
18+
---
19+
20+
In this guide we will take a look at how we can use the [Flare smart accounts CLI](/smart-accounts/guides/fsa-cli) to perform a mint action, followed by the transfer of freshly minted FXRP.
21+
What this allows us to do is to, effectively, **mint FXRP onto someone else's Flare address**.
22+
This guide is aimed primarily at Web3 developers who desire to engage with the FAssets system but want to sidestep the base minting process.
23+
24+
Let us suppose that we want to mint `1` lot of FXRP, and transfer it to the address `0xf5488132432118596fa13800b68df4c0ff25131d`.
25+
First, we need to prepare a collateral reservation instruction.
26+
We do that with the following CLI command.
27+
28+
```sh
29+
./smart_accounts.py encode fxrp-cr --wallet-id 0 --value 1 --agent-vault-id 1
30+
```
31+
32+
The `--wallet-id` flag expects a Flare-designated parameter, intended for wallet identification by the operator.
33+
It has no impact on the result of the action performed.
34+
Because no number has been provided to us, we set it to `0`.
35+
We chose the agent vault with ID `1` from the list of available agents.
36+
{/* TODO:(Nik) Link to the guide about getting agent vault addresses. */}
37+
38+
<details>
39+
<summary>Expected output</summary>
40+
41+
```sh
42+
0x0000000000000000000000010001000000000000000000000000000000000000
43+
```
44+
45+
</details>
46+
47+
Then, we need to actually send the instruction as an XRPL Payment transaction to the operator's XRPL address.
48+
We pipe the output of the first command into a `bridge` command.
49+
50+
But that is not, by itself, sufficient.
51+
To complete the minting step, we need to also transfer `1` lot worth of FXRP to the agent's vault we specified.
52+
We do that by piping the output of the second command - the hash of the transaction that carried our collateral reservation instruction - into the second `bridge` command, with the `mint-tx` positional argument.
53+
54+
```sh
55+
./smart_accounts.py encode fxrp-cr --wallet-id 0 --value 1 --agent-vault-id 1 \
56+
| ./smart_accounts.py bridge instruction - \
57+
| ./smart_accounts.py bridge mint-tx --wait -
58+
```
59+
60+
<details>
61+
<summary>Expected output</summary>
62+
63+
```sh
64+
sent bridge instruction transaction: 08C2DD9EF3C0BB0A29D70F7E495EB3D96E1AA443B9100052FCCB44A176A9FBB8
65+
sent mint tx: CD15241A6F0D2AFE5441C4FE3A2A9360109164CDCDC9EF3BC6A652D3C257DEA2
66+
CD15241A6F0D2AFE5441C4FE3A2A9360109164CDCDC9EF3BC6A652D3C257DEA2
67+
```
68+
69+
</details>
70+
71+
Next, we prepare the transfer instruction.
72+
We will send `10` FXRP (which equals `1` lot) to the address `0xf5488132432118596fa13800b68df4c0ff25131d`.
73+
The encode CLI command that does this is:
74+
75+
```sh
76+
./smart_accounts.py encode fxrp-transfer \
77+
--wallet-id 0 \
78+
--value 10 \
79+
--recipient-address "0xf5488132432118596fa13800b68df4c0ff25131d"
80+
```
81+
82+
<details>
83+
<summary>Expected output</summary>
84+
85+
```sh
86+
0x01000000000000000000000af5488132432118596fa13800b68df4c0ff25131d
87+
```
88+
89+
</details>
90+
91+
Lastly, we send the instruction as an XRPL Payment transaction to the operator's XRPL address.
92+
We do this, again, by piping the output of the above `encode` command into a `bridge` command.
93+
94+
```sh
95+
./smart_accounts.py encode fxrp-transfer \
96+
--wallet-id 0 \
97+
--value 10 \
98+
--recipient-address "0xf5488132432118596fa13800b68df4c0ff25131d" \
99+
| ./smart_accounts.py bridge instruction -
100+
```
101+
102+
<details>
103+
<summary>Expected output</summary>
104+
105+
```sh
106+
sent bridge instruction transaction: 9D5420C689DE7E0189BA15C4F874E491E4A08610A792472DF421B501DD5088AD
107+
9D5420C689DE7E0189BA15C4F874E491E4A08610A792472DF421B501DD5088AD
108+
```
109+
110+
</details>
111+
112+
With that, we have successfully minted `1` lot of FXRP, and transferred it to the Flare address `0xf5488132432118596fa13800b68df4c0ff25131d`.

0 commit comments

Comments
 (0)