• Stars
    star
    747
  • Rank 60,741 (Top 2 %)
  • Language
    Python
  • License
    GNU Affero Genera...
  • Created almost 6 years ago
  • Updated 11 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Manage and switch between Solidity compiler versions

solc-select

A tool to quickly switch between Solidity compiler versions.

The tool is split into two CLI utilities:

  • solc-select: manages installing and setting different solc compiler versions
  • solc: wrapper around solc which picks the right version according to what was set via solc-select

The solc binaries are downloaded from https://binaries.soliditylang.org/ which contains official artifacts for many historial and modern solc versions for Linux and macOS.

The versioned binaries are stored in ~/.solc-select/artifacts/.

Quickstart

pip3 install solc-select

To automatically install and use a version, run solc-select use <version> --always-install.

Running on ARM (Mac M1/M2)

solc requires Rosetta to be installed. See the FAQ on how to install Rosetta.

Usage

The global version of solc can be set with the solc-select use <version> command:

$ solc --version
solc, the solidity compiler commandline interface
Version: 0.5.2+commit.1df8f40c.Linux.g++
$ solc-select use 0.4.24
Switched global version to 0.4.24
$ solc --version
solc, the solidity compiler commandline interface
Version: 0.4.24+commit.e67f0147.Linux.g++

Use SOLC_VERSION environment variable to override the global version:

$ solc --version
solc, the solidity compiler commandline interface
Version: 0.4.24+commit.e67f0147.Linux.g++
$ SOLC_VERSION=0.5.2 solc --version
solc, the solidity compiler commandline interface
Version: 0.5.2+commit.1df8f40c.Linux.g++

You can list all available versions with solc-select install:

$ solc-select install
Available versions to install:
0.3.6
0.4.0
...
0.8.0
0.8.1

And install the one you need with solc-select install <version>:

$ solc-select install 0.8.1
Installing '0.8.1'...
Version '0.8.1' installed.

You can also install the latest version with solc-select install latest and use the latest version with solc-select use latest

Display the currently installed versions:

$ solc-select versions
0.8.0
0.4.2 (current, set by /Users/artur/.solc-select/global-version)

Getting Help

Feel free to stop by our Slack channel for help on using or extending solc-select.

FAQ

OSError: [Errno 86] Bad CPU type in executable

On newer solc-select versions, this might show as solc binaries for macOS are Intel-only. Please install Rosetta on your Mac to continue.

solc requires Rosetta to be installed. To see whether you have Rosetta installed on your Mac, run

pgrep -q oahd && echo Rosetta is installed || echo Rosetta is NOT installed

If it is not installed, it can be installed with the command

/usr/sbin/softwareupdate --install-rosetta --agree-to-license

solc-version not changing after running solc-select use [version] or setting SOLC_VERSION

Uninstall other installations of solc on your machine. solc-select re-installs solc binaries for your operating system and acts as a wrapper for solc. With duplicate solc installations, this may result in your solc version not being up to date.

"Unsupported Platform" on Windows

The solc-select version that supports Windows is currently in beta. Uninstall solc-select through pip3 uninstall solc-select and run

pip install solc-select==1.0.0b1

Alternatively, for the most up-to-date version, clone this repository and run

pip install . --user

Known Issues

SSL: CERTIFICATE_VERIFY_FAILED on running solc-select commands [investigation ongoing]

OS X

pip3 install certifi
/Applications/Python\ 3.8/Install\ Certificates.command

Python distributions on OS X has no certificates and cannot validate SSL connections, a breaking change introduced in Python 3.6. See StackOverflow post for additional details.

Connection refused [investigation ongoing]

pip3 uninstall solc-select 
pip3 install solc-select==0.2.0
solc-select install 

Try downgrading to solc-select version 0.2.0.

Our 0.2.1 version of solc-select pulls older Linux binaries from crytic/solc which seems to have introduced unexpected behavior in certain instances.

solc-select version changes, but solc --version does not match

Users seem to be experiencing situations in which the following command is successful:

solc-select use <version> 

However, when running the following command, it points to an older version of Solidity.

solc --version

solc-select is intended to work with custom binaries. This means that Solidity installed through other means (i.e: brew install solidity) will not work!.

Uninstall other versions Solidity from your computer.

License

solc-select is licensed and distributed under the AGPLv3 license. Contact us if you’re looking for an exception to the terms.

More Repositories

1

slither

