Skip to content

Commit

Permalink
fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
zamrokk committed May 27, 2024
1 parent 2e6889a commit 18a97c4
Show file tree
Hide file tree
Showing 69 changed files with 11,884 additions and 2,606 deletions.
389 changes: 189 additions & 200 deletions README.md

Large diffs are not rendered by default.

6 changes: 1 addition & 5 deletions solution/.taq/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"testing": {
"type": "simple",
"label": "ghostnet",
"rpcUrl": "https://ghostnet.tezos.marigold.dev"
"rpcUrl": "https://ghostnet.ecadinfra.com"
},
"production": {
"type": "simple",
Expand All @@ -61,10 +61,6 @@
"type": "npm",
"name": "@taqueria/plugin-taquito"
},
{
"type": "npm",
"name": "@taqueria/plugin-octez-client"
},
{
"type": "npm",
"name": "@taqueria/plugin-contract-types"
Expand Down
129 changes: 4 additions & 125 deletions solution/.taq/state.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// WARNING: This file is autogenerated and should NOT be modified
{
"build": "0b37e42",
"configHash": "546923f2c7515a39aa0ef0d5d1dc817d38aa9a407997749f10419cd2e7b5bc3f",
"build": "f20397e",
"configHash": "4b8ca44d4f0ad82cd2d4e1c77c5b61dcbaeb2190f91966bcec77fc6a8619d870",
"tasks": {
"ligo": {
"type": "npm",
Expand All @@ -20,24 +20,8 @@
"name": "@taqueria/plugin-ligo"
},
"get-image": {
"task": "get-image",
"command": "get-image",
"description": "Provided by more than one plugin. The option --plugin is required.",
"hidden": true,
"handler": "proxy",
"options": [
{
"flag": "plugin",
"description": "Specify which plugin should be used to execute this task",
"required": true,
"choices": [
"@taqueria/plugin-ligo",
"ligo",
"@taqueria/plugin-octez-client",
"tezos-client"
]
}
]
"type": "npm",
"name": "@taqueria/plugin-ligo"
},
"deploy": {
"type": "npm",
Expand All @@ -55,22 +39,6 @@
"type": "npm",
"name": "@taqueria/plugin-taquito"
},
"client": {
"type": "npm",
"name": "@taqueria/plugin-octez-client"
},
"typecheck": {
"type": "npm",
"name": "@taqueria/plugin-octez-client"
},
"typecheck-all": {
"type": "npm",
"name": "@taqueria/plugin-octez-client"
},
"simulate": {
"type": "npm",
"name": "@taqueria/plugin-octez-client"
},
"generate types": {
"type": "npm",
"name": "@taqueria/plugin-contract-types"
Expand Down Expand Up @@ -296,95 +264,6 @@
"operations": [],
"templates": []
},
{
"name": "@taqueria/plugin-octez-client",
"version": "0.1",
"schema": "1.0",
"alias": "tezos-client",
"tasks": [
{
"task": "client",
"command": "client",
"description": "This task allows you to run arbitrary octez-client native commands. Note that they might not benefit from the abstractions provided by Taqueria",
"encoding": "none",
"handler": "proxy",
"options": [
{
"shortFlag": "c",
"flag": "command",
"description": "The command to be passed to the underlying octez-client binary, wrapped in quotes",
"type": "string",
"required": true
}
]
},
{
"task": "typecheck",
"command": "typecheck <sourceFile>",
"aliases": [
"tc"
],
"description": "Typecheck a Michelson contract",
"encoding": "json",
"handler": "proxy",
"positionals": [
{
"placeholder": "sourceFile",
"description": "The name of the Michelson contract you wish to typecheck"
}
]
},
{
"task": "typecheck-all",
"command": "typecheck-all",
"description": "Typecheck all Michelson contracts in the artifacts directory",
"encoding": "json",
"handler": "proxy"
},
{
"task": "simulate",
"command": "simulate <sourceFile>",
"aliases": [
"sim"
],
"description": "Run a Michelson contract as a simulation",
"encoding": "json",
"handler": "proxy",
"options": [
{
"flag": "storage",
"description": "Name of the storage file that contains the storage value as a Michelson expression, in the artifacts directory, used for originating a contract",
"required": false
},
{
"flag": "param",
"description": "Name of the parameter file that contains the parameter value as a Michelson expression, in the artifacts directory, used for invoking a deployed contract",
"required": true
},
{
"flag": "entrypoint",
"description": "You may explicitly specify an entrypoint to make the parameter value shorter, without having to specify a chain of (Left (Right ... 14 ...))",
"required": false
}
],
"positionals": [
{
"placeholder": "sourceFile",
"description": "The name of the Michelson contract you wish to simulate"
}
]
},
{
"task": "get-image",
"command": "get-image",
"description": "Gets the name of the image to be used",
"hidden": true,
"handler": "proxy"
}
],
"operations": [],
"templates": []
},
{
"name": "@taqueria/plugin-contract-types",
"version": "0.1",
Expand Down
32 changes: 9 additions & 23 deletions solution/.taq/testing-state.json
Original file line number Diff line number Diff line change
@@ -1,52 +1,38 @@
{
"operations": {},
"tasks": {
"@taqueria/plugin-taquito.deploy.1699456432249": {
"@taqueria/plugin-taquito.deploy.1716561094699": {
"task": "deploy",
"plugin": "@taqueria/plugin-taquito",
"time": 1699456432249,
"time": 1716561094699,
"output": [
{
"contract": "nft.tz",
"address": "KT1UhE1Jd1bJqJGfW3kHChXCB7CA3UTkqpkb",
"alias": "nft",
"balanceInMutez": "0",
"destination": "https://ghostnet.tezos.marigold.dev"
}
]
},
"@taqueria/plugin-taquito.deploy.1699456678660": {
"task": "deploy",
"plugin": "@taqueria/plugin-taquito",
"time": 1699456678660,
"output": [
{
"contract": "nft.tz",
"address": "KT1F56e28pcdTFJot999SWdXr7vuDPu7yYSo",
"address": "KT1StruEsXZGqXnfnREy9kd8MRfrL8oSi4KL",
"alias": "nft"
}
]
},
"@taqueria/plugin-taquito.deploy.1699458045314": {
"@taqueria/plugin-taquito.deploy.1716794314811": {
"task": "deploy",
"plugin": "@taqueria/plugin-taquito",
"time": 1699458045314,
"time": 1716794314811,
"output": [
{
"contract": "nft.tz",
"address": "KT18nfu16UutxZNazugLwdnFce78PRTPPTon",
"address": "KT1GBQEdrGgyDEkHLJu1WLtz71KgRYJ9GrKj",
"alias": "nft"
}
]
},
"@taqueria/plugin-taquito.deploy.1699458834528": {
"@taqueria/plugin-taquito.deploy.1716797754699": {
"task": "deploy",
"plugin": "@taqueria/plugin-taquito",
"time": 1699458834528,
"time": 1716797754699,
"output": [
{
"contract": "nft.tz",
"address": "KT1TLy8qo1rfGtGmraUUQFWeBDSeM6vAQ8f5",
"address": "KT1WdJDnkQA614ADnXDCzXgtfQcarSvcjymw",
"alias": "nft"
}
]
Expand Down
2 changes: 1 addition & 1 deletion solution/_ligo/ligo/installation.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"app@link-dev:./ligo.json":"/project","@ligo/fa@1.0.9@ffffffff":"./.ligo/source/i/ligo__s__fa__1.0.9__ffffffff"}
{"app@link-dev:./ligo.json":"/home/zamrokk/training-nft-1/solution","@ligo/fa@1.4.2@ffffffff":"./.ligo/source/i/ligo__s__fa__1.4.2__ffffffff"}
5 changes: 2 additions & 3 deletions solution/app/.env
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
VITE_CONTRACT_ADDRESS=KT1TLy8qo1rfGtGmraUUQFWeBDSeM6vAQ8f5
VITE_CONTRACT_ADDRESS=KT1WdJDnkQA614ADnXDCzXgtfQcarSvcjymw
VITE_PINATA_API_KEY=701d3e9951e2ad5e7d63
VITE_PINATA_API_SECRET=adc566d96514e6ddd076ad531c36b536e7b6f33b36625c136f2100d2909da880
VITE_TEZOS_NODE=https://ghostnet.tezos.marigold.dev
#VITE_TEZOS_NODE=https://ghostnet.ecadinfra.com
VITE_TEZOS_NODE=https://ghostnet.ecadinfra.com
36 changes: 18 additions & 18 deletions solution/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,45 +10,45 @@
"preview": "vite preview"
},
"dependencies": {
"@airgap/beacon-sdk": "^4.0.6",
"@airgap/beacon-sdk": "^4.2.2",
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@mui/icons-material": "^5.14.3",
"@mui/material": "^5.14.3",
"@taquito/beacon-wallet": "^17.1.1",
"@taquito/taquito": "^17.1.1",
"@taquito/tzip12": "^17.1.1",
"@taquito/beacon-wallet": "20.0.0-beta.1",
"@taquito/taquito": "20.0.0-beta.1",
"@taquito/tzip12": "20.0.0-beta.1",
"@tzkt/sdk-api": "^2.2.1",
"formik": "^2.4.3",
"notistack": "^3.0.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.23.1",
"react-swipeable-views": "^0.14.0",
"yup": "^1.2.0"
},
"devDependencies": {
"@airgap/beacon-types": "^4.0.6",
"@types/react": "^18.2.15",
"@types/react-dom": "^18.2.7",
"@types/react-swipeable-views": "^0.13.2",
"@typescript-eslint/eslint-plugin": "^6.0.0",
"@typescript-eslint/parser": "^6.0.0",
"@vitejs/plugin-react-swc": "^3.3.2",
"assert": "^2.0.0",
"@airgap/beacon-types": "^4.2.2",
"@types/react": "^18.2.66",
"@types/react-dom": "^18.2.22",
"@types/react-swipeable-views": "^0.13.5",
"@typescript-eslint/eslint-plugin": "^7.2.0",
"@typescript-eslint/parser": "^7.2.0",
"@vitejs/plugin-react-swc": "^3.5.0",
"assert": "^2.1.0",
"buffer": "^6.0.3",
"crypto-browserify": "^3.12.0",
"eslint": "^8.45.0",
"eslint": "^8.57.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.3",
"eslint-plugin-react-refresh": "^0.4.6",
"https-browserify": "^1.0.0",
"os-browserify": "^0.3.0",
"path-browserify": "^1.0.1",
"process": "^0.11.10",
"react-router-dom": "^6.14.2",
"stream-browserify": "^3.0.0",
"stream-http": "^3.2.0",
"typescript": "^5.0.2",
"url": "^0.11.1",
"vite": "^4.4.5"
"typescript": "^5.2.2",
"url": "^0.11.3",
"vite": "^5.2.0"
}
}
2 changes: 1 addition & 1 deletion solution/app/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NetworkType } from "@airgap/beacon-types";
import { NetworkType } from "@airgap/beacon-dapp";
import { BeaconWallet } from "@taquito/beacon-wallet";
import { TezosToolkit } from "@taquito/taquito";
import { TokenMetadata, tzip12, Tzip12Module } from "@taquito/tzip12";
Expand Down
2 changes: 1 addition & 1 deletion solution/app/src/ConnectWallet.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NetworkType } from "@airgap/beacon-sdk";
import { NetworkType } from "@airgap/beacon-dapp";
import { Wallet } from "@mui/icons-material";
import { Button } from "@mui/material";
import { BeaconWallet } from "@taquito/beacon-wallet";
Expand Down
14 changes: 11 additions & 3 deletions solution/app/src/MintPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,10 @@ export default function MintPage() {

//open mint drawer if admin
useEffect(() => {
if (storage && storage!.administrators.indexOf(userAddress! as address) < 0)
if (
storage &&
storage!.extension.administrators.indexOf(userAddress! as address) < 0
)
setFormOpen(false);
else setFormOpen(true);
}, [userAddress]);
Expand Down Expand Up @@ -178,7 +181,10 @@ export default function MintPage() {
<Paper>
{storage ? (
<Button
disabled={storage.administrators.indexOf(userAddress! as address) < 0}
disabled={
storage.extension.administrators.indexOf(userAddress! as address) <
0
}
sx={{
p: 1,
position: "absolute",
Expand All @@ -189,7 +195,9 @@ export default function MintPage() {
onClick={toggleDrawer(!formOpen)}
>
{" Mint Form " +
(storage!.administrators.indexOf(userAddress! as address) < 0
(storage!.extension.administrators.indexOf(
userAddress! as address
) < 0
? " (You are not admin)"
: "")}
<OpenWithIcon />
Expand Down
2 changes: 1 addition & 1 deletion solution/app/src/OffersPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export default function OffersPage() {
userAddress as address
);
setOwnerBalance(ownerBalance.toNumber());
const ownerOffers = await storage.offers.get(
const ownerOffers = await storage.extension.offers.get(
userAddress as address
);
if (ownerOffers && ownerOffers.quantity != BigNumber(0))
Expand Down
8 changes: 4 additions & 4 deletions solution/app/src/WineCataloguePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,14 @@ export default function WineCataloguePage() {
Wine catalogue
</Typography>

{storage?.offers && storage?.offers.size != 0 ? (
{storage?.extension.offers && storage?.extension.offers.size != 0 ? (
<Fragment>
<Pagination
page={currentPageIndex}
onChange={(_, value) => setCurrentPageIndex(value)}
count={Math.ceil(
Array.from(storage?.offers.entries()).filter(([_, offer]) =>
offer.quantity.isGreaterThan(0)
Array.from(storage?.extension.offers.entries()).filter(
([_, offer]) => offer.quantity.isGreaterThan(0)
).length / itemPerPage
)}
showFirstButton
Expand All @@ -131,7 +131,7 @@ export default function WineCataloguePage() {
<ImageList
cols={isDesktop ? itemPerPage / 2 : isTablet ? itemPerPage / 3 : 1}
>
{Array.from(storage?.offers.entries())
{Array.from(storage?.extension.offers.entries())
.filter(([_, offer]) => offer.quantity.isGreaterThan(0))
.filter((_, index) =>
index >= currentPageIndex * itemPerPage - itemPerPage &&
Expand Down
Loading

0 comments on commit 18a97c4

Please sign in to comment.