Questions tagged [solc]

Questions related to the compiler for Solidity: solc

Filter by
Sorted by
Tagged with
-1
votes
1answer
12 views

Trying to compile running: 'node compile.js', but get error: “assert.js:399 throw err;” [Udemy 'Complete Developers Guide' Course]

This is my hands on contract with this Udemy Course - Ethereum-and-solidity-the-complete-developers-guide This is the contract file, which contains two contracts - Campaign and FactoryCampaign. I ...
1
vote
1answer
132 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", ...
4
votes
2answers
1k 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
1answer
162 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 ...
0
votes
1answer
21 views

Truffle and Buidler are compiling to very different bytecodes despite having same compiler settings

Truffle is giving > 24kB and out of gas errors, but Buidler is not. I have checked the number of characters in the 'deployedBytecode' of the JSON: Buidler 33k characters (so 16.5kB) Truffle 55k ...
0
votes
1answer
103 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
2answers
183 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, ...
2
votes
1answer
722 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
1answer
299 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\...
0
votes
1answer
92 views

…is an abstract contract or an interface and cannot be deployed

I don't have any programming language experience. But i'm interested to learn how to create my own ERC20 token and it was sucessfully deployed without any error using remix ethereum. But, once i'm ...
0
votes
2answers
15 views

.json files for contracts are not created

I am really new in ethereum and solidity and I am having hard time to figure out how to get the .json equivalent for contracts. I have the Campaign.sol inside the contractsFolder. The Campaign.sol ...
2
votes
1answer
14 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
1answer
173 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
1answer
139 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 ...
0
votes
2answers
201 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
26 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....
0
votes
1answer
31 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
51 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
1answer
21 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
28 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
0answers
26 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
17 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 ...
1
vote
2answers
976 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....
0
votes
1answer
72 views

CONNECTION to Rinkeby showing false, contract not getting Deployed

SOURCE CODE var Web3 = require('web3'); var Tx = require('ethereumjs-tx'); const fs = require('fs'); const solc = require('solc'); var web3 = new Web3(); web3.setProvider(new web3.providers....
1
vote
1answer
41 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
133 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
1answer
85 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
1answer
226 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
43 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
118 views

How to identify the bytecode of a single function

I am trying to generate the bytecode for a single function. I need to avoid any setup/teardown that may occur in the contract as I am trying to get a precise measurement of the execution time in the ...
4
votes
1answer
163 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 ...
2
votes
2answers
418 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
326 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'); ...
0
votes
1answer
213 views

Solc “bin-runtime” not a command?

I can generate the .bin of a contract with solc as follows: solcjs --bin -o output contract.sol However running the following command: solcjs --bin-runtime -o output contract.sol Generates the ...
0
votes
1answer
165 views

Solidity solc compiler error on code Remix can compile

I am attempting to compile the following solidity code using solc in NodeJS. pragma solidity ^0.4.11; contract helloWorld { string public message; function constructor() public{ message = "...
2
votes
1answer
229 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....
0
votes
1answer
100 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 ...
0
votes
1answer
86 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 ...
2
votes
1answer
110 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 ...
5
votes
2answers
706 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. ...
1
vote
2answers
564 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
30 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, ...
1
vote
3answers
1k 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 ...
1
vote
2answers
2k views

Why is my web3j wrapper failing to generate?

I've created a smart contract in solidity which I've compiled with solc into a .bin & a .abi file. However, when I run the generator on the .abi and .bin files it returns a JSONParseException ...
0
votes
1answer
70 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.
1
vote
2answers
626 views

Calling a function from a contract passed in as an argument

Im Trying to create a DAPP with two contracts generating assets. One is acting as the "factory" for the other contracts. From the latter I try to call a function in the factory without knowing its ...
0
votes
0answers
36 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 ...
3
votes
1answer
266 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 ...

1
2 3 4 5