eth-brownie / brownie

A Python-based development and testing framework for smart contracts targeting the Ethereum Virtual Machine.
https://eth-brownie.readthedocs.io
MIT License
2.64k stars 550 forks source link

Console commands don't use set version of solc / Apple M1 compatibility issues #1635

Open kalebima opened 1 year ago

kalebima commented 1 year ago

Environment information

What was wrong?

I've been trying to get Brownie working on my M1 Mac, and I initially traced it back to the py-solc-x library that Brownie relies on for solc. Following this post I installed solc from Homebrew and created a symlink for py-solc-x to reference:

brew update
brew upgrade
brew tap ethereum/ethereum
brew install solidity
cd ~/.solcx
ln -s $(which solc) ./solc-v0.8.17

This solution works when I define my solc version in brownie-config.yaml, i.e. I can brownie compile the standard token mix without errors. The problem is that the Brownie console isn't picking up on the installed solc version, even after I specify via compiler. set_solc_version ("0.8.17"). Instead it ignores this and tries to install an older version of solc using a binary that isn't compatible with M1 Macs when I call Contract.from_explorer(). See this screenshot showing both cases (console first, and then compiling token mix afterwards):

Screenshot 2022-11-15 at 3 31 44 PM
kalebima commented 1 year ago

@BowTiedDevil have you heard of any of your readers running into this issue? I originally ran into it when I was going through one of your older posts to set up Brownie / test out interacting with the console

kalebima commented 1 year ago

Also @iamdefinitelyahuman I saw you were the owner of py-solc-x too, would you be able to take a look when you have a chance?