Questions tagged [solc]

Questions related to the compiler for Solidity: solc

Filter by
Sorted by
Tagged with
0
votes
1answer
24 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....
1
vote
0answers
22 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
28 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
0answers
15 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
21 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
9 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, ...
1
vote
2answers
78 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
25 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 ...
1
vote
0answers
71 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
1answer
63 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
29 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
20 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
19 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
21 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
46 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 ...
0
votes
1answer
397 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
32 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
35 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
96 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
35 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
51 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
18 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
78 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
vote
0answers
99 views

Truffle compiler stuck at 0.4.17

Coming from here: How do I specify a different Solidity version in a Truffle contract? I still have the same issue, except that even after trying all of the suggested solutions, and even having the ...
1
vote
1answer
50 views

Transaction does not get mined on rinkeby

so I'm trying to deploy my first contract on rinkeby using web3 and truffle/hdwallet-provider. even with different gas prices it doesn't get mined.Please help out. const HDWalletProvider = require("@...
1
vote
1answer
238 views

Getting Error while compiling: Stack too deep

Here is my code i have array not 16 variables in a function please help where i am wrong. struct Escrow { bytes16 contractID; uint256 sellingTokenAmt; uint256 feeAmtInSellingToken; ...
2
votes
1answer
149 views

truffle version and solcjs --version returns different versions

I want to change solc version on my system(downgrade from 0.5.16 to 0.4.17). I tried uninstalling it with npm -g uninstall solc and then installed with npm -g install solc@0.4.17 but it does not ...
0
votes
1answer
205 views

Using the correct/best solc version with Truffle and general tooling setup

I haven't worked with Truffle/Solidity for a while and I am trying to get my environment/toolchain configure correctly. I have some questions regarding the compiler config. I was originally not ...
2
votes
1answer
277 views

solc-v0.6.0: TypeError: Operator - not compatible with types tuple() and int_const 1

I am having this error on solc version 0.6.0. Basically I am returning length of the list and subtract 1 from it, where that value will be assigned to an uint variable. In general this command used ...
1
vote
2answers
1k views

Install Old Solc Compiler Versions

I would like to compile older versions of solc contract source code using a solc compiler on my local machine. Is there a website from which to download old solc compilers? Google revealed a GitHub ...
1
vote
1answer
38 views

Are there any risks of undefined behavior when calling a function which doesn't return anything using a prototype of it which returns bool?

According to the ERC-20 Token Standard, functions transfer and transferFrom should return a boolean value indicating success or failure: interface IERC20Token { function transfer(address _to, ...
0
votes
1answer
147 views

How do I install Go-ethereum and solidity on Debian10

I am using debain on wsl and I want to install ethereum and solidity for blockchain development but I am not able to find an exact way to do it.
0
votes
0answers
55 views

Solc Compiler related Error in Nodejs

I have almost 800 .solc files of version ^0.5.12 (i am using also 0.5.13 compiler version), when i all give them to my input, to compile with following code; var walk = function (dir) { var ...
1
vote
1answer
217 views

what is 'UnimplementedFeatureError: Not yet implemented - FixedPointType' error?

what is 'UnimplementedFeatureError: Not yet implemented - FixedPointType' error in solidity while compiling through truffle ? How to fix it ? Using solidity compiler version - 0.5.9
0
votes
1answer
143 views

Why does solc output bytecode that is not in valid hex format?

I compile my solidity file using the following command: solc Encoder.sol --bin --abi --optimize -o <output_dir>/ Then I try to deploy it in Geth: Encoder = eth.contract([<abi file content&...
1
vote
1answer
34 views

How to type cast fixed size byte arrays in solc 0.5.x?

In solc 0.4.28 I was able to do: uint foo = 42; bytes28 bar = bytes28(foo); but in 0.5.9 I'm getting the error: TypeError: Explicit type conversion not allowed from "uint256" to "bytes28". ...
1
vote
1answer
20 views

BrowserSolc not defined

I'm trying to use BrowserSolc in my dApp, but it's just not loading, it seems. I've got browser-solc.min.js in the same folder as index.html, with the following near the top of the page: <script ...
3
votes
1answer
98 views

What are remappings and how do they work in solidity?

How can they be used with solc?
1
vote
0answers
58 views

Cannot execute contract in non-intaractive scripts

I want to deploy and to execute ERC-20 contract on geth with non-interactive scripts. But, it seems that non-interactive scripts and console shows different results. Enviroment ubuntu 18.04(docker ...
4
votes
1answer
205 views

VS code Expected identifier, got 'LParen'solc

I keep getting this error/warning on my vscode when I emit events and build constructors. or After a bit of googling I understand it is something about my compiler, since solc <0.4.18 does not ...
0
votes
1answer
212 views

Solidity Error: Cannot destructure property `interface` of 'undefined' or 'null'

I've got his error in Solidity when compiling my test file: TypeError: Cannot destructure property interface of 'undefined' or 'null'. I know it is related to my compile.js file, but what is ...
1
vote
0answers
63 views

How to achieve inheritance support using web3j wrapper?

I have two types of smart contracts. One parent contract to store the type and other child contracts which inherits the parent contract. The problem is, I can't generate java wrapper class (...
5
votes
2answers
935 views

Using two solc versions within the same truffle project

I am creating an app that has various imports that require two different versions of solidity. AragonOS(0.4.x) and openzeppelin(0.5.x) Of course, there are breaking changes in 0.5.x so my question is ...
0
votes
2answers
60 views

Store/retrieve data doesn't work using node

i trying something simple, store and retrieve a data in a smart contract, but when i want to retrieve the data, nothing is returned. solc version is 0.4.24 web3 version is 1.2 Solidity code: pragma ...
1
vote
0answers
342 views

Cannot read property 'type' of undefined - abi-coder

I'm creating a simple voting contract. It is deployed with truffle and infura. This is the contract code: pragma solidity >=0.4.21 <0.6.0; contract Voter { struct OptionPos { uint ...
0
votes
1answer
73 views
0
votes
0answers
30 views

compile_files gives errror for given path of the contract [duplicate]

pragma solidity ^0.5.1; import "./Owned.sol"; contract Greeter is Owned { bytes32 public greeting; event GreetingChange ( address indexed changer, bytes32 indexed _from, ...
1
vote
0answers
103 views

Gas usage difference between Remix and Ganache/public networks

I'm trying to integrate a contract into a front end with MetaMask and getting different gas amounts depending on the network and compile options I use. Remix ("Enable Optimization" checked): 90,410 ...
1
vote
1answer
288 views

How to call a contract function that alters blockchain state on geth console

It should be easy, but I'm having a hard time using a simple smart contract described in the Solidity language reference called SimpleStorage. It only as one attribute, a setter and a getter, and I'm ...
2
votes
1answer
139 views

solcx compile_files Key error

I am using python package py-solc-x for compiling the smart contract. os.path.abspath("D:/new.sol") Gives path where my test contract exits. 'D:\\new.sol' Then i use compile_files to compile the ...

1
2 3 4 5