New answers tagged

0

Since you have declared balances as uint in line 4, totalSupply should also have the type uint. Change the 7th line to uint public totalSupply = 10000 * 10 ** 18; and it will not show the error.


1

You are trying to mix uint with int: totalSupply is of type int while balances maps to uint. Since your totalSupply can't ever be under zero, you should simply change that to be uint. That way you don't have to convert anything and your types are more correct.


2

(Answering myself two year later for those arriving here through Google Airlines): "new" keyword is the culprit in this case. Each time "new" is used, the full code of the referenced smart-contract will be included in order to allow to build new SubContract instances at runtime. If just pre-built references are passed, the compiler is ...


1

This answer is about nightly builds in general and not specific to solidity. A nightly build, in general, is a build of a version, that is not finished yet. So there might be more bugs or missing features. It is basically a build of the current work in progress. It is called nightly build because it is common to automatically build them from the current ...


1

You error is not related to nightly builds. One of your files (SafeMath.sol) requires a compiler version (pragma solidity ^0.4.23) lower than the one you selected (0.8.3).


0

First you have to decide which solidity version you want to choose for your project. Its not necessary that you choose the latest version(my opinion). You have to consider the solidity version of external packages that you wish to use in your project. For example, if you are using Openzeppelin, you can find different versions here: @openzeppelin/contracts. ...


Top 50 recent answers are included