I want to use a editor which shows some highlights while writing a solidity code. Please suggest a good editor for writing smart contracts solidity codes for windows. Like gedit for c language.
[Ethereum] What are good offline editors for solidity in windows?
solidity
Related Solutions
There's some explanation in the original design proposal here: https://t.co/An1ZpRSu7O .
Basically, it was meant to use some OOP features to provide a convenient abstraction for contracts. Objects' data could be arbitrarily complex through its mapping
mechanism. The original design included the ability to specify (and therefore optimise) that mapping. For objects' functions, I leveraged the then-new Ethereum contract ABI specification to synthesise something familiar to OOP practitioners. The introduction of the constant
function marker was also quite nice, since it allowed an optimised way of inspecting object state with Solidity logic.
It was meant to be a sophisticated tool for developing contracts that could ultimately give both developers and users good information on what the code did. To help this along, I devised NatSpec, a contract-friendly documentation format, and made that a first-class citizen in Solidity. I also proposed a formal proofing language subset (not yet implemented) in order to maximise the kinds of correctness guarantees that could be made.
I introduced events as a first class citizen into the Solidity language in order to provide a nice abstraction for LOG
s similar in form to function calls. Inspiration for that came from the Qt meta-object system's "signals".
One later feature that Christian R. and I figured out together was function modifiers; that allows attributes placed as part of a function signature to make some modifications to the apparent function body. Being a very declarative means of expression, it's an idiom that falls nicely into the contract-oriented programming space.
You set a variable that define the price and set the value in the constructor:
contract My contract{
uint256 public TokenPrice;
constructor(uint256 _price){
TokenPrice = price;
}
}
Then you use this variable to calculate the number of tokens you will give per Ether. There is a full example of how to do this in Ethereum website.
Hope this helps
Best Answer
1. With my experience usin solidity, I'll recommend you Atom with its Solidity packages:
The Atom code editor works so well, you can edit documents in remote mode and connect with other developers to edit at the same time the same code. Also it looks fantastic and you can modify all the apperance of the interface just by editing it's CSS file.
2. Another nice option is use remix-IDE:
Note: it contains the latest release of Solidity available at the time of the packaging. No other compiler versions are supported.
VS Code Solidity package from Juan Blanco works fine but is very strict with the line breaks and spaces, if you do not put the ones that the package wants, it will mark them as errors and if you're not familiar with that line break syntax, you'll probably get tired of it.
Hope it helps!