---
# System prepended metadata

title: 'Walk Through of [Marigold Training 3](https://github.com/marigold-dev/training-dapp-3)'

---

---
title: Walk Through of [Marigold Training 3](https://github.com/marigold-dev/training-dapp-3)
author: Michael Kernaghan
---
# Walk Through of [Marigold Training 3](https://github.com/marigold-dev/training-dapp-3)

# Training dapp n°3 - ☝️ Upgradable Poke game

## 🎫 Tickets
### Step 1 : 🌱 Mint 
✅ taq compile pokeGame.jsligo 
### Step 2 : Test authorization poking 
✅ taq test unit_pokeGame.jsligo
```
┌──────────────────────┬────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Contract             │ Test Results                                                                                                                                                   │
├──────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ unit_pokeGame.jsligo │ "Sender 1 has balance : "                                                                                                                                      │
│                      │ 3800000000000mutez                                                                                                                                             │
│                      │ "*** Run test to pass ***"                                                                                                                                     │
│                      │ "contract deployed with values : "                                                                                                                             │
│                      │ KT1STayFpKfdDzBMi63HYDDSLLQfPfXcUp2g(None)                                                                                                                     │
│                      │ Success (2689n)                                                                                                                                                │
│                      │ "*** Check initial ticket is here ***"                                                                                                                         │
│                      │ {feedback = "kiss" ; pokeTraces = [] ; ticketOwnership = [tz1TDZG4vFoA2xutZMYauUnS4HVucnAGQSpZ -> (KT1STayFpKfdDzBMi63HYDDSLLQfPfXcUp2g , ("can_poke" , 1n))]} │
│                      │ Success (1850n)                                                                                                                                                │
│                      │ "*** Run test to fail ***"                                                                                                                                     │
│                      │ "contract deployed with values : "                                                                                                                             │
│                      │ KT1RkwqnXwhzxVG4iGGB5R56CrVEHjXydifC(None)                                                                                                                     │
│                      │ Success (2234n)                                                                                                                                                │
│                      │ "*** Check initial ticket is here ***"                                                                                                                         │
│                      │ {feedback = "kiss" ; pokeTraces = [] ; ticketOwnership = []}                                                                                                   │
│                      │ Fail (Rejected (("User does not have tickets => not allowed" , KT1RkwqnXwhzxVG4iGGB5R56CrVEHjXydifC)))                                                         │
│                      │ Everything at the top-level was executed.                                                                                                                      │
│                      │ - testSender1Poke exited with value ().                                                                                                                        │
│                      │ - testSender1PokeWithNoTicketsToFail exited with value ().                                                                                                     │
│                      │                                                                                                                                                                │
│                      │ 🎉 All tests passed 🎉                                                                                                                                         │
└──────────────────────┴────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
```
### Step 3 : Redeploy the smart contract 
✅ taq compile pokeGame.jsligo 

taq catches a warning here:
```
File "contracts/pokeGame.jsligo", line 40, characters 47-52:
 39 | 
 40 | export const getFeedback = ([contract_callback,store] : [contract<returned_feedback>,storage]): return_ => {
 41 |     let op : operation = Tezos.transaction(
:
Warning: variable "store" cannot be used more than once.
┌────────────────────────────┬───────────────────────────────────────────────────┐
│ Contract                   │ Artifact                                          │
├────────────────────────────┼───────────────────────────────────────────────────┤
│ pokeGame.jsligo            │ artifacts/pokeGame.tz                             │
├────────────────────────────┼───────────────────────────────────────────────────┤
│ pokeGame.storages.jsligo   │ artifacts/pokeGame.default_storage.tz             │
├────────────────────────────┼───────────────────────────────────────────────────┤
│ pokeGame.parameters.jsligo │ artifacts/pokeGame.parameter.default_parameter.tz │
└────────────────────────────┴───────────────────────────────────────────────────┘
```
✅ taq generate types ./app/src
✅ taq deploy pokeGame.tz -e testing
```
┌─────────────┬──────────────────────────────────────┬──────────┬─────────────┐
│ Contract    │ Address                              │ Alias    │ Destination │
├─────────────┼──────────────────────────────────────┼──────────┼─────────────┤
│ pokeGame.tz │ KT1JCuWHnB9N5wH1EKc6phk4g65rYT3vYbbe │ pokeGame │ ghostnet    │
└─────────────┴──────────────────────────────────────┴──────────┴─────────────┘
```
### Step 4 : Adapt the frontend code 

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




# End

[Next](https://hackmd.io/YkWeAPYaQD6FX8_KFZYLFQ)






