Questions tagged [solc]

Questions related to the compiler for Solidity: solc

Filter by
Sorted by
Tagged with
2
votes
1answer
31 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
1answer
57 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
75 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
31 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
15 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
17 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
32 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
33 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
15 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
12 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
83 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 ...
1
vote
1answer
179 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
27 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 ...
1
vote
0answers
238 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
129 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
141 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
22 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
33 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?
9
votes
1answer
2k 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 ...
0
votes
0answers
33 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
17 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
422 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
51 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
279 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-...
4
votes
1answer
3k 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
29 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 `...
0
votes
0answers
12 views

Does the Bytecode and ABI generated for each contract also include it's imports?

If not, how does a contract such as an ERC20 get deployed if each output has its own ABI and Binary file? When compiling with truffle, and looking at A.json (where A imports B and C) it seems that it ...
0
votes
1answer
51 views

I have a truffle version problem. and I've done it but it's not working

I've done npm install -g solc@0.4.16 and it reads solc@0.5.16 when doing the truffle version compilers: { solc: { version: "^0.4.26", // A version or constraint - Ex. "^0.5....
3
votes
0answers
193 views

solc unable to import scoped packages

I am trying to import these lines on solidity and compile it with solc import '@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol'; import '@uniswap/v2-periphery/contracts/interfaces/...
1
vote
1answer
46 views

Cannot reproduce Etherscan verified compilation for 0.6.6 contract

I'm trying to reproduce the following contract compilation on Etherscan: https://etherscan.io/address/0x7a250d5630b4cf539739df2c5dacb4c659f2488d#code. Runtime bytecode on-chain I can get the runtime ...
0
votes
1answer
134 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 ...
0
votes
1answer
65 views

How do I receive a revert message using go-ethereum

How do I receive a revert message using go-ethereum? receipt, err := bind.WaitMined(context.Background(), client, tx) if err != nil { fmt.Errorf(err) } fmt.Println(receipt.Status) Now I can only ...
0
votes
0answers
37 views

Abigen doesn't create free data retrieval call for public state variable

I'm looking at an example contract using go-ethereum. In the book, when a go file is created in Store.sol through abigen, the code that automatically gets the Version() string is generated. However, ...
7
votes
5answers
3k views

Solidity Error: Struct containing a (nested) mapping cannot be constructed

My version of solc: "solc": "^0.7.1", When I try to construct a struct that contains mapping, I got this error: "Struct containing a (nested) mapping cannot be constructed&...
0
votes
1answer
249 views

truffle solc specific compiler fail

,/C/Users/juhne/ipfs-image-dapp/contracts/Migrations.sol:1:1: ParserError: Source file requires different compiler version (current compiler is 0.5.16+commit.9c3226ce.Emscripten.clang - note that ...
2
votes
0answers
368 views

Conflicting solc versions on Truffle-test

I'm developing some smart contracts sing solc 0.7.0. I'm able to successfully compile and deploy the contracts, but when I try to run $truffle test I get the following error: Using network '...
0
votes
2answers
507 views

solc-js error: “before each” hook for “deploys a contract”: SyntaxError: Unexpected token u in JSON at position 0

The issue is probably here: const { interface, bytecode } = require('../compile');. interface in the test file is undefined. inbox/contracts/Inbox.sol: pragma solidity ^0.7.0; contract Inbox { ...
0
votes
0answers
31 views

How can know which is library's bytecode?

When I compile solidity file that has more then two contracts, Solc gives me some binaries. That binaries include bytecode of library. How can I know which one is library's bytecode if I don't have ...
0
votes
0answers
37 views

Why do solc v0.4.17 and v0.4.18 behave differently with the allow-paths primitive?

Here's an example contract: Nobody.sol pragma solidity ^0.4.17; contract Nobody { function die() public { selfdestruct(msg.sender); } } The solc JSON specification to compile the ...
1
vote
1answer
27 views

Compilation Eror: One contract accessing the variable of another contract

I am trying to compile two contracts. I am getting 'balance' variable error in "HoneyPotCollect.sol" contract. Is balance not a global contract variable? Somebody please guide me how to ...
-1
votes
1answer
68 views

Trying to compile running: 'node compile.js', but get error: “assert.js:399 throw err;” [Udemy 'Complete Developers Guide' Course]

This is my hands on contract with this Udemy Course - Ethereum-and-solidity-the-complete-developers-guide This is the contract file, which contains two contracts - Campaign and FactoryCampaign. I ...
0
votes
1answer
77 views

Truffle and Buidler are compiling to very different bytecodes despite having same compiler settings

Truffle is giving > 24kB and out of gas errors, but Buidler is not. I have checked the number of characters in the 'deployedBytecode' of the JSON: Buidler 33k characters (so 16.5kB) Truffle 55k ...
1
vote
1answer
2k views

…is an abstract contract or an interface and cannot be deployed

I don't have any programming language experience. But i'm interested to learn how to create my own ERC20 token and it was sucessfully deployed without any error using remix ethereum. But, once i'm ...
0
votes
2answers
175 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 ...
3
votes
1answer
115 views

abi.decode() and unused variables

I am decoding bytes as the following: // Decode Solidity tightly packed arguments (uint8 _, uint128 stakeId, address behalf) = abi.decode(userData, (uint8, uint128, address)); // solhint-...
0
votes
1answer
410 views

How can I get the ABI from solc.compile? (^0.6.4)

In pragma solidity ^0.6.4; I wrote a contract and can get the byte code as follow: const solc = require("solc"); const path = require("path"); const fs = require("fs"); const inboxPath = path....
1
vote
1answer
103 views

How to pass constructor parameters to solc?

I'm trying to compile a Smart Contract to bytecode using solc. I'm on a Ubuntu VM so I have to rely on a simple-to-install cmd line application. Compilation works fine but it seems like I can't pass ...
0
votes
2answers
309 views

How to deploy multiple compiled solidity with web3?

So I have this codes const MultiSigWalletFactory = fs.readFileSync(path.resolve(__dirname, "MultiSigWalletFactory.sol"), "utf8"); const Factory = fs.readFileSync(path.resolve(__dirname, "Factory....
0
votes
2answers
21 views

Does solidity create unique outputs every time it compiles same exact code?

Is there any difference if I compile everytime I want to deploy another multisig wallet. Or I can just deploy another multisig wallet using the same compiled data?
1
vote
1answer
189 views

converting keccak from old version: pragma solidity 0.4.19; [duplicate]

I am trying to compile following code: pragma solidity 0.5.9; contract test{ //https://github.com/ethereum/solidity/issues/3469 address payable owner; mapping (address => bool) pd; uint public sS;...

1
2 3 4 5 6