Questions tagged [solc]

Questions related to the compiler for Solidity: solc

Filter by
Sorted by
Tagged with
0 votes
0 answers
11 views

SolcInstallationError: Downloaded binary would not execute, or returned unexpected output on Windows 10

I was previously working on windows 8.1 but recently upgraded to windows 10 so I could use the Ganache GUI. The code seemed to work absolutely fine for windows 8.1 but I cannot seem to install solc on ...
user avatar
0 votes
2 answers
16 views

my code doesn't run but shows "Downloaded binary would not execute, or returned unexpected output" in the terminal. Please help check where i am wrong

from solcx import compile_standard, install_solc install_solc("0.6.0") with open("SimpleStorage.sol", "r") as file: simple_storage_file = file.read() # compile Our ...
user avatar
0 votes
1 answer
13 views

Is there a way to getting Remix to run offline?

Could you please help me getting Remix IDE run in an offline environment? I've researched that way from google but found no answers for it.
user avatar
0 votes
1 answer
38 views

Hardhat coverage tests failure - Stack too deep

I got my smart contracts ready over Hardhat and once I'm running hh test all the tests are passing successfully but while running hh coverage I'm getting the below error. Any idea why the regular ...
user avatar
  • 491
0 votes
0 answers
26 views

Brownie unable to compile contracts on Apple M1 Mac

I recently got an M1 mac and I'm trying to compile my brownie project's contracts which compiled fine on my previous machine. I've installed Brownie v1.18.2 and when attempting to run brownie compile ...
user avatar
  • 230
1 vote
0 answers
32 views

How to configure EVM in IntelliJ with Solidity plugin

There is a related question/answer from 5 years ago but back then the plugin only provided syntax highlighting. Now, I know I can compile from the solidity file opened in IntelliJ, clicking on a play/...
user avatar
0 votes
2 answers
187 views

Unable to run mythril on a Hardhat project

I have a hardhat project on my local system. For running Mythril security analysis I am using the following command: myth analyze contracts/MyFile.sol --execution-timeout 900 Receiving the following ...
user avatar
  • 113
0 votes
1 answer
66 views

truffle compile error

Compiling your contracts... =========================== ✓ Fetching solc version list from solc-bin. Attempt #1 TypeError: Cannot read properties of undefined (reading '0.5.16') at VersionRange....
user avatar
  • 11
0 votes
1 answer
33 views

yul get abi file

Normally, when you compile a solidity file for Web3j, you need a bin and abi file. The command for this is solc <contract>.sol --bin --abi --optimize -o <output-dir>/ To compile a yul ...
user avatar
  • 3
0 votes
0 answers
33 views

Why is solcjs unable to compile contract that overrides interface?

