flare-fassets
npx skills add https://github.com/fassko/fassets-skill --skill flare-fassets
Agent 安装分布
Skill 文档
Flare FAssets
What FAssets Are
FAssets is a trustless, over-collateralized bridge connecting nonâsmart-contract networks (XRP Ledger, Bitcoin, DOGE) to Flare. It creates wrapped ERC-20 tokens (FAssets) such as FXRP, FBTC, FDOGE that can be used in Flare DeFi or redeemed for the underlying asset.
Powered by:
- FTSO (Flare Time Series Oracle): decentralized price feeds
- FDC (Flare Data Connector): verifies off-chain actions (e.g. payments on other chains)
Collateral: Stablecoin and native FLR; agents and a community collateral pool provide over-collateralization.
Key Participants
| Role | Responsibility |
|---|---|
| Agents | Hold underlying assets, provide collateral, redeem for users. Verified via governance. Use work (hot) and management (cold) addresses. Must meet backing factor. |
| Users | Mint (deposit underlying â get FAssets) or redeem (burn FAssets â get underlying). No restrictions. |
| Collateral providers | Lock FLR in an agent’s pool; earn share of minting fees. |
| Liquidators | Burn FAssets for collateral when agent collateral falls below minimum; earn rewards. |
| Challengers | Submit proof of agent violations; earn from vault on successful challenge. Full liquidation stops agent from new minting. |
FAsset Workflow
Minting
- User selects an agent and reserves collateral (pays fee in FLR).
- User sends underlying asset (e.g. XRP) to the agent on the underlying chain (with payment reference).
- FDC verifies the payment and produces attestation/proof.
- User (or executor) calls executeMinting with proof â FAssets are minted on Flare.
Fees: Collateral Reservation Fee (CRF, native), Minting Fee (underlying), optional Executor Fee (native). If minting fails, CRF is not returned.
Redemption
Users redeem FAssets for the original underlying asset at any time (flow is request â agent pays out on underlying chain).
Core Vault (CV)
Per-asset vault that improves capital efficiency: agents can deposit underlying into the CV to free collateral. Multisig on the underlying network; governance can pause. Not agent-owned.
Contracts and Addresses â Get at Runtime
FlareContractsRegistry (same on all Flare networks): 0xaD67FE66660Fb8dFE9d6b1b4240d8650e30F6019. Use it as the trusted source to resolve other contract addresses (e.g. getContractAddressByName(), getAllContracts()).
Do not hardcode AssetManagerController, AssetManager, or FXRP addresses. They differ per network (Coston2, Songbird, Flare mainnet). Resolve them at runtime via the registry.
To get the FXRP address:
- Get the AssetManager from the FlareContractsRegistry
- Get AssetManagerFXRP from that
- Call
fAsset()on the AssetManager to get the FXRP ERC-20 token address. Same pattern for other FAssets (FBTC, etc.) using their AssetManager getters. AssetManagerController is also available from the registry when needed.
Guide: Get FXRP Address â e.g. const assetManager = await getAssetManagerFXRP(); const fasset = await assetManager.fAsset();
Skill resource script: scripts/get-fxrp-address.ts â gets FXRP address at runtime via FlareContractsRegistry â getContractAddressByName("AssetManagerFXRP") â fAsset(). Uses ethers; set FLARE_RPC_URL or pass your network RPC. Run with npx ts-node scripts/get-fxrp-address.ts (or in a Hardhat project with yarn hardhat run scripts/get-fxrp-address.ts --network coston2).
Developer Integration (High Level)
Minting
- Reserve collateral: Call
reserveCollateral(agentVault, lots, feeBIPS, executor)on AssetManager. Pay CRF viacollateralReservationFee(lots). UseCollateralReservedevent forcollateralReservationId, payment reference, and deadlines. - Underlying payment: User sends underlying asset to agent’s underlying-chain address with the payment reference from the event. Must complete before
lastUnderlyingBlockandlastUnderlyingTimestamp. - Proof: Use FDC to get attestation/proof for the payment (e.g. Payment attestation type).
- Execute minting: Call
executeMinting(proof, collateralReservationId)on AssetManager.
Agent selection: Use getAvailableAgentsDetailedList (or equivalent), filter by free collateral lots and status, then by fee (e.g. feeBIPS). Prefer agents with status NORMAL.
Redeeming
Request redemption (burn FAssets on Flare); the chosen agent pays out the underlying asset on the underlying chain. See FAssets Redemption and Redeem FAssets for the full flow (redemption request, queue, agent payout, optional swap-and-redeem / auto-redeem).
Prerequisites (from Flare docs): Flare Hardhat Starter Kit, @flarenetwork/flare-periphery-contracts, and for XRP payments the xrpl package.
Terminology
- Underlying network / underlying asset: Source chain and its native asset (e.g. XRPL, XRP).
- Lot: Smallest minting unit; size from AssetManager/FTSO (see “Read FAssets Settings” in reference).
- Backing factor: Minimum collateral ratio agents must maintain.
- CRF: Collateral Reservation Fee. UBA: Smallest unit of the underlying asset (e.g. drops for XRP).
Flare Smart Accounts
Flare Smart Accounts let XRPL users interact with FAssets on Flare without owning any FLR. Each XRPL address is assigned a unique smart account on Flare that only it can control.
How it works:
- User sends a Payment transaction on the XRPL to a designated address, encoding instructions in the memo field as a payment reference.
- An operator monitors incoming XRPL transactions and requests a Payment attestation from the FDC.
- The operator calls
executeTransactionon theMasterAccountControllercontract on Flare, passing the proof and the user’s XRPL address. - The contract verifies the proof, retrieves (or creates) the user’s smart account, decodes the payment reference, and executes the requested action.
Supported instruction types (first nibble of payment reference):
| Type ID | Target |
|---|---|
0 |
FXRP token interactions |
1 |
Firelight vault (stXRP) |
2 |
Upshift vault |
This means XRPL users can mint/redeem FXRP, stake into Firelight, or interact with Upshift â all from a single XRPL Payment transaction.
Guide: Flare Smart Accounts
Minting dApps and Wallets
- Minting dApps: Oracle Daemon, AU
- Wallets: Bifrost, Ledger, Luminite, OxenFlow (Flare + XRPL); MetaMask, Rabby, WalletConnect (Flare EVM); Xaman (XRPL). Dual-network wallets give the smoothest mint flow.
When to Use This Skill
- Implementing or debugging FAssets minting/redemption (scripts, bots, dApps).
- Resolving agent selection, collateral, fees, or payment-reference flows.
- Integrating with AssetManager, AssetManagerController, or FAsset token contracts.
- Explaining FAssets, FXRP, FBTC, agents, or Core Vault to users or in docs.
- Following Flare Developer Hub FAssets guides and reference.
Additional Resources
- Official docs and API/reference: reference.md
- For detailed contract interfaces, mint/redeem scripts, and operational parameters, use the Flare Developer Hub links in reference.md.