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

No Thumbnail was found
work in progress - daily update Feedback is welcome in comments section, or through my contact form click on map, to view in full size …
54 Days ago
How to: Securing your Crypto  Assets
work in progress - daily update - a more convenient online version is also hosted at https://github.com/cedricwalter/Securing-Crypto-Assets  Pull requests are welcomed! Feedback is welcome in comments section, or through my contact form click on map, to view in full size …
54 Days ago
Big Bang Blockchain: La seconde révolution d'internet de Stéphane Loignon
La blockchain est annoncée comme une révolution technologique, économique, politique et sociétale aussi puissante qu’Internet. Cette « chaîne de blocs » promet d’être l’outil incontournable de demain. À quoi sert la blockchain ? Cette nouvelle technologie permet avant tout d’envoyer de l’argent en ligne sans intermédiaire : ni banque, ni compagnie de carte de crédit. Elle pourrait bouleverser la finance, l’assurance et le transfert d’argent tout en étant le moteur d’un vaste mouvement de décentralisation de l’économie numérique. Grâce à elle, certains rêvent …
72 Days ago
Blockchain definitions
  Blocks & Transactions Transaction data is permanently recorded in files called blocks. They can be thought of as the individual pages of a city recorder's recordbook (where changes to title to real estate are recorded) or a stock transaction ledger. Blocks are organized into a linear sequence over time ("Miner" or "Worker") also known as the block chain). New transactions are constantly being processed by Miners (into new blocks which are added to the end of the chain and …
73 Days ago
No Thumbnail was found
DevFest is the biggest Google tech conference in Switzerland. All about machine learning, programming, emerging technologies and much more!  GDG DevFests are large, community-run developer events happening around the globe focused on community building and learning about Google’s technologies. This year i will be helping and organizing some of the side activities between the talk session. And i prepared a lot of stuff, enough for 11 screens! _auto_generated_thumb_ _auto_generated_thumb_ Not everything is on pictures, NES and SNES classic are missing …
78 Days ago
Mining FeatherCoin on GeForce 1080 Ti
Feathercoin is a powerful open source digital currency with monetary properties linked to Bitcoin, Litecoin and a myriad of countless alt coins, but under the hood is something very different. Feathercoin is a highly upgraded and customised piece of software compared to the Bitcoin and Litecoin protocols. Based from Bitcoin, Litecoin evolved, from which Feathercoin was born, with the intent to expand, experiment, and build onto the blockchain technology in a manner open to all for participation. Just over one …
79 Days ago
No Thumbnail was found
XMR-Stak is a universal Stratum pool miner. This is the NVIDIA GPU mining version; there is also an AMD GPU version, and a CPU version. Docker® containers are often used to seamlessly deploy CPU-based applications on multiple machines. But Docker Engine does not natively support NVIDIA GPUs with containers. I have dockerized the Nvidia GPU-mining version, so it is now running in nvidia-docker. Containerizing GPU applications provides several benefits, among them: Reproducible builds Ease of deployment Isolation of individual devices Run across heterogeneous …
100 Days ago
Running WordPress and MySql in Docker
Notes A Docker image is a lightweight, stand-alone, executable package of a piece of software that includes everything needed to run it: code, runtime, system tools, system libraries, settings. Available for both Linux and Windows based apps, containerized software will always run the same, regardless of the environment. Containers isolate software from its surroundings, for example differences between development and staging environments and help reduce conflicts between teams running different software on the same infrastructure. A container is a runtime …
172 Days ago
No Thumbnail was found
205 Days ago
Dropbox CLI on linux
Dropbox is a free service that lets you bring all your photos, docs, and videos anywhere. This means that any file you save to your Dropbox will automatically save to all your computers, phones and even the Dropbox website. Dropbox creates a special folder on the user's computer, the contents of which are then synchronized to Dropbox's servers and to other computers and devices that the user has installed Dropbox on, keeping the same files up-to-date on all devices. I …
217 Days ago