Questions tagged [solc]
Questions related to the compiler for Solidity: solc
364 questions
0
votes
2
answers
672
views
Issue with py-solc-x library
I don't really know what's wrong with my code or what's wrong about the way I installed and imported this library, but I just keep receiving this error and I don't really know how to handle it.
I ...
0
votes
1
answer
365
views
zsh: command not found: solc (macOS Monterey)
Installed solc with this command:
% pip3 install solc-select
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: solc-select in /Users/test2/...
0
votes
1
answer
320
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 ...
0
votes
1
answer
2k
views
ParserError: Source file requires different compiler version
I am a beginner working on brownie using vscode related to a lottery smart contract. Please don't mind if I am doing any rookie mistakes I am still trying my best to understand it as much as I can :) ...
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/...
0
votes
1
answer
333
views
How to compile smart contract in react app with solc?
I used solc compiler in react app but browser is not compatible with it and gives an error after using that code;
const createContract = async () => {
const contract = erc1155.print();
...
0
votes
1
answer
539
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 ...
1
vote
1
answer
348
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",
...
2
votes
0
answers
16
views
Optimizer ExpressionJoiner Help
Hi im a newbie learning about Optimizer and Im trying to Join a function like this
function fun_trigger_61() -> vloc
{
let ret := vloc
ret := vloc
...
0
votes
1
answer
392
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 ...
1
vote
1
answer
967
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
1
answer
403
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.
2
votes
2
answers
1k
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, ...
0
votes
1
answer
350
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 = "...
0
votes
3
answers
775
views
Can't compile Truffle project that imports a .sol with different pragma version
I have a contract pragma solidity 0.6.12 version that imports several 0.6.12 version contracts and one pragma solidity 0.8.0.
My truffle-config:
compilers: {
solc: {
version: "^0.6.12 &...
2
votes
1
answer
622
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
1
answer
402
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
2
answers
42
views
Attempting to install slither
When following these Instructions I get an Python error that I don't how to deal with.
I have the following installed on my Ubuntu 24.04.1 LTS.
$ python3 --version
Python 3.12.3
p$ pip3 --version
pip ...
0
votes
0
answers
23
views
I can't get solc to work on vs code
I am trying to use "compile_source" and it doesn't work, solcx is installed and is the latest version:
this is the error:
Traceback (most recent call last):
File "c:\Users\Matteo\...
2
votes
1
answer
426
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\...
8
votes
1
answer
1k
views
hardhat remappings option in configs
I know that solc can take remappings but I'm trying to force hardhat to take in my remappings.txt file each time it is compile. I've looked for a while and can't seem to find anything about that on ...
1
vote
1
answer
2k
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
1
answer
450
views
Solidity: Error encoding arguments: Error: invalid BigNumber string
I am using this code:
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.0 <0.9.0;
contract Wallet {
address owner;
struct Data {
string userEmail;
uint256 ...
4
votes
1
answer
2k
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 ...
0
votes
2
answers
866
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 ...
0
votes
2
answers
1k
views
Error: missing revert data when deploying Solidity contract with ethers.js and Ganache
I'm having an issue deploying a Solidity smart contract using ethers.js and Ganache. I have a simple contract called SimpleStorage.sol:
// SPDX-License-Identifier: MIT
pragma solidity 0.8.21;
...
2
votes
2
answers
3k
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/...
1
vote
2
answers
1k
views
Is there a way to getting Remix to run offline?
Could you please help me getting Remix IDE run in an offline environment?
I've researched that way from google but found no answers for it.
3
votes
1
answer
511
views
How to configure EVM in IntelliJ with Solidity plugin
There is a related question/answer from 5 years ago but back then the plugin only provided syntax highlighting.
Now, I know I can compile from the solidity file opened in IntelliJ, clicking on a play/...
0
votes
1
answer
62
views
Understanding discrepancies between Etherscan deployed bytecode and locally compiled bytecode for smart contracts
I’m experiencing an issue when examining the bytecode of this smart contract 0x7c21C4Bbd63D05Fa9F788e38d14e18FC52E9557B.
After locating the contract on Etherscan and viewing the contract code in the “...
0
votes
0
answers
8
views
How to get the documentation for all the methods in the smart contract when using solc --devdoc
I am running the following command to generate Developer Documentation for a smart contract in JSON format:
solc --devdoc Contract.sol > doc.json
The problem I am having is that some of the methods ...
12
votes
10
answers
32k
views
Solc --version: command not found
I'm trying to use solc with no success.
I download solc with npm install solc but when I run solc --version the console output is:
command not found.
If I list packages npm list I'm able to see ...
2
votes
1
answer
2k
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
1
answer
99
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 ...
0
votes
0
answers
27
views
Error: processing response error
Solidity
const ethers=require("ethers");
const fs=require("fs-extra");
async function main(){
//http://127.0.0.1:7545
const provider=new ethers.providers.JsonRpcProvider("...
0
votes
0
answers
15
views
solc: import defaults to cwd?
Would appreciate an explanation why the first solc call doesn't fail.
# downloaded from https://github.com/OpenZeppelin/openzeppelin-contracts
$ ls *.sol
IERC20.sol IERC20Metadata.sol
# metadata ...
0
votes
1
answer
39
views
Call to view function, which returns a bytes value, got error: VM Exception while processing transaction: invalid opcode
I have this test smart contract
// SPDX-License-Identifier: SEE LICENSE IN LICENSE
pragma solidity 0.8.26;
contract TestSomething {
bytes state;
bytes32 state32;
constructor() {}
...
0
votes
0
answers
37
views
Transaction 0x6a19aa91361ce2b93b7515962821540af2aab0ebff0fcdcb90ee252fbe64c107 is pending: true
Any insight into this?
I am attempting to deploy a smart contract using Go-Ethereum but it is pending forever until my context timeout.
In order to minimize the complexity I use a worthless contract.
/...
2
votes
1
answer
233
views
Determine compiler used to create a given bytecode
Context
The method that the solc compiler uses to set storage slots for a mapping is slightly different from how the Vyper compiler does so. In Vyper, it's keccak256(slotMapping, key), while in ...
0
votes
1
answer
44
views
ABI and BIN Files generated by solc and Etherscan verified code are not identical
I have a file that is composed of multiple imports, too much code to drop here so I will illustrate my question with a very simplified example.
My compilers:
$ abigen --version
abigen version 1.11.7-...
0
votes
0
answers
138
views
Solc too slow compiling
The solc compiler that I'm using (0.8.21) is taking too much time to compile. It's compiling 20 files for a foundry test campaign in ~90 seconds when it should be milliseconds.
Any ideas on what I ...
1
vote
1
answer
79
views
Abigen from flattened contract files
I have a file that is composed of 5 imports, too much code to drop here so I will illustrate my question with a very simplified example.
My Test.sol file:
// SPDX-License-Identifier: MIT
pragma ...
0
votes
0
answers
84
views
Solidity smart contract not compiling in python
I am trying to use the following to compile and deploy a smart contract.
The last line comes with the error mentioned below.
from web3 import Web3, HTTPProvider
from solcx import compile_files, ...
1
vote
1
answer
17
views
Accidentally removed "/usr/bin/solc" after installation, now no command work
Unfortunatly, meanwhile I was trying to get the latest solidity version, i deleted the /usr/bin/solc folder, and now I can non longer run any script (i.e. solc --version or --help)
Can someone help ...
2
votes
1
answer
118
views
Brownie <> SolcInstallationError, I've tried everything I can find -- nothing has worked!
Everytime I try brownie compile I see this:
SolcInstallationError: Downloaded binary would not execute, or returned unexpected output. If this issue persists, you can try to compile from source code ...
0
votes
1
answer
68
views
Getting different binary for the same Solidity source code compiling with solc and Remix
I'm noticing a difference in the binary generated using the same solc compiler in local and with Remix.
Here's the source code:
pragma solidity 0.8.20;
contract HelloWorld {}
I compiled it in local ...
0
votes
1
answer
2k
views
How to know the default evm version of a specific version of solc
I have multiple versions of solc installed
❯ asdf list solidity
0.4.24
*0.8.23
latest solc includes the default evm version in the help output:
❯ solc --version && solc --help|grep evm
...
1
vote
0
answers
132
views
incompatible Solidity versions
I am trying to compile the code with multiple solidity versions e.g. =0.7.6, =0.8.15 etc in foundry with the configuration of auto_detect_solc but still getting this error
Here's my foundry.toml file
[...
1
vote
2
answers
879
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 ...
2
votes
4
answers
4k
views
How to use Solidity solc to compile A.sol that imports B.sol file?
I know how to install solc via "npm install --save solc"
then use solc.compile to compile one sol file. But now I've got A.sol file that imports B.sol file, and when I run node compile.js, no error in ...