Stack Exchange Network

Stack Exchange network consists of 175 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

Questions tagged [compiler]

A compiler is a computer program that translates a higher-level programming language into a lower-level language. For example: Solidity is compiled into EVM opcodes.

0
votes
1answer
35 views

ABIEncoderV2PackedStorage bug, is something to worry about? any info?

I have a simple factory of ERC-20 Tokens, deployed to Rinkeby using remix. When I create contracts with this factory and verify the code in Etherscan (using etherscan API) I am having this warning in ...
0
votes
0answers
60 views

Warning: The compiled contract might be susceptible to ABIEncoderV2PackedStorage (low-severity) Solidity Compiler Bugs

This Etherscan.io gives this warning when compiled contract with solidity compiler version 0.5.5 I am sure that is low severity issue and might not apply to our use-case, but I could not find any ...
0
votes
0answers
15 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
42 views

Is there a way to download Remix IDE locally and access it from the Terminal (Linux)?

Is there a way to download Remix IDE locally and access it from the Terminal (Linux)? Hi, I think I have read that it should be possible to download Remix IDE and use it offline. In the latest ...
0
votes
1answer
73 views

Unhandled Rejection (Error): invalid string value (arg=“x”, coderType=“string”, value=5)

Using Truffle unbox react to unbox a boilerplate. received the following error from running npm run start Changes: Addition of "memory" parameters in the simpleStorage.sol Changed unit to string in ...
0
votes
1answer
12 views

Understanding the “.send” warning message

Warning: Failure condition of 'send' ignored. Consider using 'transfer' instead. Is this a new compiler warning, and what exactly does it mean?
0
votes
0answers
33 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
1answer
40 views

Error in external function parameter defination for an interface

Dear community members, I have come across an error while defining an interface (just using the standard one interface ERC721TokenReceiver) this interface is mentioned in this link https://github....
1
vote
2answers
753 views

Unable to run truffle compile

I want to run truffle compile on my AWS Ubuntu 18.4 server. I'm able to compile the same contracts on my local with no compilation errors but when I tried to run truffle compile on AWS ubuntu server ...
0
votes
1answer
28 views

Problem with wallet.transfer in newer solidity compilers

I read the documentation of the changes on 0.5.0 but I do not know how to get this done with my code snippet. I tried to make the constructor payable but this does not work. Can someone help me. The ...
0
votes
0answers
32 views

Can we eliminate specifying solc compiler version at the beginning of each smart contract.

Is it possible to eliminate specifying the solc compiler version at the beginning of each smart contract. This would help in separating the compiler version from the smart contract, so if the compiler ...
1
vote
1answer
319 views

Switch solc compiler versions

I have solc v0.5.2 on my system, but I have several contracts, that require solc < v0.5, so that I get errors: Error: Source file requires different compiler version What is the best way to run ...
0
votes
1answer
113 views

I build solc from source v0.4.18 but can't not use it to compile solidity. How can I solve this problem?

$ solc --bin -o ./contracts SimpleStore.sol Warning: This is a pre-release compiler version, please do not use it in product ...
1
vote
1answer
204 views

Nested structs that are part of a mapping broken in Solidity 0.5.0?

The following code compiled successfully with Soldity 0.4.21. With 0.5.0 it triggers a fatal compilation error as follows: UnimplementedFeatureError: Encoding type "struct TestNestedStructInMapping....
0
votes
1answer
90 views

Is it safe to call revert() instead of returning a value?

I have the following piece of code: function func() public returns (bool) { if (some condition on msg.sender) { do some stuff return true; } revert(); } The compiler (0.4....
2
votes
2answers
22 views

Can I count on this general pattern executing correctly (similarly to C, C++ and probably any other language)?

Suppose I have something like this: contract MyToken is ERC20 { MyTokenImpl private myTokenImpl; constructor(MyTokenImpl _myTokenImpl) public { myTokenImpl = _myTokenImpl; } ...
0
votes
1answer
58 views

Deploying fails with different compile version

I'm trying to implement a simple card game. Actually, everything is working fine. Until I tried to move from 0.4.0 to 0.4.22. Any idea what is going wrong? Thanks a lot. And here the code: pragma ...
1
vote
1answer
171 views

Why is there a difference between a public array and a function which returns it?

On-chain example: pragma solidity 0.4.24; contract MyContract { uint[] public array; constructor() public { array.push(1); array.push(2); array.push(3); } ...
2
votes
1answer
69 views

How to get the correct line numbers from `solc --ast-json`?

I have the following in a file: contract Coin { address public minter; mapping (address => uint) public balances; event Sent(address from, address to, uint amount); function Coin() ...
2
votes
1answer
35 views

Why solc does not detect issue in this code?

I wrote a sample Solidity code below: in function call() of contract sample_call, I make a call to function add_car() function of another contract sample, but this is a bug, since variable v is never ...
0
votes
1answer
222 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
12 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 ...
1
vote
1answer
481 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
222 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
78 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
63 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
96 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 ...
1
vote
2answers
519 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 =...
2
votes
2answers
681 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
32 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
141 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
104 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
131 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 { ...
2
votes
2answers
1k 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 ...
8
votes
2answers
5k 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
364 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 ...
1
vote
1answer
410 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?
1
vote
1answer
1k 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
187 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 ...
4
votes
0answers
62 views

What is the keccak256 reference in opcodes from solc? [duplicate]

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
2k 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
68 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
212 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 ...
1
vote
0answers
539 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, ...
2
votes
1answer
900 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 ...
5
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
66 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
162 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
97 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: It splits the sequence of instructions into basic blocks at JUMPs ...
2
votes
2answers
2k 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? ...