Skip to content

Commit

Permalink
FLR-737 push0 warning
Browse files Browse the repository at this point in the history
  • Loading branch information
segfaultxavi committed Mar 22, 2024
1 parent 81913b6 commit 7619b3d
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 16 deletions.
Binary file modified docs/assets/images/dev/setup/remix2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 11 additions & 1 deletion docs/dev/getting-started/setup/foundry.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Foundry can quick-start your development by providing a sample project:

```bash
forge init hello_foundry
cd hello_foundry
```

This creates a new directory `hello_foundry` from the default template which should look something like this:
Expand All @@ -27,12 +28,21 @@ This creates a new directory `hello_foundry` from the default template which sho
<figcaption>Foundry project structure.</figcaption>
</figure>

Add the highlighted line to the `foundry.toml` file, to make sure the correct EVM version is used:

```toml hl_lines="5"
[profile.default]
src = "src"
out = "out"
libs = ["lib"]
evm_version = "london"
```

### 3. Build the Contract

To build the `Counter.sol` contract in the sample project run:

```bash
cd hello_foundry
forge build
```

Expand Down
22 changes: 20 additions & 2 deletions docs/dev/getting-started/setup/hardhat.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,16 @@ require('dotenv').config();
require("@nomicfoundation/hardhat-toolbox");

module.exports = {
solidity: "0.8.24",
solidity: {
compilers: [
{
version: "0.8.17",
settings: {
evmVersion: "london"
},
}
],
},
networks: {
hardhat: {
},
Expand Down Expand Up @@ -248,7 +257,16 @@ require("@nomicfoundation/hardhat-toolbox");
require("@nomicfoundation/hardhat-verify");

module.exports = {
solidity: "0.8.17",
solidity: {
compilers: [
{
version: "0.8.17",
settings: {
evmVersion: "london"
},
}
],
},
networks: {
hardhat: {
},
Expand Down
1 change: 1 addition & 0 deletions docs/dev/getting-started/setup/remix.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ contract HelloWorld {
### 3. Compile Your Contract

* Go to the Solidity Compiler tab (on the left), and select compiler version `0.8.17`.
* Click on **Advanced Configurations**, and select `london` from the **EVM VERSION** drop down.
* Now, click the **Compile HelloWorld.sol** button.

After successful compilation, it will show a **Green tick mark** on the **Compiler** tab button.
Expand Down
49 changes: 36 additions & 13 deletions include/runner.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,21 +92,36 @@ Get test currency from <a href="https://faucet.flare.network/">the faucet</a> an
??? info "Building with Hardhat"

1. Create a new folder and move into it.
2. Create a new Hardhat project (More information in [the Hardhat setup guide](/dev/getting-started/setup/hardhat/)):
2. Initialize a new npm project and install dependencies:
```bash
npm init
npm install hardhat @nomicfoundation/hardhat-toolbox
npm install hardhat @nomicfoundation/hardhat-toolbox @flarenetwork/flare-periphery-contracts
```
3. Create a new Hardhat project (More information in [the Hardhat setup guide](/dev/getting-started/setup/hardhat/)):
```bash
npx hardhat init
```
3. You will not be using the sample project, therefore:
4. You will not be using the sample project, therefore:
* Remove `contracts/Lock.sol`
* Remove `test/Lock.js`
4. Add Flare's Periphery Package as a dependency with:
```bash
npm install @flarenetwork/flare-periphery-contracts
5. Edit `hardhat.config.js` to specify the correct EVM version. Make sure you include the highlighted lines:
```js title="hardhat.config.js" hl_lines="5-12"
require("@nomicfoundation/hardhat-toolbox");

/** @type import('hardhat/config').HardhatUserConfig */
module.exports = {
solidity: {
compilers: [{
version: "0.8.17",
settings: {
evmVersion: "london"
},
}],
}
};
```
5. Copy the Solidity code above into a new file called `{{filename}}.sol` in the `contracts` folder.
6. Compile with:
6. Copy the Solidity code above into a new file called `{{filename}}.sol` in the `contracts` folder.
7. Compile with:
```bash
npx hardhat compile
```
Expand All @@ -117,13 +132,20 @@ Get test currency from <a href="https://faucet.flare.network/">the faucet</a> an
These instructions quickly show you how to use the former.

1. Build the Hardhat project following the previous instructions.
2. Modify your `hardhat.config.js` to look like this:
```js title="hardhat.config.js"
2. Include network information in the `hardhat.config.js` file. Make sure you include the highlighted lines:
```js title="hardhat.config.js" hl_lines="13-19"
require("@nomicfoundation/hardhat-toolbox");

/** @type import('hardhat/config').HardhatUserConfig */
module.exports = {
solidity: "0.8.19",
solidity: {
compilers: [{
version: "0.8.17",
settings: {
evmVersion: "london"
},
}],
},
networks: {
hardhat: {
forking: {
Expand Down Expand Up @@ -164,8 +186,9 @@ Get test currency from <a href="https://faucet.flare.network/">the faucet</a> an
* Remove `src/Counter.sol`
* Remove `test/Counter.t.sol`
6. Copy the Solidity code above into a new file called `{{filename}}.sol` in the `src` folder.
7. Open the `foundry.toml` file, and add the following line at the end:
7. Open the `foundry.toml` file, and add the following lines at the end:
```toml
evm_version = "london"
remappings = [ "@flarenetwork/flare-periphery-contracts/=lib/flare-foundry-periphery-package/src/"]
```
8. Compile with:
Expand All @@ -189,7 +212,7 @@ Get test currency from <a href="https://faucet.flare.network/">the faucet</a> an
```
=== "Using Remix"

[Open In Remix](https://remix.ethereum.org/#url={{ config.site_url }}samples/{{folder}}{{filename}}.sol&evmVersion=paris){ .md-button }
[Open In Remix](https://remix.ethereum.org/#url={{ config.site_url }}samples/{{folder}}{{filename}}.sol&evmVersion=london){ .md-button }

{% endmacro %}

Expand Down

0 comments on commit 7619b3d

Please sign in to comment.