Skip to main content
OverflowAI is here! AI power for your Stack Overflow for Teams knowledge community. Learn more

Questions tagged [solc]

Questions related to the compiler for Solidity: solc

104 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
8 votes
1 answer
972 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 ...
karma badger's user avatar
5 votes
0 answers
570 views

Solidity sourceMap and opcodes. No map entries for every code?

After compiling a simple contract, the output are these values: "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH1 0xF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP ...
Juan Ignacio Pérez Sacristán's user avatar
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 ...
Nyxynyx's user avatar
  • 1,167
3 votes
0 answers
78 views

Why the bytecodes for the same smart contract in testnet explorer and Remix/solcjs are different?

I am using Remix to compile and deploy my smart contract to the Rinkeby test network. I don't understand why the bytecode of my contract on Rinkeby explorer is different from the metadata.data....
Aleks Shenshin's user avatar
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/...
mehrlicht's user avatar
3 votes
0 answers
429 views

solc unable to import scoped packages

I am trying to import these lines on solidity and compile it with solc import '@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol'; import '@uniswap/v2-periphery/contracts/interfaces/...
Marr's user avatar
  • 337
3 votes
0 answers
247 views

Why truffle deploy fail with address value=0 after I upgrade to version 5.0.5?

I have a truffle 2_deploy_contracts.js something like this : const sample = artifacts.require('./Sample.sol'); module.exports = function(deployer) { deployer .then(()=>deployer.deploy(...
user76333's user avatar
  • 167
3 votes
1 answer
166 views

Solidity standard library: how to contribute?

I'd like to contribute to Solidity standard library, which seems a bit feature-less. How can I do that? Is there are some agreements about Solidity standard lib like in c++? I have implemented some ...
Alianse777's user avatar
2 votes
1 answer
88 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 ...
B S's user avatar
  • 21
2 votes
1 answer
291 views

How to enable multiple compiler versions in solc js?

I'm trying to compile contract A(located in A.sol) that has a dependency on contract B(located in B.sol) using solc-js, where A has solidity version 0.8.0 and B version 0.7.6. The solcjs version that ...
MShakeG's user avatar
  • 1,693
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
YaSh Chaudhary's user avatar
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, ...
user avatar
2 votes
0 answers
410 views

What is the value range of the parameter optimize-runs when running the solidity compiler?

I would like to know what the allowed value range of the parameter optimize-runs is when running the Solidity compiler. I didn't find the answer in the official document of Solidity.
NUCKevin's user avatar
2 votes
0 answers
173 views

How to verify a contract in etherscan older than 0.4.11?

It seems that the verification feature of Etherscan supports contracts written since Solidity 0.4.11. I want to verify a contract written with Solidity 0.4.8. Is this possible? I'm wondering if this ...
elopio's user avatar
  • 452
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/...
goodvibration's user avatar
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 ...
Zaid Amir's user avatar
  • 322
2 votes
1 answer
422 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\...
byal's user avatar
  • 21
2 votes
0 answers
192 views

Reasons for and debugging a contract that failed when deploying into blockchain

I have a program that has been tested from remix's VM, and compiled with solc, in both cases without any failure. However, when I try to use a custom script for deploying it into the rinkeby testnet (...
ranchalp's user avatar
  • 540
2 votes
0 answers
338 views

Is it possible to get compiler version from the bytecode and smart contract code?

The problem is that I have deployed some contract on the etherscan.io some time ago. Now I want to verify it, so I need to specify: Smart contract code Compiler version ABI encoded constructor ...
Sergey Potekhin's user avatar
2 votes
0 answers
337 views

what does the UnimplementedFeatureError mean?

I'm getting the following error in remix.UnimplementedFeatureError: Non-padded store for function not implemented.
breakpoint's user avatar
2 votes
0 answers
111 views

Accepting Map or JSON in a constructor or method

I have a question: Can a Contract accept a HashMap kind of a data structure or some kind of a JSON structure of the following format in its Constructor? [ {key1 -> {val1, val2, val3}}, {key2 ->...
Prana's user avatar
  • 135
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 ...
Marco9631's user avatar
1 vote
0 answers
50 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 [...
Mudassir Ali's user avatar
1 vote
0 answers
70 views

How is `soljson.js` created from Solidity repository

In the official Solidity GitHub repo, under the releases section you can download the source code, binaries and the soljson.js file. How is the file generated and is it able to be generated by ...
John's user avatar
  • 71
1 vote
0 answers
62 views

Parse Error with npm workspaces

I am getting a false error with the solc language server (running on neovim with nvim-lsp). I often use npm workspaces and the language server fails to understand that the dependencies are two ...
Prateek Pravanjan's user avatar
1 vote
0 answers
71 views

Setting runs in solc options at brownie-config.yaml

My goal is to set the runs key of solc to the value of 100 inside the brownie-config.yaml file. I have found two different solutions and I would like to know what is the difference between the two in ...
rihekopo's user avatar
  • 316
1 vote
1 answer
92 views

solc --userdoc --devdoc NFTMarketplace.sol "NFTMarketplace.sol" is not found

When I tried to generate Documentation with solc --userdoc --devdoc NFTMarketplace.sol I get the error "NFTMarketplace.sol". It seems like solc cant find the path to my smart contract. I ...
Bobby's user avatar
  • 47
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/...
Aryan Raj's user avatar
1 vote
1 answer
296 views

Compilation Error with Solc - Solc Error: dyld[30112]: Library not loaded: '/opt/homebrew/opt/z3/lib/libz3.dylib'

I recently updated my solc to the latest version for foundry testing and contract compilation. I have an M1 mac and I am using Mac OS Monteray 12.5 Suddenly I am getting an error when trying to use ...
Kate Johnson's user avatar
1 vote
1 answer
159 views

Does the compiler ignore internal functions that are never called?

On inheriting a contract that contains some internal functions that are never used in the child contract. eg. contract Parent { function _someInternalFunction() internal{ } } contract Child ...
user3599285's user avatar
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.
enthusiastic's user avatar
1 vote
0 answers
42 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){ ...
Rachid Boudjelida's user avatar
1 vote
0 answers
74 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?
Gallo's user avatar
  • 33
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 ...
Niko's user avatar
  • 11
1 vote
0 answers
249 views

Does solcjs replace solc? Is there a wrapper for the differences?

It at least appears to me that "solc" (the executable) doesn't exist anymore. Installing "solc" with nmp results in a command-line tool called solcjs ... fine, but they seem to ...
Captain Midday's user avatar
1 vote
1 answer
363 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.
Philogy's user avatar
  • 627
1 vote
0 answers
150 views

TypeError: Library functions must be implemented if declared for solc compiler version ^0.6.0 library implementation

Suppose I have the following code: // SPDX-License-Identifier: MIT pragma solidity >=0.4.21 <0.7.0; library SomeLib { function add(uint256 a, uint256 b) public returns(uint256); } contract ...
user76333's user avatar
  • 167
1 vote
0 answers
592 views

Truffle compiler stuck at 0.4.17

Coming from here: How do I specify a different Solidity version in a Truffle contract? I still have the same issue, except that even after trying all of the suggested solutions, and even having the ...
Thanh-Quy Nguyen's user avatar
1 vote
0 answers
70 views

Cannot execute contract in non-intaractive scripts

I want to deploy and to execute ERC-20 contract on geth with non-interactive scripts. But, it seems that non-interactive scripts and console shows different results. Enviroment ubuntu 18.04(docker ...
chike's user avatar
  • 11
1 vote
0 answers
128 views

How to achieve inheritance support using web3j wrapper?

I have two types of smart contracts. One parent contract to store the type and other child contracts which inherits the parent contract. The problem is, I can't generate java wrapper class (...
iOS-Developer84's user avatar
1 vote
0 answers
1k views

Cannot read property 'type' of undefined - abi-coder

I'm creating a simple voting contract. It is deployed with truffle and infura. This is the contract code: pragma solidity >=0.4.21 <0.6.0; contract Voter { struct OptionPos { uint ...
Dominik Dragičević's user avatar
1 vote
0 answers
352 views

Gas usage difference between Remix and Ganache/public networks

I'm trying to integrate a contract into a front end with MetaMask and getting different gas amounts depending on the network and compile options I use. Remix ("Enable Optimization" checked): 90,410 ...
SuperCodeBrah's user avatar
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", ...
jimbo_jet's user avatar
1 vote
0 answers
54 views

Compile Solidity on openbsd

i have tried several branches and all fails, has anyone got this working on openbsd? an issue has been created on github about this aswell https://github.com/ethereum/solidity/issues/5728
ethbsd's user avatar
  • 11
1 vote
0 answers
103 views

Web3JS throws InvalidResponse without Ganache core ever receiving a request?

Versions: Ubuntu 18.04 LTS Node.JS: 8.3.0 WebJS: web3: ^1.0.0-beta.37 web3-utils: ^1.0.0-beta.36 npm: 5.6.0 Truffle version 5.x (latest) I have traced through the HttpProvider code in the Web3 ...
Robert Oschler's user avatar
1 vote
0 answers
305 views

How to compile solidity in the browser without using browser-solc?

I am thinking of implementing an API call to compile some source code entered by a user and then return the bytecode for deployment using metamask. I have tried browser-solc but it had some errors ...
Trevor Lee Oakley's user avatar
1 vote
0 answers
44 views

Manually configure EVM Assembly Tag

I have read that Ethereum during the compilation splits the code into tags. The solc optimizer doesn’t optimize across tags. If we consider “1+1”, it can be optimized to 0x2 if under the same tag: /...
Joseph T F's user avatar
1 vote
0 answers
172 views

Solc compatibility with various versions of Geth

I'm looking for information about what minimal version of solc is compatible with geth, including older versions of geth (1.6+).
George Galumov's user avatar
1 vote
0 answers
37 views

txList.length returns different value for different Solidity versions

I have RLPReader smart contract, took it from here. And I have a function untouched for a while: function deposit(bytes txBytes) public pure returns (uint) { RLP.RLPItem[] memory txList = ...
rel1x's user avatar
  • 125
1 vote
0 answers
67 views

Linker not working on solc v0.4.23

I can't seem to make the linker.linkBytecode() method to work... Here's how I'm using it: const linkedBytecode = linker.linkBytecode(mainContract.bytecode, { 'UserLib': userLibContract....
wbt_'s user avatar
  • 41