Questions tagged [solc]

Questions related to the compiler for Solidity: solc

Filter by
Sorted by
Tagged with
1 vote
0 answers
33 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 [...
Mudassir Ali's user avatar
0 votes
1 answer
92 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 ...
sify's user avatar
  • 101
0 votes
1 answer
45 views

Why is contract deploying, but giving an error on console

So I'm using ganache client and deploying the contract. I can see the contract on ganache and also the transaction. But on the console I'm getting following error: ... code: 'UNKNOWN_ERROR', ...
MySti's user avatar
  • 1
0 votes
1 answer
293 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; ...
Shuvo's user avatar
  • 1
2 votes
1 answer
85 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 ...
Another0xDev's user avatar
0 votes
0 answers
22 views

Dockerized zkSync testing environment image fails with error Solidity 0.8.19 is not fully supported yet

I'm setting up a dockerized local zksync testing environment according to this guide here. When I run the ./start.sh command, it runs all three images but the local-setup-zksync-1 image exits with ...
stuckoverflow's user avatar
0 votes
2 answers
40 views

Runtime error: code size to deposit exceeds maximum code size

I'm using solc_version version 0.8.16, which i checked is installed, but when i'm trying to deploy the contract getting error Runtime error: code size to deposit exceeds maximum code size. While using ...
Ankit kumar's user avatar
0 votes
0 answers
91 views

How to import code into a contract

I have a contract that needs to be compiled with solc so I can get Go bindings. $ tree . ├── openzeppelin ├── Swap.sol └── @uniswap pragma solidity >0.7.0 < 0.9.0; import { IUniswapV2Pair } ...
pigfox's user avatar
  • 35
2 votes
2 answers
48 views

Abigen reuses nonce when deploying a contract

We have a contract called C1 that uses another contract called RoleLib: using RoleLib for uint8; We compile it with solc: solc --combined-json abi,bin ./solidity/c1/C1.sol -o deploy/c1 --base-...
Piero dS's user avatar
1 vote
1 answer
39 views

Why does deploying programatically through nodejs cost more than deploying through remix?

I've written code to deploy contracts programatically. However when I set the same settings as remix ("gas price, gas limit, etc). The transaction mines but I get the error: Warning! Error ...
learningAsIGo's user avatar
1 vote
1 answer
85 views

--solc --userdoc --devdoc File not found. Searched the following locations: ""

When trying to generate user documentation and developer documentation from the NatSpec of a smart contract with solc --userdoc --devdoc MarketPlaceCustodial.sol by following the official ...
Torof's user avatar
  • 561
0 votes
0 answers
24 views

Where can I find the exact Solc compiler version in Docker?

I am using Docker to compile my solidity contracts with the following commands. Unable to find image 'ethereum/solc:0.8.18' locally 0.8.18: Pulling from ethereum/solc 60bfd3cb9459: Pull complete ...
pigfox's user avatar
  • 35
1 vote
1 answer
76 views

State variable not returning value when the contract is deployed into sepolia test network

The manager state variable captures the value of account that deploys the contract on the network. When deploying the contract on Ganache and calling ContractName.methods.manager().call(), it returns ...
Rakshith's user avatar
0 votes
0 answers
33 views

per file compile optimisation settings

I use both hardhat and foundry to build and both seem to offer just one value for runs for the whole project. But I have one large initialisation contract which will only be run once so I'd like runs =...
Ayeayeron's user avatar
  • 161
0 votes
0 answers
204 views

Having trouble finding and uninstalling local solc versions to enable solc-select

Years ago, I used Homebrew to install ethereum and solidity. Lately, I've been trying to use solc-select, but as its documentation states, it doesn't work when there's a local copy of solc already ...
StuckInThePast's user avatar
0 votes
1 answer
86 views

Select solc version

I am exploring the best way to switch solc versions on Ubuntu and I looked at the Docker solution. The Docker --help command is of no help, it does not show an option for listing possible solc ...
pigfox's user avatar
  • 35
0 votes
1 answer
229 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(); ...
samet mollaoglu's user avatar
2 votes
0 answers
77 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 ...
B S's user avatar
  • 21
0 votes
1 answer
67 views

asking funding while installing solc?

asking for funding while installing solc cant we insatll by skiping it npm install -g solc changed 9 packages in 9s 1 package is looking for funding run npm fund for details
PAVAN PARDHU's user avatar
0 votes
0 answers
36 views

VSCode Emmet Extension Failing in .sol Files

Has anyone experienced the emmet extension terminate on them when in a Solidity file and then try and press tab and receive "command 'emmet.expandAbbreviation' not found" I have no idea what ...
Kate Johnson's user avatar
1 vote
1 answer
508 views

Compiler error: Stack too deep

I am getting this error when trying to deploy my smart contract using zkSync but on a different chain (Polygon Mumbai): CompilerError: Stack too deep. Try compiling with `--via-ir` (cli) or the ...
Falcon Stakepool's user avatar
1 vote
1 answer
94 views

Compilation is successful but getting bytecode = "0x"

I am trying to compile this very simple smart contract but I am getting its bytecode = "0x": // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.0; import "@openzeppelin/...
Falcon Stakepool's user avatar
1 vote
1 answer
210 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
1 answer
103 views

Solc: Source file requires different compiler version

in my brownie project i have imported LinkTokenReceiver.sol contract which its pragma solidity is pragma solidity ^0.7.0;, which means that it requires compiler version equal or greater than 0.7.0, ...
noro meb's user avatar
  • 328
1 vote
0 answers
56 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
1 vote
2 answers
569 views

Operator == not compatible with types string memory and string memory [duplicate]

function hasRole(uint256 tokenId, string memory role) public view returns (bool) { string[] memory userRoles = tokenToRoles[tokenId]; uint256 userRolesLength = userRoles.length; unchecked {...
dd0sxx's user avatar
  • 185
0 votes
1 answer
219 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/...
nginx_learner's user avatar
0 votes
1 answer
207 views

How to Verify smart Contracts Using Web3.js and Solc?

everyone, I am new to web 3,I deployed smart contract successfuly and get back contract address but now I am trying to verify that the smart contract with web3 and solc . https://www.shawntabrizi.com/...
Arpit_joshi's user avatar
0 votes
1 answer
108 views

how to check if a uri is already existing in a contract?

I have written a smart contract for ERC1155. Everytime I mint a NFT, a new token is created and assigned to that URI. issue is if I use the same URI, it mints with a new token. How to stop it from ...
badcoder01's user avatar
0 votes
1 answer
885 views

What is AST in solidity

I really often meet the abbreviation AST but don't really get what it means. I suppose it is a kind of output file that the compiler generates but what exactly is in it?
AGJoYy's user avatar
  • 406
1 vote
1 answer
395 views

Could not find files for the given pattern(s)

from solcx import compile_standard, install_solc import json install_solc("0.8.0") with open("./SimpleStorage.sol", "r") as file: simple_storage_file = file.read() ...
user11738162's user avatar
1 vote
0 answers
58 views

Parse Error with npm workspaces

I am getting a false error with the solc language server (running on neovim with nvim-lsp). I often use npm workspaces and the language server fails to understand that the dependencies are two ...
Prateek Pravanjan's user avatar
1 vote
0 answers
70 views

Setting runs in solc options at brownie-config.yaml

My goal is to set the runs key of solc to the value of 100 inside the brownie-config.yaml file. I have found two different solutions and I would like to know what is the difference between the two in ...
rihekopo's user avatar
  • 304
0 votes
1 answer
421 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 ...
tianopo's user avatar
  • 21
3 votes
0 answers
73 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
1 vote
1 answer
285 views

solc compiler --allow-paths fails

I'm trying to compile a contract using standard JSON through a script via the solc compiler CLI. I have a folder structure for storing the .sol files, the input JSON, and the compiled JSON output. No ...
pdmoerman's user avatar
  • 131
1 vote
1 answer
90 views

solc --userdoc --devdoc NFTMarketplace.sol "NFTMarketplace.sol" is not found

When I tried to generate Documentation with solc --userdoc --devdoc NFTMarketplace.sol I get the error "NFTMarketplace.sol". It seems like solc cant find the path to my smart contract. I ...
Bobby's user avatar
  • 47
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
1 vote
1 answer
293 views

Compilation Error with Solc - Solc Error: dyld[30112]: Library not loaded: '/opt/homebrew/opt/z3/lib/libz3.dylib'

I recently updated my solc to the latest version for foundry testing and contract compilation. I have an M1 mac and I am using Mac OS Monteray 12.5 Suddenly I am getting an error when trying to use ...
Kate Johnson's user avatar
2 votes
1 answer
279 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,593
7 votes
1 answer
1k views

Understanding Dynamic Types in calldata

Context I have recently been interested in how calldata is formed and interpreted. The Docs have a great section on how Dynamic Types are encoded into calldata. However, in practice I have trouble ...
Another0xDev's user avatar
1 vote
1 answer
1k views

I can not import openzeppelin, but get error 'File import callback not supported'

I get 'File import callback not supported' when I try to compile my simple solidity contract, that imports ERC721. Can anybody help? Here is what I have already done: I have installed openzeppelin in ...
utroelski's user avatar
1 vote
1 answer
148 views

Does the compiler ignore internal functions that are never called?

On inheriting a contract that contains some internal functions that are never used in the child contract. eg. contract Parent { function _someInternalFunction() internal{ } } contract Child ...
user3599285's user avatar
0 votes
1 answer
81 views

SolcInstallationError: Downloaded binary would not execute, or returned unexpected output on Windows 10

I was previously working on windows 8.1 but recently upgraded to windows 10 so I could use the Ganache GUI. The code seemed to work absolutely fine for windows 8.1 but I cannot seem to install solc on ...
Taaha Rauf's user avatar
0 votes
2 answers
102 views

my code doesn't run but shows "Downloaded binary would not execute, or returned unexpected output" in the terminal. Please help check where i am wrong

from solcx import compile_standard, install_solc install_solc("0.6.0") with open("SimpleStorage.sol", "r") as file: simple_storage_file = file.read() # compile Our ...
christian olori's user avatar
1 vote
2 answers
860 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.
enthusiastic's user avatar
2 votes
1 answer
1k views

Hardhat coverage tests failure - Stack too deep

I got my smart contracts ready over Hardhat and once I'm running hh test all the tests are passing successfully but while running hh coverage I'm getting the below error. Any idea why the regular ...
forhas's user avatar
  • 775
0 votes
1 answer
455 views

Brownie unable to compile contracts on Apple M1 Mac

I recently got an M1 mac and I'm trying to compile my brownie project's contracts which compiled fine on my previous machine. I've installed Brownie v1.18.2 and when attempting to run brownie compile ...
MShakeG's user avatar
  • 1,593
3 votes
1 answer
458 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/...
mehrlicht's user avatar
2 votes
2 answers
1k views

Unable to run mythril on a Hardhat project

I have a hardhat project on my local system. For running Mythril security analysis I am using the following command: myth analyze contracts/MyFile.sol --execution-timeout 900 Receiving the following ...
mahima's user avatar
  • 133

1
2 3 4 5
8