alloy-rs/svm-rs

Feature: Support .svmrc (or similar)

OliverNChalk opened this issue · 1 comments

Brief

In NVM (Node Version Manager), it's possible to run nvm use with no version argument and it will check for a local .nvmrc file to determine the version of node to run. This creates a way for a repository to declare the version of node it was built/written on.

For svm-rs, such a feature would allow projects to broadcast their intended solc version and for those that use svm-rs they could simply run svm use to switch between different version depending on the repo they are in.

Details

If desirable, it would be ideal to determine if there is a pre-existing convention for repositories to declare the version of solc that they intend to run on. If no such convention exists, then we could either follow nvm and use .svnrc, or we could attempt to adopt a more generic name such as SOLC_VERSION, SOLIDITY_VERSION, or similar.

Scope

  • Determine if feature desirable
  • Agree on support file name(s) and format(s)
  • Optional: PR implementing feature (assuming deemed desirable)

Hi @OliverNChalk I apologise for being late in responding. You've described your feature request very well.

As of today, svm is used from within Foundry to build/test/deploy smart contracts. The ethers-solc crate already has functionality to do the following:

  1. Auto-detect the solidity version specified in your contracts
  2. Download this version's binary (using svm)
  3. Compile the project

You can also specify environment variables such as SOLC_VERSION (if I'm not wrong about the naming) and a few others to configure environment within Foundry. Most users are already familiar with the above flow. So I feel this feature wouldn't really be used to its fullest capabilities based on how things stand currently.

Closing this for now, we can re-open if we see scope in the near future :)