Skip to content

Commit fcfe889

Browse files
fix(docs): network guides, flare-tx-sdk, FSP claiming rewards
1 parent aa68dda commit fcfe889

12 files changed

Lines changed: 231 additions & 114 deletions

docs/network/flare-tx-sdk/1-getting-started.mdx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ Add the SDK to your project:
6464
The SDK separates network logic from account management.
6565
This ensures the same wallet can be used across multiple networks without code changes.
6666

67-
- **`Network`**: Represents the blockchain network you want to connect to. Available networks include:
67+
- **`Network`**: Represents the blockchain network you want to connect to.
68+
Available networks include:
6869
- `Network.FLARE`
6970
- `Network.COSTON2`
7071
- `Network.SONGBIRD`
@@ -73,7 +74,9 @@ This ensures the same wallet can be used across multiple networks without code c
7374
The `Network` object provides methods to query balances, transfer tokens, claim rewards, and interact with contracts.
7475
It uses Flare's [public RPCs](/network/overview#configuration) by default.
7576

76-
- **`Wallet`**: Represents a user account. The SDK does not store private keys. Instead, it defines a [`Wallet`](https://github.com/flare-foundation/flare-tx-sdk/blob/HEAD/src/wallet/index.ts) interface which can be implemented by:
77+
- **`Wallet`**: Represents a user account.
78+
The SDK does not store private keys.
79+
Instead, it defines a [`Wallet`](https://github.com/flare-foundation/flare-tx-sdk/blob/HEAD/src/wallet/index.ts) interface which can be implemented by:
7780
- MetaMask and other browser wallets - `EIP1193WalletController`
7881
- Ledger - `LedgerWalletController`
7982
- Trezor - `TrezorWalletController`
@@ -191,7 +194,7 @@ async function connectEip1193() {
191194
### Ledger
192195
193196
Use the [`LedgerWalletController`](https://github.com/flare-foundation/flare-tx-sdk/blob/HEAD/src/wallet/ledger/controller.ts).
194-
It supports either Zondax Flare App ([`@zondax/ledger-flare`](https://www.npmjs.com/package/@zondax/ledger-flare)) or Ledger ETH App ([`@ledgerHQ/hw-app-eth`](https://www.npmjs.com/package/@ledgerhq/hw-app-eth)).
197+
It supports either Zondax Flare App ([`@zondax/ledger-flare`](https://www.npmjs.com/package/@zondax/ledger-flare)) or Ledger ETH App ([`@ledgerhq/hw-app-eth`](https://www.npmjs.com/package/@ledgerhq/hw-app-eth)).
195198
196199
:::tip[Security]
197200
@@ -253,7 +256,7 @@ The SDK only communicates with the device for signing.
253256
254257
```javascript
255258
import { LedgerWalletController } from "@flarenetwork/flare-tx-sdk";
256-
import { Eth } from "@ledgerHQ/hw-app-eth"
259+
import { Eth } from "@ledgerhq/hw-app-eth"
257260

258261
async function connectLedgerViaEthApp() {
259262
// add Ledger transports here

docs/network/fsp/5-protocol-parameters.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ The values provided here correspond to Flare Mainnet.
1717
| **Precision (step size)** | ≈0.0122% | [`FastUpdatesIncentiveManager.getPrecision`](/ftso/solidity-reference/IFastUpdateIncentiveManager#getprecision) |
1818
| **Range (precision \* mean updates)** | 0.0183% | [`FastUpdatesIncentiveManager.getRange`](/ftso/solidity-reference/IFastUpdateIncentiveManager#getrange) |
1919
| **Max range** | 0.091% (5x) | [`FastUpdatesIncentiveManager.rangeIncreaseLimit`](/ftso/solidity-reference/IFastUpdateIncentiveManager#rangeincreaselimit) |
20-
| **Incentive duration** | 17 blocks | [`FastUpdatesIncentiveManager.getIncentiveDuration`](/ftso/solidity-reference/IFastUpdateIncentiveManager#getincentiveduration) |
20+
| **Incentive duration** | 17 blocks | governance-configured (see [`IFastUpdateIncentiveManager`](/ftso/solidity-reference/IFastUpdateIncentiveManager)) |
2121
| **Incentive fee (2x)** | ≈36.6 FLR | - |
2222

2323
### Anchor Feeds (Scaling)

docs/network/fsp/guides/claiming-rewards.mdx

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,8 @@ If the JSON cannot be fetched or validated, you cannot build a valid Merkle proo
179179

180180
</TabItem>
181181
<TabItem value="coston2" label="Flare Testnet Coston2">
182-
Fetch `reward-distribution-data-tuples.json` from [timivesel/ftsov2-testnet-rewards](https://gitlab.com/timivesel/ftsov2-testnet-rewards) on GitLab.
182+
Fetch `reward-distribution-data-tuples.json` from the community-maintained mirror [timivesel/ftsov2-testnet-rewards](https://gitlab.com/timivesel/ftsov2-testnet-rewards) on GitLab.
183+
(This mirror is not an official Flare Foundation resource; treat the data with appropriate care and verify each tuple against on-chain values before claiming on production systems.)
183184

184185
```bash
185186
EPOCH_ID=123
@@ -215,7 +216,8 @@ If the JSON cannot be fetched or validated, you cannot build a valid Merkle proo
215216

216217
</TabItem>
217218
<TabItem value="coston" label="Songbird Testnet Coston">
218-
Fetch `reward-distribution-data-tuples.json` from [timivesel/ftsov2-testnet-rewards](https://gitlab.com/timivesel/ftsov2-testnet-rewards) on GitLab.
219+
Fetch `reward-distribution-data-tuples.json` from the community-maintained mirror [timivesel/ftsov2-testnet-rewards](https://gitlab.com/timivesel/ftsov2-testnet-rewards) on GitLab.
220+
(This mirror is not an official Flare Foundation resource; treat the data with appropriate care and verify each tuple against on-chain values before claiming on production systems.)
219221

220222
```bash
221223
EPOCH_ID=123
@@ -392,7 +394,8 @@ console.log("Confirmed:", tx.hash);
392394
## Troubleshooting
393395

394396
<details>
395-
<summary>T0. Authorization failure: executor not allowed or recipient not allowlisted</summary>
397+
T0.
398+
Authorization failure: executor not allowed or recipient not allowlisted
396399

397400
- If the signer sending `RewardManager.claim(...)` is not the beneficiary, ensure it is configured as a **claim executor** via `setClaimExecutors(...)`.
398401
- If the transaction reverts when using a `recipient` address, ensure the recipient is allowlisted via `setAllowedClaimRecipients(...)`.
@@ -403,7 +406,8 @@ console.log("Confirmed:", tx.hash);
403406
</details>
404407

405408
<details>
406-
<summary>T1. No matching tuple found for my address</summary>
409+
T1.
410+
No matching tuple found for my address
407411

408412
- Double-check:
409413
- Beneficiary address selection (DIRECT uses signing policy address; FEE uses identity address).
@@ -412,7 +416,8 @@ console.log("Confirmed:", tx.hash);
412416
</details>
413417

414418
<details>
415-
<summary>T2. Claim transaction reverts</summary>
419+
T2.
420+
Claim transaction reverts
416421

417422
- Ensure the Merkle proof and tuple fields (`rewardEpochId`, `beneficiary`, `amount`, `claimType`) are copied exactly from the JSON.
418423
- Ensure `lastEpochIdToClaim` is `>=` the maximum `rewardEpochId` included in your `claims` array.

docs/network/guides/flare-for-go-developers.mdx

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ import CreateAccount from "!!raw-loader!/examples/developer-hub-go/create_accoun
2020
import DeployContractCoston2 from "!!raw-loader!/examples/developer-hub-go/coston2/deploy_contract.go";
2121
import DeployContractFlare from "!!raw-loader!/examples/developer-hub-go/flare/deploy_contract.go";
2222

23-
This guide is for developers who want to interact with Flare using Go. In this guide, using Go, you will learn how to:
23+
This guide is for developers who want to interact with Flare using Go.
24+
In this guide, using Go, you will learn how to:
2425

2526
- Query a contract on Flare using the Go API for [Geth](https://github.com/ethereum/go-ethereum), a client that implements the full Ethereum JSON-RPC API.
2627
- Compile a Solidity contract using the CLI interface of [solc](https://github.com/argotorg/solidity), the Solidity compiler.
@@ -34,7 +35,9 @@ All examples in this guide are available at [developer-hub/examples](https://git
3435

3536
## Getting started
3637

37-
Install Geth by following the instructions in the [Geth documentation](https://geth.ethereum.org/docs/getting-started/installing-geth). Also install the Solidity compiler by following the instructions in the [Solidity documentation](https://docs.soliditylang.org/en/latest/installing-solidity.html#linux-packages). The main commands are provided here:
38+
Install Geth by following the instructions in the [Geth documentation](https://geth.ethereum.org/docs/getting-started/installing-geth).
39+
Also install the Solidity compiler by following the instructions in the [Solidity documentation](https://docs.soliditylang.org/en/latest/installing-solidity.html#linux-packages).
40+
The main commands are provided here:
3841

3942
<Tabs>
4043
<TabItem value="macos" label="MacOS via Homebrew" default>
@@ -78,7 +81,8 @@ developer-hub-go/
7881

7982
### Usage
8083

81-
You need to connect to testnet or mainnet via an RPC, any RPC listed on the [Network Configuration](/network/overview#configuration) page will work. For this guide, you can use the Public RPC.
84+
You need to connect to testnet or mainnet via an RPC, any RPC listed on the [Network Configuration](/network/overview#configuration) page will work.
85+
For this guide, you can use the Public RPC.
8286

8387
<Tabs groupId="network">
8488
<TabItem value="coston2" label="Flare Testnet Coston2" default>
@@ -108,7 +112,11 @@ For this example, you can use the `FlareContractRegistry` contract which has the
108112

109113
### Fetch ABI
110114

111-
To fetch a contract's ABI, copy the [FlareContractRegistry ABI](https://api.routescan.io/v2/network/testnet/evm/114/etherscan/api?module=contract&action=getabi&address=0xaD67FE66660Fb8dFE9d6b1b4240d8650e30F6019&format=raw), and paste it into a file named `FlareContractRegistry.abi`, located in the root of your project, i.e. same level as `go.mod`.
115+
To fetch a contract's ABI, copy the FlareContractRegistry ABI from the appropriate Routescan endpoint and paste it into `FlareContractRegistry.abi` next to your `go.mod`.
116+
The `FlareContractRegistry` itself is deployed at the same `0xaD67FE66660Fb8dFE9d6b1b4240d8650e30F6019` on every Flare-family network — pick the URL that matches the chain you'll deploy to:
117+
118+
- **Flare Testnet Coston2 (chain id 114):** [routescan URL](https://api.routescan.io/v2/network/testnet/evm/114/etherscan/api?module=contract&action=getabi&address=0xaD67FE66660Fb8dFE9d6b1b4240d8650e30F6019&format=raw)
119+
- **Flare Mainnet (chain id 14):** [routescan URL](https://api.routescan.io/v2/network/mainnet/evm/14/etherscan/api?module=contract&action=getabi&address=0xaD67FE66660Fb8dFE9d6b1b4240d8650e30F6019&format=raw)
112120

113121
To generate the ABI bindings, which will be saved to `FlareContractRegistry.go`:
114122

@@ -154,7 +162,8 @@ For example, querying it for the address of the `WNat` contract:
154162

155163
## Compiling with solc
156164

157-
For this example, you can use the `FtsoV2FeedConsumer` contract to query the FTSOv2 feeds. Copy the `FtsoV2FeedConsumer` sample contract code given below, and save the `.sol` file in the same folder as your `go.mod`.
165+
For this example, you can use the `FtsoV2FeedConsumer` contract to query the FTSOv2 feeds.
166+
Copy the `FtsoV2FeedConsumer` sample contract code given below, and save the `.sol` file in the same folder as your `go.mod`.
158167

159168
<details>
160169
<summary>`FtsoV2FeedConsumer` sample contract</summary>
@@ -177,13 +186,15 @@ The compiled contract will be saved in the `build/` folder.
177186

178187
## Create account
179188

180-
Before deploying a contract, you need an account. You can create an account using the following code:
189+
Before deploying a contract, you need an account.
190+
You can create an account using the following code:
181191

182192
<CodeBlock language="go" title="create_account.go">
183193
{CreateAccount}
184194
</CodeBlock>
185195

186-
This will generate a new account and save the keystore file in the current directory. The account address will be printed to the console.
196+
This will generate a new account and save the keystore file in the current directory.
197+
The account address will be printed to the console.
187198

188199
:::danger
189200

@@ -239,7 +250,8 @@ Copy the contents of the generated keystore file into the `key` constant in the
239250

240251
</Tabs>
241252

242-
Congratulations! You have now successfully deployed a contract on Flare using Go.
253+
Congratulations!
254+
You have now successfully deployed a contract on Flare using Go.
243255

244256
:::tip[What's next?]
245257

docs/network/guides/flare-for-rust-developers.mdx

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ import DeployContractCoston2 from "!!raw-loader!/examples/developer-hub-rust/src
2121
import DeployContractFlare from "!!raw-loader!/examples/developer-hub-rust/src/bin/deploy_contract_flare.rs";
2222
import Config from "@site/examples/developer-hub-rust/config.json";
2323

24-
This guide is for developers who want to interact with Flare using Rust. In this guide, using Rust, you will learn how to:
24+
This guide is for developers who want to interact with Flare using Rust.
25+
In this guide, using Rust, you will learn how to:
2526

2627
- Query a contract on Flare using [alloy-rs](https://github.com/alloy-rs), an async library for interacting with Ethereum-like chains.
2728
- Compile a Solidity contract using the CLI interface of [solc](https://github.com/argotorg/solidity), the Solidity compiler.
@@ -35,7 +36,8 @@ All examples in this guide are available at [developer-hub/examples](https://git
3536

3637
## Getting started
3738

38-
Install the Solidity compiler by following the instructions in the [Solidity documentation](https://docs.soliditylang.org/en/latest/installing-solidity.html#linux-packages). The main commands are provided here:
39+
Install the Solidity compiler by following the instructions in the [Solidity documentation](https://docs.soliditylang.org/en/latest/installing-solidity.html#linux-packages).
40+
The main commands are provided here:
3941

4042
<Tabs>
4143
<TabItem value="macos" label="MacOS via Homebrew" default>
@@ -65,7 +67,8 @@ cargo add alloy eyre tokio --features alloy/full,tokio/rt,tokio/rt-multi-thread,
6567

6668
### Usage
6769

68-
You need to connect to testnet or mainnet via an RPC, any RPC listed on the [Network Configuration](/network/overview#configuration) page will work. For this guide, you can use the Public RPC.
70+
You need to connect to testnet or mainnet via an RPC, any RPC listed on the [Network Configuration](/network/overview#configuration) page will work.
71+
For this guide, you can use the Public RPC.
6972

7073
<Tabs groupId="network">
7174
<TabItem value="coston2" label="Flare Testnet Coston2" default>
@@ -99,7 +102,11 @@ For this example, you can use the `FlareContractRegistry` contract which has the
99102

100103
### Fetch ABI
101104

102-
To fetch a contract's ABI, copy the [FlareContractRegistry ABI](https://api.routescan.io/v2/network/testnet/evm/114/etherscan/api?module=contract&action=getabi&address=0xaD67FE66660Fb8dFE9d6b1b4240d8650e30F6019&format=raw), and paste it into a file named `FlareContractRegistry.json`, located in the root of your project, i.e. same level as `Cargo.toml`.
105+
To fetch a contract's ABI, copy the FlareContractRegistry ABI from the appropriate Routescan endpoint and paste it into `FlareContractRegistry.json` next to your `Cargo.toml`.
106+
Pick the URL that matches the chain you'll deploy to:
107+
108+
- **Flare Testnet Coston2 (chain id 114):** [routescan URL](https://api.routescan.io/v2/network/testnet/evm/114/etherscan/api?module=contract&action=getabi&address=0xaD67FE66660Fb8dFE9d6b1b4240d8650e30F6019&format=raw)
109+
- **Flare Mainnet (chain id 14):** [routescan URL](https://api.routescan.io/v2/network/mainnet/evm/14/etherscan/api?module=contract&action=getabi&address=0xaD67FE66660Fb8dFE9d6b1b4240d8650e30F6019&format=raw)
103110

104111
### Make query
105112

@@ -130,7 +137,8 @@ cargo run --bin make_query
130137

131138
## Compiling a contract
132139

133-
For this example, you can use the `FtsoV2FeedConsumer` contract to query the FTSOv2 feeds. Copy the `FtsoV2FeedConsumer` sample contract code given below, and save the `.sol` file in the same folder as your `Cargo.toml`.
140+
For this example, you can use the `FtsoV2FeedConsumer` contract to query the FTSOv2 feeds.
141+
Copy the `FtsoV2FeedConsumer` sample contract code given below, and save the `.sol` file in the same folder as your `Cargo.toml`.
134142

135143
<details>
136144
<summary>`FtsoV2FeedConsumer` sample contract</summary>
@@ -159,7 +167,8 @@ This will generate a `FtsoV2FeedConsumer.json` file with the contract's ABI and
159167

160168
### Modify format
161169

162-
Things get a bit annoying here, as the alloy-rs `solc!()` macro expects a specific format for the JSON, which is not the same as the output from the Solidity compiler. To fix this, in the generated `FtsoV2FeedConsumer.json`, remove the top-level JSON fields, after you are done, the JSON should look like:
170+
Things get a bit annoying here, as the alloy-rs `solc!()` macro expects a specific format for the JSON, which is not the same as the output from the Solidity compiler.
171+
To fix this, in the generated `FtsoV2FeedConsumer.json`, remove the top-level JSON fields, after you are done, the JSON should look like:
163172

164173
```json title="FtsoV2FeedConsumer.json"
165174
{
@@ -175,7 +184,8 @@ Things get a bit annoying here, as the alloy-rs `solc!()` macro expects a specif
175184

176185
## Create account
177186

178-
Before deploying a contract, you need to have an account with some testnet or mainnet gas tokens. You can create a new Flare account using `create_account.rs`:
187+
Before deploying a contract, you need to have an account with some testnet or mainnet gas tokens.
188+
You can create a new Flare account using `create_account.rs`:
179189

180190
<CodeBlock language="rust" title="src/bin/create_account.rs">
181191
{CreateAccount}
@@ -208,7 +218,8 @@ You can also import the raw hex private key to MetaMask and any other wallet - t
208218

209219
## Deploying with alloy-rs
210220

211-
With the account ready, you can now deploy the contract. In a `deploy_contract.rs` file, you can define the following code to deploy the contract:
221+
With the account ready, you can now deploy the contract.
222+
In a `deploy_contract.rs` file, you can define the following code to deploy the contract:
212223

213224
<Tabs groupId="network">
214225
<TabItem value="coston2" label="Flare Testnet Coston2" default>
@@ -227,13 +238,16 @@ With the account ready, you can now deploy the contract. In a `deploy_contract.r
227238
</TabItem>
228239
</Tabs>
229240

230-
You can now run the `deploy_contract.rs` script to deploy the contract. The contract address will be printed once the deployment is successful. You can check the contract address on a Flare Blockchain explorer, linked on the [Network Configuration](/network/overview#configuration) page.
241+
You can now run the `deploy_contract.rs` script to deploy the contract.
242+
The contract address will be printed once the deployment is successful.
243+
You can check the contract address on a Flare Blockchain explorer, linked on the [Network Configuration](/network/overview#configuration) page.
231244

232245
```bash
233246
cargo run --bin deploy_contract
234247
```
235248

236-
Congratulations! You have now successfully deployed a contract on Flare using 🦀.
249+
Congratulations!
250+
You have now successfully deployed a contract on Flare using 🦀.
237251

238252
:::tip[What's next?]
239253

0 commit comments

Comments
 (0)