Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update main from staging 2 Jan 2024 #237

Merged
merged 14 commits into from
Jan 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/architecture/governance/amendment-history.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ Jakarta's main changes are:

* Transactional optimistic rollups (or TORU), an experimental implementation of optimistic rollups on Tezos. TORU provide a way to enable higher throughput (TPS) of transactions by moving their validation away from the main chain, to 'Layer 2'.

* A new improved design for the integration of Sapling transactions into Smart Contracts. The Sapling protocol uses advanced cryptography to enable the protection of users' privacy and transparency with regard to regulators.
* A new improved design for the integration of Sapling transactions into smart contracts. The Sapling protocol uses advanced cryptography to enable the protection of users' privacy and transparency with regard to regulators.

* A redesign and renaming of the Liquidity Baking Escape Hatch mechanism, now called "Liquidity Baking Toggle Vote".

Expand Down
2 changes: 1 addition & 1 deletion docs/dApps/taquito.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ The _Taquito_ library is made of several modules:
- [@taquito/ledger-signer](https://www.npmjs.com/package/@taquito/ledger-signer): Provides ledger signing functionality.
- [@taquito/rpc](https://www.npmjs.com/package/@taquito/rpc): Provides low-level methods and types to interact with an RPC node.
- [@taquito/utils](https://www.npmjs.com/package/@taquito/utils): Provides utility methods to verify Tezos-specific data and convert data types.
- [@taquito/michelson-encoder](https://www.npmjs.com/package/@taquito/michelson-encoder): Provides a JavaScript abstraction based on a Tezos Smart contracts code, parameters and storage.
- [@taquito/michelson-encoder](https://www.npmjs.com/package/@taquito/michelson-encoder): Provides a JavaScript abstraction based on a Tezos smart contracts code, parameters and storage.
- [@taquito/michel-codec](https://www.npmjs.com/package/@taquito/michel-codec): Michelson parser/validator/formatter.
- [@taquito/local-forging](https://www.npmjs.com/package/@taquito/local-forging): Provides local forging functionality.
- [@taquito/signer](https://www.npmjs.com/package/@taquito/signer): Provides signing functionality.
Expand Down
4 changes: 2 additions & 2 deletions docs/developing/testnets.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Waiting for the next block every time you inject a new transaction takes a lot o

To make testing a lot faster, options are available, depending on the language and tools you are using, that don't use a network or even a single node at all, and skip all the consensus mechanism steps.

- The **Michelson interpreter** is an OCaml function that can be used by tools to simulate a call to any entry point of any smart contract, given an initial value of the storage and parameters. Some programming languages like **Ligo** or **Smartpy** use this as part of their testing frameworks.
- The **Michelson interpreter** is an OCaml function that can be used by tools to simulate a call to any entry point of any smart contract, given an initial value of the storage and parameters. Some programming languages like **LIGO** or **Smartpy** use this as part of their testing frameworks.

- The **mockup mode** of `octez-client` can be used to test contract calls and other features such as some RPC calls, all without running an actual node, saving the time of going through the consensus mechanism and waiting to get blocks created and validated. Tools like **Completium**, built by the team behind the **Archetype** language, use this for their testing framework. Find out more in the [documentation of the mockup mode](https://tezos.gitlab.io/user/mockup.html).

Expand Down Expand Up @@ -55,7 +55,7 @@ As the protocol on `Ghostnet` migrates to the newly adopted amendment a few days

#### Getting tez testnet tokens

In order to get Tez tokens to use when testing your application on testnet, you can use a faucet. You
In order to get tez tokens to use when testing your application on testnet, you can use a faucet. You
can request some tokens from the [Ghostnet faucet](https://faucet.ghostnet.teztnets.xyz/)


Expand Down
2 changes: 1 addition & 1 deletion docs/overview/tezos-different.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ For more information about how Tezos handles proof of stake, see https://tezos.g

## Tezos accepts multiple languages

Tezos lets developers use languages that make sense for their use case, including versions of Python and JavaScript/TypeScript. For more information, see [An Introduction to Smart Contracts](../smart-contracts/languages/).
Tezos lets developers use languages that make sense for their use case, including versions of Python and JavaScript/TypeScript. For more information, see [Languages](../smart-contracts/languages/).
2 changes: 1 addition & 1 deletion docs/smart-contracts/creating.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ The online editor is the quickest and easiest way to get started.

For example:
- For smartpy user, we recommend to use the [SmartPy online IDE](https://smartpy.io/)
- For Ligo user, we recommend to use the [Ligo online IDE](https://ligolang.org/?lang=jsligo)
- For LIGO user, we recommend to use the [LIGO online IDE](https://ligolang.org/?lang=jsligo)


### Defining contract storage
Expand Down
10 changes: 5 additions & 5 deletions docs/smart-contracts/deploying.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ octez-client originate contract CONTRACT_NAME transferring AMOUNT_TEZ from FROM_
where:
- `CONTRACT_NAME` is the name given to the contract.
- `MICHELSON_FILE` is the path for the Michelson smart contract code (.tz file).
- `AMOUNT_TEZ` is the quantity of Tez being transferred to the newly deployed contract. If a contract balance reaches 0 then it is deactivated.
- `FROM_USER` account from which the Tez are taken (and transferred to the new contract).
- `AMOUNT_TEZ` is the quantity of tez being transferred to the newly deployed contract. If a contract balance reaches 0 then it is deactivated.
- `FROM_USER` account from which the tez are taken (and transferred to the new contract).
- `INITIAL_STORAGE` is a Michelson expression. The --init parameter is used to specify the initial state of the storage.
- `GAZ_FEE` is a specified maximal fee the user is willing to pay for this operation (using the --burn-cap parameter).

### Deploying via online IDE
As for deploying through your online IDE, if you are using Ligo or SmartPy programming languages, you can simply deploy your smart contracts through their respective online IDEs.
As for deploying through your online IDE, if you are using LIGO or SmartPy programming languages, you can simply deploy your smart contracts through their respective online IDEs.
- [SmartPy online IDE](https://smartpy.io/)
- [Ligo online IDE](https://ligolang.org/?lang=jsligo)
- [LIGO online IDE](https://ligolang.org/?lang=jsligo)

## Interacting with the contract
Once you have successfully originated the smart contract and it is included in a baked block, there are two ways to interact with it: through command lines or through a block explorer.
Expand Down Expand Up @@ -70,7 +70,7 @@ Where:
- `KT1Vsw5kh4P1Vn...`: Contract address.
- `tz1VSUr8wwNhLAzempoch5d6hLRiTh8Cjcjb`: User's account address.
- `'42'`: New integer value you wish to pass to the update_data entrypoint.
- `0.05`: Maximum amount of Tez you're willing to pay in fees.
- `0.05`: Maximum amount of tez you're willing to pay in fees.

:::note
Always ensure that you check the documentation specific to the smart contract you are interacting with, as the expected arguments (`--arg`) and the name of the entrypoint (`--entrypoint`) can vary widely depending on the contract's design and purpose.
Expand Down
2 changes: 1 addition & 1 deletion docs/smart-contracts/languages/ligo.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Ligo
title: LIGO
last_update:
date: 29 June 2023
---
Expand Down
6 changes: 3 additions & 3 deletions docs/tutorials.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ These tutorials are intended for developers who are starting work with Tezos:
title="Create a minimum dApp"
emoji="🏆"
href="./tutorials/dapp"
description="Create your minimum dApp from the smart contract to the frontend, using Typescript React and Typescript-like JsLigo language"
description="Create your minimum dApp from the smart contract to the frontend, using Typescript React and Typescript-like JsLIGO language"
link="Start tutorial"
/>

Expand Down Expand Up @@ -49,7 +49,7 @@ These tutorials contain multiple parts and are intended for developers with some
title="Learn about tickets"
emoji="🎫"
href="./tutorials/dapp/part-3"
description="Learn about a Tezos unique feature named Tickets, using Typescript React and Typescript-like JsLigo language"
description="Learn about a Tezos unique feature named Tickets, using Typescript React and Typescript-like JsLIGO language"
link="Start tutorial"
/>

Expand Down Expand Up @@ -89,7 +89,7 @@ These tutorials are intended for developers who are familiar with Tezos and want
title="Upgrade your smart contract"
emoji="⬆️"
href="./tutorials/dapp/part-4"
description="Learn the different ways of upgrading your smart contract, using Typescript React and Typescript-like JsLigo language"
description="Learn the different ways of upgrading your smart contract, using Typescript React and Typescript-like JsLIGO language"
link="Start tutorial"
/>

Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/create-an-nft/fa12/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ storage with initial values. The two values we are interested in are the number
of tokens and the address that will own the initial supply.

Before we originate the contract, we need a Tezos address, along with some Tezos
tokens, to pay for the gas costs associated with calling the Smart Contract. Gas
tokens, to pay for the gas costs associated with calling the smart contract. Gas
costs get paid using Tezos tokens, not the tokens represented within our soon to
be created asset contract.

Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/dapp.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ sequenceDiagram
You will learn :

- How to create a Tezos project with Taqueria.
- How to create a smart contract in jsLigo.
- How to create a smart contract in jsLIGO.
- How to deploy the smart contract a real testnet named Ghostnet.
- How to create a frontend dApp using Taquito library and interact with a Tezos browser wallet.
- How to use an indexer like TZKT.
Expand Down
22 changes: 11 additions & 11 deletions docs/tutorials/dapp/part-1.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Taqueria manages the project structure and keeps it up to date.
For example, when you deploy a new smart contract, Taqueria automatically updates the web app to send transactions to that new smart contract.
Follow these steps to set up a Taqueria project:

On the command-line terminal, run these commands to set up a Taqueria project and install the Ligo and Taquito plugins:
On the command-line terminal, run these commands to set up a Taqueria project and install the LIGO and Taquito plugins:

```bash
taq init training
Expand Down Expand Up @@ -44,13 +44,13 @@ taq create contract pokeGame.jsligo
Every contract has to follow these rules :

- At least one entrypoint, annotated with **@entry** , with a mandatory signature taking 2 arguments **\*(parameter, storage)** and a return type. An entrypoint is function that is exposed as an external API.
- **parameter**: the entrypoint parameter. Mandatory and can be of any type. For example: an (ignored) variable starting with`_` here, and of type `unit` (the type void on Ligo).
- **storage**: the on-chain storage. Mandatory and can be of any type. For example, here we use the type `unit`. It is recommended to add an `export` keyword before the type definition as it is a good practice to export it when you require to write unit tests from another Ligo file.
- **parameter**: the entrypoint parameter. Mandatory and can be of any type. For example: an (ignored) variable starting with`_` here, and of type `unit` (the type void on LIGO).
- **storage**: the on-chain storage. Mandatory and can be of any type. For example, here we use the type `unit`. It is recommended to add an `export` keyword before the type definition as it is a good practice to export it when you require to write unit tests from another LIGO file.
- **return\_**: a mandatory pair of list of `operation` and the storage type (defined earlier). Return type naming is free but don't use an existing keyword like **return**.

[Have a look on the Entrypoints contracts documentation](/smart-contracts/entrypoints)>

> Note: Previous versions of LIGO used a single main function instead of a function for each entrypoint. This syntax is still valid, but it is harder to read and deprecated in Ligo V1.
> Note: Previous versions of LIGO used a single main function instead of a function for each entrypoint. This syntax is still valid, but it is harder to read and deprecated in LIGO V1.
>
> A `Poke` variant parameter is generated from the `poke` entrypoint function under the hood. A variant is more or less equivalent of the Enum type in Javascript. A default main function is generated and act like as a dispatcher for each of your entrypoints. It means that this painful boilerplate is no more needed on the new syntax.

Expand All @@ -77,7 +77,7 @@ taq create contract pokeGame.jsligo

Explanation:

- The Ligo Set library has a function **add** to add one element to the Set of items. There is no concept of Class in Ligo, you use a library to apply functions on objects.
- The LIGO Set library has a function **add** to add one element to the Set of items. There is no concept of Class in LIGO, you use a library to apply functions on objects.
- A list of operation is required to return. An empty list is returned here as there is no other contract to call.

[Have a look on the Set library documentation](https://ligolang.org/docs/language-basics/sets-lists-tuples#sets)
Expand All @@ -90,11 +90,11 @@ taq create contract pokeGame.jsligo

## Simulate a call on your smart contract

The Ligo command-line provides sub-commands to test your Ligo code.
The LIGO command-line provides sub-commands to test your LIGO code.

[Have a look on the Testing Framework documentation](https://ligolang.org/docs/advanced/testing)

1. Compile the contract with Taqueria (Force to use a specific Ligo version with `TAQ_LIGO_IMAGE` Taqueria environment variable).
1. Compile the contract with Taqueria (Force to use a specific LIGO version with `TAQ_LIGO_IMAGE` Taqueria environment variable).

```bash
TAQ_LIGO_IMAGE=ligolang/ligo:1.1.0 taq compile pokeGame.jsligo
Expand Down Expand Up @@ -124,7 +124,7 @@ Taqueria is generating the `.tz` Michelson file on the `artifacts` folder. The M

It compiles both source code and storage.

Before deployment, to simulate a call to our entrypoint **poke**, Taq has a **taq simulate** command.
Before deployment, to simulate a call to our entrypoint **poke**, Taq has a **taq simulate** command.
The contract parameter `Poke()` and the initial storage with the default empty set is passed to the execution.

1. Edit the second file **pokeGame.parameterList.jsligo**
Expand Down Expand Up @@ -199,7 +199,7 @@ The default Tezos testing testnet is called **Ghostnet**.
}
```

- Choice N°2: use the Taqueria generated account. Copy the account **privateKey** from the **.taq/config.local.testing.json** config file. Open your Temple browser extension on your computer or on your mobile phone and do the [initial setup](https://www.youtube.com/watch?v=S8_tL8PfCts). Once you are done, go to Settings (click on the avatar icon, or display Temple in full page) and click on **Import account > Private key** tab. Paste the **privateKey** to Temple text input and confirm. Send free Tez to your new account via this web faucet [Marigold faucet](https://faucet.marigold.dev/). Connect your wallet on **Ghostnet** and ask for free tez.
- Choice N°2: use the Taqueria generated account. Copy the account **privateKey** from the **.taq/config.local.testing.json** config file. Open your Temple browser extension on your computer or on your mobile phone and do the [initial setup](https://www.youtube.com/watch?v=S8_tL8PfCts). Once you are done, go to Settings (click on the avatar icon, or display Temple in full page) and click on **Import account > Private key** tab. Paste the **privateKey** to Temple text input and confirm. Send free tez to your new account via this web faucet [Marigold faucet](https://faucet.marigold.dev/). Connect your wallet on **Ghostnet** and ask for free tez.

Now you have some money to play with.

Expand Down Expand Up @@ -631,8 +631,8 @@ Instead of querying heavily the rpc node to search where are located all other s

## Summary

Now, you are able to create any Smart Contract using Ligo and create a complete Dapp via Taqueria/Taquito.
Now, you are able to create any Smart Contract using LIGO and create a complete Dapp via Taqueria/Taquito.

In the next section, you will learn how to call a Smart contract from a Smart Contract using callbacks, and also write unit and mutation tests.
In the next section, you will learn how to call a smart contract from a smart contract using callbacks, and also write unit and mutation tests.

When you are ready, continue to [Part 2: Inter-contract calls and testing](./part-2).
4 changes: 2 additions & 2 deletions docs/tutorials/dapp/part-2.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ sequenceDiagram

Explanation:

- `...store` do a copy by value of your object. [Have a look on the Functional updates documentation](https://ligolang.org/docs/language-basics/maps-records/#functional-updates). Note: you cannot do assignment like this `store.pokeTraces=...` in jsLigo, there are no concept of Classes, use `Functional updates` instead.
- `...store` do a copy by value of your object. [Have a look on the Functional updates documentation](https://ligolang.org/docs/language-basics/maps-records/#functional-updates). Note: you cannot do assignment like this `store.pokeTraces=...` in jsLIGO, there are no concept of Classes, use `Functional updates` instead.
- `Map.add(...`: Add a key, value entry to a map. For more information about [Map](https://ligolang.org/docs/language-basics/maps-records/#maps).
- `export type storage = {...};` a `Record` type is declared, it is an [object structure](https://ligolang.org/docs/language-basics/maps-records#records).
- `Tezos.get_self_address()` is a native function that returns the current contract address running this code. Have a look on [Tezos native functions](https://ligolang.org/docs/reference/current-reference).
Expand Down Expand Up @@ -408,7 +408,7 @@ sequenceDiagram

## Write mutation tests

Ligo provides mutations testing through the Test library. Mutation tests are like `testing your tests` to see if your unit tests coverage is strong enough. Bugs, or mutants, are automatically inserted into your code. Your tests are run on each mutant.
LIGO provides mutations testing through the Test library. Mutation tests are like `testing your tests` to see if your unit tests coverage is strong enough. Bugs, or mutants, are automatically inserted into your code. Your tests are run on each mutant.

If your tests fail then the mutant is killed. If your tests passed, the mutant survived.
The higher the percentage of mutants killed, the more effective your tests are.
Expand Down
4 changes: 2 additions & 2 deletions docs/tutorials/dapp/part-3.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Minting is the action of creating ticket from void. In general, minting operatio

> Note: to simplify, there is no security around this entrypoint, but in Production it should.

Tickets are very special objects that cannot be **DUPLICATED**. During compilation to Michelson, using a variable twice, copying a structure holding tickets are generating `DUP` command. To avoid our contract to fail at runtime, Ligo parses statically our code during compilation time to detect any DUP on tickets.
Tickets are very special objects that cannot be **DUPLICATED**. During compilation to Michelson, using a variable twice, copying a structure holding tickets are generating `DUP` command. To avoid our contract to fail at runtime, LIGO parses statically our code during compilation time to detect any DUP on tickets.

To solve most of issues, segregate ticket objects from the rest of the storage, or structures containing ticket objects in order to avoid compilation errors. To do this, just destructure any object until you get tickets isolated.

Expand Down Expand Up @@ -430,7 +430,7 @@ Update the unit tests files to see if you can still poke.
yarn dev
```

1. Connect with any wallet with enough Tez, and Poke your own contract.
1. Connect with any wallet with enough tez, and Poke your own contract.

![pokefail](/img/tutorials/dapp-pokefail.png)

Expand Down
Loading
Loading