Questions tagged [solc]

Questions related to the compiler for Solidity: solc

Filter by
Sorted by
Tagged with
0
votes
0answers
16 views

I am trying to print out the variable (compiled_sol), so I can deploy my smart contract, but I keep running at this error

INFO: Could not find files for the given pattern(s). Traceback (most recent call last): File "C:\Users\jethr\demos\web3_py_simple_storage\deploy.py", line 8, in <module> ...
0
votes
1answer
9 views

Where can I find the security enhancement of solc compiler?

I came from this link, and quote It is highly encouraged to use Solidity v0.7.0 or newer. If you want to use a version of the 0.6 series, please make sure to not make use of flaws that have been ...
0
votes
0answers
11 views

Solidity compile error 6275 with openzeppelin

I'm using solc 8.0.0 with node.js 16.13.1 my project dependencies are the following: "dependencies": { "@openzeppelin/contracts": "^4.4.2", "@truffle/...
0
votes
1answer
57 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 :) ...
0
votes
1answer
30 views

How do I fix the 'Only "Solidity" or "Yul" is supported as a language' error from py-solc-x

this is the error I get after running this code from solcx import compile_standard, install_solc install_solc("0.6.0") #from my crowdFund.sol file i call the whole file with open("./...
0
votes
1answer
14 views

Solc throwing assertions in compile despite working perfectly in Remix

I have an ERC721 project using pragma solidity ^0.8.2. It drags in several open zeppelin imports that specify 0.8.0. It compiles in Remix with no errors or warnings and I am able to call the ...
1
vote
1answer
33 views

Programmatically get smart contract ABI and Bytecode

I have ERC20 contracts with imports and solc is not able to compile contracts with imports. I have tried truffle compile and it works fine and generates ABI. I want to fetch smart contract file ABI by ...
1
vote
0answers
24 views

What pragma version to use? [duplicate]

When I start with a project and have to decide which pragma I want to use, what are the main things I have to consider? For simplicity, lets first assume I start a project from scratch, without ...
1
vote
0answers
11 views

Brownie Compile - Show compiler warnings

Am using Brownie v1.16.3, and when running brownie compile I do not see any compiler warnings. Is there a way to show compiler warnings when using brownie?
0
votes
0answers
16 views

Unable to installed global npm package solc

So, recently I got into security and started using Slither. I can run it on an entire project but not on a single file. According to my diagnose, the solc version is not compatible with my contract's ...
1
vote
0answers
131 views

Missing artifacts for openzeppelin contracts with hardhat

I'm using hardhat to write a dapp. As I'm compiling my dapp I'm getting an error: Error HH700: Artifact for contract "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:...
0
votes
1answer
58 views

Compatibility problem: Truffle version is 0.5.16 but Solidity file requires 0.8.3

My smart contract (SC) file has the following line: pragma solidity ^0.8.3; When I am compiling it with truffle, I am getting following error: Error: Truffle is currently using solc 0.5.16, but one ...
1
vote
1answer
55 views

Cannot compile code with inline assembly using solc linux binaries

The code with inline assembly fails to compile with the solc binaries from soliditylang.org. The same code compiles without issue using Remix or solcjs. Because of this issue I cannot even compile the ...
0
votes
0answers
14 views

how can I get the solidity ast file detailed structure?

I have get the combined.json file after using solc --combined-json ast file_path,but I can't get the detaild explanation of the file so that I can't get an idea of the ast file structure even if I ...
0
votes
0answers
21 views

How to change solc compiler version?

I would like to change solc compiler version from latest (currently 0.8.6) to 0.5.5, i tried with "solc-select" but it doesnt actually change it. Note: i need to change it globally, not in a ...
0
votes
1answer
45 views

How to run SMTchecker without the pragma

According to documentation pragma experimental SMTchecker won't work for latest versions. It says to use --model-checker-targets "underflow,overflow". But I don't know how. I am new in this ...
1
vote
1answer
36 views

How do I get a list of function/variable hashes from a already deployed smart contract

I am aware that solidity variables and functions are the first 4 bytes of the some hashed string. I want to be able to retrieve a list of these 4 byte functions/variables from a already deployed ...
0
votes
0answers
135 views

Ethereum dev environment for mac M1

I recently got a mac M1 and I am trying to set up my environment for development. I manage to install ganache-cli, truffle and docker. I am trying to set up the solidity compiler configuration, how ...
1
vote
1answer
116 views

