Questions tagged [compilation]

For questions regarding contracts compilation.

Filter by
Sorted by
Tagged with
2
votes
0answers
92 views

Too many variables with production contract [duplicate]

We have a contract that is in production already and has a getPerson() function. This is a public function that returns 12 uint256 values. We are attempting to call this function from another contract ...
0
votes
2answers
796 views

Compile error - Warning: Unused local variable

I am getting warning errors on a few variables such as deposit, totalpayment and duration which are necessary for taking payments from users. The error I am receiving is: Warning: Unused local ...
0
votes
0answers
121 views

How does the constructor turn your compiled contract into a deployed contract?

The input is: you just compiled a contract The output is: your contract is deployed How did your constructor get from A to B? And how is the state storage reserved which is associated with your ...
5
votes
4answers
848 views

I can't verify my contract on the Rinkeby etherscan site

I'm getting the following error when verifying on the RINKEBY etherscan site: Error! Unable to verify source code Exception #1 Occured: ERROR|The Contract solidity compilation has exceeded the ...
0
votes
1answer
78 views

TypeError at compile for public mapping of address ==> uint?

Maybe this is really obvious but for some reason I can't shake this error. At compile I get the following error: TypeError: Indexed expression has to be a type, mapping or array (is uint256) ...
0
votes
2answers
576 views

How to get an output similar to remix in solc, woth opcodes + comments from source

I would like to compile my contracts and to get an output with the opcodes in detail (not just assembly) but with references to the solidity source code at each line. This is the output one gets by ...
0
votes
1answer
546 views

How does solc generate the bytecode for a contract?

I got sick of using remix and copying-pasting my web3 deploy text so I'm trying to write a python script that will generate this deploy test for me. However, one of the fields in the instantiation ...
0
votes
1answer
100 views

Can I trust Solidity compiler to replace MOD with AND when possible

According to the EVM Gas Cost Yellow Paper (can be found here): The cost of % is 5 The cost of & is 3 When x is a power of 2, the expression a % x is equivalent to a & (x - 1). If x is a ...
0
votes
1answer
79 views

Compiling with outdated compiler

In my contracts I've been placing pragma solidity ^0.4.2; Without knowing my compiler is outdated at 0.4.16! Interestingly, all contracts still compile and are able to migrate to testrpc. Still, I ...
0
votes
1answer
38 views

Can't recompile old “Block King” solidity contract

I've been trying to compile and analyze the so-called "Block King" contract, which can be found on Etherscan. However, I can't find a way to run the compiler which is claimed to have produced the EVM ...
0
votes
1answer
74 views

LLL preprocessing/optimization issue

