# 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 %}
