當使用的 Solidity 庫文件中 pragma 指定的 版本 與本地編譯器的使用版本不一致時,會出現這類提示。
解決方式是菜單欄 View -> Extensions -> Extension Settings -> Compile Using Remote Versio 編輯 settings.json
在其中加一行:"solidity.compileUsingRemoteVersion": "v0.5.0+commit.1d4f565a",
針對你合約文件中指定的 Solidity 版本,選擇實際存在的編譯器版本配置上去即可 https://github.com/ethereum/solc-bin/tree/gh-pages/bin
Ref:https://ethereum.stackexchange.com/questions/62914/solidity-version-error