Questions tagged [compilation]

For questions regarding contracts compilation.

Filter by
Sorted by
Tagged with
0
votes
0answers
37 views

remix compiler just won't end compiling

I've just started my journy with etherium, so now I am trying to get my first script complied. I tried starting with this project https://github.com/san-lee-ai/simple_auction But I could not get the ...
0
votes
0answers
26 views

Contract can't import remote repository locally

I made a compiler script that takes all contracts in folder ./contracts/ and produces a .json for each contract, containing an ABI and Bytecode. This worked fine for a while. However, I added some ...
0
votes
0answers
12 views

TypeError: Function overload clash during conversion to external types for arguments

Why do I get following error "TypeError: Function overload clash during conversion to external types for arguments." when using compiler version ^0.5.0; but when I choose 0.5.2; and later releases ...
1
vote
1answer
43 views

Can I deploy smart contract written in an older version of solidity ? If yes how to recognize it in EVM?

If I can compile a smart-contract written in an older version say 0.1.3, can I still deploy it? If I can, is there a way to look at EVM bytecode and tell that this smart contract is written with an ...
2
votes
1answer
111 views

Status of ABIEncoderV2 now

Do you know the current status of ABIEncoderV2? I want to know the current status of ABIEncoderV2 Live projects using ABIEncoderV2 right now Restriction on the normal encoder Risks of using ...
0
votes
1answer
39 views

#pragma compilation Error [duplicate]

