Here are the list of tips and tricks to develop solidity in a modern way (understand back to 2017 year :-) )

IDE Support

I recommend you to use the excellent Jetbrains Webstorm or Intellij IDEA with the folllowing free plugins:

  • Intellij-Solidity see https://github.com/intellij-solidity/intellij-solidity
  • Solidity Solhint Plugin allow to enable Solhint inspection capabilities in your project. It highlight of warnings / errors found by the linter in editor during code modification.
  • Refactoring in Javascript is excellent but still not supported in Solidity,

Auto-completion of solidity

Your smart contract code also deserve to be recognized by your IDE and in your test-cases. In order to enjoy auto-completion you'll have to use Soltsice ()https://github.com/dbrainio/Soltsice) to convert Solidity code to TypeScript at compile time.

Add to your package.json

"scripts": {

"types": "soltsice build/contracts types",

},
"devDependencies": {

"soltsice": "^0.9.8"

}

After any major changes to your Solidity code, run "npn run types", once done you can enjoy auto-completion in javascript and in solidity!

Auto-completion in Javascript

Chances are high that you are writing a lot of unit tests, integration tests...I hope you do. In order to get hint from the IDE, you'll need under IDEA/WebStorm settings - Javascript - to add the following libraries by clicking [ download ]

mocha, jasmine, chai, chai-as-promised, babel-core, add as much as your are using in your code.

FYI by doing so  you just add typedscript packages from DefinitelyTyped GitHub project.

Auto-completion of Web3 

Web3 is the Ethereum compatible JavaScript API which implements the Generic JSON RPC spec. It's available on npm as a node module, for bower and component as an embeddable js and as a meteor.js package.

There currently no official Web3 type definition included in the DefinitelyTyped project. But there is one package good enough even if in Beta at https://www.npmjs.com/package/web3-typescript-typings

Debugger

Only the Truffle debugger for now http://truffleframework.com/docs/getting_started/debugging 

Running unit test

Using Karma is still a work in progress with TruffleSuite. A karma-trufflesuite runner is missing (https://github.com/karma-runner) but i am developing one!

CI in Travis with Docker, .travis.yml

dist: trusty
sudo: required
group: beta
language: node_js
node_js:
  - "8"
cache:
  directories:
    - node_modules
before_script:
  - truffle version
script:
  - npm run lint
  - npm run test
notifications:
  slack:
    rooms:
      - secure: xxxxxxxxxxxxxxxx
    on_success: change
    on_failure: always
    on_pull_requests: false

Easy testing of EVM Time shifting  with Truffle snapshot/restore

Buggy right now, but may be solved soon see https://github.com/trufflesuite/ganache-cli/issues/390 

This is a work in progress, i will continue trying to improve my day to day Solidity toolbox! If you have more tips, feel free to use the comment section below.

 

comments powered by Disqus

You might like also

Evaluating Blockchain Projects With Token Economy Canvas
Business Model Canvas is a strategic management and lean startup template for developing new or documenting existing business models. It is a visual chart with elements describing a firm's or product's value proposition, infrastructure, customers, and finances. It assists firms in aligning their activities by illustrating potential trade-offs. Business Model Canvas: nine business model building blocks, Osterwalder, Pigneur & al. 2010 After reading this great article https://medium.com/@pstehlik/evaluating-blockchain-projects-with-token-economy-canvas-908bc1bab6 I felt the need to create an online editor. "Token Economy Canvas consists of …
27 Days ago
ICO friendliness rating index
Do you want to relocate your Blockchain company to an ICO friendly country? the ICO friendliness rating index is a interactive way to go through the list of countries that are hostile or favorable to ICO and Cryptocurrencies. Attention! a disclaimer is required: No Legal Advice or Attorney-Client Relationship: This chart is provided for informational purposes only and is not legal advice. This information is not intended to create, and receipt of it does not constitute, an attorney-client relationship. Recipient should …
27 Days ago
Joomla 3.8.7 and WTLib WinNMP 18.03
As always updating to the latest version of all your developement components is never without any issues, here is what  you need to take into consideration when upgrading Joomla 3.8.7 and WinNMP 18.03 Install WinNMp 18.03 from https://winnmp.wtriple.com/ in any directory, default is C:\WinNMP\ Unpack Joomla 3.8.7 to C:\WinNMP\WWW\dev for example When starting WinNMP, you can click reload, to see the site appearing    Now edit Nginx virtual server    And cut and paste the following config (you can get it from http://winnmp.wtriple.com/nginx.phpJoomla-Nginx-configuration)   …
54 Days ago
The cryptocurrency hack of Bob
Bob did a lot of (obvious) mistakes, but you will still be able to learn a lot by going through this mindmap. The names have been changed to protect the innocent. Hack of Bob   …
83 Days ago
Dilbert about blockchain
compilation of the famous dilbert.com about Blockchain and Bitcoin   …
83 Days ago
coin360.io current market capitalization of all main cryptocurrencies
Coin360.io • Market State • Coins and tokens • 1 day performance • Market cap Coin360.io is an online platform with the latest data on the situation on the cryptocurrency market with the indication of the current market capitalization of all main cryptocurrencies. The service was launched in 2017 by the resource Cointelegraph.com.The information about the cryptocurrency market capitalization is visualized by Coin360.io with the use of the brick diagram or tree-like map. Such visualization form allows seeing the total …
90 Days ago
All blockchain companies in Zug - Switzerland
The Swiss blockchain ecosystem, also known as the Crypto Valley, is home to a growing number of startups, service providers and other organizations. Powered bv https://cryptovalley.directory …
92 Days ago
All blockchain companies in Switzerland
Powered bv https://cryptovalley.directory …
92 Days ago
But what *is* a Neural Network? part 2
Neural Networks Demystified [Part 1: Data and Architecture] Neural Networks Demystified [Part 2: Forward Propagation] Neural Networks Demystified [Part 3: Gradient Descent] Neural Networks Demystified [Part 4: Backpropagation] Neural Networks Demystified [Part 5: Numerical Gradient Checking] Neural Networks Demystified [Part 6: Training] Neural Networks Demystified [Part 7: Overfitting, Testing, and Regularization] …
97 Days ago
But what *is* a Neural Network?
Here are the best video i've found on the subject. Moreover this channel is among the best also for learning mathematical concept in a very didactic way! Chapter 1, deep learning Gradient descent, how neural networks learn What is backpropagation really doing? Backpropagation calculus …
97 Days ago