Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [solc]

Questions related to the compiler for Solidity: solc

1
vote
1answer
57 views

Recently upgraded Solc and Web3. Transactions with zero addresses now reverting with “invalid address” message?

I recently upgraded Web3JS and Solc. Now every time I pass a zero address to a Solidity contact method the transaction reverts with an "invalid address" message. This message appears to be coming ...
1
vote
1answer
25 views

Error when calling the selfdistruct method in solidity

I am quite new to solidity, and I have not managed to find a solution for this problem. I am passing the function an address but it says the following: "Invalid type for argument in function call. ...
0
votes
0answers
25 views

How to compile solidity using solc on docker compose?

I am currently dockerizing my Blockchain nodejs application. So prior to launching the application, Solidity files has to be compiled. my dockercompose.yml file looks like version: '3' services: ...
1
vote
1answer
22 views

What about calls you can do safely in constructor?

As a matter of fact, there is more than one discussion about what are the call you can safely do in the constructor. Someone thinks “avoid all external call”, some other says “avoid to use ‘this’ or ...
2
votes
0answers
23 views

SOLIDITY: is anywhere formalized the assignment operator behaviour in nested statements?

As a matter of fact, solidity seems to have same behaviour of C in nested assignment. I.e. running the sample test contract below, calling nestedSum(1) results in the following: a=38, b=16, c=4 ...
0
votes
1answer
148 views

I got error when npm install -g solc [closed]

I got error when try to install solc using npm install -g solc here is the error: erfans-MacBook-Pro:01 erfanandesta$ npm uninstall -g solc npm WARN checkPermissions Missing write access to /usr/...
1
vote
1answer
33 views

How to access string arguments from calldata in external functions? (0.5.X)

With the introduction of Solc 0.5.X , parameter memory locations for arrays (and strings/bytes) must be made explicit. For external functions, this memory location is required to be specified as ...
1
vote
1answer
35 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 ...
0
votes
0answers
112 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, ...
6
votes
1answer
65 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 ...
3
votes
1answer
46 views

How to match the etherscan.io bytecode using the solc compiler?

Trying to do some simple sanity checks between the verified contracts on etherscan.io and the bytecode available on the blockchain for those contracts. I picked a random contract to test: https://...
1
vote
1answer
191 views

truffle compile with solc 5.0.0 error: solc.compileStandard is not a function [duplicate]