pragma solidity ^0.4.0; contract test { event test_value(uint256 indexed value1); uint256 value_test; function test_f() { //value_test processing test_value(value_test)...
0
votes
0answers
37 views

Compile solidity smart contract using compiler version provided in the contract

I have been using solc-js in javascript to compile .sol contracts. However, many old smart contracts use older compiler versions that are specified using pragma in the smart contract source code. How ...
1
vote
2answers
47 views

Get values from stack when certain Opcode is called

I am currently trying to use genetic algorithms to automatically generate test cases that for ethereum smart contracts similar to https://ieeexplore.ieee.org/abstract/document/7840029>this paper. In ...
0
votes
0answers
74 views

Compile two .sol file with solc

I'm trying to compile two different sol file with 1 smart contract each and output the compiled code of each one in two different json file. But when i run the code the .json file return empty, i dont ...
0
votes
2answers
121 views

Error while compiling Solidity code via py-solc

I am getting the following error while attempting to compile Solidity code via py-solc. Is it due to a new update of py-solc? how can I fix it? >>> from . import views File "/home/manzik/...
2
votes
1answer
285 views

How to compile Solidity ^0.5.5 contract with Node.js?

I am terribly new in Solidity and now I try to learn how to compile a contract in Solidity ^0.5.5 (No versions below). I have the contract as follow (UsersContract.sol) pragma solidity ^0.5.5; ...
0
votes
1answer
459 views

Invalid implicit conversion from address to address payable requested

first of all really nice to find this forum, I'm starting coding Solidity. Here the problem I get compiling a template of crowdsale smart contract ExampleTokenCrowdsale.sol, from this tutorial. The ...
0
votes
0answers
16 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 ...
0
votes
1answer
44 views

how to change approveAndCall() function for upgraded compiler version of solidity 0.5.1 from 0.4.6?

Here is the code snipped which is used when I'am working with compiler version 0.4.6 : function approveAndCall(address _spender, uint256 _value, bytes memory _extraData) public returns (bool success) ...
0
votes
2answers
354 views

Solidity ,Member“transfer”Not found or not visible after argument dependent lookup in address

pragma solidity ^0.4.11; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user ...
1
vote
2answers
1k views

Unable to run truffle compile

I want to run truffle compile on my AWS Ubuntu 18.4 server. I'm able to compile the same contracts on my local with no compilation errors but when I tried to run truffle compile on AWS ubuntu server ...
1
vote
0answers
76 views

My code compiles on remix.ethereum.org but not on etherscan.io please help! [closed]

I get this error " ParserError: Function, variable, struct or modifier declaration expected. function transferFrom(address _from, address _to, uint _value) public returns (bool) ^ " everytime ...
1
vote
1answer
58 views

How come npmjs website shows that Truffle latest version is 4.1.14, and that it was published 3 days ago?

According to this page, Truffle latest version is 4.1.14, and it was published 3 days ago. However: I have been using this version for months now. I have noticed this "published 3 days ago" several ...
7
votes
1answer
177 views

When did the Ethereum “free memory pointer” change? (6060… -> 6080…)

I have been digging a bit deeper into the Ethereum bytecode with the specific goal to do contract verification from the source code. I noticed, while doing some tests, that the initial bytes of the ...
2
votes
1answer
546 views

Remix is compiling the smart contract but not solc command

I am able to successfully compile a smart contract in remix IDE. However when I try to do the same with solc npm command, it shows a JSON error when compiling. Voting.sol pragma solidity ^0.4.25; ...
1
vote
1answer
213 views

Solidity: Function with same name but different parameter possible? [duplicate]

Will the contract auto detect wether I am calling the function with or without parameter? pragma solidity 0.4.25; contract A{ function test() public{ //do something } function ...
1
vote
1answer
103 views

Discrepancy in Solidity compiler output for Remix and offline (same version, same code)

I'm compiling the following contract locally and on Remix and getting two different bytecode results. Contract pragma solidity ^0.4.25; contract ReadBool { bool public flag; function ...
2
votes
1answer
58 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] ...
1
vote
0answers
56 views

Error on contract constructor - CompilerError: Stack too deep, try removing local variables [duplicate]

I have the following constructor on a contract: constructor( string name, string symbol, uint8 tokenResolution, string defaultUnderlying, uint maturityTimestamp, uint rate, ...
0
votes
2answers
335 views

Remix warning - Is constant but potentially should not be.

I am getting the warning on the code shown below. Could you please assist me know to resolve this warning ? warning message - "Is constant but potentially should not be"
1
vote
0answers
21 views

Manually configure EVM Assembly Tag

I have read that Ethereum during the compilation splits the code into tags. The solc optimizer doesn’t optimize across tags. If we consider “1+1”, it can be optimized to 0x2 if under the same tag: /...
1
vote
0answers
28 views

Compiling from remix onto geth console

I found how to deploy a contract onto MEW, but I do not understand, partially due to meta references and missing/assumed knowledge. I'm just looking from help on a walk through. I'm including the ...
0
votes
1answer
485 views

Error compiling OpenZeppelin imported contracts

I'm running a truffle project and have imported OpenZeppelin contracts. While running truffle compile I'm facing following error: github.com/OpenZeppelin/openzeppelin-solidity/contracts/crowdsale/...
0
votes
1answer
52 views

Sending contract's source code to deployed contract in order to deploy it

I am writing a factory contract in solidity. I want to be able to add some more contracts to be deployed by the factory after it has been deployed. I thought sending the contract's source code to my ...
2
votes
1answer
87 views

Can't use constructor() when deploying a contract from ethereum wallet

Take the following code: pragma solidity 0.4.24; contract TestCoin { mapping(address => uint256) public balanceOf; uint256 public totalSupply; constructor(uint256 initialSupply) ...
3
votes
1answer
111 views

v0.4.22 solc compile failing - not predictable behavior

Error: Warning: Defining constructors as functions with the same name as the contract is deprecated. Use "constructor(...) { ... }" instead. function CappedCrowdsale(uint256 _cap) public { ^ (...
1
vote
2answers
832 views

Solidity Compiler - Error: Identifier already declared

Full source code of the file 'Test.sol' : pragma solidity ^0.4.23; contract Mortal{ address owner; string ownerInfo = "Contract Owner name XYZ"; constructor () public { owner =...
2
votes
1answer
226 views

solc producing different contract binary depending on OS

I have a Linux, and another person has a Mac. We have the same solc compiler version, except for the OS extension (I have 0.4.24+commit.e67f0147.Linux.g++, they have 0.4.24+commit.e67f0147.Darwin....
0
votes
2answers
138 views

How do I find out what compiler version was used to deploy with MyEtherWallet

If I deploy a contract on MyEtherWallet.com how can I find out what compiler version was used, for verifying the code on etherscan, etc.?
0
votes
1answer
316 views

Deploying a smart contract with several solidity files

I have a contract contains 4 .sol files and when I generate its bytecode and api as follows: > solc --bin GreenToken.sol > solc --abi GreenToken.sol I receive: ======= BasicToken.sol:...
1
vote
1answer
44 views

Use shared library type in contracts

I want to reuse on type DateRange in two contracts. However, I fail with multiple errors. Currently I have one error: G21FE98E9 Member "endTicks" not found or not visible after argument-dependent ...
0
votes
0answers
350 views

Solcjs doesn't use the last version of compiler

I am compiling a contract using the npm package solcjs. The package is at version 0.4.21 (npm view solc). However compilation fails because my pragma is set to ^0.4.21 while solcjs states current ...
4
votes
1answer
246 views

Difference between unoptimized and optimized solidity code

I am trying to find a source on what the difference is between optimized and unoptimized code. My main question is what the unoptimized compiler does, especially in the sense of calling the SSTORE ...
0
votes
0answers
55 views

Automatically deploy a contract with generated Web3js code

I want a command line tool which having only contract source would automatically not only compile it but also automatically create the JS code which can deploy the contract through Web3.js (using user ...
1
vote
0answers
67 views

About using Solidity optimization

It is a well known fact that in optimizing mode compilers usually have more bugs than in non-optimizing mode. As such, do you recommend to use the Solidity compiler with or without optimization? My ...
0
votes
2answers
140 views

How would I best resolve this specific type of 'Unused local variable' warning?

I have a function which returns multiple values. In some places I use all of them, while in other places I use only some of them. This short snippet can illustrate the problem: contract A { ...
3
votes
1answer
236 views

How to use evm compile?

I have been testing with evm and I am not getting any output. Code - pragma solidity ^0.4.18; contract d8 { function myBalance() pure public returns (uint) { return 880; } } My ...
5
votes
1answer
216 views

Why does inserting a Struct cost 5,000 extra gas per item in the Struct?

Related to the findings in: Solidity bool size in Structs Why does inserting a Struct cause an increase of 5,000 gas per item in the Struct? For example: // A Struct that, when tightly packed, is ...
3
votes
0answers
156 views

What's the difference between unlinked_binary and bytecode?

I have two different projects. In one, the build/token.json file contains an unlinked_binary field. In the other, there's no unlinked_binary, but there's bytecode. What's the difference between the ...
2
votes
0answers
80 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
637 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
120 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
747 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
61 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
498 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 ...