Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [solc]

Questions related to the compiler for Solidity: solc

Filter by
Sorted by
Tagged with
2 votes
1 answer
423 views

How can I use solc solidity compiler on truffle webpack?

When I try to import solc, it raises an error which says: ERROR in ./~/require-from-string/index.js Module not found: Error: Can't resolve 'module' in 'C:\users\bisrat\Desktop\webpacksample\...
8 votes
1 answer
985 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 ...
4 votes
1 answer
2k views

Truffle Bytecode Different from Etherscan Bytecode

I am having difficulty verifying my contract code on Etherscan using the code generated by Truffle. Using Etherscan VerifyContract V1: https://rinkeby.etherscan.io/verifyContract Truffle produced ...
0 votes
1 answer
432 views

Solidity: Error encoding arguments: Error: invalid BigNumber string

I am using this code: // SPDX-License-Identifier: MIT pragma solidity >=0.7.0 <0.9.0; contract Wallet { address owner; struct Data { string userEmail; uint256 ...
1 vote
2 answers
1k 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.
0 votes
2 answers
824 views

.json files for contracts are not created

I am really new in ethereum and solidity and I am having hard time to figure out how to get the .json equivalent for contracts. I have the Campaign.sol inside the contractsFolder. The Campaign.sol ...
0 votes
2 answers
576 views

Error: missing revert data when deploying Solidity contract with ethers.js and Ganache

I'm having an issue deploying a Solidity smart contract using ethers.js and Ganache. I have a simple contract called SimpleStorage.sol: // SPDX-License-Identifier: MIT pragma solidity 0.8.21; ...
2 votes
2 answers
2k views

Importing files from an "outside" folder

I am trying to import files from a relative path outside of my Truffle-project folder: import '../../../common/solidity/contracts/token/ERC20/BurnableToken.sol'; import '../../../common/solidity/...
0 votes
1 answer
23 views

ABI and BIN Files generated by solc and Etherscan verified code are not identical

I have a file that is composed of multiple imports, too much code to drop here so I will illustrate my question with a very simplified example. My compilers: $ abigen --version abigen version 1.11.7-...
0 votes
0 answers
45 views

Solc too slow compiling

The solc compiler that I'm using (0.8.21) is taking too much time to compile. It's compiling 20 files for a foundry test campaign in ~90 seconds when it should be milliseconds. Any ideas on what I ...
1 vote
1 answer
27 views

Abigen from flattened contract files

I have a file that is composed of 5 imports, too much code to drop here so I will illustrate my question with a very simplified example. My Test.sol file: // SPDX-License-Identifier: MIT pragma ...
0 votes
0 answers
60 views

Solidity smart contract not compiling in python

I am trying to use the following to compile and deploy a smart contract. The last line comes with the error mentioned below. from web3 import Web3, HTTPProvider from solcx import compile_files, ...
3 votes
1 answer
474 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/...
0 votes
2 answers
645 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 ...
1 vote
1 answer
14 views

Accidentally removed "/usr/bin/solc" after installation, now no command work

Unfortunatly, meanwhile I was trying to get the latest solidity version, i deleted the /usr/bin/solc folder, and now I can non longer run any script (i.e. solc --version or --help) Can someone help ...
2 votes
1 answer
89 views

Brownie <> SolcInstallationError, I've tried everything I can find -- nothing has worked!

Everytime I try brownie compile I see this: SolcInstallationError: Downloaded binary would not execute, or returned unexpected output. If this issue persists, you can try to compile from source code ...
2 votes
1 answer
2k views

what is 'UnimplementedFeatureError: Not yet implemented - FixedPointType' error?

what is 'UnimplementedFeatureError: Not yet implemented - FixedPointType' error in solidity while compiling through truffle ? How to fix it ? Using solidity compiler version - 0.5.9
0 votes
1 answer
25 views

Getting different binary for the same Solidity source code compiling with solc and Remix

I'm noticing a difference in the binary generated using the same solc compiler in local and with Remix. Here's the source code: pragma solidity 0.8.20; contract HelloWorld {} I compiled it in local ...
0 votes
1 answer
753 views

How to know the default evm version of a specific version of solc

I have multiple versions of solc installed ❯ asdf list solidity 0.4.24 *0.8.23 latest solc includes the default evm version in the help output: ❯ solc --version && solc --help|grep evm ...
0 votes
1 answer
1k 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 :) ...
1 vote
2 answers
1k views

Facing an error while running "truffle compile"

I'm facing an error while running truffle compile- Error: Failed to fetch the Solidity compiler from the following locations: https://relay.trufflesuite.com/solc/bin/,https://solc-bin.ethereum.org/bin/...
0 votes
1 answer
387 views

Solc-js: error "before each" hook for "deploys a contract": ReferenceError: accounts is not defined

