Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ npx hardhat run scripts/fassets/getLotSize.ts --network coston2
You should see the following output:

```bash
Compiled 1 Solidity file successfully (evm target: london).
Compiled 1 Solidity file successfully (evm target: shanghai).
Deploying FAssetsSettings...
FAssetsSettings deployed to: 0x40deEaA76224Ca9439D4e1c86F827Be829b89D9E
Lot size: 20000000n
Expand Down
2 changes: 1 addition & 1 deletion docs/fdc/2-getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ The response consists of several key components:

:::warning

Don't forget to set the EVM version to `london` in Remix before compiling the contract.
Don't forget to set the EVM version to `shanghai` in Remix before compiling the contract.

:::

Expand Down
4 changes: 2 additions & 2 deletions docs/ftso/1-getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import CodeBlock from "@theme/CodeBlock";
import YoutubeEmbed from "@site/src/components/youtube";
import FtsoV2FeedConsumer from "!!raw-loader!/examples/developer-hub-solidity/FtsoV2FeedConsumer.sol";
import OpenSolidityCompiler from "/static/img/ftso-getting-started/0-open-solidity-compiler-tab.png";
import SetEvmVersion from "/static/img/ftso-getting-started/1-set-evm-version.png";
import SetEvmVersion from "/static/img/set-evm-version-remix.png";
import SetInjectedProvider from "/static/img/ftso-getting-started/1-set-injected-provider.png";
import CompileContract from "/static/img/ftso-getting-started/2-compile-contract.png";
import OpenDeploy from "/static/img/ftso-getting-started/3-open-deploy.png";
Expand Down Expand Up @@ -132,7 +132,7 @@ If you have not already configured your MetaMask wallet to support Flare Testnet

<img src={OpenSolidityCompiler} style={{ width: 300 }} />

3. Expand the **Advanced Configurations** section and make sure the **EVM Version** is set to `london`.
3. Expand the **Advanced Configurations** section and make sure the **EVM Version** is set to `shanghai`.

<img src={SetEvmVersion} style={{ width: 300 }} />

Expand Down
8 changes: 4 additions & 4 deletions docs/ftso/guides/build-first-app.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,12 @@ This guide is for developers who want to build an FTSOv2 application using eithe
{FtsoV2FeedConsumerFoundry}
</CodeBlock>

2. Set EVM version to `london` in `foundry.toml`:
2. Set EVM version to `shanghai` in `foundry.toml`:

```toml title="foundry.toml"
[profile.default]
...
evm_version = "london"
evm_version = "shanghai"
```

3. To ensure everything is set up correctly, compile the contract by running:
Expand All @@ -180,14 +180,14 @@ This guide is for developers who want to build an FTSOv2 application using eithe
{FtsoV2ConsumerHardhat}
</CodeBlock>

2. Set EVM version to `london` in `hardhat.config.ts`:
2. Set EVM version to `shanghai` in `hardhat.config.ts`:

```typescript
module.exports = {
solidity: {
version: "0.8.27",
settings: {
evmVersion: "london",
evmVersion: "shanghai",
optimizer: {
enabled: true,
runs: 200,
Expand Down
14 changes: 7 additions & 7 deletions docs/ftso/guides/change-quote-feed.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -51,33 +51,33 @@ contract FtsoV2ChangeQuoteFeed {

:::

:::warning[Set EVM Version to London]
:::warning[Set EVM Version to Shanghai]

- **Using Remix:** Set EVM version to `london` in the **Advanced Configurations** section of the **Solidity Compiler** tab:
- **Using Remix:** Set EVM version to `shanghai` in the **Advanced Configurations** section of the **Solidity Compiler** tab:

{" "}

<img src={SetEvmVersionRemix} style={{ width: 300 }} />

- **Using Hardhat or Foundry:** Set EVM version to `london` in [hardhat.config.ts](https://github.com/flare-foundation/flare-hardhat-starter/blob/master/hardhat.config.ts#L34) or [foundry.toml](https://github.com/flare-foundation/flare-foundry-starter/blob/master/foundry.toml).
- **Using Hardhat or Foundry:** Set EVM version to `shanghai` in [hardhat.config.ts](https://github.com/flare-foundation/flare-hardhat-starter/blob/master/hardhat.config.ts#L34) or [foundry.toml](https://github.com/flare-foundation/flare-foundry-starter/blob/master/foundry.toml).

- **Using Standard Solidity JSON:** Set `evmVersion` to `london`:
- **Using Standard Solidity JSON:** Set `evmVersion` to `shanghai`:

```json
{
"settings": {
"optimizer": {
/* ... */
},
"evmVersion": "london"
"evmVersion": "shanghai"
}
}
```

- **Using `solc` CLI:** Set `--evm-version` to `london`:
- **Using `solc` CLI:** Set `--evm-version` to `shanghai`:

```bash
solc --evm-version london <args>
solc --evm-version shanghai <args>
```

:::
2 changes: 1 addition & 1 deletion docs/network/0-overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ Discover suitable options for your needs on the [Flare Wallets](https://flare.ne

- **RPC-API:** [Ethereum RPC API](https://ethereum.org/en/developers/docs/apis/json-rpc/)

- **Supported opcodes:** Supports all EVM [opcodes](https://www.evm.codes/?fork=london) up to and including the London hard fork.
- **Supported opcodes:** Supports all EVM [opcodes](https://www.evm.codes/?fork=shanghai) up to and including the Shanghai hard fork.

## Consensus mechanism

Expand Down
4 changes: 2 additions & 2 deletions docs/network/1-getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import CopyAddress from "/static/img/deploy-first-contract/4-copy-address.png";
import PasteAddress from "/static/img/deploy-first-contract/5-paste-address.png";
import AfterFaucetConfirmation from "/static/img/deploy-first-contract/6-after-faucet-confirmation.png";
import OpenSolidityCompiler from "/static/img/deploy-first-contract/7-open-solidity-compiler.png";
import SetEvmVersion from "/static/img/deploy-first-contract/8-set-evm-version.png";
import SetEvmVersion from "/static/img/set-evm-version-remix.png";
import CompileContract from "/static/img/deploy-first-contract/9-compile-contract.png";
import DeployAndRunTxs from "/static/img/deploy-first-contract/10-deploy-and-run-transactions.png";
import SetInjectedProvider from "/static/img/deploy-first-contract/11-set-injected-provider.png";
Expand Down Expand Up @@ -120,7 +120,7 @@ Let's break down the `HelloWorld` contract:

<img src={OpenSolidityCompiler} style={{ width: 300 }} />

4. Expand the **Advanced Configurations** section and make sure the **EVM Version** is set to `london`.
4. Expand the **Advanced Configurations** section and make sure the **EVM Version** is set to `shanghai`.

<img src={SetEvmVersion} style={{ width: 300 }} />

Expand Down
2 changes: 1 addition & 1 deletion docs/network/guides/flare-for-go-developers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ Note that the contract interface dependencies have been inlined to avoid any imp
To compile the contract, use the Solidity compiler:

```bash
solc --evm-version london --abi --bin FtsoV2FeedConsumer.sol -o build
solc --evm-version shanghai --abi --bin FtsoV2FeedConsumer.sol -o build
```

The compiled contract will be saved in the `build/` folder.
Expand Down
2 changes: 1 addition & 1 deletion docs/network/guides/flare-for-javascript-developers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ Note that the contract interface dependencies have been inlined to avoid any imp
</details>

```bash
solc --evm-version london FtsoV2FeedConsumer.sol --abi --bin -o build
solc --evm-version shanghai FtsoV2FeedConsumer.sol --abi --bin -o build
```

This will generate two files `build/FtsoV2FeedConsumer.abi` and `build/FtsoV2FeedConsumer.bin` files with the contract's ABI and bytecode. Rename `FtsoV2FeedConsumer.abi` to `FtsoV2FeedConsumer.json`.
Expand Down
14 changes: 7 additions & 7 deletions docs/network/guides/secure-random-numbers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -105,31 +105,31 @@ In addition to the `randomNumber` itself, two other variables are retrieved:

- `timestamp`: The UNIX timestamp marking the end of the voting epoch during which data was collected from data providers to generate the specific number. Each voting epoch lasts for a fixed 90-second window.

:::warning[Set EVM Version to London]
:::warning[Set EVM Version to Shanghai]

- **Using Remix:** Set EVM version to `london` in the **Advanced Configurations** section of the **Solidity Compiler** tab:
- **Using Remix:** Set EVM version to `shanghai` in the **Advanced Configurations** section of the **Solidity Compiler** tab:

<img src={SetEvmVersionRemix} style={{ width: 300 }} />

- **Using Hardhat or Foundry:** Set EVM version to `london` in [hardhat.config.ts](https://github.com/flare-foundation/flare-hardhat-starter/blob/master/hardhat.config.ts#L34) or [foundry.toml](https://github.com/flare-foundation/flare-foundry-starter/blob/master/foundry.toml).
- **Using Hardhat or Foundry:** Set EVM version to `shanghai` in [hardhat.config.ts](https://github.com/flare-foundation/flare-hardhat-starter/blob/master/hardhat.config.ts#L34) or [foundry.toml](https://github.com/flare-foundation/flare-foundry-starter/blob/master/foundry.toml).

- **Using Standard Solidity JSON:** Set `evmVersion` to `london`:
- **Using Standard Solidity JSON:** Set `evmVersion` to `shanghai`:

```json
{
"settings": {
"optimizer": {
/* ... */
},
"evmVersion": "london"
"evmVersion": "shanghai"
}
}
```

- **Using `solc` CLI:** Set `--evm-version` to `london`:
- **Using `solc` CLI:** Set `--evm-version` to `shanghai`:

```bash
solc --evm-version london <args>
solc --evm-version shanghai <args>
```

:::
Expand Down
77 changes: 0 additions & 77 deletions docs/support/faqs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,83 +21,6 @@ import SetEvmVersionRemix from "/static/img/set-evm-version-remix.png";

This page answers common questions encountered by developers building applications on Flare networks.

## Technical Troubleshooting

### Why am I getting `invalid opcode: opcode 0x5f not defined` when deploying or interacting with my contract?

**Cause:** This error typically occurs because your contract was compiled with a Solidity version (usually >=0.8.20) that defaults to the `shanghai` EVM version (or later), which introduced the `PUSH0` (0x5f) opcode. Flare and Songbird currently support EVM versions up to `london`, which does not recognize this opcode.

**Solution:** You need to explicitly tell your compiler to target the `london` EVM version.

- **Using Remix:** Set EVM version to `london` in the **Advanced Configurations** section of the **Solidity Compiler** tab:

<img src={SetEvmVersionRemix} style={{ width: 300 }} />

- **Using Hardhat:** Set `evmVersion: "london"` within the `solidity` configuration object in your `hardhat.config.ts` (or `.js`):

```typescript
// hardhat.config.ts
import { HardhatUserConfig } from "hardhat/config";
// ... other imports

const config: HardhatUserConfig = {
solidity: {
version: "0.8.24", // Example version
settings: {
optimizer: {
enabled: true,
runs: 200,
},
evmVersion: "london", // Add this line
},
},
// ... other configurations
};

export default config;
```

_See the [Hardhat Starter Kit config](https://github.com/flare-foundation/flare-hardhat-starter/blob/master/hardhat.config.ts#L34) for a full example._

- **Using Foundry:** Add `evm_version = "london"` under the `[profile.default]` section in your `foundry.toml`:

```toml
# foundry.toml
[profile.default]
src = "src"
out = "out"
libs = ["lib"]
# ... other settings
evm_version = "london" # Add this line
```

_See the [Foundry Starter Kit config](https://github.com/flare-foundation/flare-foundry-starter/blob/master/foundry.toml) for a full example._

- **Using Standard Solidity JSON Input:** Set `evmVersion` to `london` within the `settings` object:

```json
{
"language": "Solidity",
"sources": {
/* ... */
},
"settings": {
"optimizer": {
/* ... */
},
"evmVersion": "london", // Set this
"outputSelection": {
/* ... */
}
}
}
```

- **Using `solc` CLI:** Use the `--evm-version london` flag:
```bash
solc --evm-version london --optimize --abi --bin YourContract.sol -o build/
```

## Network & Tokens

### Where can I get testnet tokens (faucet)?
Expand Down
2 changes: 1 addition & 1 deletion examples/developer-hub-python/compile_contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
}
},
"optimizer": {"enabled": True, "runs": 200},
"evmVersion": "london",
"evmVersion": "shanghai",
},
},
solc_version=solc_version,
Expand Down
Loading