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

Merge staging to main Jan 18 #267

Merged
merged 4 commits into from
Jan 18, 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
118 changes: 118 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,124 @@ To run tests locally, run `npm run test -- --filesToCheck=docs/developing.md,doc

Docusaurus automatically checks for broken links and markdown-encoded images when you run `npm run build`.

## Search

Search on the site is powered by Algolia Docsearch.
The index is in the [Algolia dashboard](https://dashboard.algolia.com/apps/QRIAHGML9Q/dashboard).
Contextual search is enabled according to the [Docusaurus instructions](https://docusaurus.io/docs/search#using-algolia-docsearch), although the site does not currently use contextual search to separate searches by version, language, or other similar factors.

The search uses [this crawler](https://crawler.algolia.com/admin/crawlers/eaa2c548-8b82-493b-8ab8-0c37e2e5d5cc/configuration/edit) to index the site:

```js
new Crawler({
rateLimit: 8,
maxDepth: 10,
maxUrls: 5000,
startUrls: ["https://docs.tezos.com/"],
sitemaps: ["https://docs.tezos.com/sitemap.xml"],
renderJavaScript: false,
ignoreCanonicalTo: true,
ignoreQueryParams: ["source", "utm_*"],
discoveryPatterns: ["https://docs.tezos.com/**"],
schedule: "every 24 hours",
appId: "QRIAHGML9Q",
apiKey: "API_KEY_GOES_HERE",
actions: [
{
indexName: "tezosdocs",
pathsToMatch: ["https://docs.tezos.com/**"],
recordExtractor: ({ $, helpers }) => {
// priority order: deepest active sub list header -> navbar active item -> 'Documentation'
const lvl0 =
$(
".menu__link.menu__link--sublist.menu__link--active, .navbar__item.navbar__link--active",
)
.last()
.text() || "Documentation";

return helpers.docsearch({
recordProps: {
lvl0: {
selectors: "",
defaultValue: lvl0,
},
lvl1: ["header h1", "article h1"],
lvl2: "article h2",
lvl3: "article h3",
lvl4: "article h4",
lvl5: "article h5, article td:first-child",
lvl6: "article h6",
content: "article p, article li, article td:last-child",
},
indexHeadings: true,
aggregateContent: true,
recordVersion: "v3",
});
},
},
],
initialIndexSettings: {
tezosdocs: {
attributesForFaceting: [
"type",
"lang",
"language",
"version",
"docusaurus_tag",
],
attributesToRetrieve: [
"hierarchy",
"content",
"anchor",
"url",
"url_without_anchor",
"type",
],
attributesToHighlight: ["hierarchy", "content"],
attributesToSnippet: ["content:10"],
camelCaseAttributes: ["hierarchy", "content"],
searchableAttributes: [
"unordered(hierarchy.lvl0)",
"unordered(hierarchy.lvl1)",
"unordered(hierarchy.lvl2)",
"unordered(hierarchy.lvl3)",
"unordered(hierarchy.lvl4)",
"unordered(hierarchy.lvl5)",
"unordered(hierarchy.lvl6)",
"content",
],
distinct: true,
attributeForDistinct: "url",
customRanking: [
"desc(weight.pageRank)",
"desc(weight.level)",
"asc(weight.position)",
],
ranking: [
"words",
"filters",
"typo",
"attribute",
"proximity",
"exact",
"custom",
],
highlightPreTag: '<span class="algolia-docsearch-suggestion--highlight">',
highlightPostTag: "</span>",
minWordSizefor1Typo: 3,
minWordSizefor2Typos: 7,
allowTyposOnNumericTokens: false,
minProximity: 1,
ignorePlurals: true,
advancedSyntax: true,
attributeCriteriaComputedByMinProximity: true,
removeWordsIfNoResults: "allOptional",
separatorsToIndex: "_",
},
},
});
```

## License

This project is open for contribution but the source code itself uses a commercial template and is therefore not licensed under any open-source license. Forking this project as a base for your own projects is not permitted under the license of the original template.
2 changes: 1 addition & 1 deletion docs/architecture.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ Optionally, this node can open its RPC interface to serve different kinds of req

For more information about the architecture of Tezos, see:

- [Accounts](./architecture/accounts)
- [Accounts and addresses](./architecture/accounts)
- [Tokens](./architecture/tokens)
- [Smart Optimistic Rollups](./architecture/smart-rollups)
- [Governance](./architecture/governance)
24 changes: 15 additions & 9 deletions docs/architecture/accounts.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
---
title: Accounts
title: Accounts and addresses
authors: "Tim McMackin"
last_update:
date: 29 December 2023
date: 10 January 2024
---

## Accounts

Tezos uses these types of accounts:

- Classic accounts (also known as _implicit accounts_) store tez (ꜩ) and tickets.
These accounts have addresses that start with "tz1", "tz2", "tz3" or "tz4."
Any wallet application or the Octez command-line tool can create implicit accounts.
- User accounts (sometimes known as _implicit accounts_) store tez (ꜩ) and tickets.
Any wallet application or the Octez command-line tool can create user accounts.

- Smart contract accounts (also known as _originated accounts_) store immutable code, mutable storage, tez (ꜩ), and tickets.
Smart contracts have addresses that start with "KT1."
- Smart contract accounts (sometimes known as _originated accounts_) store immutable code, mutable storage, tez (ꜩ), and tickets.
See [Smart contracts](../smart-contracts).

- Smart Rollup accounts are another type of originated account.
Their addresses start with `SR1`.
## Addresses

- User accounts have addresses that start with "tz1", "tz2", "tz3" or "tz4."

- Smart contracts have addresses that start with "KT1."

- Smart Rollups have addresses, but are not accounts because they cannot store tez.
Their addresses start with "SR1".
They have a tree of commitments attached to them.
See [Smart Optimistic Rollups](./smart-rollups).
12 changes: 0 additions & 12 deletions docs/dApps.md

This file was deleted.

52 changes: 52 additions & 0 deletions docs/dApps.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
title: Decentralized applications (dApps)
authors: Benjamin Pilia, Tim McMackin
last_update:
date: 12 January 2024
---

import LucidDiagram from '@site/src/components/LucidDiagram';

One of the main features of blockchains is _decentralization_: each transaction is verified by multiple nodes and its validation process does not rely on a single trusted third party.
Decentralized applications (dApps or Dapps) take advantage of these features to create applications that are independent, transparent, and trustless.

In general, dApps have these parts:

- **Frontend**: An off-chain component that can act as a user interface to simplify interaction with the on-chain component, run off-chain processing, and get information from sources that are not available to the on-chain component
- **Middleware**: Optionally, an [indexer](./developing/information/indexers) to interpret the backend information and provide it in a more convenient format for the front-end component
- **Backend**: An on-chain component that consists of one or more [smart contracts](./smart-contracts)

The off-chain component can be nearly any kind of program, including a web application, mobile or desktop app, or command-line interface.
It relies on wallets and tools to interact with the smart contract on behalf of a user's Tezos account.

<LucidDiagram width="640px" height="480px" src="https://lucid.app/documents/embedded/8caf9ef1-11e4-454a-bbb6-ef4852515959" id=".4NXymECcQqz" />

Some of these tools that allow an off-chain component to interact with smart contracts include:

- [Taquito](./dApps/taquito), an SDK for JavaScript/TypeScript applications
- The [Tezos SDK for Unity](./unity), a toolkit for Unity applications
- [Taqueria](https://taqueria.io/), a development platform for dApps

## Sample dApps

For example dApps, see [Sample dApps](./dApps/samples).

## Best practices

Good programming and design practices make dApps easier to use and provide a better user experience.
See [Best practices and avoiding flaws](./dApps/best-practices).

## dApp tasks

For information on typical tasks that dApps do, see:

- [Connecting to wallets](./dApps/wallets)
- [Sending transactions](./dApps/sending-transactions)

## Tutorials

These tutorials cover dApps of different complexities:

- For a simple dApp, see [Build your first app on Tezos](./tutorials/build-your-first-app)
- For a dApp that mints NFTs, see [Mint NFTs from a web app](./tutorials/create-an-nft/nft-web-app)
- For a large dApp that allows users to buy and sell NFTs, see [Build an NFT marketplace](./tutorials/build-an-nft-marketplace)
4 changes: 2 additions & 2 deletions docs/dApps/taquito.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,13 @@ Tezos.setWalletProvider(wallet)

## Getting data from the Tezos blockchain

Taquito provides methods to get different types of data from the Tezos blockchain, for example, the balance of an implicit account, the storage of a contract or token metadata.
Taquito provides methods to get different types of data from the Tezos blockchain, for example, the balance of a user account, the storage of a contract or token metadata.

> Note: querying data from the blockchain doesn't create a new transaction.

### Getting the balance of an account

Taquito allows developers to get the current balance in tez of an implicit account. The `getBalance` method is available on the instance of the TezosToolkit and requires a parameter of type `string` that represents the address of the account.
Taquito allows developers to get the current balance in tez of a user account. The `getBalance` method is available on the instance of the TezosToolkit and requires a parameter of type `string` that represents the address of the account.

The returned value is of type `BigNumber`:

Expand Down
30 changes: 18 additions & 12 deletions docs/overview/glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ The following is adapted from this [Agora post](https://forum.tezosagora.org/t/n
In the context, each account is associated with a balance (an amount of
tez available).

An account can be either an originated account or an implicit account.
An account can be a user account or a smart contract.

- **Baker**

Expand Down Expand Up @@ -190,9 +190,9 @@ The following is adapted from this [Agora post](https://forum.tezosagora.org/t/n

- **Delegate**

An implicit account that can participate in consensus and in governance.
A user account that can participate in consensus and in governance.
Actual participation is under further provisions, like having a minimal stake.
An implicit account becomes a delegate by registering as such.
A user account becomes a delegate by registering as such.
Through delegation, other accounts can delegate their rights to a delegate account.
The delegate's rights are calculated based on its stake.
Note that `tz4` accounts cannot be delegates.
Expand Down Expand Up @@ -252,15 +252,7 @@ The following is adapted from this [Agora post](https://forum.tezosagora.org/t/n

- **Implicit account**

An account that is linked to a public key. Contrary to a smart
contract, an implicit account cannot include a script and it
cannot reject incoming transactions.

If *registered*, an implicit account can act as a delegate.

The address of an implicit account always starts with the
letters tz followed by 1, 2, 3, or 4 (depending on the
signature scheme) and finally the hash of the public key.
See [User account](#user-account).

- **Layer 1**

Expand Down Expand Up @@ -345,6 +337,20 @@ The following is adapted from this [Agora post](https://forum.tezosagora.org/t/n
An operation to transfer tez between two accounts, or to run the code of a
smart contract.

<a name="user-account"/>

- **User account**

An account that is linked to a public key. Contrary to a smart
contract, a user account cannot include a script and it
cannot reject incoming transactions.

If *registered*, a user account can act as a delegate.

The address of a user account always starts with the
letters tz followed by 1, 2, 3, or 4 (depending on the
signature scheme) and finally the hash of the public key.

- **Validation pass**

An index (a natural number) associated with a particular kind of
Expand Down
2 changes: 1 addition & 1 deletion docs/smart-contracts/data-types/complex-data-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ The ticket's information is public and can be read by any contract that holds th

Contracts can pass tickets to entrypoints to change which contract is in control of the ticket.
If contract A passes a ticket to contract B, contract A loses all access to the ticket.
Contracts can pass tickets only to other contracts (implicit accounts) because the entrypoint must accept a ticket of the correct type; contracts cannot pass tickets to user accounts.
Contracts can pass tickets to other contracts via entrypoints accepting a ticket of the correct type; contracts can also pass tickets to user accounts.

### Ticket features

Expand Down
10 changes: 5 additions & 5 deletions docs/smart-contracts/data-types/primitive-data-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,16 +160,16 @@ The following operations are supported on timestamps:

## Addresses {#addresses}

On Tezos, each account is uniquely identified by its `address`, whether it is a user account (implicit account) or a contract (originated account).
On Tezos, each account is uniquely identified by its `address`.

Internally, addresses take the form of a `string` type.
For implicit accounts, the string starts with "tz1", "tz2", "tz3" or "tz4".
For originated accounts, the string starts with "KT1".
For user accounts, the string starts with "tz1", "tz2", "tz3" or "tz4".
For smart contract accounts, the string starts with "KT1".

| Type of Account | Example |
| --- | --- |
| Implicit Account | `tz1YWK1gDPQx9N1Jh4JnmVre7xN6xhGGM4uC` |
| Originated Account | `KT1S5hgipNSTFehZo7v81gq6fcLChbRwptqy` |
| User account | `tz1YWK1gDPQx9N1Jh4JnmVre7xN6xhGGM4uC` |
| Smart contract | `KT1S5hgipNSTFehZo7v81gq6fcLChbRwptqy` |

The next part of the string is a `Base58` encoded hash, followed by a 4-byte checksum.

Expand Down
2 changes: 1 addition & 1 deletion docs/smart-contracts/deploying.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ last_update:
date: 6 November 2023
---
## Introduction
In Tezos, deploying a smart contract is often referred to as “origination”. This process essentially creates a new account that holds the smart contract's script. Contracts originated in this manner have addresses that start with `KT1` (known as originated accounts), which distinguishes them from the implicit accounts with addresses beginning with `tz1`, `tz2`, or `tz3`.
In Tezos, deploying a smart contract is often referred to as “origination”. This process essentially creates a new account that holds the smart contract's script. Contracts originated in this manner have addresses that start with `KT1`, which distinguishes them from the user accounts with addresses beginning with `tz1`, `tz2`, or `tz3`.

## Prerequisites
- Compile your contract and its initial storage
Expand Down
2 changes: 1 addition & 1 deletion docs/smart-contracts/logic/comparing.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ How values are compared depends on the type of the values:
- Strings, `bytes`, `key_hash`, `key`, `signature` and `chain_id` values are compared lexicographically.
- Boolean values are compared so that false is strictly less than true.
- Address are compared as follows:
- Addresses of implicit accounts are strictly less than addresses of originated accounts.
- Addresses of user accounts are strictly less than addresses of smart contracts.
- Addresses of the same type are compared lexicographically.
- Pair values (and therefore records) are compared component by component, starting with the first component.
- Options are compared as follows:
Expand Down
2 changes: 1 addition & 1 deletion docs/smart-contracts/multisig-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Note, this section uses the

The Generic Multisig allows us to set administrators of the contract
(`signerKeys`) and the number of those administrators required to sign
(`threshold`). As of writing, the command line tool only allows `tz1` implicit
(`threshold`). As of writing, the command line tool only allows `tz1` user
accounts to be administrators, though the contract allows `KT1` originated
accounts as well.

Expand Down
2 changes: 1 addition & 1 deletion docs/smart-contracts/special-values.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ For example, assume that user A called contract B that in turn called contract C
When C runs, `source` is the address of A, while `caller` is the address of B.

:::warning Access permissions
It is best practice to implement permissioning based on `caller` instead of `source` because any implicit account can call any entrypoint on Tezos.
It is best practice to implement permissioning based on `caller` instead of `source` because any user account can call any entrypoint on Tezos.
:::

- `self`: The address of the contract itself.
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/dapp/part-1.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ Taqueria is generating the `.tz` Michelson file on the `artifacts` folder. The M

The default Tezos testing testnet is called **Ghostnet**.

> :warning: You need an account to deploy a contract with some `tez` (the Tezos native currency). The first time you deploy a contract with Taqueria, it is generating a new implicit account with `0 tez`.
> :warning: You need an account to deploy a contract with some `tez` (the Tezos native currency). The first time you deploy a contract with Taqueria, it is generating a new user account with `0 tez`.

1. Deploy your contract to the `testing` environment. Ut forces Taqueria to generate a default account on a testing config file.

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

- `#import "./pokeGame.jsligo" "PokeGame"` to import the source file as module in order to call functions and use object definitions.
- `export type main_fn` it will be useful later for the mutation tests to point to the main function to call/mutate.
- `Test.reset_state ( 2...` this creates two implicit accounts on the test environment.
- `Test.reset_state ( 2...` this creates two user accounts on the test environment.
- `Test.nth_bootstrap_account` this return the nth account from the environment.
- `Test.to_contract(taddr)` and `Tezos.address(contr)` are util functions to convert typed addresses, contract and contract addresses.
- `let _testPoke = (s : address) : unit => {...}` declaring function starting with `_` is escaping the test for execution. Use this to factorize tests changing only the parameters of the function for different scenarios.
Expand Down
Loading
Loading