Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

The tag has no usage guidance.

0
votes
1answer
35 views

Remix IDE nolonger loads old solidity compilers. Error: "mock compiler: source not found|

The Ethereum solidity Remix IDE doesn't work for some reason. It doesn't seem to load the various compiler versions and renders the error: mock compiler: source not found I've tried to install ...
2
votes
0answers
10 views

What is the compiler version of a contract created by internal transaction? [duplicate]

I want to be able to verify and publish a contract source code on Etherscan.io. I have created a new contract from a factory contract, in which I successfully published and verified. When I come to ...
0
votes
1answer
51 views

Do modifiers work in interfaces

Can an interface enforce a modifier on a function? For example, does this work: contract TokenSeller { modifer enforceSale(uint256 amount) { ERC20 t = token(); uint256 beforeBalance = t....
0
votes
3answers
63 views

Stack too deep compiler error, but function only has 5 parameters?

I have a function, shown in its entirety below, that is getting the dreaded "stack too deep" compiler error. I have read several of the other posts on this forum about this error, but all of them ...
3
votes
0answers
52 views

Why does this work with Solidity 0.4.21 but not 0.4.22?

I have this simple set of contracts. pragma solidity ^0.4.21; contract FirstContract { bool public isTrue = true; function sayHello() public pure returns(bool) { return true; } } ...
0
votes
2answers
27 views

How smart contract versioning work with compiler?

As Solidity is keep updating and so the compiler. In the beginning there was constant keyword which now is deprecated. So how does that smart contract is still working? If i make some contract with ^0....
0
votes
2answers
38 views

My contract doesnt get published on ropsten etherscan

I get the following error: Error! Unable to generate Contract ByteCode and ABI I've seen other people experiencing the same issue but their solutions don't work for my issue. I don't use libraries ...
0
votes
2answers
98 views

Solidity Compiler - Error: Identifier already declared

Full source code of the file 'Test.sol' : pragma solidity ^0.4.23; contract Mortal{ address owner; string ownerInfo = "Contract Owner name XYZ"; constructor () public { owner =...
1
vote
2answers
109 views

Solidity: Best practices - Which compiler version should I use? Advantages / Disadvantages

Where is the main difference between: pragma solidity ^0.4.24; and pragma solidity 0.4.24; Why would I use one or the other? Advantages / Disadvantages? What effect will it have in the future when ...
0
votes
0answers
16 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
67 views

The contract will not compile: Member not found or not visible [closed]

This is my code: pragma solidity ^0.4.23; import "./SafeMath.sol"; import "./MintableToken.sol"; import "./Ownable.sol"; import "./BurnableToken.sol"; /** * @title Crowdsale * @dev Crowdsale is a ...
0
votes
2answers
45 views

How do I find out what compiler version was used to deploy with MyEtherWallet

If I deploy a contract on MyEtherWallet.com how can I find out what compiler version was used, for verifying the code on etherscan, etc.?
2
votes
3answers
68 views

ParseError in solidity code

This is the error i get. ParserError: Expected pragma, import directive or contract/interface/library definition. This is my Solidity contract code. pragma solidity ^0.4.6 contract Inbox { ...
1
vote
1answer
317 views

Solved: How to change Solidity linter [solc] compiler version in Visual Studio Code?

Hi may I know how to change my Solidity linter compiler version in Visual Studio Code(vscode)? OR Visual studio code how to specify solidity compiler version? The only Solidity related extensions I ...
6
votes
2answers
3k views

I've got an error while compiling.Use “constructor(…) { … }” instead

I've followed the lecture on Udemy. But I've got an error here's my 'Inbox/contracts/Inbox.sol' pragma solidity ^0.4.17; contract Inbox { string public message; function Inbox(string ...
1
vote
2answers
132 views

Solidity Help - Undeclared Identifier - onlyOwner WithdrawEther

I'm new to Solidity and attempting to add a withdraw ether function for my contract which enables me to release funds the parent contract account, but the compiler (remix) keeps on giving me an ...
0
votes
1answer
179 views

Where is the compiler in Remix?

I installed remix-ide. It is able to compile contracts. So it somehow calls Solidity compiler. Where is this compiler located in the filesystem and how to use it without remix-ide?
0
votes
1answer
653 views

Remix compiler is not loading and gives “Compiler not yet loaded.” message when attempting to force

This issue is occurring on both chrome and firefox. I have not changed anything from a week ago when it worked fine. The remix compiler works on Edge browser but not the other 2. If anyone has any ...
1
vote
1answer
89 views

What is auxdata in the asm output from solc?

I am using - solc --asm smartcontractname.sol I get at the end of the asm auxdata. I am trying to check different modules to see what is inherited. Does anyone know how auxdata is computed? Here is ...
3
votes
0answers
35 views

What is the keccak256 reference in opcodes from solc?

Opcodes - Opcodes: PUSH1 0x60 PUSH1 0x40 MSTORE CALLVALUE ISZERO PUSH1 0xE JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0xA0 DUP1 PUSH2 0x1C PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN STOP PUSH1 0x60 ...
0
votes
1answer
601 views

Solidity: ParserError: Expected pragma, import directive or contract/interface/library definition. uint private age; ^

I am using Atom together with etheratom and I don't get why this simple code won't run: pragma solidity ^0.4.19 contract MyFirstContract { string private name; uint private age; ...
2
votes
1answer
40 views

Examples of functions limitations?

I coded different functions and didn't find a standard that define crystal clear how many variables you can use (fields, local or as parameters of modifiers inside this function? Do you know a ...
0
votes
2answers
121 views

Car Rental System Compile Error

I am writing code for a car rental system but i'm getting a few compile error messages that don't understand. The first error is TypeError: Expression has to be an lvalue. The second is ...
0
votes
0answers
416 views

Solidity Compile error: Identifier already declared

I'm trying to run my code but i get this error: Could not compile source code. " Identifier already declared. function addCar(string _make, string _model, unit _pricePerDay, uint _minRentalDay, ...
0
votes
0answers
27 views

Compiler allows local variable use, before it has been initialized

Hey I noticed that Solidity allows the use of a variable before it has been initialized. The variable is recognized as 0 in the case of a uint. What is the purpose of this design? contract ...
-1
votes
2answers
760 views

How to call & use ERC20 airdrop smartcontract

I'm using remix solidity browser compiler. I deployed this code for an AirDrop smart contract: https://pastebin.com/kzYxmEab I used the same address to create/deploy the Airdrop contract as was used ...
3
votes
3answers
2k views

“Mock compiler : Source not found” Error in Remix online IDE

I haven't been able to compile any solidity code because of this error. How do I solve this problem?
0
votes
1answer
24 views

Compiling with outdated compiler

In my contracts I've been placing pragma solidity ^0.4.2; Without knowing my compiler is outdated at 0.4.16! Interestingly, all contracts still compile and are able to migrate to testrpc. Still, I ...
0
votes
1answer
89 views

Ethereum Wallet cannot complie “msg.sender.send”

I have been using Ethereum Wallet to compile and deploy contracts. Now I got this error when trying to test the code in CryptoKittyCore. It failed to compile with this message Failure condition of '...
1
vote
0answers
77 views

EVM Assembly tags

Studying the Solidity optimizer i found that the assembly code is divided into tags and the optimizer doesn't work between them From Solidity docs Optimizer Internals: It splits the sequence of ...
0
votes
0answers
117 views

Issue with Using a Struct: InternalCompilerError

The following struct resides in Queue.sol. struct Request { address to; uint256 value; bytes data; } In Unnamed.sol, I have the following pragma solidity ^0.4.14; import "./Queue.sol"; ...
2
votes
2answers
994 views

unable to verify the contract on etherscan.io. How to resolve this issue?

I am unable to verify the contract in etherscan.io. I was able to deploy the same solidity code in (Geth, Mist). But the same code I am unable to verify in etherscan.io. What mistake am I doing here? ...
0
votes
0answers
36 views

Need assistance on Altcoin Daemon Setup

I created an altcoin using this Steemit Link I am trying to create a bot on twitter to tip people in my token currency. I am using this github link for the tipbot. I am stuck on the RPC area for my ...
0
votes
0answers
638 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 ...
2
votes
2answers
3k views

Remix Warning - No visibility specified, Violate Checks-Effects-Interaction pattern, Function state mutability can be restricted to pure - Can ignore?

Two months ago, I wrote a smart contract with Remix.ethereum.org. Line 1 of my code has: pragma solidity ^0.4.11; It compiled fine with no errors and nor warnings. I tested every function in ...
0
votes
1answer
279 views

How to execute web3 batch js file

New to solidity programming and I discovered this today at this site: var contract = new web3.eth.Contract(abi, address); var batch = new web3.BatchRequest(); batch.add(web3.eth.getBalance.request('...
4
votes
2answers
409 views

totalSupply() Solidity signature causing conflict error

I'm writing a very basic ERC20 token using solidity in the Mist wallet. For some reason the compiler doesn't like the totalSupply() function name. If I change this name it compiles fine. To be ERC20 ...
0
votes
1answer
101 views

In Node.js connected to Geth : solc.compile prefixes an additional ':' before contractName

I'm trying the following script on Node.js while running a node connected to Rinkeby Testnet (from https://github.com/ethereum/wiki/wiki/JavaScript-API#web3ethcontract): const fs = require("fs"); ...
3
votes
0answers
473 views

How to update the Ethereum Wallet Solidity Compiler

I'm using the latest Ethereum Wallet version which is 0.9.0 and I want to update my latest Solidity compiler since it seems that the wallet is using this version 0.4.13+commit.0fb4cb1a.Emscripten....
0
votes
1answer
78 views

error building solidity compiler with `brew upgrade`. build from source?

This is the error message I got after recently running brew upgrade: The command which solc, still outputs: /usr/local/bin/solc Is this a problem? Maybe I should uninstall and reinstall my ...
2
votes
0answers
103 views

Is there a “gas penalty” for using too many asserts in a contract?

I'm at a very puzzling scenario. While using Remix, I noticed that adding a few asserts has caused a significant increase in execution cost (from ~50K to ~59K). And not only did it increase the ...
2
votes
1answer
409 views

Node JS module in Geth is not found

I have installed solC module with command: npm install solc How can I use this module in Geth? When I execute var solc = require("solc") in Geth's console, interpreter throws: Error: Cannot find ...
1
vote
1answer
456 views

Truffle Compile on Windows “Could not find a suitable configuration file” [duplicate]

I am trying to do a simple Truffle Compile on window 10 using git bash but i keep getting "Could not find a suitable configuration file" I have tried "Truffle Compile" after running truffle init. I ...
1
vote
1answer
467 views

Undeclared identifier when compiling with truffle compile

I have this contract and can't figure out where's the problem. Any ideas? (I'm a noob in solidity, just started a few days ago). HelloWorld.sol file: mapping (address => uint) balances; function ...
1
vote
1answer
209 views

Why was the Solidity compiler removed in geth 1.6.0?

Why was the Solidity compiler removed in geth 1.6.0? What is the procedure to deploy a contract in geth 1.6.0?
1
vote
0answers
139 views

(web3.js) The method eth_compileSolidity does not exist/is not available [duplicate]

I have tried to develop a javascript function with web3.js to compile a solidity contract. In html/javascript code, I have prepared the following. var contract_code = "pragma solidity ^0.4.....[omit ...
4
votes
2answers
861 views

Solidity optimizer vs LLVM optimizer

Looking at the evmjit code I noticed that the LLVM optimizer is actually used right before execution of a contract by the virtual machine. I have also noticed that the Solidity compiler has its own ...
0
votes
1answer
109 views

web3.eth.compile.solidity enable/disable optimization

Is there any way to enable/disable compiler optimisation when using web3.eth.compile.solidity(...) PS: using solc-js is not considered
1
vote
1answer
144 views

solc: exit status 1 when compiling my contract on my private blockchain

I was trying to compile an example contract as told in the official website: here it was successful to setSolc and getCompilers ,but some errors occur when compiling the contract available on that ...
1
vote
1answer
1k views

Solidity function that accepts mapping as input

Is it possible for Solidity to accept mappings as input parameter in a function? I've been trying to create a function with a second parameter mapping (string => string) aMapping, pragma solidity ^0....