I have a hardhat project with the following structure and an npm script specified in my package.json to compile Simple.sol(I can build/compile my contracts fine use npx hardhat compile, but I can't ...
user avatar
  • 230
0 votes
0 answers
30 views

DeclarationError: "Identifier already declared" when compiling SmartContract with solc

I have a Smart Contract "MyCoin". It has another SmartContract "Dex" as dependency. MyCoin: import "./openzeppelin/contracts/token/ERC721/IERC721.sol"; // import "./...
user avatar
  • 29
0 votes
0 answers
127 views

Callback not suppoprted compiling contracts with solc

I'm building a Web-API with express which should compile two Smart Contracts and its imports. I've tried almost anything but I don't get it to work. I have the error "Callback not supported" ...
user avatar
  • 29
0 votes
1 answer
220 views

How to complie smart contract in node.js [solc version: ^0.8.13]

I would like to complie my smart contract code at node.js. Although solc version at package.json and solidity version at smart contract code are same, it doesn't work. complie.js const path= require('...
user avatar
  • 3
0 votes
1 answer
16 views

Does solc generate the same byte code everytime?

I came from this question: How does Etherscan know the uncompiled contents of contracts? I'm wondering if the same solc compiler version would generate the same bytecode for the same contract every ...
user avatar
  • 147
0 votes
1 answer
107 views

failed require() causes RangeError: Maximum call stack size exceeded

This makes little sense to me: a require() statement with no function calls seems to be causing the RangeError: Maximum call stack size exceeded error, but only when the requirements are not met. The ...
user avatar
  • 81
4 votes
0 answers
113 views

hardhat remappings option in configs

I know that solc can take remappings but I'm trying to force hardhat to take in my remappings.txt file each time it is compile. I've looked for a while and can't seem to find anything about that on ...
user avatar
1 vote
1 answer
147 views

Error in solcx python package

While deploying the following code: from solcx import compile_standard, install_solc import json from web3 import Web3 install_solc("0.8.0") with open("./SimpleStorage.sol", &...
user avatar
0 votes
0 answers
19 views

why can't I install solc 0.6.0., I have run the command ***install_solc("0.6.0")*** and **install_solc('0.6.0').** on my terminal, it says this

pc@DAVE-WIN MINGW64 ~/demo/web3_py_simple_storage $ install_solc("0.6.0") bash: syntax error near unexpected token `"0.6.0"' pc@DAVE-WIN MINGW64 ~/demo/web3_py_simple_storage $ ...
user avatar
0 votes
1 answer
122 views

Why does truffle compile report TypeError: Cannot destructure property 'contractName' of 'contract' as it is undefined?

Why does truffle compile report TypeError: Cannot destructure property 'contractName' of 'contract' as it is undefined? $ npx truffle compile --all Compiling your contracts... ========================...
user avatar
0 votes
0 answers
42 views

Solc installed ok but so solcjs command not found?

I'm struggling for days with this. MacOs Monterey v12.2.1 npm install -g solc works fine. then when I try to use any solcjs command, it says : zsh: command not found: solcjs print screen of what i'm ...
user avatar
  • 1
0 votes
0 answers
36 views

Incompatible Solc Version

I am trying to run a pytest file on a smart contract in VSCode using Brownie, but get the following error upon running the test: File "brownie/_cli/main.py", line 64, in main importlib....
user avatar
  • 33
1 vote
0 answers
17 views

does solidity compiler convert to immutable implicitly?

I was wondering if the solidity compiler automatically sets a state variable to immutable if it is never modified? example contract MyContract { uint256 myNumber; constructor(uint256 _myNumber){ ...
user avatar
1 vote
1 answer
213 views

hardhat compile, solc, bytecode and missing library references

I am looking Sushiswap Hardhat compilation output. Specifically, UniswapV2Router02 output. UniswapV2Router02 router refers to UniswapV2Library. However, there are no link references for this library ...
user avatar
0 votes
0 answers
57 views

I am trying to print out the variable (compiled_sol), so I can deploy my smart contract, but I keep running at this error

INFO: Could not find files for the given pattern(s). Traceback (most recent call last): File "C:\Users\jethr\demos\web3_py_simple_storage\deploy.py", line 8, in <module> ...
user avatar
0 votes
1 answer
12 views

Where can I find the security enhancement of solc compiler?

I came from this link, and quote It is highly encouraged to use Solidity v0.7.0 or newer. If you want to use a version of the 0.6 series, please make sure to not make use of flaws that have been ...
user avatar
  • 147
0 votes
0 answers
147 views

Solidity compile error 6275 with openzeppelin

I'm using solc 8.0.0 with node.js 16.13.1 my project dependencies are the following: "dependencies": { "@openzeppelin/contracts": "^4.4.2", "@truffle/...
user avatar
0 votes
1 answer
465 views

ParserError: Source file requires different compiler version

I am a beginner working on brownie using vscode related to a lottery smart contract. Please don't mind if I am doing any rookie mistakes I am still trying my best to understand it as much as I can :) ...
user avatar
0 votes
1 answer
132 views

How do I fix the 'Only "Solidity" or "Yul" is supported as a language' error from py-solc-x

this is the error I get after running this code from solcx import compile_standard, install_solc install_solc("0.6.0") #from my crowdFund.sol file i call the whole file with open("./...
user avatar
0 votes
1 answer
47 views

Solc throwing assertions in compile despite working perfectly in Remix

I have an ERC721 project using pragma solidity ^0.8.2. It drags in several open zeppelin imports that specify 0.8.0. It compiles in Remix with no errors or warnings and I am able to call the ...
user avatar
  • 101
1 vote
2 answers
766 views

Programmatically get smart contract ABI and Bytecode

I have ERC20 contracts with imports and solc is not able to compile contracts with imports. I have tried truffle compile and it works fine and generates ABI. I want to fetch smart contract file ABI by ...
user avatar
1 vote
0 answers
27 views

What pragma version to use? [duplicate]

When I start with a project and have to decide which pragma I want to use, what are the main things I have to consider? For simplicity, lets first assume I start a project from scratch, without ...
user avatar
1 vote
0 answers
32 views

Brownie Compile - Show compiler warnings

Am using Brownie v1.16.3, and when running brownie compile I do not see any compiler warnings. Is there a way to show compiler warnings when using brownie?
user avatar
  • 33
0 votes
0 answers
69 views

Unable to installed global npm package solc

So, recently I got into security and started using Slither. I can run it on an entire project but not on a single file. According to my diagnose, the solc version is not compatible with my contract's ...
user avatar
2 votes
1 answer
711 views

Missing artifacts for openzeppelin contracts with hardhat

I'm using hardhat to write a dapp. As I'm compiling my dapp I'm getting an error: Error HH700: Artifact for contract "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:...
user avatar
  • 491
0 votes
1 answer
339 views

Compatibility problem: Truffle version is 0.5.16 but Solidity file requires 0.8.3

My smart contract (SC) file has the following line: pragma solidity ^0.8.3; When I am compiling it with truffle, I am getting following error: Error: Truffle is currently using solc 0.5.16, but one ...
user avatar
  • 1,215
1 vote
1 answer
73 views

Cannot compile code with inline assembly using solc linux binaries

The code with inline assembly fails to compile with the solc binaries from soliditylang.org. The same code compiles without issue using Remix or solcjs. Because of this issue I cannot even compile the ...
user avatar
0 votes
0 answers
52 views

how can I get the solidity ast file detailed structure?

I have get the combined.json file after using solc --combined-json ast file_path,but I can't get the detaild explanation of the file so that I can't get an idea of the ast file structure even if I ...
user avatar
0 votes
0 answers
81 views

How to change solc compiler version?

I would like to change solc compiler version from latest (currently 0.8.6) to 0.5.5, i tried with "solc-select" but it doesnt actually change it. Note: i need to change it globally, not in a ...
user avatar
  • 11
0 votes
1 answer
116 views

How to run SMTchecker without the pragma

According to documentation pragma experimental SMTchecker won't work for latest versions. It says to use --model-checker-targets "underflow,overflow". But I don't know how. I am new in this ...
user avatar
1 vote
1 answer
193 views

How do I get a list of function/variable hashes from a already deployed smart contract

I am aware that solidity variables and functions are the first 4 bytes of the some hashed string. I want to be able to retrieve a list of these 4 byte functions/variables from a already deployed ...
user avatar
0 votes
0 answers
306 views

Ethereum dev environment for mac M1

I recently got a mac M1 and I am trying to set up my environment for development. I manage to install ganache-cli, truffle and docker. I am trying to set up the solidity compiler configuration, how ...
user avatar
  • 331
1 vote
2 answers
587 views

Can`t fix: AssertionError [ERR_ASSERTION]: Invalid callback object specified

I´m doing my first smart contract, these errors are probably no npm but versioning problems. Though intensive research I could not find a proper way to fix it. Thank you for your help! const assert = ...
user avatar
  • 11
0 votes
3 answers
478 views

Can't compile Truffle project that imports a .sol with different pragma version

I have a contract pragma solidity 0.6.12 version that imports several 0.6.12 version contracts and one pragma solidity 0.8.0. My truffle-config: compilers: { solc: { version: "^0.6.12 &...
user avatar
0 votes
2 answers
355 views

Issue with py-solc-x library

I don't really know what's wrong with my code or what's wrong about the way I installed and imported this library, but I just keep receiving this error and I don't really know how to handle it. I ...
user avatar
20 votes
6 answers
11k views

having a problem with solc-x version "solc 0.6.0 has not been installed"

I m trying to print out the variable (compiled_sol) as you will see in the code below of the python file named deploy.py so I can deploy my smart contract, but I keep running at this error *****INFO: ...
user avatar
0 votes
0 answers
249 views

JSON interface problem

I'm wondering why I still get "Error: You must provide the json interface of the contract when instantiating a contract object." I've tried plenty of solution from this community but they ...
user avatar
0 votes
2 answers
348 views

How to generate Natspec docs using version 0.6.x of the Solidity compiler

I'm trying to run solc --userdoc --devdoc myContract.sol to generate natspec. However, the compiler complains that the contract has a different pragma-version. In fact the contract pragma is at ^0.6....
user avatar
  • 167
2 votes
1 answer
77 views

searching for an elegant solc compiler solution

I firstly had a problem with import statement inside my contracts, I figured out that the solc compiler didn't handle import statement, and that we needed to make out own. With the help of some nice ...
user avatar
  • 103
1 vote
2 answers
2k views

Solc Compiler : File import callback not supported

As a context I am trying to fork uniswap v2 contracts using my own compiler and deploy files. I am not using truffle, as I want to deeply understand before using a framework. When I run my compiler, I ...
user avatar
  • 103
1 vote
1 answer
530 views

SolcInstallationError: Downloaded binary would not execute, or returned unexpected output

I am attempting to do the 'brownie compile' but each time it processes I am provided with 'SolcInstallation Error' - Downloaded Library would not execute or returned unexpected output. I have gone ...
user avatar
  • 11

1
2 3 4 5
7