Trying to use Solidity v0.5.0 with Truffle. Starting v5.0.0 Truffle allows setting solc version in truffle.js, as per its docs I tried both native compilers: { solc: { ...
4
votes
2answers
63 views

Do intermediate memory variables cost gas?

Example without an intermediate variable: uint startTime = 9; uint allowedTime = 7; require(now > startTime + allowedTime); Example with an intermediate variable: uint startTime = 9; uint ...
2
votes
1answer
55 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] ...
0
votes
0answers
39 views

How to compile solidity in the browser without using browser-solc?

I am thinking of implementing an API call to compile some source code entered by a user and then return the bytecode for deployment using metamask. I have tried browser-solc but it had some errors ...
1
vote
1answer
103 views

How can we compile multiple smart contracts by compile.js file?

My compile.js file is below const path = require('path'); const fs = require('fs'); const solc = require('solc'); const ballotPath = path.resolve(__dirname, 'contracts', 'blocktitans_ballot.sol'); ...
1
vote
0answers
17 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
2answers
91 views

How to compile and deploy smart contracts programmatically with Infura in NodeJs

I understand that i will need to be able to unlock my account in web3 to be able to deploy smart contracts. It's all good except i'm using Infura's hosted network instead which prevents me from ...
2
votes
1answer
34 views

Why solc does not detect issue in this code?

I wrote a sample Solidity code below: in function call() of contract sample_call, I make a call to function add_car() function of another contract sample, but this is a bug, since variable v is never ...
0
votes
1answer
188 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 ...
1
vote
1answer
173 views

warning about security/enforce-explicit-visibility: No visibility specified explicitly for multiply function [duplicate]

my ide is vs(can find solc version is 0.4.17),but my solcjs is 0.4.24.when I run this simple code `pragma solidity^ 0.4.45; contract test{ function multiply(uint a) constant returns(uint d){ ...
1
vote
1answer
61 views

What is the “clone-bin” output in solc?

When it comes to bytecode solc has three types of outputs: --bin Binary of the contracts in hex. --bin-runtime Binary of the runtime part of the contracts in hex. --clone-bin ...
1
vote
1answer
205 views

Compile multiple contracts

When compiling a .sol file that contains multiple contracts you get multiple binaries. How do I know which one belongs to the root contract? For example looking at etherdelta contract code I can see ...
0
votes
0answers
23 views

Cannot mint when creating contract in Ropsten nor in Remix

Code: https://gitlab.com/snippets/1730722 After I compiled the code using solc I embedded the ABI and the binary data. I instantiated the contract and I'm able to call for example the owner or the ...
0
votes
1answer
26 views

Solidity says my function can by marked as view but my code changes state?

Given the code below, when I compile the code with Remix it says the function processBandPayments() can be marked as view. This concerns me greatly since in my mind, the code is changing state by ...
0
votes
0answers
31 views

solc compiles same contract to different binaries

I'm running solidity compiler over some solidity file to get the binary. I'm running solc once via command line and once via java app that runs solc process. I get 2 binaries at the same length but ...
0
votes
0answers
83 views

Transaction remains pending on RINKEBY network

var Web3 = require('web3'); var Tx = require('ethereumjs-tx'); const fs = require('fs'); const solc = require('solc'); const generateWallet = require('ethereumjs-wallet'); var toAccount = 'TO ACCOUNT';...
0
votes
1answer
41 views

CONNECTION to Rinkeby showing false, contract not getting Deployed

SOURCE CODE var Web3 = require('web3'); var Tx = require('ethereumjs-tx'); const fs = require('fs'); const solc = require('solc'); var web3 = new Web3(); web3.setProvider(new web3.providers....
0
votes
1answer
90 views

How to identify the bytecode of a single function

I am trying to generate the bytecode for a single function. I need to avoid any setup/teardown that may occur in the contract as I am trying to get a precise measurement of the execution time in the ...
0
votes
0answers
125 views

solc: unrecognised option '--add-std' message during loadScript() call

I'm installing a Quorum example using instructions from this page: quorum-docker-Nnodes. ...Using these versions of geth and solc on Ubuntu 16.04.. geth Version: 1.8.10-stable-eae63c51 solc Version:...
3
votes
1answer
58 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
307 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
129 views

what's the “Contract Creation Code” in Etherscan Verfied Contract?

what's the difference between "Contract Creation Code" in Etherscan Verfied Contract and the bytecode compiled by Solc?
1
vote
1answer
145 views

Why is my transaction not visible on ropsten.etherscan

I am testing a contract on a Ropsten network using geth 1.8.8 with command line: geth --testnet --datadir="" In order to connect to geth I use web3js version 1, beta 34 running from node.js. ...
0
votes
0answers
20 views

Does the solC compiler work in the geth Javascript console anymore

does the solC compiler work in the javascript console anymore, and if it does how can I install it. I have tried using the compiler methods in the javascript console api however they do not work and ...
0
votes
0answers
52 views

Solc compatibility with various versions of Geth

I'm looking for information about what minimal version of solc is compatible with geth, including older versions of geth (1.6+).
2
votes
1answer
115 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....
-1
votes
1answer
136 views

How can I compile my smart contract from an API using solc?

I want to compile my solidity code (smart contract) inside my node.js API using the solc library to get the ABI and bytecode of my solidity. What I want in details is an input that can read solidity ...
1
vote
0answers
26 views

txList.length returns different value for different Solidity versions

I have RLPReader smart contract, took it from here. And I have a function untouched for a while: function deposit(bytes txBytes) public pure returns (uint) { RLP.RLPItem[] memory txList = ...
1
vote
1answer
39 views

Problems with binary generated by solc

I'm compiling a contract with solc and I'm getting something like this (I replaced most of the hexadecimal digits with three dots to make it shorter): 608060405234801561001057600080fd5b5060008054600.....
0
votes
1answer
140 views

Cannot verify a particular smart contract code on Etherscan with optimization enabled

I've already deployed many smart contracts to Ropsten testnet and successfully verified them in Etherscan, but today I encountered one contract which doesn't get verified through all my attempts. This ...
0
votes
1answer
234 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
2answers
239 views

Calling a function from a contract passed in as an argument

Im Trying to create a DAPP with two contracts generating assets. One is acting as the "factory" for the other contracts. From the latter I try to call a function in the factory without knowing its ...
1
vote
1answer
36 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 ...
1
vote
0answers
24 views

Linker not working on solc v0.4.23

I can't seem to make the linker.linkBytecode() method to work... Here's how I'm using it: const linkedBytecode = linker.linkBytecode(mainContract.bytecode, { 'UserLib': userLibContract....
2
votes
2answers
650 views

How to use Solidity solc to compile A.sol that imports B.sol file?

I know how to install solc via "npm install --save solc" then use solc.compile to compile one sol file. But now I've got A.sol file that imports B.sol file, and when I run node compile.js, no error in ...
0
votes
1answer
106 views

Solidity solc compiler error on code Remix can compile

I am attempting to compile the following solidity code using solc in NodeJS. pragma solidity ^0.4.11; contract helloWorld { string public message; function constructor() public{ message = "...
0
votes
1answer
220 views

Problem updating truffle framework

I have problems updating truffle. I run the command "truffle --version" and i got truffle version 4.0.1 and solc version 0.4.18. So i wanted to upgrade to 4.1.6 which is the latest version. I run "...
1
vote
1answer
78 views

What is ethereum bytecode link references is?

I compiled contract from there and found some strange things in bytecode: <some_bytecode>...__CrowdsaleTokenExt:SafeMathLibExt______6366098d4f9091836000604051...<some-bytecode> As I ...
0
votes
0answers
95 views

How to use solc-js with Jest?

I can't compile solidity code in my Jest files, but without Jest it works fine. Here is a test file: const fs = require("fs") const solc = require("solc") describe("test", () => { test("", () =...