I have written a simple nested macro in LLL, but I can't get it to reduce to the simplest expression when calling the compiler with the optimization option. My macro looks like this: (def 'mcopy (pos ...
2
votes
2answers
2k views

unable to verify the contract on etherscan.io. How to resolve this issue?

I am unable to verify the contract in etherscan.io. I was able to deploy the same solidity code in (Geth, Mist). But the same code I am unable to verify in etherscan.io. What mistake am I doing here? ...
4
votes
1answer
185 views

How to disable 'Gas requirement not constant' warning in Solidity

I keep getting these warnings when compiling Solidity code: Gas requirement of function [...] unknown or not constant. I know that the gas requirement is not constant, and I've implemented a ...
1
vote
1answer
259 views

Generic remapping of “import” statements

I have vim setup to report solc errors while editing via syntastic. If I have the line: import 'zeppelin-solidity/contracts/token/StandardToken.sol'; I receive the error: Source "zeppelin-solidity/...
4
votes
2answers
783 views

Why and how does the “low security” functions affect the biggest multi signature contract?

People use this contract everyday http://github.com/ethereum/dapp-bin/blob/master/wallet/wallet.sol and it's also the contract with most ethereums right now. Also you can create a multisig account on ...
2
votes
0answers
131 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 ...
4
votes
2answers
675 views

totalSupply() Solidity signature causing conflict error

I'm writing a very basic ERC20 token using solidity in the Mist wallet. For some reason the compiler doesn't like the totalSupply() function name. If I change this name it compiles fine. To be ERC20 ...
0
votes
1answer
2k 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
0answers
584 views

On Ubuntu, I can't build sha3sum

I was following this article. When I saw that I've to have this keccak256-sum, I moved to this GitHub repo. But, when I am building it, it's giving below issue. $ make cc -Wall -Wextra -pedantic ...
2
votes
1answer
230 views

why is it not possible to install a solidity compiler in the geth console?

I've been trying every which way to install Solidity in my geth console- why? -because the outdated tutorials recommend to do that- and as a programmer you need to have the disposition of not ...
1
vote
1answer
284 views

What does this import code in solidity actually do? Where are the files located?

If MyCo.sol contract needs to access the Owned.sol contract, how is the file firing? Does the Owned.sol file have to be added to the blockchain prior to firing MyCo.sol; if so, does it just need to be ...
4
votes
3answers
2k views

Compiling contract in web3: “Method eth_compileSolidity not supported”

I have web3 and truffle running. I am able to execute the following commands: > node > Web3 = require('web3') > web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545")); >...
4
votes
2answers
2k 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 ...
0
votes
2answers
792 views

How would you install the Ethminer without sudo access?

I am trying to get Genoil's Ethminer installed on a machine without sudo access. The Github instructions require some packages to be installed. sudo apt-get install git cmake libcryptopp-dev ...
2
votes
1answer
2k views

Require in modifier: Undeclared identifier

curious why the require statement throws up Undeclared identifier in this solidity code: pragma solidity ^0.4.8; contract Escrow { .... modifier onlyafter(uint _time) { require(now >...
2
votes
1answer
574 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 ...
2
votes
1answer
4k views

Contract not Compiling: Undeclared identifier

I am just playing around on testnet w/ code snippets ... What am I doing wrong?
27
votes
6answers
15k views

How to compile Solidity contracts with Geth v1.6?

I tried to compile the following contract within geth: pragma solidity ^0.4.8; contract Test { uint256 public value; function Test() { value = 123; } } using the following ...
4
votes
2answers
343 views

Why is the jump address calculation so complex in compiled Solidity code?

I have the following simple Solidity contract: pragma solidity ^0.4.0; contract Test { function Test() { intfunc(5); } uint8 store; function intfunc (uint8 a) internal { ...
1
vote
0answers
241 views

Error: Invalid params when trying to deploy a contract which calls a library function

ecverify.sol // Written by Alex Beregszaszi (@axic), use it under the terms of the MIT license. pragma solidity ^0.4.2; library ECVerify { function safer_ecrecover(bytes32 hash, uint8 v, ...
3
votes
1answer
1k views

How are the arguments of the constructor encoded in the contract creation transaction?

The Ethereum ABI defines how arguments are encoded and passed when a method is called. But how are the arguments to the constructor encoded in the contract creation transaction which creates the smart ...
4
votes
2answers
621 views

What is the program counter at the start of an Ethereum method execution?

When a method in a deployed contract is called (either by an externally controlled account or by another smart contract), what will the program counter be at the beginning of the method call? In other ...
7
votes
1answer
834 views

Why does compiled solidity code do this check on the argument with which it was called?

I have compiled the following Solidity code: pragma solidity ^0.4.9; import "./Callee.sol"; contract Caller{ function call(address callee_address){ Callee callee = Callee(callee_address); ...
-1
votes
1answer
272 views

Stack too deep exception

I get this error when i try to compile my code: Internal compiler error: Stack too deep, try removing local variables. How could i get around this issue, I though the stack could be at least 16 ...
7
votes
2answers
2k views

Why does solidity compiled bytecode not match data for creating transaction?

I'm trying to independently verify the source code of solidity contracts, and stumbled across a case where the compiled bytecode for the source code of the contract does not match the data of the ...
2
votes
1answer
329 views

Solidity compiler

I've been having issues trying to get a solidity compiler in both my windows and linux clients. I've tried a few times - following instructions from answers from this community (some links are dead), ...
1
vote
0answers
30 views

Unable to deploy hello world ethereum contract [duplicate]

I am using this tutorial to create a hello world contract. I am on solidity 0.4.9, and I am trying to deploy the contract after compiling it. However, the compiled version is different. Here is the ...
8
votes
1answer
261 views

Could a contract, or parts of a contract, be reverse engineered from bytecode if the ABI was available?

Compilation back to the original source code from just the bytecode is impossible because all variable names, type names and even function names are removed. (source) It's possible to call functions ...
5
votes
4answers
2k views

web3.eth.compile.solidity doesn't compile

I am trying to deploy a contract through my front-end via web3 API. However nothing appear to compile and there is no contract address or ABI to interact with the deployed contract (if it is deployed) ...
4
votes
1answer
831 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,...
7
votes
1answer
165 views

Distinct, inconsistent compilation of inherited but identical contract in solidity

Consider the following solidity source file A.sol: pragma solidity ^0.4.8; contract A {} and B.sol: pragma solidity ^0.4.8; contract A {} contract B is A {} Using solc version 0.4.8, the code ...
3
votes
1answer
1k views

Compiling solidity code with geth+testrpc - Error: Invalid JSON RPC response

I'm attempting to compile the following contract using geth console attached to a testrpc instance: contract UnitCounter { mapping (address => uint256) public UnitsFrom; uint256 public ...
0
votes
1answer
160 views

How do I compile interdependent contracts separately in Mist?

I am working with this Solidity example, using geth console and/or Mist's compiler: contract InfoFeed { function info() payable returns (uint ret) { return 42; } } contract Consumer { InfoFeed ...
4
votes
1answer
3k views

returns (uint256) is not implicitly convertible to expected type uint256

I try to compile the following (in Solidity) ... contract InfoFeed { function info() payable returns (uint ret) { return 42; } } contract Consumer { uint attribut = 0; InfoFeed feed; ...
4
votes
1answer
331 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?
3
votes
1answer
220 views

Structure with 16 elements

I have created structure with 16 elements and received solidity compiler error. Exception during compilation: /src/libsolidity/../libevmasm/Instruction.h(217): Throw in function dev::solidity::...
2
votes
1answer
735 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
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 ...
2
votes
0answers
1k views

Building ethminer on Win7 using CMake & VS2015

I'm trying to build ethminer on a windows box and am Visual Studio 2015 fails. The steps that I take are the following: Download ethminer/cpp-ethereum and install dependencies using the command line ...
12
votes
1answer
2k views

Bytecode on block chain different from the one used when deploying

When I deploy a contract from node.js using the web3 JavaScript API (connected to a locally running geth), and then check the deployed bytecode using eth.getCode(address) (either from the JS console ...