Questions tagged [solc]
Questions related to the compiler for Solidity: solc
70
questions with no upvoted or accepted answers
0
votes
1answer
98 views
cannot “npm install -g truffle” in PowerShell - #ERROR (cannot find module 'original-require')
What's this error? How can I resolve
0
votes
0answers
134 views
Why am I getting the error "Expected pragma, import directive or contract/interface/library definition?
I have "pragma solidity ^0.5.9" at the start of the file yet I still get this error.
Listing.sol:1:1: ParserError: Expected pragma, import directive or contract/interface/library definition.
...
0
votes
2answers
433 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
1answer
184 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
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
2answers
333 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
0answers
18 views
Unexpected behaviour. Huge size increase when adding new SubContract()
I have a contract similar to:
contract Contract01 {
SubContract _refContract;
...
constructor() public {
refContract = new SubContract();
}
function setSubContractRef(SubContract ...
0
votes
0answers
112 views
solc command is generating empty .bin files
Firstly, this is not an inheritance problem like in this post
I have the following two files ( ManagedWallet.sol & ManagedWalletLookup.sol )
pragma solidity ^0.4.24;
contract ...
0
votes
0answers
70 views
Why the same contract has more bytecode size in solidity 0.5 in compare to 0.4.24?
My earlier contract was compatible with solc@0.4.24. Now I am upgrading my contract to make it compatible with solidity 0.5 but it leads to an increase in bytecode size. AFAICT There is no change in ...
0
votes
0answers
131 views
solc/wrapper not working with reactjs
My compile.js code:
var wrapper = require('solc/wrapper')
var solc = wrapper(window.Module)
const Compile = (code,name) => {
return solc.compile(code, 1).contracts[':'+name];
};
export default ...
0
votes
0answers
234 views
Transaction remains pending on RINKEBY network
var Web3 = require('web3');
var Tx = require('ethereumjs-tx');
const fs = require('fs');
const solc = require('solc');
const generateWallet = require('ethereumjs-wallet');
var toAccount = 'TO ACCOUNT';...
0
votes
1answer
90 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....
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
0answers
48 views
Does the solC compiler work in the geth Javascript console anymore
does the solC compiler work in the javascript console anymore, and if it does how can I install it. I have tried using the compiler methods in the javascript console api however they do not work and ...
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 = "...
0
votes
0answers
431 views
Solcjs doesn't use the last version of compiler
I am compiling a contract using the npm package solcjs.
The package is at version 0.4.21 (npm view solc).
However compilation fails because my pragma is set to ^0.4.21 while solcjs states current ...
0
votes
1answer
251 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 ...
0
votes
1answer
564 views
Problem updating truffle framework
I have problems updating truffle. I run the command "truffle --version" and i got truffle version 4.0.1 and solc version 0.4.18. So i wanted to upgrade to 4.1.6 which is the latest version. I run "...
0
votes
1answer
2k views
Can't compile contract - pragma error and Cannot read property 'interface' of undefined
I am trying to compile this simple contract:
pragma solidity ^0.4.18;
contract Tasks
{
struct TaskOwner {
address TaskOwnerAddress;
bytes32 TaskOwnerName;
}
mapping (address ...
-1
votes
1answer
41 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 ...