Introduction

This is our 3rd development update for the Mercury Protocol project. We’ve been incredibly busy over the last week leading up to the token launch, and have a lot to share since our last development update.

Key milestones

Incorporated recommendations made by security auditors into GMT token contracts Developed smart contracts and APIs to handle gas refillment of user-owned GMT wallets Added push notifications for various transactions Added GMT rewards to incentivize various actions within Dust Upgraded geth and handled the byzantium fork on rinkeby Configured Ethereum peers to run as a service Various improvements to premium feature smart contracts Developed various UI improvements for the GMT rewards and premium features experience Added additional Ethereum services to handle GMT wallet features Bring iOS client up to speed with all GMT related development

1. Incorporated recommendations made by security auditors into GMT token contracts

Our team asked Open Zeppelin to review and audit our Global Messaging Token (GMT) and crowdsale contracts. The audit has been successfully completed and the results are published here.

The audited contracts are located in the MercuryProtocol/global-messaging-token-contracts repository. The original version used for this report is the commit d0765cbd0732453832455dae0e2cf892da1ab572 .

We have followed Open Zeppelin’s recommendations and updated the contracts. The updated version is at commit df08a450e3960d6717348d38da10b542d4123534 .

2. Developed smart contracts and APIs to handle gas refillment of user-owned GMT wallets

Every time a transaction is made on Ethereum, there is a fee that must be paid to the miner of the block for calculating the result of the computation. While this might change in the future, for the moment fees can only be paid in Ether and therefore all users of GMT tokens need some amount of Ether in their wallets to transact. Otherwise, tokens in GMT wallets that have an Ether balance smaller than the fee would get stuck until the user can pay for the necessary fee.

Since GMT wallets transact for all services using GMT tokens, we want users to only think about their GMT balance, and not have to think about the Ethereum blockchain or how to obtain Ether.

Our solution to this was to have a contract that automatically refills the user’s GMT wallet balance as soon as it detects the Ether balance is dangerously low.

In order to do that, first we created a variable that will hold the threshold amount, unit256 public MIN_BALANCE_FOR_ACCOUNT . This value is set when the contract is initiated, and only the owner of the contract is allowed to update it:

Next, we have a initiateRefill function that takes a user’s GMT account address and calculates the amount of ETH the user needs to add into their GMT account. It then calculates the GMT token price for that amount of ETH, and deducts those tokens from the user’s GMT account, and refills the user’s account with the ETH they just paid for.

On the back-end, we have a service that runs every time a user logs into the Dust application, and upon login, checks if the user’s ETH balance is below the threshold amount. If it is, it first invokes the GMTtokensToSell function on the GasRefill contract to fetch the number of GMT tokens to approve on behalf of the user. Then it calls approve on the GMToken contract with the right amount of tokens. Finally, the service invokes the initiateRefill function on the GasRefill contract to take the GMT tokens that were approved by the user and sends them to a GAS_SINK_ADDRESS , and finally refills the user with enough ETH to meet the gas requirements for future transactions.

3. Added push notifications for various transactions

Android and iOS clients now get notified for various transaction events, such as when someone transfers them GMT, when a “paid to be featured” action is completed, or when they are no longer a featured user.

4. Added GMT rewards to incentivize various actions within Dust

We are excited to share that our first set of “rewards” features are feature complete! We currently reward users for:

1 GMT for creating an account

0.01 GMT for login per 24 hours

0.03 for logging in 7 days in a row

5. Added gas/tx cost estimate endpoint

We want users to have complete transparency into how much a transaction for unlocking a premium feature would cost, before they decide to unlock this feature using GMT. This new endpoint allows the client to query gas estimate for any transaction and inform the user ahead of time.

6. Upgraded geth and handled the byzantium fork

As many of you know, Monday October 16th was when the Byzantium fork was slated to happen. In preparation for that, the development team had to upgrade geth to the latest client verion (v1.7.2) on our machines. Moreover, we had to update the geth clients running on AWS. We’ve tested everything and all processes are running smoothly at this time. 👍

7. Various improvement to premium feature smart contracts

Integrated testing framework and preliminary unit tests of premium feature smart contracts

Improved efficiency of Premium Exposure contract by using maps instead of array to store featured users

Updated contract fields to be more modifiable once deployed

8. Developed various UI improvements for the GMT rewards and premium features experience

Built a new UI for the “Connect” tab in Dust

Created a countdown timer after user is “featured” to indicate how long they have remaining until their featured user spot expires

Dynamically update UI for featured users, wallet balance and transactions

Create functionality to “swipe” to refresh transaction history

Built a new wallet UI that includes copy button and export button for a user’s public key and encrypted private key

9. Add additional Ethereum services to handle GMT wallet features

We did a refactor of the Ethereum services library to modularize it. Moreover, we built a new service for handling Ethereum account management, which does account creation, passphrase updates, account exports, etc.

10. Bring iOS client up to speed with all GMT related development

Our initial set of GMT related features were first developed on Android. Within the last two weeks, we got the iOS client up to speed on all the GMT features.

Join Our Community

Mercury Protocol is an open source project where anyone can get involved. If you’re a developer and interested in getting involved with development, come say Hello on our Slack in our #dev channel.

We plan to open source the protocol in Q1 2018, and we’ll be actively building out our development team and looking for core open source contributors. We’d love to have you on board! 🙂

Connect

Slack

Telegram

Twitter

Reddit

Facebook

LinkedIn

Learn more about the Mercury Protocol

Read the Mercury Protocol whitepaper