Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for ABIs, general Guides improvements #63

Merged
merged 4 commits into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/fdc/guides/part2-attestation-types.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1005,7 +1005,7 @@ The full rules for verification are quite complex (and chain-dependent) and are

### Example

To produce a correct and thorough example that allows you to test everything properly, you need to be careful. Since you are proving a negative, any mistake during request preparation can result in a transaction that was not made (a simple misencoding of a memo field would almost certainly produce a non-existing transaction) and give a false sense of security.
To produce a correct and thorough example that allows you to test everything properly, you need to be careful. Since you are proving a negative, any mistake during request preparation can result in a transaction that was not made (a simple mis-encoding of a memo field would almost certainly produce a non-existing transaction) and give a false sense of security.

To ensure accuracy, structure your request as follows:

Expand Down
6 changes: 3 additions & 3 deletions docs/ftso/4-solidity-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ import DocCardList from "@theme/DocCardList";

| Contract | Address | ABI |
|----------|---------|---------|
| FastUpdater | [`0x9B931f5d3e24fc8C9064DB35bDc8FB4bE0E862f9`](https://coston.testnet.flarescan.com/address/0x9B931f5d3e24fc8C9064DB35bDc8FB4bE0E862f9) | [ABI](https://api.routescan.io/v2/network/mainnet/evm/19/etherscan/api?module=contract&action=getabi&address=0x9B931f5d3e24fc8C9064DB35bDc8FB4bE0E862f9&format=raw) |
| FastUpdatesConfiguration | [`0x9A53e14B58383642cdB2bb4D5C46989F05C6B5f9`](https://coston.testnet.flarescan.com/address/0x9A53e14B58383642cdB2bb4D5C46989F05C6B5f9) | [ABI](https://api.routescan.io/v2/network/mainnet/evm/19/etherscan/api?module=contract&action=getabi&address=0x9A53e14B58383642cdB2bb4D5C46989F05C6B5f9&format=raw) |
| FastUpdateIncentiveManager | [`0x8c45666369B174806E1AB78D989ddd79a3267F3b`](https://coston.testnet.flarescan.com/address/0x8c45666369B174806E1AB78D989ddd79a3267F3b) | [ABI](https://api.routescan.io/v2/network/mainnet/evm/19/etherscan/api?module=contract&action=getabi&address=0x8c45666369B174806E1AB78D989ddd79a3267F3b&format=raw) |
| FastUpdater | [`0x9B931f5d3e24fc8C9064DB35bDc8FB4bE0E862f9`](https://coston.testnet.flarescan.com/address/0x9B931f5d3e24fc8C9064DB35bDc8FB4bE0E862f9) | [ABI](https://api.routescan.io/v2/network/testnet/evm/16/etherscan/api?module=contract&action=getabi&address=0x9B931f5d3e24fc8C9064DB35bDc8FB4bE0E862f9&format=raw) |
| FastUpdatesConfiguration | [`0x9A53e14B58383642cdB2bb4D5C46989F05C6B5f9`](https://coston.testnet.flarescan.com/address/0x9A53e14B58383642cdB2bb4D5C46989F05C6B5f9) | [ABI](https://api.routescan.io/v2/network/testnet/evm/16/etherscan/api?module=contract&action=getabi&address=0x9A53e14B58383642cdB2bb4D5C46989F05C6B5f9&format=raw) |
| FastUpdateIncentiveManager | [`0x8c45666369B174806E1AB78D989ddd79a3267F3b`](https://coston.testnet.flarescan.com/address/0x8c45666369B174806E1AB78D989ddd79a3267F3b) | [ABI](https://api.routescan.io/v2/network/testnet/evm/16/etherscan/api?module=contract&action=getabi&address=0x8c45666369B174806E1AB78D989ddd79a3267F3b&format=raw) |

</TabItem>

Expand Down
24 changes: 23 additions & 1 deletion docs/ftso/guides/read-feeds-onchain.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ If you are familiar with Hardhat or Foundry, use the [Hardhat and Foundry Starte
}
```
</TabItem>
<TabItem value="coston2" label="Flare Testnet Coston2">
<TabItem value="coston2" label="Flare Testnet Coston2" default>
```solidity title="FtsoV2FeedConsumer.sol"
// SPDX-License-Identifier: MIT
pragma solidity <0.9.0;
Expand Down Expand Up @@ -149,3 +149,25 @@ If you are familiar with Hardhat or Foundry, use the [Hardhat and Foundry Starte
```

:::

<details>
<summary>Didn't understand the Solidity contract?</summary>

Let's break the Solidity contract down into its key components:

- **Purpose**: The `FtsoV2FeedConsumer` contract fetches and returns current feed values for specific cryptocurrency pairs.

- **Dependencies**: It imports interfaces for contract registry (`IFlareContractRegistry`) and feed updater (`IFastUpdater`) from the Flare Network.

- **State Variables**:
- `ftsoV2`: Holds the address of the `FastUpdater` contract.
- `feedIndexes`: An array specifying indexes for FLR/USD, BTC/USD, and ETH/USD feeds.

- **Constructor**:
- Initializes `contractRegistry` with a hardcoded address.
- Retrieves and sets the `FastUpdater` contract address in `ftsoV2`.

- **Main Function**: `getFtsoV2CurrentFeedValues`
- Fetches and returns current feed values, their decimals, and the timestamp using the `fetchCurrentFeeds` method of the `FastUpdater` contract.

</details>
10 changes: 5 additions & 5 deletions docs/ftso/scaling/4-solidity-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ import DocCardList from "@theme/DocCardList";

| Contract | Address | ABI |
|----------|---------|---------|
| FtsoFeedIdConverter | [`0x5c871668b17B604c0CAA848D8Efa7D9094748BC8`](https://coston.testnet.flarescan.com/address/0x5c871668b17B604c0CAA848D8Efa7D9094748BC8) | [ABI](https://api.routescan.io/v2/network/mainnet/evm/19/etherscan/api?module=contract&action=getabi&address=0x5c871668b17B604c0CAA848D8Efa7D9094748BC8&format=raw) |
| FtsoFeedPublisher | [`0x595AbCc4f9330b30ca31966dFfF71EBE0Af2b820`](https://coston.testnet.flarescan.com/address/0x595AbCc4f9330b30ca31966dFfF71EBE0Af2b820) | [ABI](https://api.routescan.io/v2/network/mainnet/evm/19/etherscan/api?module=contract&action=getabi&address=0x595AbCc4f9330b30ca31966dFfF71EBE0Af2b820&format=raw) |
| FtsoInflationConfigurations | [`0x4f634084483dE74cd4b69007fdF1DaeCC7354991`](https://coston.testnet.flarescan.com/address/0x4f634084483dE74cd4b69007fdF1DaeCC7354991) | [ABI](https://api.routescan.io/v2/network/mainnet/evm/19/etherscan/api?module=contract&action=getabi&address=0x4f634084483dE74cd4b69007fdF1DaeCC7354991&format=raw) |
| FtsoRewardOffersManager | [`0xC9534cB913150aD3e98D792857689B55e2404212`](https://coston.testnet.flarescan.com/address/0xC9534cB913150aD3e98D792857689B55e2404212) | [ABI](https://api.routescan.io/v2/network/mainnet/evm/19/etherscan/api?module=contract&action=getabi&address=0xC9534cB913150aD3e98D792857689B55e2404212&format=raw) |
| Relay | [`0x32D46A1260BB2D8C9d5Ab1C9bBd7FF7D7CfaabCC`](https://coston.testnet.flarescan.com/address/0x32D46A1260BB2D8C9d5Ab1C9bBd7FF7D7CfaabCC) | [ABI](https://api.routescan.io/v2/network/mainnet/evm/19/etherscan/api?module=contract&action=getabi&address=0x32D46A1260BB2D8C9d5Ab1C9bBd7FF7D7CfaabCC&format=raw) |
| FtsoFeedIdConverter | [`0x5c871668b17B604c0CAA848D8Efa7D9094748BC8`](https://coston.testnet.flarescan.com/address/0x5c871668b17B604c0CAA848D8Efa7D9094748BC8) | [ABI](https://api.routescan.io/v2/network/testnet/evm/16/etherscan/api?module=contract&action=getabi&address=0x5c871668b17B604c0CAA848D8Efa7D9094748BC8&format=raw) |
| FtsoFeedPublisher | [`0x595AbCc4f9330b30ca31966dFfF71EBE0Af2b820`](https://coston.testnet.flarescan.com/address/0x595AbCc4f9330b30ca31966dFfF71EBE0Af2b820) | [ABI](https://api.routescan.io/v2/network/testnet/evm/16/etherscan/api?module=contract&action=getabi&address=0x595AbCc4f9330b30ca31966dFfF71EBE0Af2b820&format=raw) |
| FtsoInflationConfigurations | [`0x4f634084483dE74cd4b69007fdF1DaeCC7354991`](https://coston.testnet.flarescan.com/address/0x4f634084483dE74cd4b69007fdF1DaeCC7354991) | [ABI](https://api.routescan.io/v2/network/testnet/evm/16/etherscan/api?module=contract&action=getabi&address=0x4f634084483dE74cd4b69007fdF1DaeCC7354991&format=raw) |
| FtsoRewardOffersManager | [`0xC9534cB913150aD3e98D792857689B55e2404212`](https://coston.testnet.flarescan.com/address/0xC9534cB913150aD3e98D792857689B55e2404212) | [ABI](https://api.routescan.io/v2/network/testnet/evm/16/etherscan/api?module=contract&action=getabi&address=0xC9534cB913150aD3e98D792857689B55e2404212&format=raw) |
| Relay | [`0x32D46A1260BB2D8C9d5Ab1C9bBd7FF7D7CfaabCC`](https://coston.testnet.flarescan.com/address/0x32D46A1260BB2D8C9d5Ab1C9bBd7FF7D7CfaabCC) | [ABI](https://api.routescan.io/v2/network/testnet/evm/16/etherscan/api?module=contract&action=getabi&address=0x32D46A1260BB2D8C9d5Ab1C9bBd7FF7D7CfaabCC&format=raw) |

</TabItem>

Expand Down
4 changes: 2 additions & 2 deletions docs/network/guides/flare-for-go-developers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ slug: flare-for-go-developers
title: Flare for Go Devs
authors: [dineshpinto]
tags: [go, quickstart, solidity]
description: Interact with Flare using geth.
description: Learn how to interact with Flare using geth.
keywords: [go, quickstart, solidity, smart-contract, flare-network]
sidebar_position: 5
---
Expand Down Expand Up @@ -43,7 +43,7 @@ Install Geth by following the instructions in the [Geth documentation](https://g
</TabItem>
</Tabs>

Add the `ethclient` package to your Go project:
Add the `ethclient` and `keystore` packages to your Go project:

```bash
go get github.com/ethereum/go-ethereum/ethclient
Expand Down
8 changes: 4 additions & 4 deletions docs/network/guides/flare-for-javascript-developers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
slug: flare-for-javascript-developers
title: Flare for JavaScript Devs
authors: [dineshpinto]
description: Interact with Flare using web3.js and ethers.js.
description: Learn how to interact with Flare using web3.js.
tags: [javascript, quickstart, solidity]
keywords:
[
Expand Down Expand Up @@ -189,7 +189,7 @@ For example, querying it for the address of the `WNat` contract:

## Compiling a contract

For this example, you can write a simple Solidity contract to query the FTSOv2 feeds. You can reuse `FtsoV2FeedConsumer.sol` from the [FTSOv2 Sample Contract](/ftso/getting-started#sample-contract). Copy the code, and save the `.sol` file in the same folder as your Python script.
For this example, you can write a simple Solidity contract to query the FTSOv2 feeds. You can reuse `FtsoV2FeedConsumer.sol` from the [FTSOv2 Sample Contract](/ftso/getting-started#sample-contract). Copy the code, and save the `.sol` file in the root of your project, i.e. same level as `package.json`.

:::info
Double check the addresses in `FtsoV2FeedConsumer.sol` to make sure it is the same as on the network you want to deploy your contract.
Expand Down Expand Up @@ -240,7 +240,7 @@ This will output a new private key and an account pair.
You can save the account and private key into environment variables `ACCOUNT` and `ACCOUNT_PRIVATE_KEY` respectively.

:::note
You can also import the raw hex private key to MetaMask and any other wallet - the private key can be shared between your Python code and any number of wallets.
You can also import the raw hex private key to MetaMask and any other wallet - the private key can be shared between your JavaScript code and any number of wallets.
:::

### Fund account
Expand Down Expand Up @@ -328,7 +328,7 @@ With the account ready, you can now deploy the contract. In a `deployContract.js

You can now run the `deployContract.js` 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.

Congratulations! You have now successfully deployed a contract on Flare using Python.
Congratulations! You have now successfully deployed a contract on Flare using JavaScript.

:::tip[What's next?]
Check out the [Solidity Reference](/ftso/solidity-reference/IFastUpdater) for the Flare Time-Series Oracle (FTSOv2), to see what all on-chain functions you can interact with using JavaScript.
Expand Down
2 changes: 1 addition & 1 deletion docs/network/guides/flare-for-python-developers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
slug: flare-for-python-developers
title: Flare for Python Devs
authors: [dineshpinto]
description: Interact with Flare using web3.py.
description: Learn how to interact with Flare using web3.py.
tags: [python, quickstart, solidity]
keywords: [python, web3.py, quickstart, solidity, smart-contract, flare-network]
sidebar_position: 3
Expand Down
4 changes: 2 additions & 2 deletions docs/network/guides/flare-for-rust-developers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
slug: flare-for-rust-developers
title: Flare for Rust Devs
authors: [dineshpinto]
description: Interact with Flare using alloy-rs.
description: Learn how to interact with Flare using alloy-rs.
tags: [rust, quickstart, solidity]
keywords: [rust, alloy-rs, quickstart, solidity, smart-contract, flare-network]
sidebar_position: 4
Expand Down Expand Up @@ -182,7 +182,7 @@ Double check the addresses in `FtsoV2FeedConsumer.sol` to make sure it is the sa

You can always query the `FlareContractRegistry` with key `FastUpdater` to get the address on that network:

```python
```rust
registry.get_contract_address_by_name("FastUpdater".to_string()).call().await
```

Expand Down
8 changes: 4 additions & 4 deletions docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const config: Config = {
themeConfig: {
announcementBar: {
content:
'Flare Developer Hub v0.7. Track the latest updates on <a target="_blank" rel="noopener noreferrer" href="https://github.com/flare-foundation/developer-hub">GitHub</a>.',
'Flare Developer Hub v0.8. Track the latest updates on <a target="_blank" rel="noopener noreferrer" href="https://github.com/flare-foundation/developer-hub">GitHub</a>.',
backgroundColor: "#fafbfc",
textColor: "#091E42",
isCloseable: true,
Expand Down Expand Up @@ -119,15 +119,15 @@ const config: Config = {
items: [
{
label: "FAQs",
to: "support/faqs",
to: "/support/faqs",
},
{
label: "Terminology",
to: "support/terminology",
to: "/support/terminology",
},
{
label: "Audits",
to: "support/audits",
to: "/support/audits",
},
],
},
Expand Down
Loading