Skip to main content

Questions tagged [solc]

Questions related to the compiler for Solidity: solc

Filter by
Sorted by
Tagged with
0 votes
1 answer
16 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() {} ...
Trong-Hieu Nguyen's user avatar
0 votes
0 answers
20 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. /...
pigfox's user avatar
  • 71
0 votes
0 answers
50 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 ...
dNyrM's user avatar
  • 928
0 votes
1 answer
25 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-...
pigfox's user avatar
  • 71
1 vote
1 answer
30 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 ...
pigfox's user avatar
  • 71
0 votes
0 answers
69 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, ...
Thierry Grandjean's user avatar
1 vote
1 answer
15 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 ...
Marco9631's user avatar
0 votes
1 answer
26 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 ...
quantoor's user avatar
1 vote
0 answers
67 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
978 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
58 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
2 answers
658 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
134 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
29 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
59 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
133 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
  • 71
2 votes
2 answers
56 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
41 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
124 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
  • 790
0 votes
0 answers
43 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
  • 71
1 vote
1 answer
100 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
49 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
1 answer
119 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
  • 71
0 votes
1 answer
272 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
1 answer
92 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
90 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
39 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
569 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
103 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
276 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
145 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
  • 368
1 vote
0 answers
72 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
  • 71
1 vote
2 answers
725 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
280 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
228 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
132 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
1 vote
1 answer
1k 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
  • 426
1 vote
1 answer
476 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
62 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
73 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
  • 316
0 votes
1 answer
436 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
78 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
328 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
95 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
298 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
297 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,723
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
163 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

1
2 3 4 5
8