Questions tagged [solc]

Questions related to the compiler for Solidity: solc

Filter by
Sorted by
Tagged with
2 votes
2 answers
2k views

invalid opcode "0x1c" during smart contract method execution

I have written a smart contract to test event from java project using web3j I have prepared the web3j wrapper java class using solc compiler version "0.5.7+commit.6da8b019.Linux.g++" I am using a ...
iOS-Developer84's user avatar
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 ...
Russo's user avatar
  • 1,784
2 votes
1 answer
1k 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 ...
forhas's user avatar
  • 775
2 votes
2 answers
1k 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 ...
mahima's user avatar
  • 133
2 votes
1 answer
838 views

Stack too deep error in Solidity v0.8.4, no error / debug info from compiler

I have been facing the Stack too deep error, and it is being displayed without any line number / contract info. It is compiling all my contracts together (over 10) and I have no clue where this error ...
tinker's user avatar
  • 161
2 votes
1 answer
347 views

UnimplementedFeatureError: Only byte arrays can be encoded from calldata currently

I received the error message UnimplementedFeatureError: Only byte arrays can be encoded from calldata currently from the compiler, but without any reference to a file or line. In a big project, and ...
Travis Jacobs's user avatar
2 votes
1 answer
1k views

solc not importing from github

In a Solidity source file I have an import along the lines of... import 'https://github.com/<username>/<repo>/<source>.sol'; which works fine in Browser Solidity but solc (ver 0.3....
o0ragman0o's user avatar
  • 4,320
2 votes
1 answer
614 views

How to pass constructor parameters to solc?

I'm trying to compile a Smart Contract to bytecode using solc. I'm on a Ubuntu VM so I have to rely on a simple-to-install cmd line application. Compilation works fine but it seems like I can't pass ...
moritz-mbw's user avatar
2 votes
1 answer
957 views

Why does solc output bytecode that is not in valid hex format?

I compile my solidity file using the following command: solc Encoder.sol --bin --abi --optimize -o <output_dir>/ Then I try to deploy it in Geth: Encoder = eth.contract([<abi file content&...
user56170's user avatar
2 votes
1 answer
568 views

Recently upgraded Solc and Web3. Transactions with zero addresses now reverting with "invalid address" message?

I recently upgraded Web3JS and Solc. Now every time I pass a zero address to a Solidity contact method the transaction reverts with an "invalid address" message. This message appears to be coming ...
Robert Oschler's user avatar
2 votes
2 answers
2k views

Calling a function from a contract passed in as an argument

Im Trying to create a DAPP with two contracts generating assets. One is acting as the "factory" for the other contracts. From the latter I try to call a function in the factory without knowing its ...
Marlon Gelpke's user avatar
2 votes
2 answers
643 views

How to compile solidity AST to binary code?

I want to do some automatic transformation of solidity source code. For this reason, I thought to get its AST representation using solc --ast or solc --ast-json and modify it. My questions are: ...
Mike B's user avatar
  • 131
2 votes
1 answer
90 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 ...
Another0xDev's user avatar
2 votes
1 answer
487 views

solcx compile_files Key error

I am using python package py-solc-x for compiling the smart contract. os.path.abspath("D:/new.sol") Gives path where my test contract exits. 'D:\\new.sol' Then i use compile_files to compile the ...
Chidananda Nayak's user avatar
2 votes
1 answer
34 views

Unexpected behaviour. Huge size increase when adding new SubContract()

I have a contract similar to: contract Contract01 { SubContract _refContract; ... constructor() public { refContract = new SubContract(); } function setSubContractRef(SubContract ...
earizon's user avatar
  • 606
2 votes
1 answer
833 views

Solc compile contracts with 5.0.0 [duplicate]

I was following this guide for compiling my contracts How To: Compile a Solidity Smart Contract Using Node.js but "solc.compile(input, 1)" is not working anymore. I have problems understanding how to ...
Lomo's user avatar
  • 103
2 votes
1 answer
3k views

truffle compile with solc 5.0.0 error: solc.compileStandard is not a function [duplicate]

Trying to use Solidity v0.5.0 with Truffle. Starting v5.0.0 Truffle allows setting solc version in truffle.js, as per its docs I tried both native compilers: { solc: { ...
Utgarda's user avatar
  • 791
2 votes
1 answer
385 views

What is ethereum bytecode link references is?

I compiled contract from there and found some strange things in bytecode: <some_bytecode>...__CrowdsaleTokenExt:SafeMathLibExt______6366098d4f9091836000604051...<some-bytecode> As I ...
Дима Меркурьев's user avatar
2 votes
1 answer
355 views

How to compile solidity release version

I've followed instruction to build solidity. But when it finished, i've got develop version: Version: 0.4.16-develop.2017.8.31+commit.d7661dd9.mod.Linux.g++ I've tried to run make with argument ...
Valera Dubrava's user avatar
2 votes
1 answer
1k views

TypeError when trying to deploy a contract with web3 1.0.0-beta.11

I'm trying to figure out how to deploy a contract with web3 in version 1.0.0-beta.11, and I don't know if I'm hitting a bug in web3, an incompatibility issue with the version of solc I'm using, or if ...
Sebastien's user avatar
  • 323
2 votes
1 answer
739 views

Downgrade Geth from 1.6 to 1.59 to have solc integrated in Geth

I have this project on ropsten testnt that don't want to keep developing but keep on running. Since they took solc out of Geth on v1.6, I get the error method eth_compilesolidity does not exist. Is ...
PetrosM's user avatar
  • 526
2 votes
2 answers
565 views

Python bindings for solc

There are javascript bindings for solc. Is there an equivalent Python binding for solc, such that you could simply install solc via pip?
dbryson's user avatar
  • 6,403
2 votes
1 answer
210 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 ...
retlok's user avatar
  • 23
2 votes
1 answer
1k 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('...
jjjoo's user avatar
  • 23
2 votes
2 answers
1k 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 = ...
D. J.K.'s user avatar
  • 21
2 votes
1 answer
209 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 ...
Cizia's user avatar
  • 263
2 votes
1 answer
1k views

I ran into an error when using Pragma Solidity 0.4.24

I use pragma solidity 0.4.24 on the smart contract, but when running the truffle compile command, an error appears like this: =========================== > Compiling ./contracts/ImageRegister.sol &...
Adam Faturahman's user avatar
2 votes
1 answer
718 views

Conflicting solc versions on Truffle-test

I'm developing some smart contracts sing solc 0.7.0. I'm able to successfully compile and deploy the contracts, but when I try to run $truffle test I get the following error: Using network '...
Flav Scheidt's user avatar
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....
Kowsik Gelli's user avatar
2 votes
1 answer
1k views

I got error when npm install -g solc [closed]

I got error when try to install solc using npm install -g solc here is the error: erfans-MacBook-Pro:01 erfanandesta$ npm uninstall -g solc npm WARN checkPermissions Missing write access to /usr/...
andesta.erfan's user avatar
2 votes
1 answer
51 views

Why solc does not detect issue in this code?

I wrote a sample Solidity code below: in function call() of contract sample_call, I make a call to function add_car() function of another contract sample, but this is a bug, since variable v is never ...
user311703's user avatar
2 votes
2 answers
1k views

How to deploy a smart contract in a server?

I have developed a smart contract and compiled it with solc and bin and abi fils have been generated. Now, I want to deploy this contract using web3js in a linux server. How can I do it?
Questioner's user avatar
  • 2,670
2 votes
1 answer
746 views

Node JS module in Geth is not found

I have installed solC module with command: npm install solc How can I use this module in Geth? When I execute var solc = require("solc") in Geth's console, interpreter throws: Error: Cannot find ...
AntonB's user avatar
  • 123
2 votes
2 answers
2k views

How to deploy compiled contract file using the geth cli?

So I've followed the greeter contract tutorial from here to deploy a contract to my private cloud. It works fine and all, but it is rather difficult that I need to create a string from my contract and ...
kramer65's user avatar
  • 655
2 votes
1 answer
254 views

Is there any specific reason for web3.js to not compile contracts directly from file?

web3.eth.compile.solidity ask for a string as a parameter. Not only, it must be a string without line breaks: in the official greeter tutorial to use an online-tool to remove line breaks from ...
Sergeon's user avatar
  • 396
2 votes
2 answers
51 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-...
Piero dS's user avatar
2 votes
0 answers
79 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
284 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,603
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
408 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
1 answer
82 views

What is this evm code produced by solc in this public array checking, and why?

When solc creates code for arrays when they are declared public. In particular, it contains a check on the length of the array. For example, this: contract OutOfBoundsException { uint256[8] ...
rocky's user avatar
  • 131
2 votes
1 answer
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
572 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
  • 312
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
190 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
337 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 2
3
4 5
8