Questions tagged [solc]

Questions related to the compiler for Solidity: solc

Filter by
Sorted by
Tagged with
2
votes
1answer
8 views

abi.decode() and unused variables

I am decoding bytes as the following: // Decode Solidity tightly packed arguments (uint8 _, uint128 stakeId, address behalf) = abi.decode(userData, (uint8, uint128, address)); // solhint-...
0
votes
0answers
19 views

How can I get the ABI from solc.compile? (^0.6.4)

In pragma solidity ^0.6.4; I wrote a contract and can get the byte code as follow: const solc = require("solc"); const path = require("path"); const fs = require("fs"); const inboxPath = path....
1
vote
1answer
15 views

How to pass constructor parameters to solc?

I'm trying to compile a Smart Contract to bytecode using solc. I'm on a Ubuntu VM so I have to rely on a simple-to-install cmd line application. Compilation works fine but it seems like I can't pass ...
0
votes
2answers
25 views

How to deploy multiple compiled solidity with web3?

So I have this codes const MultiSigWalletFactory = fs.readFileSync(path.resolve(__dirname, "MultiSigWalletFactory.sol"), "utf8"); const Factory = fs.readFileSync(path.resolve(__dirname, "Factory....
0
votes
2answers
15 views

Does solidity create unique outputs every time it compiles same exact code?

Is there any difference if I compile everytime I want to deploy another multisig wallet. Or I can just deploy another multisig wallet using the same compiled data?
1
vote
1answer
36 views

converting keccak from old version: pragma solidity 0.4.19; [duplicate]

I am trying to compile following code: pragma solidity 0.5.9; contract test{ //https://github.com/ethereum/solidity/issues/3469 address payable owner; mapping (address => bool) pd; uint public sS;...
1
vote
0answers
12 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
38 views

Transaction does not get mined on rinkeby

so I'm trying to deploy my first contract on rinkeby using web3 and truffle/hdwallet-provider. even with different gas prices it doesn't get mined.Please help out. const HDWalletProvider = require("@...
1
vote
1answer
222 views

Getting Error while compiling: Stack too deep

Here is my code i have array not 16 variables in a function please help where i am wrong. struct Escrow { bytes16 contractID; uint256 sellingTokenAmt; uint256 feeAmtInSellingToken; ...
2
votes
1answer
25 views

truffle version and solcjs --version returns different versions

I want to change solc version on my system(downgrade from 0.5.16 to 0.4.17). I tried uninstalling it with npm -g uninstall solc and then installed with npm -g install solc@0.4.17 but it does not ...
0
votes
1answer
70 views

Using the correct/best solc version with Truffle and general tooling setup

I haven't worked with Truffle/Solidity for a while and I am trying to get my environment/toolchain configure correctly. I have some questions regarding the compiler config. I was originally not ...
1
vote
1answer
75 views

solc-v0.6.0: TypeError: Operator - not compatible with types tuple() and int_const 1

I am having this error on solc version 0.6.0. Basically I am returning length of the list and subtract 1 from it, where that value will be assigned to an uint variable. In general this command used ...
1
vote
2answers
317 views

Install Old Solc Compiler Versions

I would like to compile older versions of solc contract source code using a solc compiler on my local machine. Is there a website from which to download old solc compilers? Google revealed a GitHub ...
1
vote
1answer
28 views

Are there any risks of undefined behavior when calling a function which doesn't return anything using a prototype of it which returns bool?

According to the ERC-20 Token Standard, functions transfer and transferFrom should return a boolean value indicating success or failure: interface IERC20Token { function transfer(address _to, ...
0
votes
1answer
53 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
32 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 ...
1
vote
1answer
98 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
61 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
12 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
12 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". ...
1
vote
1answer
15 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
64 views

What are remappings and how do they work in solidity?

How can they be used with solc?
1
vote
0answers
52 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 ...
4
votes
1answer
131 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
1answer
147 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
57 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 (...
5
votes
2answers
344 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
52 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
276 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
49 views
0
votes
0answers
29 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
49 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
120 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
104 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
96 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
62 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
2answers
152 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
374 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), ...
2
votes
1answer
186 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
33 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
36 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
117 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
46 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
78 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
516 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
479 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
743 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
176 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
100 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
123 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
2 3 4 5