Questions tagged [solc]

Questions related to the compiler for Solidity: solc

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

How do I install Go-ethereum and solidity on Debian10

I am using debain on wsl and I want to install ethereum and solidity for blockchain development but I am not able to find an exact way to do it.
0
votes
0answers
14 views

Solc Compiler related Error in Nodejs

I have almost 800 .solc files of version ^0.5.12 (i am using also 0.5.13 compiler version), when i all give them to my input, to compile with following code; var walk = function (dir) { var ...
0
votes
1answer
33 views

what is 'UnimplementedFeatureError: Not yet implemented - FixedPointType' error?

what is 'UnimplementedFeatureError: Not yet implemented - FixedPointType' error in solidity while compiling through truffle ? How to fix it ? Using solidity compiler version - 0.5.9
0
votes
1answer
34 views

Why does solc output bytecode that is not in valid hex format?

I compile my solidity file using the following command: solc Encoder.sol --bin --abi --optimize -o <output_dir>/ Then I try to deploy it in Geth: Encoder = eth.contract([<abi file content&...
0
votes
0answers
11 views

What is EVM15 as a Solidity output target?

In the Solidity compiler help menu solc --help, I noticed that evm15 is one of the new compilation targets in addition to evm and ewasm. I know what ewasm stands for, but what's the difference between ...
1
vote
1answer
11 views

How to type cast fixed size byte arrays in solc 0.5.x?

In solc 0.4.28 I was able to do: uint foo = 42; bytes28 bar = bytes28(foo); but in 0.5.9 I'm getting the error: TypeError: Explicit type conversion not allowed from "uint256" to "bytes28". ...
0
votes
1answer
11 views

BrowserSolc not defined

I'm trying to use BrowserSolc in my dApp, but it's just not loading, it seems. I've got browser-solc.min.js in the same folder as index.html, with the following near the top of the page: <script ...
3
votes
1answer
55 views

What are remappings and how do they work in solidity?

How can they be used with solc?
1
vote
0answers
47 views

Cannot execute contract in non-intaractive scripts

I want to deploy and to execute ERC-20 contract on geth with non-interactive scripts. But, it seems that non-interactive scripts and console shows different results. Enviroment ubuntu 18.04(docker ...
0
votes
1answer
58 views

VS code Expected identifier, got 'LParen'solc

I keep getting this error/warning on my vscode when I emit events and build constructors. or After a bit of googling I understand it is something about my compiler, since solc <0.4.18 does not ...
0
votes
0answers
78 views

Solidity Error: Cannot destructure property `interface` of 'undefined' or 'null'

I've got his error in Solidity when compiling my test file: TypeError: Cannot destructure property interface of 'undefined' or 'null'. I know it is related to my compile.js file, but what is ...
1
vote
0answers
46 views

How to achieve inheritance support using web3j wrapper?

I have two types of smart contracts. One parent contract to store the type and other child contracts which inherits the parent contract. The problem is, I can't generate java wrapper class (...
3
votes
2answers
146 views

Using two solc versions within the same truffle project

I am creating an app that has various imports that require two different versions of solidity. AragonOS(0.4.x) and openzeppelin(0.5.x) Of course, there are breaking changes in 0.5.x so my question is ...
0
votes
2answers
43 views

Store/retrieve data doesn't work using node

i trying something simple, store and retrieve a data in a smart contract, but when i want to retrieve the data, nothing is returned. solc version is 0.4.24 web3 version is 1.2 Solidity code: pragma ...
1
vote
0answers
161 views

Cannot read property 'type' of undefined - abi-coder

I'm creating a simple voting contract. It is deployed with truffle and infura. This is the contract code: pragma solidity >=0.4.21 <0.6.0; contract Voter { struct OptionPos { uint ...
0
votes
1answer
37 views
0
votes
0answers
28 views

compile_files gives errror for given path of the contract [duplicate]

pragma solidity ^0.5.1; import "./Owned.sol"; contract Greeter is Owned { bytes32 public greeting; event GreetingChange ( address indexed changer, bytes32 indexed _from, ...
1
vote
0answers
31 views

Gas usage difference between Remix and Ganache/public networks

I'm trying to integrate a contract into a front end with MetaMask and getting different gas amounts depending on the network and compile options I use. Remix ("Enable Optimization" checked): 90,410 ...
1
vote
1answer
81 views

How to call a contract function that alters blockchain state on geth console

It should be easy, but I'm having a hard time using a simple smart contract described in the Solidity language reference called SimpleStorage. It only as one attribute, a setter and a getter, and I'm ...
2
votes
1answer
81 views

solcx compile_files Key error

I am using python package py-solc-x for compiling the smart contract. os.path.abspath("D:/new.sol") Gives path where my test contract exits. 'D:\\new.sol' Then i use compile_files to compile the ...
0
votes
0answers
70 views

Why am I getting the error "Expected pragma, import directive or contract/interface/library definition?

I have "pragma solidity ^0.5.9" at the start of the file yet I still get this error. Listing.sol:1:1: ParserError: Expected pragma, import directive or contract/interface/library definition. ...
0
votes
1answer
50 views

extract address of used library

Is there anyway or method to extract the address of a linked library from the contract bytecode (not a verified contract code) or deployment transaction? my question is about step 3: step 1. ...
0
votes
0answers
91 views

Solc complier error “TypeError: Cannot read property 'TestToken.sol' of undefined”

I set up a contract with three files referring to Token Factory. I make a test on remix online tool, they can be successfully compiled. when I'm tring to compile them by solc module in a .js file, ...
1
vote
2answers
239 views

Can't deploy contract with web3.js and ganache-cli

I'm using the solc module to compile a Solidity contract. The compilation step looks to be working correctly, however, when I attempt to deploy the contract to the Ganache network (in a Mocha test), ...
1
vote
0answers
90 views

Importing .sol files from an node_modules folder

Did i miss something in configuration, or will this be fixed in an future version? Best regards # ls -al Makefile README.md build cmd contracts node_modules package.json # ls -al ./contracts Wallet....
1
vote
0answers
23 views

What is the value range of the parameter optimize-runs when running the solidity compiler?

I would like to know what the allowed value range of the parameter optimize-runs is when running the Solidity compiler. I didn't find the answer in the official document of Solidity.
2
votes
0answers
32 views

How to verify a contract in etherscan older than 0.4.11?

It seems that the verification feature of Etherscan supports contracts written since Solidity 0.4.11. I want to verify a contract written with Solidity 0.4.8. Is this possible? I'm wondering if this ...
0
votes
0answers
78 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 ...
1
vote
1answer
44 views

Why is the data from remix different from that from my computer when compiling the same contract using the same version of solidity complier? [closed]

I downloaded the 0.5.7+commit.6da8b019 version of solidity compiler, compiled an ERC20 contract locally using the compiler, and got the binary data. Then I also copied the ERC20 contract and pasted it ...
0
votes
1answer
58 views

Gas is 0 when executing CALL opcode?

I wrote a very simple smart contract like this: contract Test{ function test1(address payable addr, uint256 value) payable public { addr.transfer(value); } } And I compiled it using ...
0
votes
2answers
408 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 │ ...
2
votes
2answers
368 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 ...
3
votes
1answer
648 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 (...
1
vote
3answers
113 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
69 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
108 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
25 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
124 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
183 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
2answers
126 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/...
0
votes
2answers
127 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
45 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
71 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
460 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
656 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 ...
2
votes
1answer
74 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
191 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
243 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
377 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 ...