Skip to content

Commit 985c508

Browse files
committed
init resolc docs
1 parent 5ef4357 commit 985c508

File tree

11 files changed

+63
-24
lines changed

11 files changed

+63
-24
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<!-- ALL-CONTRIBUTORS-BADGE:END -->
88

9-
A book on all things Foundry. [Read now](https://book.getfoundry.sh).
9+
A book on all things Foundry. [Read now](https://paritytech.github.io/foundry-book-polkadot).
1010

1111
### Contributing
1212

src/README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Foundry manages your dependencies, compiles your project, runs tests, deploys, a
1010
1111
> 📖 **Contributing**
1212
>
13-
> You can contribute to this book on [GitHub](https://github.com/foundry-rs/book).
13+
> You can contribute to this book on [GitHub](https://github.com/paritytech/foundry-book-polkadot).
1414
1515
### Sections
1616

@@ -49,6 +49,7 @@ Guides on configuring Foundry.
4949
- [Static Analyzers](./config/static-analyzers.md)
5050
- [Integrating with Hardhat](./config/hardhat.md)
5151
- [Vyper support](./config/vyper.md)
52+
- [Resolc support](./config/resolc.md)
5253

5354
**Guides**
5455

src/SUMMARY.md

+1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
- [Static Analyzers](./config/static-analyzers.md)
6464
- [Integrating with Hardhat](./config/hardhat.md)
6565
- [Vyper support](./config/vyper.md)
66+
- [Resolc support](./config/resolc.md)
6667

6768
# Guides
6869

src/announcements.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ If you are running Foundry's **latest nightly build** you may encounter the foll
2020
[FAIL: call didn't revert at a lower depth than cheatcode call depth]
2121
```
2222
23-
Please read [here](https://book.getfoundry.sh/cheatcodes/expect-revert#error) for more information.
23+
Please read [here](https://paritytech.github.io/foundry-book-polkadot/cheatcodes/expect-revert#error) for more information.
2424
2525
## Releases
2626

src/ci-cd/github-actions.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ Then, locate the "Management" section, and click on "Caches". You will see a lis
9292

9393
#### Fuzzing
9494

95-
Note that if you are fuzzing in your fork tests, the RPC cache strategy above will not work unless you set a [fuzz seed](https://book.getfoundry.sh/reference/config/testing#seed). You might also want to reduce your number of RPC calls by using [Multicall](https://github.com/mds1/multicall).
95+
Note that if you are fuzzing in your fork tests, the RPC cache strategy above will not work unless you set a [fuzz seed](https://paritytech.github.io/foundry-book-polkadot/reference/config/testing#seed). You might also want to reduce your number of RPC calls by using [Multicall](https://github.com/mds1/multicall).
9696

9797
### Summaries
9898

src/config/resolc.md

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
## Resolc support
2+
3+
Foundry supports compiling and deploying Solidity contracts to `Asset-Hub Westend` network on Polkadot using the `resolc` compiler.
4+
5+
### 1. Compilation
6+
7+
You can install Resolc by following the instructions [here](https://contracts.polkadot.io/revive_compiler/installation) or [here](https://github.com/paritytech/rvm-rs). If you have `resolc` available in your PATH, foundry will automatically use it.
8+
9+
Otherwise, you can set the path to `resolc` in your `foundry.toml` by adding the following:
10+
```toml
11+
[profile.default.resolc]
12+
resolc_compile = true
13+
resolc = "path/to/resolc"
14+
```
15+
16+
`resolc` config value supports
17+
- valid values follow the SemVer format `x.y.z-dev.n`, `resolc:x.y.z-dev.n`
18+
- path `path/to/resolc`.
19+
20+
### 3. Deploying
21+
22+
You can deploy Vyper contracts via `forge create` command:
23+
```bash
24+
forge create --resolc --legacy --broadcast --rpc-url $RPC_URL --private-key $PRIVATE_KEY <path to the contract> --constructor-args '1'
25+
```
26+
27+
### 4. Solidity scripts
28+
29+
Currently not supported
30+
31+
### 5. Limitations
32+
33+
- [Working forge commands](https://github.com/paritytech/foundry-polkadot/issues/54#issuecomment-2695723499)
34+
- [Working cast commands](https://github.com/paritytech/foundry-polkadot/issues/57#issuecomment-2699458251)
35+
- [Known issues on `resolc` side](https://contracts.polkadot.io/known_issues/)

src/config/static-analyzers.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ To run Slither on a single file, use this command:
2424
slither src/Contract.sol
2525
```
2626

27-
Note, this requires configuring the [solc version in the foundry config file](https://book.getfoundry.sh/reference/config/solidity-compiler#solc_version).
27+
Note, this requires configuring the [solc version in the foundry config file](https://paritytech.github.io/foundry-book-polkadot/reference/config/solidity-compiler#solc_version).
2828

2929
You do not need to provide remappings via the `solc_remaps` option as Slither will automatically detect remappings in a Foundry project. Slither will invoke `forge` to perform the build.
3030

src/forge/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ $ forge build
2828
Compiler run successful!
2929
```
3030

31-
Let's [test](https://book.getfoundry.sh/forge/tests#tests) our contracts:
31+
Let's [test](https://paritytech.github.io/foundry-book-polkadot/forge/tests#tests) our contracts:
3232

3333
```sh
3434
$ forge test

src/getting-started/installation.md

+18-16
Original file line numberDiff line numberDiff line change
@@ -4,40 +4,46 @@ If you encounter any issues during installation, refer to the [FAQ](../faq.md) f
44

55
### Precompiled Binaries
66

7-
Precompiled binaries can be downloaded from the [GitHub releases page](https://github.com/foundry-rs/foundry/releases). For easier management, we recommend using [Foundryup](#using-foundryup).
7+
Precompiled binaries can be downloaded from the [GitHub releases page](https://github.com/paritytech/foundry-polkadot/releases). For easier management, we recommend using [Foundryup](#using-foundryup).
88

99
### Using Foundryup
1010

11-
Foundryup is the official installer for the Foundry toolchain. You can learn more about it [here](https://github.com/foundry-rs/foundry/blob/master/foundryup/README.md).
11+
Foundryup is the official installer for the Foundry toolchain. You can learn more about it [here](https://github.com/paritytech/foundry-polkadot/blob/master/foundryup/README.md).
1212

1313
To install Foundryup, open your terminal and run the following command:
1414

1515
```sh
16-
curl -L https://foundry.paradigm.xyz | bash
16+
curl -L https://raw.githubusercontent.com/paritytech/foundry-polkadot/refs/heads/master/foundryup/install | bash
1717
```
1818

1919
This will install Foundryup. Simply follow the on-screen instructions, and the `foundryup` command will become available in your CLI.
2020

21-
Running `foundryup` will automatically install the latest stable version of the [precompiled binaries](#precompiled-binaries): `forge`, `cast`, `anvil`, and `chisel`. If you wish to use the latest `nightly` build run `foundryup --install nightly`. For additional options, such as installing a specific version or commit, run `foundryup --help`.
21+
Running `foundryup` will automatically install the latest stable version of the [precompiled binaries](#precompiled-binaries): `forge`, `cast`. If you wish to use the latest `nightly` build run `foundryup --install nightly`. For additional options, such as installing a specific version or commit, run `foundryup --help`.
2222

2323
> ℹ️ **Note**
2424
> If you're using Windows, you'll need to install and use [Git BASH](https://gitforwindows.org/) or [WSL](https://learn.microsoft.com/en-us/windows/wsl/install) as your terminal, since Foundryup currently doesn't support Powershell or Command Prompt (Cmd).
2525
26+
#### Installing Paritytech fork of foundry
27+
28+
```
29+
foundryup --nightly
30+
```
31+
2632
#### Verify integrity and provenance of binaries
2733

2834
Foundry binaries are attested by using [GitHub artifact attestations](https://docs.github.com/en/actions/security-for-github-actions/using-artifact-attestations/using-artifact-attestations-to-establish-provenance-for-builds). It is strongly recommended to verify the binaries installed using `foundryup` in order to check that they were built and distributed from Foundry repository.
2935
For example, `forge` binary integrity and provenance can be verified by running:
3036
```shell
31-
$ gh attestation verify --owner foundry-rs $(which forge)
37+
$ gh attestation verify --owner paritytech $(which forge)
3238

3339
✓ Verification succeeded!
3440

3541
The following 1 attestation matched the policy criteria
3642

3743
- Attestation #1
38-
- Build repo:..... foundry-rs/foundry
44+
- Build repo:..... paritytech/foundry-polkadot
3945
- Build workflow:. .github/workflows/release.yml@refs/tags/stable
40-
- Signer repo:.... foundry-rs/foundry
46+
- Signer repo:.... paritytech/foundry-polkadot
4147
- Signer workflow: .github/workflows/release.yml@refs/tags/stable
4248
```
4349

@@ -67,30 +73,26 @@ foundryup --path path/to/foundry
6773
Alternatively, you can install via Cargo with the following command:
6874

6975
```sh
70-
cargo install --git https://github.com/foundry-rs/foundry --profile release --locked forge cast chisel anvil
76+
cargo install --git https://github.com/paritytech/foundry-polkadot --profile release --locked forge cast
7177
```
7278

73-
You can also manually build from a local copy of the [Foundry repository](https://github.com/foundry-rs/foundry):
79+
You can also manually build from a local copy of the [Foundry repository](https://github.com/paritytech/foundry-polkadot):
7480

7581
```sh
7682
# clone the repository
77-
git clone https://github.com/foundry-rs/foundry.git
83+
git clone https://github.com/paritytech/foundry-polkadot.git
7884
cd foundry
7985
# install Forge
8086
cargo install --path ./crates/forge --profile release --force --locked
8187
# install Cast
8288
cargo install --path ./crates/cast --profile release --force --locked
83-
# install Anvil
84-
cargo install --path ./crates/anvil --profile release --force --locked
85-
# install Chisel
86-
cargo install --path ./crates/chisel --profile release --force --locked
8789
```
8890

8991
### CI Installation with GitHub Actions
9092

9193
For instructions on setting up Foundry in a CI pipeline, refer to the [foundry-rs/foundry-toolchain](https://github.com/foundry-rs/foundry-toolchain) GitHub Action.
9294

93-
### Using Foundry with Docker
95+
<!-- ### Using Foundry with Docker
9496
9597
Foundry can also be run inside a Docker container. If you don’t have Docker installed, you can download it from [Docker's website](https://docs.docker.com/get-docker/).
9698
@@ -109,4 +111,4 @@ docker build -t foundry .
109111
For examples and guides on using this image, refer to the [Docker guide](../guides/foundry-in-docker).
110112
111113
> ℹ️ **Note**
112-
> Some systems, including those with M1 chips, may experience issues when building the Docker image locally. This is a known issue.
114+
> Some systems, including those with M1 chips, may experience issues when building the Docker image locally. This is a known issue. -->

src/reference/cast/cast.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -314,4 +314,4 @@ This program is a set of tools to interact with Ethereum and perform conversions
314314

315315
### BUGS
316316

317-
See <https://github.com/foundry-rs/foundry/issues> for issues.
317+
See <https://github.com/paritytech/foundry-polkadot/issues> for issues.

src/reference/forge/forge.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -160,4 +160,4 @@ This program is a set of tools to build, test, fuzz, debug and deploy Solidity s
160160

161161
### BUGS
162162

163-
See <https://github.com/foundry-rs/foundry/issues> for issues.
163+
See <https://github.com/paritytech/foundry-polkadot/issues> for issues.

0 commit comments

Comments
 (0)