Questions tagged [solc]
Questions related to the compiler for Solidity: solc
349
questions
0
votes
0
answers
8
views
Hayatta neyin en önemli olduğunu düşünüyorsun
soruyu, değerlerini ve önceliklerini daha iyi anlamak için sorarım. Bu soru, kişinin hayattaki motivasyonlarını ve hedeflerini de ortaya çıkarabilir.
Bu soruyu sorarkensergilerim
0
votes
2
answers
11
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 ...
0
votes
0
answers
25
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 } ...
2
votes
2
answers
23
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-...
1
vote
1
answer
24
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 ...
1
vote
1
answer
29
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 ...
0
votes
0
answers
13
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
...
1
vote
1
answer
26
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 ...
0
votes
0
answers
19
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 =...
0
votes
0
answers
96
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 ...
0
votes
1
answer
37
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 ...
0
votes
1
answer
157
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();
...
2
votes
0
answers
63
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
41
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
0
votes
0
answers
31
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 ...
1
vote
1
answer
257
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 ...
1
vote
1
answer
67
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/...
1
vote
1
answer
126
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?
1
vote
1
answer
61
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, ...
1
vote
0
answers
33
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 ...
1
vote
2
answers
403
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 {...
0
votes
1
answer
149
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
179
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/...
0
votes
1
answer
83
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 ...
0
votes
1
answer
576
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?
1
vote
1
answer
225
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()
...
0
votes
0
answers
62
views
TypeError: Unable to deduce common type for array elements - multidimensional string array
I would like to instantiate a multidimensional array of strings, as follows:
string[][][] private data =
[
[
["a", "b"],
...
1
vote
0
answers
51
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 ...
1
vote
0
answers
61
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 ...
0
votes
1
answer
376
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 ...
3
votes
0
answers
63
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....
1
vote
1
answer
222
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 ...
1
vote
1
answer
83
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 ...
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/...
1
vote
1
answer
279
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 ...
2
votes
1
answer
246
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 ...
7
votes
1
answer
965
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 ...
1
vote
1
answer
918
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 ...
1
vote
1
answer
127
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 ...
0
votes
1
answer
70
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 ...
0
votes
2
answers
90
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 ...
0
votes
2
answers
571
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.
2
votes
1
answer
990
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 ...
0
votes
1
answer
388
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 ...
3
votes
1
answer
412
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/...
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 ...
0
votes
1
answer
409
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....
2
votes
1
answer
181
views
yul get abi file
Normally, when you compile a solidity file for Web3j, you need a bin and abi file. The command for this is
solc <contract>.sol --bin --abi --optimize -o <output-dir>/
To compile a yul ...
1
vote
1
answer
168
views
DeclarationError: "Identifier already declared" when compiling SmartContract with solc
I have a Smart Contract "MyCoin". It has another SmartContract "Dex" as dependency.
MyCoin:
import "./openzeppelin/contracts/token/ERC721/IERC721.sol"; //
import "./...
0
votes
0
answers
675
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" ...