Can`t fix: AssertionError [ERR_ASSERTION]: Invalid callback object specified

I´m doing my first smart contract, these errors are probably no npm but versioning problems. Though intensive research I could not find a proper way to fix it. Thank you for your help! const assert = ...
0
votes
2answers
176 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 &...
0
votes
1answer
143 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 ...
14
votes
6answers
6k views

having a problem with solc-x version "solc 0.6.0 has not been installed"

I m trying to print out the variable (compiled_sol) as you will see in the code below of the python file named deploy.py so I can deploy my smart contract, but I keep running at this error *****INFO: ...
0
votes
0answers
128 views

JSON interface problem

I'm wondering why I still get "Error: You must provide the json interface of the contract when instantiating a contract object." I've tried plenty of solution from this community but they ...
0
votes
2answers
163 views

How to generate Natspec docs using version 0.6.x of the Solidity compiler

I'm trying to run solc --userdoc --devdoc myContract.sol to generate natspec. However, the compiler complains that the contract has a different pragma-version. In fact the contract pragma is at ^0.6....
2
votes
1answer
42 views

searching for an elegant solc compiler solution

I firstly had a problem with import statement inside my contracts, I figured out that the solc compiler didn't handle import statement, and that we needed to make out own. With the help of some nice ...
1
vote
2answers
987 views

Solc Compiler : File import callback not supported

As a context I am trying to fork uniswap v2 contracts using my own compiler and deploy files. I am not using truffle, as I want to deeply understand before using a framework. When I run my compiler, I ...
1
vote
1answer
314 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 ...
0
votes
1answer
54 views

installing a different solc version [duplicate]

(current compiler is 0.5.16+commit.9c3226ce.Emscripten.clang - note that nightly builds are considered to be strictly less than the released version pragma solidity ^0.4.19; ^----------------------^ ...
2
votes
0answers
82 views

Solidity sourceMap and opcodes. No map entries for every code?

After compiling a simple contract, the output are these values: "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH1 0xF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP ...
0
votes
1answer
151 views

mocha beforeEach is not running

beforeEach hook is not running. THis is a strange error, I googled but did not find anything. For anything strange, I delete node-modules and reinstall and it works but this time it did not work. ...
1
vote
0answers
95 views

Does solcjs replace solc? Is there a wrapper for the differences?

It at least appears to me that "solc" (the executable) doesn't exist anymore. Installing "solc" with nmp results in a command-line tool called solcjs ... fine, but they seem to ...
0
votes
1answer
188 views

Stack too deep error in Solidity v0.8.4, no error / debug info from compiler

I have been facing the Stack too deep error, and it is being displayed without any line number / contract info. It is compiling all my contracts together (over 10) and I have no clue where this error ...
0
votes
0answers
17 views

how much is the gas fee when forking uniswap with @openzeppelin/contracts?

I have tested it on remix , but in truffle is there anyway you can spend less? people have said it was 500 $ seems steep, if it's the truth is what i am curious of. has anyone successfully done it?
1
vote
0answers
14 views

Solc compiler shows only one compilation error at a time [closed]

The solc compiler reports only one error at a time. Is there any way to get the list of all errors in the sol file?
1
vote
1answer
193 views

Cannot send ETH to contract using solc 0.8.4 using truffle console (revert)

I spend like 6 to 8 hours on this issue, finally asking here on the following problem. Goal I want to sent ETH from one of the default Ganache addresses to the deployed contract SportBet. Versions ...
2
votes
1answer
536 views

I ran into an error when using Pragma Solidity 0.4.24

I use pragma solidity 0.4.24 on the smart contract, but when running the truffle compile command, an error appears like this: =========================== > Compiling ./contracts/ImageRegister.sol &...
0
votes
1answer
105 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 ...
4
votes
1answer
556 views

Error: project ID does not have access to archive state

I am coding a script to deploy smart contracts using python web3, and I came across this error when I ran the script: ValueError: {'message': 'Returned error: project ID does not have access to ...
3
votes
1answer
233 views

Adding new custom opcode to solidity

I have a problem with adding new opcode to solidity. I'm using solc (on C++) and geth(ethereum on Go). I want to add new opcode, that takes address payable, uint256, uint256, bytes memory and returns ...
0
votes
1answer
370 views

Web3j generate command not running

I am trying to generate a java wrapper class for a solidity contract, I have compiled the file and have the abi and bin file, but when I run the command as follows: web3j solidity generate ...
1
vote
0answers
57 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.
1
vote
1answer
36 views

Do file names need to be UTF-8 for solc to be able to compile them?

I combed through the Using the compiler section in the Solidity documentation, but I couldn't find an answer for my question. Do file names need to be valid UTF-8 for solc to be able to compile them?
15
votes
5answers
5k views

Is the SafeMath library obsolete in solidity 0.8.0?

SafeMath was commonly used to revert the transaction on overflow and underflow, instead of allowing the number to wrap around. The solidity 0.8.0 release notes state: Code Generator: All arithmetic ...
1
vote
0answers
78 views

TypeError: Library functions must be implemented if declared for solc compiler version ^0.6.0 library implementation

Suppose I have the following code: // SPDX-License-Identifier: MIT pragma solidity >=0.4.21 <0.7.0; library SomeLib { function add(uint256 a, uint256 b) public returns(uint256); } contract ...
0
votes
1answer
46 views

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

I have compiled my contracts with solc module for nodejs. These contracts import and use some libraries. But in the deployed bytecodes of the contracts, there are no placeholders for librairies used ...
0
votes
1answer
844 views

Remix: ParserError: Expected pragma. import directive, or contract/library/interface definition

I'm trying to use Remix to interact with a suite of contracts. One of the contracts being used is OpenZeppelin's Ownable contract. I copied from the link above, and pasted it into Remix, with a few ...
0
votes
1answer
93 views

Deploying multiple contracts with different solc versions

I have a few contracts that I deploy with my 1_initial_migration.js. However some of them are of different solc version than others. Is there a way to change it programmatically before compiling and ...
0
votes
2answers
548 views

Resolve solidity compiler error

I am trying to create a smart contract and I am using ganache, visual studio code and truffle for that purpose. The versions installed in my windows system are: Truffle v5.1.49, Solidity v0.5.16 (solc-...
5
votes
1answer
5k views

Compiler solc expected a state variable declaration

I try example from book Mastering Ethereum: contract Faucet { function withdraw(uint withdraw_amount) public { require(withdraw_amount<=10000000000000000); msg.sender.transfer(...
0
votes
1answer
31 views

Updating array.length++ to array.push()

There is this piece of code that runs good with solc 0.5.0 updateValueAtNow(totalSupplyHistory, curTotalSupply + _amount); updateValueAtNow(balances[_user], previousBalanceTo + _amount); /// @dev `...

1
2 3 4 5 6