Stack Exchange Network

Stack Exchange network consists of 175 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

0
votes
2answers
23 views

Solc error invalid opcode, but works in truffle

I am trying to compile solidity code in solc(nodejs) but unsuccessful so far. I have created a sample app for demo. Here is sample's directory structure (node.js and truffle combined): │ app.js │ ...
0
votes
1answer
39 views

invalid opcode “0x1c” during smart contract method execution

I have written a smart contract to test event from java project using web3j I have prepared the web3j wrapper java class using solc compiler version "0.5.7+commit.6da8b019.Linux.g++" I am using a ...
1
vote
0answers
47 views

Timeout exceeded during the transaction confirmation process

I am trying to figure out the right syntax for solc 0.5.7 and web3 1 beta 52 Follow my source code: contract.sol pragma solidity ^0.5; contract Hello { string public message; constructor (...
0
votes
3answers
31 views

Truffle and Remix compiles differently

I have a smart contract that outputs a different bytecode when compiled with truffle, and with remix, even though both seem to use the same compiler version: 0.5.7+commit.6da8b019 Is that a known ...
0
votes
1answer
34 views

I have written a javascript code for compiling the solidity code but it's showing error

I was trying to compile my contract using solc compiler but it returning me some errors. I will place my solidity code along with the error that I am getting here. Please help me out to sort this ...
1
vote
1answer
58 views

Cannot deploy contract

I'm having difficulty deploying a solc-compiled contract to ganache test network using web3. package.json { "name": "smartinvoice", "version": "1.0.0", "description": "", "main": "index.js", ...
0
votes
1answer
15 views

Deploy.js script is inifinite, does not show any errors

This is the deploy.js file: const assert = require('assert'); const HDWalletProvider = require('truffle-hdwallet-provider'); const Web3 = require('web3'); const cF =...
1
vote
1answer
37 views

Solc: Build from source code failed. Error: ‘mod’ is not a member of ‘z3’

I tried to build solidity compiler (solc) from source code, which was cloned from Solidity Git Repository. I followed the instructions in Solidity Documentation, but I ran into an error when execute: ...
1
vote
1answer
41 views

HDWalletProvider & truffleconfig: 'truffle migrate' will compile but not do anything else

I am trying to build a React app with Truffle. Firstly, my file structure is like so, with root_dir being the project root directory: root_dir/node_modules/src/libs/truffle All of truffle's files, ...
0
votes
0answers
36 views

I am getting solc error while compiling solidity code via py-solc. Is it due tonew update of py-solc ? how to fix it?

from . import views File "/home/manzik/Desktop/Ethereum Voting/voting/home/views.py", line 5, in import commission.views as comm File "/home/manzik/Desktop/Ethereum Voting/voting/commission/...
0
votes
2answers
33 views

No such file or directory: 'solc': 'solc'

I have been trying to follow the following tutorial [https://github.com/adamyala/Your_First_Decentralized_Application_Python] But the following error occurs: I have followed all the steps in ...
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
0answers
16 views

solc command is generating empty .bin files

Firstly, this is not an inheritance problem like in this post I have the following two files ( ManagedWallet.sol & ManagedWalletLookup.sol ) pragma solidity ^0.4.24; contract ...
2
votes
0answers
38 views

Why truffle deploy fail with address value=0 after I upgrade to version 5.0.5?

I have a truffle 2_deploy_contracts.js something like this : const sample = artifacts.require('./Sample.sol'); module.exports = function(deployer) { deployer .then(()=>deployer.deploy(...
1
vote
1answer
140 views

How to compile solidity files in nodejs using solc@0.5.4? [duplicate]

I am using node@10.14.2 and solc@0.5.4 to compile solidity files using the following code: var solc = require('solc'); var input = { language: 'Solidity', sources: { 'Bon.sol':{ content:...
1
vote
2answers
153 views

Unable to get abi and bytecode when compiling using solc

I am new to solidity and am following a tutorial that uses solidity compiler version 0.4.25. In the tutorial, solc.compile is used in a compile.js file followed by extract abi and bytecode and ...
3
votes
1answer
33 views

UnimplementedFeatureError: Only byte arrays can be encoded from calldata currently

I received the error message UnimplementedFeatureError: Only byte arrays can be encoded from calldata currently from the compiler, but without any reference to a file or line. In a big project, and ...
2
votes
1answer
73 views

What is the behavior of solc with optimizer disabled?

When enabling the optimizer the documentation of solc tells you that you can choose between optimizing the gas cost at deployment or the gas cost at execution by setting the runs parameter. But what ...
1
vote
1answer
125 views

Importing in SOLC to deploy smart contract

I don't run an Ethereum framework like Truffle and I want to deploy a smart contract using infura node. The smart contract is very simple: pragma solidity ^0.5.2; import "http://github.com/...
0
votes
1answer
187 views

Upgrading to solidity version 0.5.0 getting deployment failed error with same smartcontract perfectly deployed on 0.4.24

The same smart contract is running smoothly in solidity version 0.4.24 but now when I update the solidity version and solving a lot of bugs inside my smart contract I intended to deploy that in ...
0
votes
0answers
33 views

Why the same contract has more bytecode size in solidity 0.5 in compare to 0.4.24?

My earlier contract was compatible with solc@0.4.24. Now I am upgrading my contract to make it compatible with solidity 0.5 but it leads to an increase in bytecode size. AFAICT There is no change in ...
1
vote
1answer
333 views

Switch solc compiler versions

I have solc v0.5.2 on my system, but I have several contracts, that require solc < v0.5, so that I get errors: Error: Source file requires different compiler version What is the best way to run ...
1
vote
0answers
12 views

Compile Solidity on openbsd

i have tried several branches and all fails, has anyone got this working on openbsd? an issue has been created on github about this aswell https://github.com/ethereum/solidity/issues/5728
0
votes
0answers
30 views

solc/wrapper not working with reactjs

My compile.js code: var wrapper = require('solc/wrapper') var solc = wrapper(window.Module) const Compile = (code,name) => { return solc.compile(code, 1).contracts[':'+name]; }; export default ...
0
votes
1answer
338 views

Not able to get rid of error from solc-js “AssertionError [ERR_ASSERTION]: Invalid callback specified.”

const path=require('path'); const fs=require('fs'); const solc=require('solc'); const InboxPath=path.resolve(__dirname,'contracts','Inbox.sol'); const source=fs.readFileSync(InboxPath,'utf8'); solc....
2
votes
1answer
181 views

Solc compile contracts with 5.0.0 [duplicate]

I was following this guide for compiling my contracts How To: Compile a Solidity Smart Contract Using Node.js but "solc.compile(input, 1)" is not working anymore. I have problems understanding how to ...
1
vote
0answers
23 views

Web3JS throws InvalidResponse without Ganache core ever receiving a request?

Versions: Ubuntu 18.04 LTS Node.JS: 8.3.0 WebJS: web3: ^1.0.0-beta.37 web3-utils: ^1.0.0-beta.36 npm: 5.6.0 Truffle version 5.x (latest) I have traced through the HttpProvider code in the Web3 ...
1
vote
1answer
85 views

“Cannot import url”, “File outside of allowed directories” using --standard-json

I'm trying to understand how to use solidity's JSON input-output API. Here's my json file; { "language": "Solidity", "sources": { "StandardToken.sol": { "urls": [ "file:///home/...
1
vote
1answer
134 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 ...
2
votes
2answers
359 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. ...
2
votes
1answer
27 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 ...
3
votes
1answer
37 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 ...
2
votes
1answer
573 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
383 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
52 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 ...
1
vote
1answer
677 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, ...
8
votes
1answer
126 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
70 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://...
2
votes
1answer
841 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
142 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
78 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
188 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
18 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
145 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
35 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
423 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
249 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
85 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
269 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 ...