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 fd3ea7e commit 43791f0
Show file tree
Hide file tree
Showing 15 changed files with 2,232 additions and 1,624 deletions.
2,874 changes: 1,423 additions & 1,451 deletions README.md

Large diffs are not rendered by default.

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": "95cc0acc339d65cc234dee961459ad11d3c67febc5f5a89fc5714735e5b5b8c4",
"build": "0b37e42",
"configHash": "4e9729cd476e258cb7ff391dfd36a9490035f9349ef5915e88b2c80790607e4d",
"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-4/solution/node_modules/@taqueria/plugin-ligo/postinstall.js",
"postInstall": "node /home/zamrokk/training-nft-4/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
50 changes: 28 additions & 22 deletions solution/.taq/testing-state.json
Original file line number Diff line number Diff line change
@@ -1,59 +1,65 @@
{
"operations": {},
"tasks": {
"@taqueria/plugin-taquito.deploy.1696518968789": {
"@taqueria/plugin-taquito.deploy.1699456432249": {
"task": "deploy",
"plugin": "@taqueria/plugin-taquito",
"time": 1696518968789,
"time": 1699456432249,
"output": [
{
"contract": "nft.tz",
"address": "KT18sgGX5nu4BzwV2JtpQy4KCqc8cZU5MwnN",
"address": "KT1UhE1Jd1bJqJGfW3kHChXCB7CA3UTkqpkb",
"alias": "nft",
"balanceInMutez": "0",
"destination": "https://ghostnet.ecadinfra.com"
"destination": "https://ghostnet.tezos.marigold.dev"
}
]
},
"@taqueria/plugin-taquito.deploy.1696852728145": {
"@taqueria/plugin-taquito.deploy.1699456678660": {
"task": "deploy",
"plugin": "@taqueria/plugin-taquito",
"time": 1696852728145,
"time": 1699456678660,
"output": [
{
"contract": "nft.tz",
"address": "KT1KyV1Hprert33AAz5B94CLkqAHdKZU56dq",
"alias": "nft",
"balanceInMutez": "0",
"destination": "https://ghostnet.ecadinfra.com"
"address": "KT1F56e28pcdTFJot999SWdXr7vuDPu7yYSo",
"alias": "nft"
}
]
},
"@taqueria/plugin-taquito.deploy.1696938882527": {
"@taqueria/plugin-taquito.deploy.1699458045314": {
"task": "deploy",
"plugin": "@taqueria/plugin-taquito",
"time": 1696938882528,
"time": 1699458045314,
"output": [
{
"contract": "nft.tz",
"address": "KT1EUWEeR9RHMb5q5jeW5jbhxBFHbLTqQgiZ",
"alias": "nft",
"balanceInMutez": "0",
"destination": "https://ghostnet.ecadinfra.com"
"address": "KT18nfu16UutxZNazugLwdnFce78PRTPPTon",
"alias": "nft"
}
]
},
"@taqueria/plugin-taquito.deploy.1696942364056": {
"@taqueria/plugin-taquito.deploy.1699458834528": {
"task": "deploy",
"plugin": "@taqueria/plugin-taquito",
"time": 1696942364056,
"time": 1699458834528,
"output": [
{
"contract": "nft.tz",
"address": "KT1KAkKJdbx9FGwYhKfWN3pHovX1mb3fQpC4",
"alias": "nft",
"balanceInMutez": "0",
"destination": "https://ghostnet.ecadinfra.com"
"address": "KT1TLy8qo1rfGtGmraUUQFWeBDSeM6vAQ8f5",
"alias": "nft"
}
]
},
"@taqueria/plugin-taquito.deploy.1699460101633": {
"task": "deploy",
"plugin": "@taqueria/plugin-taquito",
"time": 1699460101633,
"output": [
{
"contract": "nft.tz",
"address": "KT1QvQJw9SYUZw62wzFb9q79G5fETkoWG6ks",
"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=KT1KAkKJdbx9FGwYhKfWN3pHovX1mb3fQpC4
VITE_CONTRACT_ADDRESS=KT1QvQJw9SYUZw62wzFb9q79G5fETkoWG6ks
VITE_PINATA_API_KEY=701d3e9951e2ad5e7d63
VITE_PINATA_API_SECRET=adc566d96514e6ddd076ad531c36b536e7b6f33b36625c136f2100d2909da880
VITE_TEZOS_NODE=https://ghostnet.tezos.marigold.dev
Expand Down
2 changes: 0 additions & 2 deletions solution/app/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@ import { BeaconWallet } from "@taquito/beacon-wallet";
import { TezosToolkit } from "@taquito/taquito";
import { TokenMetadata, tzip12, Tzip12Module } from "@taquito/tzip12";
import * as api from "@tzkt/sdk-api";
import { BigNumber } from "bignumber.js";
import React, { Dispatch, SetStateAction, useEffect, useState } from "react";
import "./App.css";
import { NftWalletType, Storage } from "./nft.types";
import Paperbase from "./Paperbase";

export type TZIP21TokenMetadata = TokenMetadata & {
artifactUri?: string; //A URI (as defined in the JSON Schema Specification) to the asset.
displayUri?: string; //A URI (as defined in the JSON Schema Specification) to an image of the asset.
Expand Down
5 changes: 4 additions & 1 deletion solution/app/src/OffersPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,10 @@ export default function OffersPage() {
formik.touched.quantity && formik.errors.quantity
}
InputProps={{
inputProps: { min: 0, max: balance.toNumber() },
inputProps: {
min: 0,
max: balance.toNumber(),
},
endAdornment: (
<InputAdornment position="end">
<Button
Expand Down
14 changes: 7 additions & 7 deletions solution/app/src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React from "react";
import ReactDOM from "react-dom/client";
import App from "./App.tsx";
import "./index.css";
import React from 'react'
import ReactDOM from 'react-dom/client'
import App from './App.tsx'
import './index.css'

ReactDOM.createRoot(document.getElementById("root")!).render(
ReactDOM.createRoot(document.getElementById('root')!).render(
<React.StrictMode>
<App />
</React.StrictMode>
);
</React.StrictMode>,
)
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 }
0x7b0a202020202020202020226e616d65223a22464132204e4654204d61726b6574706c616365222c0a202020202020202020226465736372697074696f6e223a224578616d706c65206f662046413220696d706c656d656e746174696f6e222c0a2020202020202020202276657273696f6e223a22302e302e31222c0a202020202020202020226c6963656e7365223a7b226e616d65223a224d4954227d2c0a20202020202020202022617574686f7273223a5b224d617269676f6c643c636f6e74616374406d617269676f6c642e6465763e225d2c0a20202020202020202022686f6d6570616765223a2268747470733a2f2f6d617269676f6c642e646576222c0a20202020202020202022736f75726365223a7b0a202020202020202020202022746f6f6c73223a5b224c69676f225d2c0a2020202020202020202020226c6f636174696f6e223a2268747470733a2f2f6769746875622e636f6d2f6c69676f6c616e672f636f6e74726163742d636174616c6f6775652f747265652f6d61696e2f6c69622f666132227d2c0a20202020202020202022696e7465726661636573223a5b22545a49502d303132225d2c0a202020202020202020226572726f7273223a205b5d2c0a202020202020202020227669657773223a205b5d0a2020202020202020207d }
{}
{})

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/asset/multi_asset.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 = { quantity: nat, 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`
Loading

0 comments on commit 43791f0

Please sign in to comment.