---
# System prepended metadata

title: 'NFTicket, Nigeria Sequence Diagram (V1)'
tags: [NFTicket]

---

# NFTicket, Nigeria Sequence Diagram (V1)

## Participant in Sequence Diagram
**Personal Wallet**
* Ticket Master
* Business Owner
* Customer
* Driver

**Web2 Application**
* Frontend
* Backend & Database

**Web3 Smart Contract**
* Nigeria Service Contract  
* Ticket Master Contract

-----------

## Smart Contract Architecture

![](https://i.imgur.com/q3OLJfI.png)

-----------

## Smart Contract Specification

**Nigeria Service Contract**
:::info
function
* presentTicket function
* startDelivery function
* checkIn function
* endDelivery function
* checkOut function
 
event
* presentTicket event
* startDelivery event
* checkIn event
* endDelivery event
* checkOut event
:::
**Ticket Master Contract**
:::info
storage
* NFTicketId & credit mapping
* NFTicketId & credit lock/unlock status mapping
* whitelist service contract address

function
* mintNFTicket function
* topUpNFTicket function
* (whitelist only) lockCredit function
* (whitelist only) distributeRevenue function
* (whitelist only) unlockCredit function
:::

-----------

## Smart Contract Configuration
**Nigeria Service Contract**
:::info

:::
**Ticket Master Contract**
:::info
* Base fee pre NFTicket
* Price per credit
* Service contract whitelist
:::
Base fee 是用什麼定價? ETH,穩定幣, BLXM?
Price per credit 要用什麼單位匯兌? 錨定穩定幣,錨定USD?

-----------

## Sequence Diagram

### Buy a New NFTicket
假定是以ETH來定Base Fee
(如果是ERC20，要用approve+transferfrom的方式)
![](https://i.imgur.com/mcPEsQB.png)

### Top Up an NFTicket
假定是以ETH來定Price per credit
(如果是ERC20，要用approve+transferfrom的方式)
![](https://i.imgur.com/52YDd68.png)

### Present an NFTicket 

![](https://i.imgur.com/cSJPi7L.png)

### Start Delivery 

![](https://i.imgur.com/GDQ8dok.png)

### Check In

![](https://i.imgur.com/Ib9i8BK.png)

### End Delivery 

![](https://i.imgur.com/H9X9Ogk.png)

### Check Out

![](https://i.imgur.com/OIwYfD1.png)
分潤的時候是要分什麼?分credit還是分什麼幣? 

###### tags: `NFTicket`