We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [solc]

Questions related to the compiler for Solidity: solc

61 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
3
votes
1answer
243 views

Infinite gas estimate for empty contract

I am trying to deploy a contract with web3, and always get an error Error: exceeds block gas limit, even for correct or empty contract code. Actually, gasEstimates always throws : Error: gas required ...
2
votes
0answers
30 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 ...
2
votes
0answers
69 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(...
2
votes
1answer
273 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'); ...
2
votes
2answers
356 views

How to deploy a smart contract in a server?

I have developed a smart contract and compiled it with solc and bin and abi fils have been generated. Now, I want to deploy this contract using web3js in a linux server. How can I do it?
2
votes
0answers
471 views

Importing files from an “outside” folder

I am trying to import files from a relative path outside of my Truffle-project folder: import '../../../common/solidity/contracts/token/ERC20/BurnableToken.sol'; import '../../../common/solidity/...
2
votes
1answer
276 views

How can I use solc solidity compiler on truffle webpack?

When I try to import solc, it raises an error which says: ERROR in ./~/require-from-string/index.js Module not found: Error: Can't resolve 'module' in 'C:\users\bisrat\Desktop\webpacksample\...
2
votes
0answers
160 views

Reasons for and debugging a contract that failed when deploying into blockchain

I have a program that has been tested from remix's VM, and compiled with solc, in both cases without any failure. However, when I try to use a custom script for deploying it into the rinkeby testnet (...
2
votes
1answer
563 views

Truffle Bytecode Different from Etherscan Bytecode

I am having difficulty verifying my contract code on Etherscan using the code generated by Truffle. Using Etherscan VerifyContract V1: https://rinkeby.etherscan.io/verifyContract Truffle produced ...
2
votes
0answers
124 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 ...
2
votes
0answers
240 views

what does the UnimplementedFeatureError mean?

I'm getting the following error in remix.UnimplementedFeatureError: Non-padded store for function not implemented.
2
votes
0answers
101 views

Accepting Map or JSON in a constructor or method

I have a question: Can a Contract accept a HashMap kind of a data structure or some kind of a JSON structure of the following format in its Constructor? [ {key1 -> {val1, val2, val3}}, {key2 ->...
1
vote
0answers
46 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 ...
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 (...
1
vote
0answers
126 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 ...
1
vote
0answers
28 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 ...
1
vote
0answers
84 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.
1
vote
1answer
105 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", ...
1
vote
0answers
20 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
1
vote
0answers
39 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
0answers
109 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
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
117 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+).
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
0answers
40 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....
1
vote
0answers
153 views

verifying code deployed with web3.js

I am deploying my smart contracts using web3.js and compiling the code using solc. The contracts are deployed successfully with no issues however I am having a bit of a problem in verifying my ...
1
vote
1answer
75 views

Solidity standard library: how to contribute?

I'd like to contribute to Solidity standard library, which seems a bit feature-less. How can I do that? Is there are some agreements about Solidity standard lib like in c++? I have implemented some ...
1
vote
0answers
99 views

EVM Assembly tags

Studying the Solidity optimizer, I found that the assembly code is divided into tags and the optimizer doesn't work between them: It splits the sequence of instructions into basic blocks at JUMPs ...
1
vote
0answers
58 views

Where in the compile process do storage indexes get assigned to variable names and where can I sniff that data?

I have found the articles explaining how storage works and I understand that if I have a mapping that I need to know the key. What I'm trying to do is figure out how given, solidity code, abi, and ...
1
vote
0answers
577 views

How to query the blockchain data ?

I am developing an KYC dapp where I am keeping customer information like name, dob, age etc. Each customer is having an account address ( i.e Ethereum account). Basically this is a private blockchain. ...
1
vote
0answers
569 views

Why is the balance of the ethereum account still zero after I create a token based on the private chain I built?

0 down vote favorite I used the contract codes available on the ethereum official website,to create an advanced token on the private chain run in geth console. The version of geth is 1.5.5,and the ...
1
vote
0answers
29 views

How to change the compiler the mix-ide uses?

I have build the mix-ide from source, is there a way to change the solidity compiler it uses? I have tried to simply replace the solidity folder in the webumbrella directory with a new version but ...
0
votes
1answer
26 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
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 ...
0
votes
1answer
9 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 ...
0
votes
1answer
52 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
65 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 ...
0
votes
1answer
36 views
0
votes
0answers
62 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
0answers
76 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, ...
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
0answers
40 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
1answer
68 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 ...
0
votes
1answer
24 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 =...
0
votes
2answers
122 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
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 ...
0
votes
0answers
45 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 ...