Questions tagged [solc]

Questions related to the compiler for Solidity: solc

Filter by
Sorted by
Tagged with
32
votes
5answers
7k 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 ...
1
vote
1answer
2k views

solc.compile() @0.5.0 is not working like 0.4 version

I read the solc document and followed the instruction. When I am using solc@0.4.24 version, compile command is working fine solc.compile(smartContractPath, 1); When I switched to solc@0.5.0 version, ...
9
votes
1answer
2k views

What's the difference between solc's bin bytecode versus bin runtime?

Solc says that bin-runtime is the runtime part of the contracts. What exactly is the runtime bytecode part and how does it differ from bin bytecode output?
2
votes
2answers
688 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 ...
8
votes
1answer
571 views

What is the cryptic part at the end of a solidity contract bytecode?

Given the following contract: pragma solidity ^0.4.11; contract Simple { bytes32 public v; function set(bytes32 _v) { v = _v; } } When disassembling, neither remix, solc or evm ...
21
votes
2answers
7k views

How do I find out the solidity compiler version I am using?

Specifically, while using Mist. When I create a contract via the Mist GUI, I want to then be able to verify the source code over at Etherscan. However, Etherscan requires that you provide the ...
6
votes
3answers
547 views

Solc Compiler oversight? Innappropriate mapping declaration overwrites storage

I have written a contract that has the mapping storage variable A & B. These variables get initialized with some values in constructor. A method getBalance returns the balance from mapping A & ...
15
votes
2answers
2k views

Etherscan: How can I verify a contract with multiple imports deployed with Truffle?

When I deploy a contract with Truffle that has an import statement, and try to verify it on etherscan, my understanding is that I need to paste in the contents of the imported file. I get an error on ...
8
votes
2answers
1k views

Infinite gas estimation from solc for simple function

Here is a simple Solidity contract: pragma solidity ^0.4.16; contract Test { uint[] array; function testGasEstimation() public { array.length = 1; } } Here is the output of ...
17
votes
2answers
2k views

Is there a way to disable a warning in solidity code? [duplicate]

I'm writing unit tests for some contracts and in some of the tests I'm generating a warning on purpose and solc will display this warning when compiling. Is there a way to disable warnings in solc ...
7
votes
3answers
949 views

Alternative to deprecated Greeter example code?

After loads of research, it seems the Ethereum.org Greeter example code no longer works. Here's the GitHub issues thread: https://github.com/ethereum/go-ethereum/issues/3793. There are some ...
6
votes
1answer
562 views

Compiler Issue or Improper State Variable declaration?

After seeing some unexpected compiler results, I've reduced the issue to this tiny example: The following compiles under 0.4.10 in Remix: contract StorageMapping { struct S { mapping(...
4
votes
1answer
829 views

solc returns empty bin for contracts with constructor and inheritance

Having a simple contract structure like this: pragma solidity ^0.4.8; contract A { uint public a1; } contract B is A { uint8 public b1; } I can compile it with: > solc --combined-json "abi,...
9
votes
1answer
2k views

Link solc with geth problem

After upgrading to geth 1.4.4 I am no longer able to from to reference the compiler from geth. The solc compiler is installed in /usr/local/bin but this is what I get when I check for available ...
2
votes
1answer
134 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 ...
0
votes
2answers
608 views

Solc error invalid opcode, but works in truffle

I am trying to compile solidity code in solc(nodejs) but unsuccessful so far. I have created a sample app for demo. Here is sample's directory structure (node.js and truffle combined): │ app.js │ ...
7
votes
2answers
2k views

Unhandled rejection Error: Couldn't decode uint256 from ABI

I am working on using a sample Contract using NodeJS, Web3, and Solc but I encountered some error that the given address in the Contract that I've created couldn't decode. Am I doing something wrong? ...
6
votes
1answer
4k views

How to include solidity file into another?

I completely stuck on modules importing into Solidity contract. Here is my files/directory layout: . |-> contracts/ |-> contract1.sol |-> contract2.sol File contract1.sol contains only ...
3
votes
2answers
3k views

compiling solidity code using solc@0.4.10 on node.js

