Qtum Hackathon — Week 2

Team Mint’s Entry for the Qtum Hackathon 2018

Shruti Vinodh
Mintosa
3 min readAug 16, 2018

--

If you haven’t gotten a chance to read the first weekly update you can do so here. You can also catch up with us on twitter @mintosa_app.

Smart Contracts with QMix

This week, the Mintosa team was working on designing the Smart Contract which is to be at the heart of our dapp.

Planning

We at Mintosa believe in incrementally adding key features step by step to the Smart Contract to make it as simple and concise as possible. In order to do so, first we drafted a short outline of the core functions we would need.
After a couple of hours of analyzing our options debating, we settled on the following:

  1. Verify user
  2. Add loan
  3. Pay back loan (Part)
  4. Send from one user to another (Helper function, called by 2, 3 & 4)
  5. Calculate user rating
  6. Update user rating

Testing

We then set to work on writing and testing the Smart Contract. We decided to try the online IDE Qmix to test it out. Safe to say that the QTUM team did a great job making development a breeze.

QMix makes the whole experience delightful!

After a couple of iterations and ensuring that secure code patterns are used, we finished two of our Smart Contracts, Lender.sol and Ratings.sol. While Lenders.sol has general transaction functions, Ratings.sol holds the core of the logic driving our rating system, having functions which allow lenders to rate borrowers on a scale of 1 to 5.

(To learn more about code patterns in Solidity, go here. The section on Withdrawal Contracts, especially this,

The recommended method of sending funds after an effect is using the withdrawal pattern. Although the most intuitive method of sending Ether, as a result of an effect, is a direct send call, this is not recommended as it introduces a potential security risk.

helped us avoid pitfalls in our Smart Contract.)

RoadMap for Future

Take a look at our road map. We’re currently atthe development stage after which we will proceed with the creating the UI and UX of our Web application.

Credits

Road Map by Sabiha Shaik

Logo Icon from FlatIcon

--

--