Questions tagged [solc]

Questions related to the compiler for Solidity: solc

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

Interacting with wrappers in contracts from Go

I'm currently having issues with contracts in a small project of mine. The issue is as follows: I have a Go client for a Dapp and some Smart Contracts to interact with. I planned a contract (...
1
vote
1answer
588 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 ...
0
votes
2answers
335 views

Error while compiling Solidity code via py-solc

I am getting the following error while attempting to compile Solidity code via py-solc. Is it due to a new update of py-solc? how can I fix it? >>> from . import views File "/home/manzik/...
0
votes
1answer
18 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 ...
0
votes
1answer
103 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
1answer
106 views

Solidity standard library: how to contribute?

I'd like to contribute to Solidity standard library, which seems a bit feature-less. How can I do that? Is there are some agreements about Solidity standard lib like in c++? I have implemented some ...
0
votes
2answers
95 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 ...
0
votes
1answer
46 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 ...
2
votes
2answers
1k views

Not able to get rid of error from solc-js “AssertionError [ERR_ASSERTION]: Invalid callback specified.”

const path=require('path'); const fs=require('fs'); const solc=require('solc'); const InboxPath=path.resolve(__dirname,'contracts','Inbox.sol'); const source=fs.readFileSync(InboxPath,'utf8'); solc....
1
vote
0answers
31 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
2answers
468 views

How can we compile multiple smart contracts by compile.js file?

My compile.js file is below const path = require('path'); const fs = require('fs'); const solc = require('solc'); const ballotPath = path.resolve(__dirname, 'contracts', 'blocktitans_ballot.sol'); ...
1
vote
1answer
392 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
128 views

How to identify the bytecode of a single function

I am trying to generate the bytecode for a single function. I need to avoid any setup/teardown that may occur in the contract as I am trying to get a precise measurement of the execution time in the ...
0
votes
1answer
91 views

CONNECTION to Rinkeby showing false, contract not getting Deployed

SOURCE CODE var Web3 = require('web3'); var Tx = require('ethereumjs-tx'); const fs = require('fs'); const solc = require('solc'); var web3 = new Web3(); web3.setProvider(new web3.providers....
3
votes
1answer
62 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
252 views

Solc “bin-runtime” not a command?

I can generate the .bin of a contract with solc as follows: solcjs --bin -o output contract.sol However running the following command: solcjs --bin-runtime -o output contract.sol Generates the ...
4
votes
4answers
1k 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&...
2
votes
2answers
531 views

How to deploy a smart contract in a server?

I have developed a smart contract and compiled it with solc and bin and abi fils have been generated. Now, I want to deploy this contract using web3js in a linux server. How can I do it?
6
votes
6answers
13k views

Solc --version: command not found

I'm trying to use solc with no success. I download solc with npm install solc but when I run solc --version the console output is: command not found. If I list packages npm list I'm able to see ...
0
votes
1answer
184 views

Solidity solc compiler error on code Remix can compile

I am attempting to compile the following solidity code using solc in NodeJS. pragma solidity ^0.4.11; contract helloWorld { string public message; function constructor() public{ message = "...
2
votes
3answers
2k views

How to use Solidity solc to compile A.sol that imports B.sol file?

I know how to install solc via "npm install --save solc" then use solc.compile to compile one sol file. But now I've got A.sol file that imports B.sol file, and when I run node compile.js, no error in ...
1
vote
1answer
177 views

verifying code deployed with web3.js

I am deploying my smart contracts using web3.js and compiling the code using solc. The contracts are deployed successfully with no issues however I am having a bit of a problem in verifying my ...
1
vote
1answer
190 views

Cannot deploy contract

I'm having difficulty deploying a solc-compiled contract to ganache test network using web3. package.json { "name": "smartinvoice", "version": "1.0.0", "description": "", "main": "index.js", ...
0
votes
1answer
186 views

I have written a javascript code for compiling the solidity code but it's showing error

I was trying to compile my contract using solc compiler but it returning me some errors. I will place my solidity code along with the error that I am getting here. Please help me out to sort this ...
0
votes
1answer
42 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....
0
votes
2answers
447 views

Solc complier error “TypeError: Cannot read property 'TestToken.sol' of undefined”

I set up a contract with three files referring to Token Factory. I make a test on remix online tool, they can be successfully compiled. when I'm tring to compile them by solc module in a .js file, ...
0
votes
2answers
265 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 { ...
2
votes
1answer
336 views

How can I use solc solidity compiler on truffle webpack?

When I try to import solc, it raises an error which says: ERROR in ./~/require-from-string/index.js Module not found: Error: Can't resolve 'module' in 'C:\users\bisrat\Desktop\webpacksample\...
1
vote
0answers
12 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
30 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?
2
votes
1answer
1k views

Truffle Bytecode Different from Etherscan Bytecode

I am having difficulty verifying my contract code on Etherscan using the code generated by Truffle. Using Etherscan VerifyContract V1: https://rinkeby.etherscan.io/verifyContract Truffle produced ...
8
votes
1answer
586 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
25 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
11 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
143 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
43 views

Deploy.js script is inifinite, does not show any errors

This is the deploy.js file: const assert = require('assert'); const HDWalletProvider = require('truffle-hdwallet-provider'); const Web3 = require('web3'); const cF =...
0
votes
1answer
30 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
100 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-...
3
votes
1answer
920 views

Timeout exceeded during the transaction confirmation process

I am trying to figure out the right syntax for solc 0.5.7 and web3 1 beta 52 Follow my source code: contract.sol pragma solidity ^0.5; contract Hello { string public message; constructor (...
1
vote
2answers
361 views

Truffle and Remix compiles differently

I have a smart contract that outputs a different bytecode when compiled with truffle, and with remix, even though both seem to use the same compiler version: 0.5.7+commit.6da8b019 Is that a known ...
3
votes
1answer
229 views

How to match the etherscan.io bytecode using the solc compiler?

Trying to do some simple sanity checks between the verified contracts on etherscan.io and the bytecode available on the blockchain for those contracts. I picked a random contract to test: https://...
2
votes
1answer
1k 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
28 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
11 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 ...
2
votes
0answers
102 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
40 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
42 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
57 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
0answers
18 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
2 3 4 5 6