Questions tagged [solcjs]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer
171 views

How to compile with --bin option in solcjs?

I want to compile using --bin option because I want to get to see the bytecode of the compilation. Using solc I know it is something like this: solc --bin How can I achieve this using solcjs?
Falcon Stakepool's user avatar
1 vote
0 answers
43 views

How is `soljson.js` created from Solidity repository

In the official Solidity GitHub repo, under the releases section you can download the source code, binaries and the soljson.js file. How is the file generated and is it able to be generated by ...
John's user avatar
  • 61
3 votes
0 answers
69 views

Why the bytecodes for the same smart contract in testnet explorer and Remix/solcjs are different?

I am using Remix to compile and deploy my smart contract to the Rinkeby test network. I don't understand why the bytecode of my contract on Rinkeby explorer is different from the metadata.data....
Aleks Shenshin's user avatar
2 votes
1 answer
380 views

Different bytecode when compiling from both solc-js and Remix IDE

Currently, I'm trying to get the bytecode from this contract code for example: // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; contract GetSet { uint256 private total; mapping(address =&...
Linh Nguyen's user avatar
1 vote
2 answers
1k views

Facing an error while running "truffle compile"

I'm facing an error while running truffle compile- Error: Failed to fetch the Solidity compiler from the following locations: https://relay.trufflesuite.com/solc/bin/,https://solc-bin.ethereum.org/bin/...
Aryan Raj's user avatar
2 votes
1 answer
266 views

How to enable multiple compiler versions in solc js?

I'm trying to compile contract A(located in A.sol) that has a dependency on contract B(located in B.sol) using solc-js, where A has solidity version 0.8.0 and B version 0.7.6. The solcjs version that ...
MShakeG's user avatar
  • 1,398
0 votes
1 answer
427 views

truffle compile error

Compiling your contracts... =========================== ✓ Fetching solc version list from solc-bin. Attempt #1 TypeError: Cannot read properties of undefined (reading '0.5.16') at VersionRange....
yao yu's user avatar
  • 11
0 votes
0 answers
721 views

Callback not suppoprted compiling contracts with solc

I'm building a Web-API with express which should compile two Smart Contracts and its imports. I've tried almost anything but I don't get it to work. I have the error "Callback not supported" ...
Luex's user avatar
  • 51
0 votes
1 answer
267 views

Solc installed ok but so solcjs command not found?

I'm struggling for days with this. MacOs Monterey v12.2.1 npm install -g solc works fine. then when I try to use any solcjs command, it says : zsh: command not found: solcjs print screen of what i'm ...
Ywouat's user avatar
  • 1
0 votes
1 answer
82 views

How to extract fourbyte signatures and resulting arguments from Solidity compiler output?

It seems that the Solidity compiler output has JSON that lists methods and their arguments as a complex nested JSON structure. How can I take parse structure and output the string and fourbyte that ...
Watson Ladd's user avatar
2 votes
3 answers
1k views

How to compile Solidity code in the browser?

I am building a tool to deploy solidity contracts using pre-made templates. I want to compile solidity (like remix) so I can deploy it directly from the client-side (I do not want to use a server). I ...
Atharva Shukla's user avatar
0 votes
0 answers
212 views

Unable to installed global npm package solc

So, recently I got into security and started using Slither. I can run it on an entire project but not on a single file. According to my diagnose, the solc version is not compatible with my contract's ...
Pradhumna Pancholi's user avatar
1 vote
0 answers
20 views

VSC highlighting problem with pragma, compiler version [duplicate]

My Visual Studio Code is highlighting problem with pragma statement and I have no clue how to fix this. Error is saying: Source file requires different compiler version (current compiler is 0.4.17+...
BlackH3art's user avatar
2 votes
2 answers
3k views

Using solc to compile contract that imports local OpenZeppelin contracts

I am trying to compile and deploy a contract based on OpenZeppelin using Node.js app.get("/", (req, res) => { const input = fs.readFileSync("./BaseContract.sol", "utf8&...
orangutan's user avatar
  • 125
1 vote
1 answer
278 views

Different bytecodes using solcjs and remix

Using solcjs in any contract ends up producing significantly longer bytecode that using remix For instance this simple smart contract pragma solidity >=0.8.0; contract test { uint256 public c; ...
Jaime's user avatar
  • 8,280
1 vote
0 answers
226 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 ...
Captain Midday's user avatar
2 votes
1 answer
569 views

solcjs --standard-json is not working

I was trying to compile a .sol file using solcjs --standardjson inputConfig.json command, the compilation had thrown error. But when I try with Solidity compiler, the compilation was success. Can you ...
Tamil's user avatar
  • 21
0 votes
1 answer
1k views

Web3j generate command not running

I am trying to generate a java wrapper class for a solidity contract, I have compiled the file and have the abi and bin file, but when I run the command as follows: web3j solidity generate ...
Ewan's user avatar
  • 1
1 vote
1 answer
325 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.
Philogy's user avatar
  • 487
1 vote
1 answer
190 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 ...
Samaritain Sims's user avatar
0 votes
1 answer
2k views

File import callback not supported in solcjs

Running E:\projects\Greeter-Contract-master\contracts>solcjs --abi Greeter.sol gives: Greeter.sol:3:1: ParserError: Source "contracts/Mortal.sol" not found: File import callback not supported ...
aki abi's user avatar
  • 21
2 votes
2 answers
5k 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 ...
Daniel Connelly's user avatar
0 votes
1 answer
373 views

Unable to interface the contract while running test.js and how to get the abi while compiling using solc?

Solidity Contract: index.sol pragma solidity ^0.5.0; contract Inbox{ string public message; constructor(string memory IntialMessage) public{ message = IntialMessage; } function setMessage(...
Aashutosh Singh's user avatar
0 votes
0 answers
263 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. ...
Carl Gillis's user avatar
0 votes
1 answer
375 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 ...
Saiteja Kuruva's user avatar
1 vote
1 answer
337 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", ...
jimbo_jet's user avatar
1 vote
1 answer
991 views

"Cannot import url", "File outside of allowed directories" using --standard-json

I'm trying to understand how to use solidity's JSON input-output API. Here's my json file; { "language": "Solidity", "sources": { "StandardToken.sol": { "urls": [ "file:///home/...
Alex Altair's user avatar