Treatail Smart Contract(s) and Middleware for the NEO Blockchain
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

This Repository

This repository contains the source code for the Award-Winning (First Place in City of Zion dApps Competition, and Second Place in NEO / Microsoft Dev Competition) Smart Contract for a Treatail NEP5 Token (TTL) and Treatail Asset management, Core middleware (leveraging neo-lux), REST API middleware, tests libraries, and test harness.

The Product / dApp


Treatail is a revolutionary commerce layer that sits on top of all the sites and marketplaces on the Internet. Our platform allows for buyers, both consumer and business, to make offers and receive personalized deals on goods and services listed for sale on any site doing commerce on the Internet. Our goal is to help buyers to get unpublished, personalized deals and help online retailers boost profits by optimizing inventory through precision discounts and reduced cart abandonment.

The cornerstone of the next evolution to the Treatail Ecosystem will be the creation of Treatail Token (TTL) and smart contracts to facilitate transactions on the blockchain and to further incent users. To date, blockchain has primarily been available to technical users. Treatail aims to change this by bringing the power of the NEO blockchain to the average user using intuitive interfaces and seamless integration into the Treatail platform.

Find out more at and check out the whitepaper below.



A brief whitepaper for the Treatail product and future blockchain offering can be found here:

Product / dApp

A quick demo video of the demo code in this repository in action can be found on YouTube:

Code and API Documentation

Commented code and Visual Studio XML comments, with additional compiled Microsoft HTML Help file (.chm) found in the /Docs folder


Treatail website

Login and signup

Login or sign up for an account

Active deal list interface

This interface will show the user all the active deals they currently have outstanding.

Deal details

This interface shows the user the deal details (terms of the offer, captured information, etc) and allows the user to take action.

Seller deal response interface (simple)

This is the interface that lets sellers send a basic response to the buyer based on USD and TTL price

Seller deal response interface (advanced)

The advanced deal response interface will allow the seller to add or adjust line items, create multiple counter offer options for the buyer, and allow the buyer to share the deal(s).

Buyer payment

This is the payment screen for the demo. Treatail uses PayPal for all USD transactions, but this was unavailable in the demo site. The demo site will only make the blockchain related TTL transfers at the close of a deal, but we skip over PayPal piece for brevity.

User details screen

This is the screen where the user can find their information - the links for them to share their referral link on social media, manage their TTL Token wallet and transfers, and see audit history of transfers of TTL.

Sending TTL Token to a Treatail user

Users can easily send TTL Tokens to other users in the Treatail ecosystem by providing just an e-mail address. Treatail will find the hosted wallet information for that user and make the blockchain transfer on the behalf of the user.

Sending TTL Token to a NEO Address

Users can also send TTL Tokens to an external NEO Address, for example, if they want to use their own NEP5 compatible wallet to manage their own keys for the TTL they earn. They can always transfer back to their Treatail address if needed.

TTL Token transaction history

This provides an audit trail for any TTL Token transfer activity within Treatail.

List of user's Treatail Assets

Treatail Assets are blockchain verified asset receipts for purchases made in the Treatail Ecosystem. Users can verify the purchase and authenticity of an item using blockchain as the source of truth.

Verified Treatail Asset details screen

This is the asset details screen that actively compares the details hash of the item against the blockchain and shows the "Blockchain Verified" badge if the data they are viewing matches the data stored to the blockchain.

Architecture and Hosting


Treatail is hosted on Microsoft Azure - Platform as a Service


Microsoft .NET Web Application and Mobile Apps available for iOS and Android


Microsoft .NET WebAPI (REST), Treatail.NEO Middleware


Microsft SQL Server, Redis, and Microsoft Cosmos DB


Azure Blob Storage, NEO Blockchain


This project wouldn't have been possible without the support from the City of Zion NEO development community. A big shout out to Sérgio Flores (Relfos) for his work on neo-debugger-tools and neo-lux, and for all his assistance in helping me get neo-lux implemented in the project. Thanks to Chris Hager (Metachris) for his assistance in getting started with neo-python and NEO development, and for his great work on hosting a privatenet docker