Skip to content
No description, website, or topics provided.
JavaScript Other
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
img add background img Apr 26, 2018
lib
smartContract update structure Apr 28, 2018
.gitignore
README.md
_config.yml
index.css first version Apr 25, 2018
index.html

README.md

Super Dictionary

Introduction

Super Dictionary is a Dapp deployed on Nebulas testnet.

Dapp Structure

Smart contract

The source code of Super Dictionary smart contract is smart_dictionary.js. And the contract address after deployed on testnet is n1oXdmwuo5jJRExnZR5rbceMEyzRsPeALgm.

Super Dictionary is a simple smart contract that stores and gets key/value pairs. It has two functions for Dapp user to use:

  • save(key, value) to create a entry(key/value pair) into Super Dictionary.
  • get(key) to search the value of a given key. If this entry doesn't exits, then you can create this entry.

Web page of Dapp

After the smart contract of our Dapp is deployed, we need to develop a web page or App for user to interact with it. The webpage of Super Dictionary is index.html.

In Super Dictionary, we use NebPay SDK as our payment interface, and Dapp user need to install chrome extension WebExtensionWallet(on PC) or NAS Nano wallet app(on mobile) to complete the transactions initiated by Dapp.

Now we explain how to call smart contract functions save and get in Dapp html file.

Since the function get is just used to search results, we don't need to send transactions. Here we use API call of neb.js to get the return values of function get.

And to store dictionary entries with function save, we need to send transactions. Here we use NebPay to send transactions. To learn how to use nebpay in Dapp, please refer to Nebpay documents "Introduction of NebPay SDK"

How to use Super Dictionary

To use Super Dictionary, you need to install chrome extension WebExtensionWallet(on PC) or NAS Nano wallet app.

Here is the video that showing how to use Super Dictionary on PC and mobile phone.

Video on Youtube:

Video on bilibili:

You can’t perform that action at this time.