> For the complete documentation index, see [llms.txt](https://ret2basic.gitbook.io/ctfnote/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ret2basic.gitbook.io/ctfnote/web3-security-research/foundry/set-soliditiy-compiler-version.md).

# Set Soliditiy Compiler Version

{% embed url="<https://youtu.be/bmOxtjzFcbk>" %}
How to Set Solidity Compiler Version
{% endembed %}

Add the Solidity version you want in `foundry.toml`:

```
solc_version = "0.8.17"
```

If any contract does not follow `pragma solidity 0.8.17` then the solc compiler is going to throw error.

In `foundry.toml` you can also toggle optimizer on and off:

```
optimizer = true
optimizer_runs = 200
```

There are a lot more configurations:

{% embed url="<https://github.com/foundry-rs/foundry/tree/master/config>" %}
Foundry configurations
{% endembed %}
