Skip to content

Commit 9c94a59

Browse files
committed
feat(docs): update Minting Tag Manager details and enhance operational parameters
1 parent c3ef6ad commit 9c94a59

5 files changed

Lines changed: 143 additions & 22 deletions

File tree

docs/fassets/03-direct-minting.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ The `MintingTagManager` contract on Flare manages the reservation and ownership
6969
- Tags are assigned sequentially.
7070
The user always receives the next available tag.
7171
- The contract implements the **ERC-721** (NFT) interface, so reserved tags can be transferred or resold.
72-
- Tag owners can set a minting recipient with `setMintingRecipient` and a preferred executor with `setAllowedExecutor`.
72+
- Tag owners can set a preferred executor with `setAllowedExecutor`.
7373
Executor changes are not immediate: the new executor becomes active after a 10-minute cooldown to protect in-flight FDC proofs.
7474
- On initial reservation and tag transfer, the recipient resets to the new owner and the executor resets to the zero address.
7575

docs/fassets/09-operational-parameters.mdx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,13 @@ Specific functions added to each parameter.
6666

6767
<OperationalParameters sectionTitle="Direct Minting" networks={["coston2"]} />
6868

69+
## Minting Tag Manager
70+
71+
<OperationalParameters
72+
sectionTitle="Minting Tag Manager"
73+
networks={["coston2"]}
74+
/>
75+
6976
## Redeem With Tag
7077

7178
<OperationalParameters sectionTitle="Redeem With Tag" networks={["coston2"]} />

