Questions tagged [solc]

Questions related to the compiler for Solidity: solc

72 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
3
votes
0answers
219 views

solc unable to import scoped packages

I am trying to import these lines on solidity and compile it with solc import '@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol'; import '@uniswap/v2-periphery/contracts/interfaces/...
3
votes
0answers
173 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(...
3
votes
1answer
130 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 ...
2
votes
0answers
19 views

Solidity sourceMap and opcodes. No map entries for every code?

After compiling a simple contract, the output are these values: "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH1 0xF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP ...
2
votes
0answers
319 views

Error: project ID does not have access to archive state

I am coding a script to deploy smart contracts using python web3, and I came across this error when I ran the script: ValueError: {'message': 'Returned error: project ID does not have access to ...
2
votes
0answers
391 views

Conflicting solc versions on Truffle-test

I'm developing some smart contracts sing solc 0.7.0. I'm able to successfully compile and deploy the contracts, but when I try to run $truffle test I get the following error: Using network '...
2
votes
0answers
63 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
2answers
2k 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
2answers
602 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
1answer
1k 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
355 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
179 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
1k 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
179 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
275 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
107 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
1answer
115 views

SolcInstallationError: Downloaded binary would not execute, or returned unexpected output

I am attempting to do the 'brownie compile' but each time it processes I am provided with 'SolcInstallation Error' - Downloaded Library would not execute or returned unexpected output. I have gone ...
1
vote
0answers
49 views

Does solcjs replace solc? Is there a wrapper for the differences?

It at least appears to me that "solc" (the executable) doesn't exist anymore. Installing "solc" with nmp results in a command-line tool called solcjs ... fine, but they seem to ...
1
vote
0answers
34 views

How do I get solcjs to compile yul

I want to write a smart contract using pure Yul but I have no idea how I'm meant to configure / run solcjs to compile my yul code down to bytecode. Any pointers would be much appreciated.
1
vote
0answers
48 views

TypeError: Library functions must be implemented if declared for solc compiler version ^0.6.0 library implementation

Suppose I have the following code: // SPDX-License-Identifier: MIT pragma solidity >=0.4.21 <0.7.0; library SomeLib { function add(uint256 a, uint256 b) public returns(uint256); } contract ...
1
vote
0answers
298 views

Truffle compiler stuck at 0.4.17

Coming from here: How do I specify a different Solidity version in a Truffle contract? I still have the same issue, except that even after trying all of the suggested solutions, and even having the ...
1
vote
1answer
632 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
1
vote
0answers
59 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
70 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
542 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
215 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
831 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
140 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
219 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
32 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
59 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
158 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
29 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
151 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
29 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
50 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
1answer
196 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
0answers
114 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
62 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
605 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
659 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
34 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
0answers
15 views

JSON interface problem

I'm wondering why I still get "Error: You must provide the json interface of the contract when instantiating a contract object." I've tried plenty of solution from this community but they ...
0
votes
1answer
48 views

How to compile solidity docs for a particular compiler version

Im trying to run solc --userdoc --devdoc myContract.sol to generate docs. However, the compiler complains that the contract has a different pragma-version. In fact the contract pragma is at ^0.6.0 ...
0
votes
0answers
15 views

how much is the gas fee when forking uniswap with @openzeppelin/contracts?

I have tested it on remix , but in truffle is there anyway you can spend less? people have said it was 500 $ seems steep, if it's the truth is what i am curious of. has anyone successfully done it?
0
votes
1answer
40 views

Build with multiple solc versions?

My tokens and basic setup scripts are built in solidity 0.8.0 and I just downloaded GSN with OpenZeppelin because I need a platform which will fund users' few things. Now I can't compile because it ...
0
votes
1answer
20 views

Library placeholders does not appear in bytecode of compiled contracts - Solc

I have compiled my contracts with solc module for nodejs. These contracts import and use some libraries. But in the deployed bytecodes of the contracts, there are no placeholders for librairies used ...
0
votes
0answers
13 views

Does the Bytecode and ABI generated for each contract also include it's imports?

If not, how does a contract such as an ERC20 get deployed if each output has its own ABI and Binary file? When compiling with truffle, and looking at A.json (where A imports B and C) it seems that it ...
0
votes
1answer
51 views

I have a truffle version problem. and I've done it but it's not working

I've done npm install -g solc@0.4.16 and it reads solc@0.5.16 when doing the truffle version compilers: { solc: { version: "^0.4.26", // A version or constraint - Ex. "^0.5....
0
votes
1answer
145 views

Solc-js: error "before each" hook for "deploys a contract": ReferenceError: accounts is not defined

I have just started building contracts. Kindly help me in resolving this error. Attached image of error. Lottery/contract/Lottery.sol: pragma solidity ^0.4.17; contract Lottery{ address public ...