Questions tagged [solc]

Questions related to the compiler for Solidity: solc

Filter by
Sorted by
Tagged with
14
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 ...
4
votes
1answer
1k views

What is the proper way to build and call a specific version of solidity?

I am getting the following error from solc: Error: Source file requires different compiler version (current compiler is 0.4.11-develop.2017.6.22+commit.68ef5810.Darwin.appleclang - note that nightly ...
1
vote
1answer
163 views

The Solc Compiler on OSX - Hello World

I'm trying to do the hello world app seen here https://www.ethereum.org/greeter#compiling-your-contract. It says I should be able to do eth.getCompilers() The first you can get by using a ...
7
votes
3answers
922 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 ...
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 ...
2
votes
1answer
498 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 ...
1
vote
1answer
342 views

“Skipping non-existent input file” error using solc docker on Windows

I'm trying to setup a local build environment for Solidity on Windows (10). One of the options recommended in the Solidity docs is docker. Superficially, the docker image runs fine: C:\work\eth>...
16
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 ...
3
votes
1answer
729 views

Deploying the smart contract using Web3.js gives error?

I'm deploying a smart contract using the following guide but getting a strange error - Guide: https://tokenmarket.net/blog/creating-ethereum-smart-contract-transactions-in-client-side-javascript/ ...
5
votes
1answer
2k views

TypeError: 'setSolc' is not a function

I am trying to sync geth and solc. which solc # I get the path to my solc /usr/local/bin/solc Open the geth console geth console 2>>geth.log and now I try to sync admin.setSolc("/usr/local/...
1
vote
0answers
172 views

(web3.js) The method eth_compileSolidity does not exist/is not available [duplicate]

I have tried to develop a javascript function with web3.js to compile a solidity contract. In html/javascript code, I have prepared the following. var contract_code = "pragma solidity ^0.4.....[omit ...
6
votes
1answer
506 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(...
8
votes
1answer
1k views

solc bin vs. bin-runtime

Solc says that bin-runtime is the runtime part of the contracts. What exactly is the runtime part and how does it differ from bin output?
1
vote
0answers
564 views

Why is the balance of the ethereum account still zero after I create a token based on the private chain I built?

0 down vote favorite I used the contract codes available on the ethereum official website,to create an advanced token on the private chain run in geth console. The version of geth is 1.5.5,and the ...
4
votes
1answer
249 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 ...
6
votes
3answers
458 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 & ...
4
votes
1answer
2k views

The solc is not generatig *.abi file with the option --abi and -o build

When I use the --abi option, the abi interface is generated: $ solc Greeter.sol --abi ======= Greeter.sol:mortal ======= Contract JSON ABI [{"constant":false,"inputs":[],"name":"kill","outputs":[],"...
1
vote
0answers
29 views

Solidity compilation issue on Linux Mint [duplicate]

I have a smart contract which I am invoking through webjs. Everything works well untill I am on Windows. Recently i had to move to Linux Mint. Now when i compile the contract. I get stdin in the ...
4
votes
1answer
732 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,...
1
vote
2answers
530 views

How do we convert uint8[3] to uint8[]?

So the code is struct A { uint8[] a; } I want to initialize A by A a = A([1,2,3]);. However, solc says that can't convert uint8[3] to uint8[]. In conclusion, I am looking for a way to convert ...
3
votes
1answer
1k views

How to call imported Contract using Solidity?

Inside my contract I want to use importkeyword to load other contracts and libraries to make my code more clean. As an example, I carried DateTime.sol contract to another file and import it inside ...
4
votes
1answer
136 views

Setting a struct once cause error while compiling: Stack too deep

See my smart contract below : contract Test { struct MyBool { bool initialized; // /!\ if false then 'NA' else fetch value's property bool value; } struct Patient { ...
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 ...
1
vote
0answers
28 views

How to change the compiler the mix-ide uses?

I have build the mix-ide from source, is there a way to change the solidity compiler it uses? I have tried to simply replace the solidity folder in the webumbrella directory with a new version but ...
2
votes
1answer
327 views

Cannot run solc

After following the install instructions here: http://solidity.readthedocs.io/en/latest/installing-solidity.html When I try and run solc, I get the following error: solc: error while loading shared ...
4
votes
1answer
296 views

Is the Solidity compiler deterministic?

I am aware that you have to specify the Solidity compiler version and whether or not you use the optimisation flag. But even with all that considered - is the compiler deterministic?
10
votes
1answer
7k 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-...
5
votes
2answers
577 views

Error: Member “assertNotEqual” not found or not visible after argument-dependent lookup in uint256

I am trying to run test cases in sol-unit for Solidity, but when I compile my code with solc compiler I get an error. I don't think the error is critical, but there is very little material on net ...
4
votes
1answer
352 views

How to deploy a solidity contract to the blockchain. myContract.new is not a function

I have a contract that compiles in browser solidity and solc. Using either the auto-generated deployment code in browser solidity or my own npm version, I end up with the error "myContract.new" is ...
2
votes
1answer
646 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....
2
votes
1answer
721 views

deploying a contract from geth

Hi I have been trying to deploy a contract from geth console to the testnet, I established a connection and also mined to make sure its all working... one thing I couldn't do for some reason is use ...
1
vote
2answers
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 ...
3
votes
1answer
348 views

solc not producing binary

I am trying to compile OwnedRegistrar contract using Solidity. It's like import "./owned.sol"; import "./Registrar.sol"; contract OwnedRegistrar is Registrar, owned { // ... } However ...
3
votes
3answers
4k views

populus OSError: [Errno 2] No such file or directory

When trying: $populus compile Get: OSError: [Errno 2] No such file or directory Tried: Tried to install missing dependencies as described here and installed solidity compiler as well - same ...
4
votes
2answers
744 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: ...
2
votes
2answers
417 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?
2
votes
1answer
229 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 ...
3
votes
1answer
882 views

How do I deploy a contract complied with solc?

I am trying to deploy a contract that I have compiled with solc using solc --bin mycontract.sol. I used to be able to paste the result into Ethereum-Wallet and deploy the contract this way. However, ...
4
votes
1answer
96 views

Parse contract to retrieve declared identifiers

Node.js Solidity compiler parses contract and returns its ABI, is there any library to retrieve all declared identifiers in a contract? For example, the following contract: contract Person { ...
7
votes
5answers
10k 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 ...
5
votes
1answer
461 views

Solidity compiler doesn't work in the Javascript Console

I'm using Geth 1.4.5-stable along with Solc version 0.3.5-0 both on Linux. It is run on a Digital Ocean server. I have a fully synced testnet chain and I'm trying to compile contracts from within the ...
5
votes
5answers
8k 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 ...
28
votes
4answers
6k 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 ...
4
votes
3answers
4k views

Installing solidity in Debian Linux

I'm trying to install solidity but apparently there are no online repositories with all dependencies. I have tried using the methods described here. sudo add-apt-repository ppa:ethereum/ethereum ...
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 ...
3
votes
5answers
1k views

Error “Trying to create an instance of an abstract contract.” for standard token

When I try to create a new instance of the standard token, compiler throws an error: Error: Trying to create an instance of an abstract contract. I suppose it is due to abstract receiveApproval ...
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 ...
3
votes
1answer
177 views

Backslashes being removed and unable to set Solc in windows 10

I've installed Geth on win 10 and I'm trying to link solc but I'm not sure why the backslashes are being removed? How can I get past this error? > admin.setSolc("C:\Program Files\Ethereum\solc") ...
20
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 ...
5
votes
1answer
3k views

How do I host Ethereum on a server?

I recently tried to get geth and solidity up and running on a virtual server I have some free time on. I got stuck trying to build the Solidity compiler due to issues with the OpenGL library. I've ...