Skip to content

Commit

Permalink
sync with docs.tezos.com
Browse files Browse the repository at this point in the history
  • Loading branch information
zamrokk committed Nov 8, 2023
1 parent 1757178 commit 152c096
Show file tree
Hide file tree
Showing 15 changed files with 1,251 additions and 1,207 deletions.
1,672 changes: 825 additions & 847 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion solution/.ligo/repository_id
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3fb1d854-fbaa-43e9-dd40-657be22fa39b
0a3766d1-839c-491f-0c47-048c48b4c1d6
6 changes: 5 additions & 1 deletion 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.ecadinfra.com"
"rpcUrl": "https://ghostnet.tezos.marigold.dev"
},
"production": {
"type": "simple",
Expand All @@ -61,6 +61,10 @@
"type": "npm",
"name": "@taqueria/plugin-taquito"
},
{
"type": "npm",
"name": "@taqueria/plugin-octez-client"
},
{
"type": "npm",
"name": "@taqueria/plugin-contract-types"
Expand Down
131 changes: 126 additions & 5 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": "dcdfa46",
"configHash": "707614f7b7a6adaafc06b7bec7002784a01e61280a67d735ed2df34a323713ec",
"build": "0b37e42",
"configHash": "87dc7a200b3d61fe598a38cc37f847e73371be155923b134a871b0a136032b80",
"tasks": {
"ligo": {
"type": "npm",
Expand All @@ -20,8 +20,24 @@
"name": "@taqueria/plugin-ligo"
},
"get-image": {
"type": "npm",
"name": "@taqueria/plugin-ligo"
"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"
]
}
]
},
"deploy": {
"type": "npm",
Expand All @@ -39,6 +55,22 @@
"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 All @@ -57,7 +89,7 @@
"version": "0.1",
"schema": "1.0",
"alias": "ligo",
"postInstall": "node /home/zamrokk/training-nft-2/solution/node_modules/@taqueria/plugin-ligo/postinstall.js",
"postInstall": "node /home/zamrokk/training-nft-2/solution/node_modules/@taqueria/lib-ligo/postinstall.js",
"tasks": [
{
"task": "ligo",
Expand Down Expand Up @@ -264,6 +296,95 @@
"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
30 changes: 20 additions & 10 deletions solution/.taq/testing-state.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,41 @@
{
"operations": {},
"tasks": {
"@taqueria/plugin-taquito.deploy.1697032681766": {
"@taqueria/plugin-taquito.deploy.1699456432249": {
"task": "deploy",
"plugin": "@taqueria/plugin-taquito",
"time": 1697032681766,
"time": 1699456432249,
"output": [
{
"contract": "nft.tz",
"address": "KT1FB3Bp8pGaKPm2JPG7PAQ64oZi6P84MWCL",
"address": "KT1UhE1Jd1bJqJGfW3kHChXCB7CA3UTkqpkb",
"alias": "nft",
"balanceInMutez": "0",
"destination": "https://ghostnet.ecadinfra.com"
"destination": "https://ghostnet.tezos.marigold.dev"
}
]
},
"@taqueria/plugin-taquito.deploy.1697035117646": {
"@taqueria/plugin-taquito.deploy.1699456678660": {
"task": "deploy",
"plugin": "@taqueria/plugin-taquito",
"time": 1697035117646,
"time": 1699456678660,
"output": [
{
"contract": "nft.tz",
"address": "KT1R4jgz5N8nmgXmfoHCoAixMLc7qdjDv9Wn",
"alias": "nft",
"balanceInMutez": "0",
"destination": "https://ghostnet.ecadinfra.com"
"address": "KT1F56e28pcdTFJot999SWdXr7vuDPu7yYSo",
"alias": "nft"
}
]
},
"@taqueria/plugin-taquito.deploy.1699458045314": {
"task": "deploy",
"plugin": "@taqueria/plugin-taquito",
"time": 1699458045314,
"output": [
{
"contract": "nft.tz",
"address": "KT18nfu16UutxZNazugLwdnFce78PRTPPTon",
"alias": "nft"
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion solution/app/.env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VITE_CONTRACT_ADDRESS=KT1R4jgz5N8nmgXmfoHCoAixMLc7qdjDv9Wn
VITE_CONTRACT_ADDRESS=KT18nfu16UutxZNazugLwdnFce78PRTPPTon
VITE_PINATA_API_KEY=701d3e9951e2ad5e7d63
VITE_PINATA_API_SECRET=adc566d96514e6ddd076ad531c36b536e7b6f33b36625c136f2100d2909da880
VITE_TEZOS_NODE=https://ghostnet.tezos.marigold.dev
Expand Down
23 changes: 12 additions & 11 deletions solution/app/src/MintPage.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import SwipeableViews from "react-swipeable-views";
import {
AddCircleOutlined,
Close,
KeyboardArrowLeft,
KeyboardArrowRight,
} from "@mui/icons-material";
import OpenWithIcon from "@mui/icons-material/OpenWith";
import {
Box,
Expand All @@ -14,23 +19,19 @@ import {
} from "@mui/material";
import Card from "@mui/material/Card";
import CardContent from "@mui/material/CardContent";
import {
AddCircleOutlined,
Close,
KeyboardArrowLeft,
KeyboardArrowRight,
} from "@mui/icons-material";
import Paper from "@mui/material/Paper";
import Typography from "@mui/material/Typography";
import { char2Bytes } from "@taquito/utils";
import { BigNumber } from "bignumber.js";
import { useFormik } from "formik";
import { useSnackbar } from "notistack";
import React, { useEffect, useState } from "react";
import SwipeableViews from "react-swipeable-views";
import * as yup from "yup";
import { TZIP21TokenMetadata, UserContext, UserContextType } from "./App";
import { useSnackbar } from "notistack";
import { BigNumber } from "bignumber.js";
import { address, bytes, nat } from "./type-aliases";
import { char2Bytes } from "@taquito/utils";
import { TransactionInvalidBeaconError } from "./TransactionInvalidBeaconError";
import { address, bytes, nat } from "./type-aliases";

export default function MintPage() {
const {
userAddress,
Expand Down
2 changes: 1 addition & 1 deletion solution/app/src/nft.code.ts

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion solution/artifacts/nft.default_storage.tz
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{}
{ Elt "" 0x74657a6f732d73746f726167653a64617461 ;
Elt "data"
0x7b0a202020202020226e616d65223a22464132204e4654204d61726b6574706c616365222c0a202020202020226465736372697074696f6e223a224578616d706c65206f662046413220696d706c656d656e746174696f6e222c0a2020202020202276657273696f6e223a22302e302e31222c0a202020202020226c6963656e7365223a7b226e616d65223a224d4954227d2c0a20202020202022617574686f7273223a5b224d617269676f6c643c636f6e74616374406d617269676f6c642e6465763e225d2c0a20202020202022686f6d6570616765223a2268747470733a2f2f6d617269676f6c642e646576222c0a20202020202022736f75726365223a7b0a202020202020202022746f6f6c73223a5b224c69676f225d2c0a2020202020202020226c6f636174696f6e223a2268747470733a2f2f6769746875622e636f6d2f6c69676f6c616e672f636f6e74726163742d636174616c6f6775652f747265652f6d61696e2f6c69622f666132227d2c0a20202020202022696e7465726661636573223a5b22545a49502d303132225d2c0a202020202020226572726f7273223a205b5d2c0a202020202020227669657773223a205b5d0a2020202020207d }
0x7b0a202020202020202020202020226e616d65223a22464132204e4654204d61726b6574706c616365222c0a202020202020202020202020226465736372697074696f6e223a224578616d706c65206f662046413220696d706c656d656e746174696f6e222c0a2020202020202020202020202276657273696f6e223a22302e302e31222c0a202020202020202020202020226c6963656e7365223a7b226e616d65223a224d4954227d2c0a20202020202020202020202022617574686f7273223a5b224d617269676f6c643c636f6e74616374406d617269676f6c642e6465763e225d2c0a20202020202020202020202022686f6d6570616765223a2268747470733a2f2f6d617269676f6c642e646576222c0a20202020202020202020202022736f75726365223a7b0a202020202020202020202020202022746f6f6c73223a5b224c69676f225d2c0a2020202020202020202020202020226c6f636174696f6e223a2268747470733a2f2f6769746875622e636f6d2f6c69676f6c616e672f636f6e74726163742d636174616c6f6775652f747265652f6d61696e2f6c69622f666132227d2c0a20202020202020202020202022696e7465726661636573223a5b22545a49502d303132225d2c0a202020202020202020202020226572726f7273223a205b5d2c0a202020202020202020202020227669657773223a205b5d0a2020202020202020202020207d }
{}
{})

20 changes: 10 additions & 10 deletions solution/contracts/nft.jsligo
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#import "@ligo/fa/lib/fa2/nft/nft.impl.jsligo" "FA2Impl"

/* ERROR MAP FOR UI DISPLAY or TESTS
const errorMap : map<string,string> = Map.literal(list([
["0", "Enter a positive and not null amount"],
["1", "Operation not allowed, you need to be administrator"],
["2", "You cannot sell more than your current balance"],
["3", "Cannot find the offer you entered for buying"],
["4", "You entered a quantity to buy than is more than the offer quantity"],
["5", "Not enough funds, you need to pay at least quantity * offer price to get the tokens"],
["6", "Cannot find the contract relative to implicit address"],
]));
*/
const errorMap : map<string,string> = Map.literal(list([
["0", "Enter a positive and not null amount"],
["1", "Operation not allowed, you need to be administrator"],
["2", "You cannot sell more than your current balance"],
["3", "Cannot find the offer you entered for buying"],
["4", "You entered a quantity to buy than is more than the offer quantity"],
["5", "Not enough funds, you need to pay at least quantity * offer price to get the tokens"],
["6", "Cannot find the contract relative to implicit address"],
]));
*/

export type offer = { owner: address, price: nat };

Expand Down
8 changes: 2 additions & 6 deletions solution/contracts/nft.parameterList.jsligo
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
#import "nft.jsligo" "Contract"

// Define your parameter values as a list of LIGO variable definitions
// When this file was created, the smart contract was defined with an entrypoint using `@entry` that was not within a namespace. As such, the examples below are written with that assumption in mind.

// If your parameter is a simple value, you can define it directly
// E.g. const default_parameter = 10

// For added type-safety, you can reference the type of your parameter from the contract
// E.g. const default_parameter : parameter_of Contract = 10
// IMPORTANT: We suggest always explicitly typing your parameter values:
// E.g.: `const parameter: int = 10` or `const parameter: Contract.parameter = 10`
26 changes: 13 additions & 13 deletions solution/contracts/nft.storageList.jsligo
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ const default_storage: Contract.storage = {
"data",
bytes
`{
"name":"FA2 NFT Marketplace",
"description":"Example of FA2 implementation",
"version":"0.0.1",
"license":{"name":"MIT"},
"authors":["Marigold<[email protected]>"],
"homepage":"https://marigold.dev",
"source":{
"tools":["Ligo"],
"location":"https://github.com/ligolang/contract-catalogue/tree/main/lib/fa2"},
"interfaces":["TZIP-012"],
"errors": [],
"views": []
}`
"name":"FA2 NFT Marketplace",
"description":"Example of FA2 implementation",
"version":"0.0.1",
"license":{"name":"MIT"},
"authors":["Marigold<[email protected]>"],
"homepage":"https://marigold.dev",
"source":{
"tools":["Ligo"],
"location":"https://github.com/ligolang/contract-catalogue/tree/main/lib/fa2"},
"interfaces":["TZIP-012"],
"errors": [],
"views": []
}`
]
]
)
Expand Down
2 changes: 1 addition & 1 deletion solution/ligo.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "name": "app", "dependencies": { "@ligo/fa": "^1.0.9" } }
{ "dependencies": { "@ligo/fa": "^1.0.9" }, "name": "app" }
Loading

0 comments on commit 152c096

Please sign in to comment.