docs/fassets/reference/IMintingTagManager.mdx

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,36 @@ function reservedTagsForOwner(address _owner) external view returns (uint256[] m
6363

6464
- An array of minting tag IDs owned by `_owner`.
6565

66+
### `transfer`
67+
68+
Transfer a minting tag to a new owner.
69+
Also updates the minting recipient to the new owner and resets the allowed executor.
70+
71+
```solidity
72+
/**
73+
* Transfer a minting tag to a new owner. Also updates the minting recipient
74+
* to the new owner and resets the allowed executor.
75+
* @param _to The address to transfer the tag to.
76+
* @param _mintingTag The minting tag id to transfer.
77+
*/
78+
function transfer(address _to, uint256 _mintingTag) external;
79+
```
80+
81+
#### Parameters
82+
83+
- `_to`: The address to transfer the tag to.
84+
- `_mintingTag`: The minting tag ID to transfer.
85+
6686
### `mintingRecipient`
6787

6888
Return the minting recipient for a given tag.
6989

7090
```solidity
91+
/**
92+
* Return the minting recipient for a given tag.
93+
* @param _mintingTag The minting tag id.
94+
* @return The address that receives minted f-assets when this tag is used.
95+
*/
7196
function mintingRecipient(uint256 _mintingTag) external view returns (address);
7297
```
7398

src/features/FAssets/OperationalParameters/index.tsx

Lines changed: 52 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React from "react";
22
import Tabs from "@theme/Tabs";
33
import TabItem from "@theme/TabItem";
44
import Link from "@docusaurus/Link";
5+
import CopyButton from "@site/src/components/CopyButton";
56

67
import { operationalParameters } from "./operational-parameters";
78

@@ -32,6 +33,20 @@ export default function OperationalParameters({
3233
type OperationalParameter =
3334
(typeof operationalParameters)[number]["parameters"][number];
3435
type Network = "songbird" | "coston" | "coston2" | "flare";
36+
type ValueType = "text" | "address";
37+
38+
const networkAddressExplorerPrefix: Record<Network, string> = {
39+
flare: "https://flare-explorer.flare.network/address/",
40+
coston2: "https://coston2-explorer.flare.network/address/",
41+
songbird: "https://songbird-explorer.flare.network/address/",
42+
coston: "https://coston-explorer.flare.network/address/",
43+
};
44+
const networkExplorerLabel: Record<Network, string> = {
45+
flare: "Flare Mainnet",
46+
coston2: "Flare Testnet Coston2",
47+
songbird: "Songbird Canary-Network",
48+
coston: "Songbird Testnet Coston",
49+
};
3550

3651
function ParameterTable({
3752
network,
@@ -46,6 +61,8 @@ export default function OperationalParameters({
4661
hideBtc?: boolean;
4762
hideDoge?: boolean;
4863
}) {
64+
const isAddress = (value: string) => /^0x[a-fA-F0-9]{40}$/.test(value);
65+
4966
const getNetworkValue = (
5067
parameter: OperationalParameter,
5168
asset: "xrp" | "btc" | "doge",
@@ -54,6 +71,38 @@ export default function OperationalParameters({
5471
return typeof value === "string" && value.trim().length > 0 ? value : "-";
5572
};
5673

74+
const getValueType = (parameter: OperationalParameter): ValueType =>
75+
"valueType" in parameter && parameter.valueType === "address"
76+
? "address"
77+
: "text";
78+
79+
const renderValueCell = (
80+
parameter: OperationalParameter,
81+
asset: "xrp" | "btc" | "doge",
82+
) => {
83+
const value = getNetworkValue(parameter, asset);
84+
const valueType = getValueType(parameter);
85+
86+
if (valueType === "address" && value !== "-" && isAddress(value)) {
87+
const explorerNetwork = networkExplorerLabel[network];
88+
return (
89+
<>
90+
<Link
91+
href={`${networkAddressExplorerPrefix[network]}${value}`}
92+
target="_blank"
93+
rel="noopener noreferrer"
94+
title={`Open address in ${explorerNetwork} explorer`}
95+
>
96+
<code>{value}</code>
97+
</Link>{" "}
98+
<CopyButton textToCopy={value} />
99+
</>
100+
);
101+
}
102+
103+
return <span dangerouslySetInnerHTML={{ __html: value }} />;
104+
};
105+
57106
return (
58107
<table>
59108
<thead>
@@ -112,27 +161,9 @@ export default function OperationalParameters({
112161
<br />
113162
{parameter.description}
114163
</td>
115-
{!hideXrp && (
116-
<td
117-
dangerouslySetInnerHTML={{
118-
__html: getNetworkValue(parameter, "xrp"),
119-
}}
120-
/>
121-
)}
122-
{!hideBtc && (
123-
<td
124-
dangerouslySetInnerHTML={{
125-
__html: getNetworkValue(parameter, "btc"),
126-
}}
127-
/>
128-
)}
129-
{!hideDoge && (
130-
<td
131-
dangerouslySetInnerHTML={{
132-
__html: getNetworkValue(parameter, "doge"),
133-
}}
134-
/>
135-
)}
164+
{!hideXrp && <td>{renderValueCell(parameter, "xrp")}</td>}
165+
{!hideBtc && <td>{renderValueCell(parameter, "btc")}</td>}
166+
{!hideDoge && <td>{renderValueCell(parameter, "doge")}</td>}
136167
</tr>
137168
))}
138169
</tbody>

src/features/FAssets/OperationalParameters/operational-parameters.ts

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1433,6 +1433,7 @@ export const operationalParameters = [
14331433
interfaceLink:
14341434
"/fassets/reference/IAssetManager#getdirectmintingfeereceiver",
14351435
description: "Address that receives the direct minting fee.",
1436+
valueType: "address",
14361437
values: {
14371438
flare: {
14381439
xrp: "0x0000000000000000000000000000000000000000",
@@ -1468,4 +1469,61 @@ export const operationalParameters = [
14681469
},
14691470
],
14701471
},
1472+
{
1473+
title: "Minting Tag Manager",
1474+
parameters: [
1475+
{
1476+
name: "Name (NFT)",
1477+
description: "NFT collection name used by the minting tag manager.",
1478+
values: {
1479+
coston2: {
1480+
xrp: "Minting Tag Manager (FTestXRP open beta)",
1481+
},
1482+
},
1483+
},
1484+
{
1485+
name: "Symbol (NFT)",
1486+
description: "NFT collection symbol used by the minting tag manager.",
1487+
values: {
1488+
coston2: {
1489+
xrp: "MTMTXRP",
1490+
},
1491+
},
1492+
},
1493+
{
1494+
name: "Reservation Fee",
1495+
functionName: "reservationFee",
1496+
interfaceLink: "/fassets/reference/IMintingTagManager#reservationfee",
1497+
description:
1498+
"Fee charged when reserving a minting tag for the NFT-based manager.",
1499+
values: {
1500+
coston2: {
1501+
xrp: "100 C2FLR",
1502+
},
1503+
},
1504+
},
1505+
{
1506+
name: "Reservation Fee Recipient",
1507+
functionName: "mintingRecipient",
1508+
interfaceLink: "/fassets/reference/IMintingTagManager#mintingRecipient",
1509+
description: "Address that receives reservation fees.",
1510+
valueType: "address",
1511+
values: {
1512+
coston2: {
1513+
xrp: "0x355156629f25102c3cc51b7630eb80E9De5d1211",
1514+
},
1515+
},
1516+
},
1517+
{
1518+
name: "Reserved Tag Count",
1519+
settingName: "reservedTagCount",
1520+
description: "Number of tags reserved for minting operations.",
1521+
values: {
1522+
coston2: {
1523+
xrp: "20",
1524+
},
1525+
},
1526+
},
1527+
],
1528+
},
14711529
];

0 commit comments

Comments
 (0)