I have just started building contracts. Kindly help me in resolving this error. Attached image of error. Lottery/contract/Lottery.sol: pragma solidity ^0.4.17; contract Lottery{ address public ...
0 votes
1 answer
523 views

Solc "bin-runtime" not a command?

I can generate the .bin of a contract with solc as follows: solcjs --bin -o output contract.sol However running the following command: solcjs --bin-runtime -o output contract.sol Generates the ...
1 vote
1 answer
342 views

Cannot deploy contract

I'm having difficulty deploying a solc-compiled contract to ganache test network using web3. package.json { "name": "smartinvoice", "version": "1.0.0", "description": "", "main": "index.js", ...
0 votes
3 answers
762 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 &...
1 vote
1 answer
938 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 ...
2 votes
2 answers
1k views

Solc complier error "TypeError: Cannot read property 'TestToken.sol' of undefined"

I set up a contract with three files referring to Token Factory. I make a test on remix online tool, they can be successfully compiled. when I'm tring to compile them by solc module in a .js file, ...
0 votes
1 answer
339 views

Solidity solc compiler error on code Remix can compile

I am attempting to compile the following solidity code using solc in NodeJS. pragma solidity ^0.4.11; contract helloWorld { string public message; function constructor() public{ message = "...
1 vote
1 answer
364 views

How do I get solcjs to compile yul

I want to write a smart contract using pure Yul but I have no idea how I'm meant to configure / run solcjs to compile my yul code down to bytecode. Any pointers would be much appreciated.
2 votes
1 answer
587 views

verifying code deployed with web3.js

I am deploying my smart contracts using web3.js and compiling the code using solc. The contracts are deployed successfully with no issues however I am having a bit of a problem in verifying my ...
0 votes
1 answer
387 views

I have written a javascript code for compiling the solidity code but it's showing error

I was trying to compile my contract using solc compiler but it returning me some errors. I will place my solidity code along with the error that I am getting here. Please help me out to sort this ...
12 votes
9 answers
31k views

Solc --version: command not found

I'm trying to use solc with no success. I download solc with npm install solc but when I run solc --version the console output is: command not found. If I list packages npm list I'm able to see ...
1 vote
0 answers
54 views

incompatible Solidity versions

I am trying to compile the code with multiple solidity versions e.g. =0.7.6, =0.8.15 etc in foundry with the configuration of auto_detect_solc but still getting this error Here's my foundry.toml file [...
1 vote
2 answers
817 views

Build with multiple solc versions?

My tokens and basic setup scripts are built in solidity 0.8.0 and I just downloaded GSN with OpenZeppelin because I need a platform which will fund users' few things. Now I can't compile because it ...
2 votes
4 answers
4k views

How to use Solidity solc to compile A.sol that imports B.sol file?

I know how to install solc via "npm install --save solc" then use solc.compile to compile one sol file. But now I've got A.sol file that imports B.sol file, and when I run node compile.js, no error in ...
0 votes
1 answer
57 views

Why is contract deploying, but giving an error on console

So I'm using ganache client and deploying the contract. I can see the contract on ganache and also the transaction. But on the console I'm getting following error: ... code: 'UNKNOWN_ERROR', ...
2 votes
2 answers
2k views

Not able to get rid of error from solc-js "AssertionError [ERR_ASSERTION]: Invalid callback specified."

const path=require('path'); const fs=require('fs'); const solc=require('solc'); const InboxPath=path.resolve(__dirname,'contracts','Inbox.sol'); const source=fs.readFileSync(InboxPath,'utf8'); solc....
22 votes
6 answers
19k views

Solidity Error: Struct containing a (nested) mapping cannot be constructed

My version of solc: "solc": "^0.7.1", When I try to construct a struct that contains mapping, I got this error: "Struct containing a (nested) mapping cannot be constructed&...
1 vote
2 answers
788 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 ...
0 votes
1 answer
482 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 ...
7 votes
2 answers
2k views

Do intermediate memory variables cost gas?

Example without an intermediate variable: uint startTime = 9; uint allowedTime = 7; require(now > startTime + allowedTime); Example with an intermediate variable: uint startTime = 9; uint ...
43 votes
8 answers
16k views

Error while compiling: Stack too deep

When trying to compile, I am getting the following error: "Internal compiler error: Stack too deep, try removing local variables." Is there any way around this? I'm not sure if I'll be able to ...
2 votes
1 answer
116 views

Determine compiler used to create a given bytecode

Context The method that the solc compiler uses to set storage slots for a mapping is slightly different from how the Vyper compiler does so. In Vyper, it's keccak256(slotMapping, key), while in ...
0 votes
0 answers
27 views

Dockerized zkSync testing environment image fails with error Solidity 0.8.19 is not fully supported yet

I'm setting up a dockerized local zksync testing environment according to this guide here. When I run the ./start.sh command, it runs all three images but the local-setup-zksync-1 image exits with ...
2 votes
1 answer
216 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 ...
0 votes
1 answer
228 views

How to Verify smart Contracts Using Web3.js and Solc?

everyone, I am new to web 3,I deployed smart contract successfuly and get back contract address but now I am trying to verify that the smart contract with web3 and solc . https://www.shawntabrizi.com/...
0 votes
2 answers
54 views

Runtime error: code size to deposit exceeds maximum code size

I'm using solc_version version 0.8.16, which i checked is installed, but when i'm trying to deploy the contract getting error Runtime error: code size to deposit exceeds maximum code size. While using ...
2 votes
2 answers
54 views

Abigen reuses nonce when deploying a contract

We have a contract called C1 that uses another contract called RoleLib: using RoleLib for uint8; We compile it with solc: solc --combined-json abi,bin ./solidity/c1/C1.sol -o deploy/c1 --base-...
0 votes
0 answers
123 views

How to import code into a contract

I have a contract that needs to be compiled with solc so I can get Go bindings. $ tree . ├── openzeppelin ├── Swap.sol └── @uniswap pragma solidity >0.7.0 < 0.9.0; import { IUniswapV2Pair } ...
1 vote
1 answer
41 views

Why does deploying programatically through nodejs cost more than deploying through remix?

I've written code to deploy contracts programatically. However when I set the same settings as remix ("gas price, gas limit, etc). The transaction mines but I get the error: Warning! Error ...

1
2 3 4 5
8