Trying to compile solidity smart contract on windows using solc@0.4.10. But the code breaks with the below error, and this happens only for the contracts in which import statements are there, other ...
12
votes
1answer
435 views

How to generate sugared assembly code from Solidity code?

In the Solidity documentation I see a sample assembly code: { mstore(0x40, 0x60) // store the "free memory pointer" // function dispatcher switch div(calldataload(0), exp(2, 226)) case ...
7
votes
2answers
1k views

All cases when Solidity compiles to invalid jump destination

Solidity generates EVM bytecode that leads to an invalid jump destination when: throw is used ... ? ... ? Can the above list be completed, with examples? To explain the first item, throw in ...
7
votes
1answer
321 views

Tracing back tripped require() to a source code line

What would be the process to map failed transactions (require, throw, etc.) back to the source code line where they occurred? Any examples of such yet?
4
votes
1answer
289 views

Unexpected implicit casting in Solidity's exponential operator

While investigating an incorrect token award bug in an ERC20, it's come to light that there is an apparent inconsistency in casting with regard to the exponential operator a**b. In particular, the ...
11
votes
1answer
8k views

How do I install solc on Mac Osx? Error encountered “Error: No formulae found in taps.”

I'm trying to install a solidity compiler on my Mac. I've followed the guide here: https://github.com/ethereum/go-ethereum/wiki/Contract-Tutorial The error that I've gotten when installing ccp-...
8
votes
5answers
12k views

What is the cause of the error: Expected import directive or contract definition

I'm working on the tutorial at https://www.ethereum.org/dao and I'm getting the following error: 1:5: Error- Expected import directive or contract definition. function owned() { ^ When I get ...
4
votes
2answers
760 views

Contract not deploying on blockchain using solc & web3

I am using the npm package of solc to compile the contracts and accessing it as given here. It is compiling my contracts. But when I try to deploy the contract using web3.eth.sendTransaction({data: ...
3
votes
1answer
813 views

Timeout exceeded during the transaction confirmation process

I am trying to figure out the right syntax for solc 0.5.7 and web3 1 beta 52 Follow my source code: contract.sol pragma solidity ^0.5; contract Hello { string public message; constructor (...
1
vote
1answer
47 views

Transaction does not get mined on rinkeby

so I'm trying to deploy my first contract on rinkeby using web3 and truffle/hdwallet-provider. even with different gas prices it doesn't get mined.Please help out. const HDWalletProvider = require("@...
1
vote
2answers
786 views

Install Old Solc Compiler Versions

I would like to compile older versions of solc contract source code using a solc compiler on my local machine. Is there a website from which to download old solc compilers? Google revealed a GitHub ...
0
votes
1answer
775 views

Can't get contract to contract function calls working

I can't quite seem to figure out an issue preventing contract to contract function calls. I'm feeling fairly confident it's something with how I'm deploying. Preface: I have a Parent and Child ...
6
votes
1answer
390 views

Getting segmentation fault while compiling solidity contract

Getting segmentation fault when compiling a simple contract on geth on OSX Yosemite web3.eth.getCompilers(); ["Solidity"] source = "contract test { function multiply(uint a) returns(uint d) { return ...
5
votes
2answers
3k views

Install Solc Compiler on Windows 8

I need a command line compiler in order to make an expert system that automatically builds, tests, and deploys systems of smart contracts based only on metadata. I have tried for several days to ...
2
votes
1answer
573 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 ...
1
vote
1answer
477 views

Calling Transfer event causes infinite gas estimation solc

solc estimates an infinite gas usage from _transfer and I am unsure why. I did find that if I comment out the Transfer(_from, _to, _amount) line, the gas usage becomes finite. Here is the minimum ...
1
vote
1answer
176 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
1answer
105 views

Gas is 0 when executing CALL opcode?

I wrote a very simple smart contract like this: contract Test{ function test1(address payable addr, uint256 value) payable public { addr.transfer(value); } } And I compiled it using ...
0
votes
1answer
500 views

Upgrading to solidity version 0.5.0 getting deployment failed error with same smartcontract perfectly deployed on 0.4.24

The same smart contract is running smoothly in solidity version 0.4.24 but now when I update the solidity version and solving a lot of bugs inside my smart contract I intended to deploy that in ...