This chapter covers
- Designing and implementing a voting contract showcasing most Solidity features, such as modifiers and events
- Integrating the voting contract in Truffle, for integrated compilation, testing, and deployment
- Implementing an asynchronous web UI seamlessly connected to the contract through the truffle-contract JavaScript library
- Deploying onto the public test network from Truffle
In the previous chapter, you started to enjoy the benefits of using Truffle to improve the development lifecycle:
- Contract compilation became as easy as executing a simple truffle compile command. You didn’t have to instruct the solc compiler explicitly to push its output to specific files to be reused later for deployment.
- Contract deployment became much easier than you were used to, thanks to Truffle’s migrations functionality based on minimalistic configuration. Truffle did all the hard work of packaging the compilation output and feeding the contract ABI and bytecode to the deployment transaction behind the curtains. No more manual copying and pasting of long text!
- Also, testing became much simpler than when you performed it through Mocha. You didn’t need complicated initialization to deploy the contract at each test, and you could keep testing logic by writing asynchronous JavaScript based on async/await.