Static Analyzer for Solidity and Vyper
Python
5,270
star
2

echidna

Ethereum smart contract fuzzer
Haskell
2,714
star
3

building-secure-contracts

Guidelines and training material to write secure smart contracts
Solidity
2,208
star
4

not-so-smart-contracts

Examples of Solidity security issues
Solidity
2,150
star
5

awesome-ethereum-security

A curated list of awesome Ethereum security references
1,318
star
6

evm-opcodes

Ethereum opcodes and instruction reference
1,300
star
7

ethersplay

EVM dissassembler
Python
836
star
8

blockchain-security-contacts

Directory of security contacts for blockchain companies
400
star
9

pyevmasm

Ethereum Virtual Machine (EVM) disassembler and assembler
Python
353
star
10

rattle

evm binary static analysis
Python
349
star
11

etheno

Simplify Ethereum security analysis and testing
Python
330
star
12

ida-evm

IDA Processor Module for the Ethereum Virtual Machine (EVM)
Python
307
star
13

medusa

Parallelized, coverage-guided, mutational Solidity smart contract fuzzing, powered by go-ethereum
Go
292
star
14

properties

Pre-built security properties for common Ethereum operations
Solidity
281
star
15

crytic-compile

Abstraction layer for smart contract build systems
Python
150
star
16

amarna

Amarna is a static-analyzer and linter for the Cairo programming language.
Python
148
star
17

caracal

Static Analyzer for Starknet smart contracts
Cairo
130
star
18

slither-action

Shell
128
star
19

evm_cfg_builder

EVM CFG recovery
Python
118
star
20

echidna-streaming-series

A 6-part series on how to use Echidna on real-world codebases
Solidity
97
star
21

optik

Optik is a set of symbolic execution tools that assist smart-contract fuzzers
Python
89
star
22

fuzz-utils

A tool to automatically generate Foundry unit test cases from Echidna and Medusa failed properties
Solidity
89
star
23

roundme

Rust
86
star
24

tayt

StarkNet smart contract fuzzer
Python
75
star
25

diffusc

Experimental tool to ease the review of smart contracts upgrades
Solidity
74
star
26

tealer

Static Analyzer for Teal
Python
61
star
27

echidna-action

GitHub Action to run Echidna, the Ethereum smart contract fuzzer
Shell
59
star
28

attacknet

Tool and testing methodology for subjecting blockchain devnets to simulated network and side channel attacks
Go
54
star
29

fluxture

A crawling framework for blockchains and peer-to-peer systems
Python
46
star
30

secureum-medusa

Solidity
43
star
31

echidna-spearbit-demo

Example code for testing using Echidna explained during the Spearbit presentation
Solidity
39
star
32

slither-docs-action

Write documentation for your code in pull requests using Slither and OpenAI.
TypeScript
36
star
33

solana-lints

Lints based on the Sealevel Attacks
Rust
30
star
34

contract-explorer

Visual Studio Code integration for Slither, a Solidity static analysis framework
TypeScript
30
star
35

echidna-parade

Python
28
star
36

trailofbits-security

The Trail of Bits Truffle Security Toolbox
JavaScript
24
star
37

whipstaff

A specification of the CBC Casper consensus protocols written in TLA+ and PlusCal (transpiled to TLA+)
TLA
20
star
38

cloudexec

A general purpose foundation for cloud-based fuzzing and mutation testing jobs
Go
17
star
39

damn-vulnerable-defi-echidna

Solidity
12
star
40

slither-docs-demo

A demo on how to use the slither-docs actions (https://github.com/crytic/slither-docs-action)
Solidity
11
star
41

medusa-geth

A go-ethereum fork enabling additional testing capabilities for medusa
10
star
42

amarna-action

Github action for the Amarna static analyzer
Shell
9
star
43

slightly-smarter-contracts

Python
7
star
44

vscode-starknet-explorer

StarkNet support extension for VSCode. Visualize StarkNet contracts: view storage variables, external and view functions, and events.
TypeScript
6
star
45

solc

4
star
46

fuzz-vs-fv

TypeScript
4
star
47

embark-contract-info

embark-contract-info
JavaScript
3
star
48

addressarrayutils_demo

Demonstration for using echidna to test a Solidity library
Solidity
2
star
49

remix-plugin-8000

JavaScript
2
star
50

ethdam

2
star
51

slither-workshop

Slither workshop (secureum)
Python
1
star
52

slither-lsp

Python
1
star