Questions tagged [solc]

Questions related to the compiler for Solidity: solc

Filter by
Sorted by
Tagged with
0
votes
1answer
169 views

In Node.js connected to Geth : solc.compile prefixes an additional ':' before contractName

I'm trying the following script on Node.js while running a node connected to Rinkeby Testnet (from https://github.com/ethereum/wiki/wiki/JavaScript-API#web3ethcontract): const fs = require("fs"); ...
3
votes
3answers
5k views

"[Errno 2] No such file or directory: 'solc' " Using py-solc and solidity

I installed py-solc and solidity: solc, the solidity compiler commandline interface Version: 0.4.16+commit.d7661dd9.Darwin.appleclang and ran this code in python (with a contract source example): ...
0
votes
1answer
285 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 ...
2
votes
1answer
317 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 ...
1
vote
0answers
605 views

How to query the blockchain data ?

I am developing an KYC dapp where I am keeping customer information like name, dob, age etc. Each customer is having an account address ( i.e Ethereum account). Basically this is a private blockchain. ...
0
votes
1answer
3k views

Solidity compiler command-line utility (solcjs) various problems

I am trying to compile a file using solcjs from a command-line, and running into various problems. First of all, I need to supply in the command-line all the files that are imported by the primary ...
2
votes
1answer
677 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 ...
2
votes
0answers
275 views

what does the UnimplementedFeatureError mean?

I'm getting the following error in remix.UnimplementedFeatureError: Non-padded store for function not implemented.
9
votes
1answer
886 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 ...
2
votes
2answers
399 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: ...
2
votes
1answer
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 ...
4
votes
1answer
626 views

solc.loadRemoteVersion is not a function error

I'm trying to load another version of solc using the following code var Web3 = require('web3'); var web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545")); var solc = require('solc'...
2
votes
0answers
108 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 ->...
6
votes
1answer
5k 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 ...
1
vote
1answer
67 views

Problem while retrieving from array

I have the following simple structure and array of that structure: struct Document { bytes32 ownerID; bytes32 documentID; bytes32 name; } Document[] public documents; I'...
0
votes
2answers
30 views

What's wrong in this mapping code?

Could someone please point out what is wrong in this code? It seems that when I call the registerClient() function, it succeeds and returns TRUE. But when I call the getRegisteredClients() method, it ...
18
votes
3answers
5k 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 ...
7
votes
2answers
4k 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
181 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
978 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
635 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
409 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>...
17
votes
2answers
3k 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
757 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
219 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
595 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(...
11
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?
1
vote
0answers
659 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
347 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
672 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
3k 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
32 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
953 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
797 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
164 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
34 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
387 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 ...
5
votes
1answer
386 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?
11
votes
1answer
9k 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-...
6
votes
2answers
784 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
417 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
903 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
873 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 ...
2
votes
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
400 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 ...