Hot answers tagged

7 votes
Accepted

Install Old Solc Compiler Versions

I maintain a Python library called py-solc-x that allows you to install and use multiple versions of solc at the same time. It supports versions >=0.4.11. I've included some code examples below to ...
user avatar
2 votes

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

There is no real problem with your code. Just take a look at the error message. It tells you that you only have 2 seconds time to execute your code. Cause of the nature of blockchain (and ethereum) ...
user avatar
1 vote

truffle compile error

use compilers in truffle.config.js to change the solc version to match the contract's solidity version. need to mention that i use solc-select to change my solc golab version before truffle compile. ...
user avatar
  • 11
1 vote

How to compile Solidity code in the browser?

browser-solc is a bit out-dated and doesn't work with the latest compiler versions. I updated the browser-solc code so it works with newer compiler versions. Source code: https://pastebin.com/QxEz6tQU ...
user avatar
  • 164
1 vote
Accepted

Using solc to compile contract that imports local OpenZeppelin contracts

I was running into this error because I did not specify all the relevant sources for solc (version ^0.8.0). I solved the issue by writing a recursive function that compiles all the dependencies in the ...
user avatar
1 vote
Accepted

Different bytecodes using solcjs and remix

The issue seems to be a bug in solcj, see here Using solcjs --bin ./filename.sol does not indicate the optimization flag, which then should be false but this is not the case. As described by @Kamil in ...
user avatar
  • 7,805
1 vote

Web3j generate command not running

The syntax has changed. Try commands like this: web3j generate solidity -a PR_sol_ballot.abi -b PR_sol_ballot.bin -o .\Web3App\src\main\java -p com.project.contracts See also: web3j
user avatar
1 vote

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

The functions you use must have been declared public or internal. In that case the compiler will add their bytecode in the resulting contract so there's no need to reference the library. OpenZeppelin'...
user avatar
  • 29.1k
1 vote

File import callback not supported in solcjs

There are essentially two different problems in import "contracts/Mortal.sol": For a local files, the input path name must start with ./ Since your files reside under folder contracts, you should not ...
user avatar
1 vote

Install Old Solc Compiler Versions

There are a couple of ways to do this and the Solidity documentation has a page on it: Keep in mind you have the option to use the "cli binary" version (solc-bin) which is quite faster than the ...
user avatar
  • 1,242
1 vote
Accepted

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

When I change input.json to the following, without "file://" and with back-slashes instead of forward-slashes, solc is able to import the URL. { "language": "Solidity", "sources": { "...
user avatar
  • 26

Only top scored, non community-wiki answers of a minimum length are eligible