Skip to content

Commit

Permalink
fix: relative urls throughout the docs (#45)
Browse files Browse the repository at this point in the history
* adding extension in docs references

* fix formatting

* fix broken link
  • Loading branch information
ArielElp authored Jun 15, 2022
1 parent bb732eb commit 9264f15
Show file tree
Hide file tree
Showing 12 changed files with 65 additions and 65 deletions.
28 changes: 14 additions & 14 deletions docs/Blocks/header.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ The following fields define the block header:

<APITable>

| Name | Type | Description | Implemented |
| ------------------------ | -------------- | --------------------------------------------------------------------------------- | :----------------: |
| `parent_block_hash` | `FieldElement` | The hash of this block's parent | :heavy_check_mark: |
| `block_number` | `Integer` | The number (height) of this block | :heavy_check_mark: |
| `global_state_root` | `FieldElement` | The state [commitment](../State/starknet-state#state-commitment) after this block | :heavy_check_mark: |
| `sequencer_address` | `FieldElement` | The StarkNet address of the sequencer who created this block | :heavy_check_mark: |
| `block_timestamp` | `Timestamp` | The time the sequencer created this block before executing transactions | :heavy_check_mark: |
| `transaction_count` | `Integer` | The number of transactions in a block | :heavy_check_mark: |
| `transaction_commitment` | `FieldElement` | A commitment to the transactions included in the block | :heavy_check_mark: |
| `event_count` | `Integer` | The number of events | :heavy_check_mark: |
| `event_commitment` | `FieldElement` | A commitment to the events produced in this block | :heavy_check_mark: |
| `protocol_version` | `Integer` | The version of the StarkNet protocol used when creating this block | |
| `extra data` | `FieldElement` | Extraneous data that might be useful for running transactions | |
| Name | Type | Description | Implemented |
| ------------------------ | -------------- | ------------------------------------------------------------------------------------ | :----------------: |
| `parent_block_hash` | `FieldElement` | The hash of this block's parent | :heavy_check_mark: |
| `block_number` | `Integer` | The number (height) of this block | :heavy_check_mark: |
| `global_state_root` | `FieldElement` | The state [commitment](../State/starknet-state.md#state-commitment) after this block | :heavy_check_mark: |
| `sequencer_address` | `FieldElement` | The StarkNet address of the sequencer who created this block | :heavy_check_mark: |
| `block_timestamp` | `Timestamp` | The time the sequencer created this block before executing transactions | :heavy_check_mark: |
| `transaction_count` | `Integer` | The number of transactions in a block | :heavy_check_mark: |
| `transaction_commitment` | `FieldElement` | A commitment to the transactions included in the block | :heavy_check_mark: |
| `event_count` | `Integer` | The number of events | :heavy_check_mark: |
| `event_commitment` | `FieldElement` | A commitment to the events produced in this block | :heavy_check_mark: |
| `protocol_version` | `Integer` | The version of the StarkNet protocol used when creating this block | |
| `extra data` | `FieldElement` | Extraneous data that might be useful for running transactions | |

</APITable>

Expand All @@ -42,7 +42,7 @@ h(B)=h(&\text{block\_number}, \text{ global\_state\_root}, \text{ sequencer\_add
\end{aligned}
$$

Where $h$ is the [Pedersen](../Hashing/hash-functions#pedersen-hash) hash.
Where $h$ is the [Pedersen](../Hashing/hash-functions.md#pedersen-hash) hash.

:::note placeholders
Zeroes inside the hash computation of an object are used as placeholders, to be replaced in the future by meaningful fields.
Expand Down
2 changes: 1 addition & 1 deletion docs/Blocks/transaction-life-cycle.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Transaction will now either execute successfully or be rejected.

### PENDING

Transaction executed successfully and entered the [pending block](./transaction-life-cycle#the-pending-block).
Transaction executed successfully and entered the [pending block](./transaction-life-cycle.md#the-pending-block).

### REJECTED

Expand Down
20 changes: 10 additions & 10 deletions docs/Blocks/transactions.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ StarkNet, in its Alpha version, supports two types of transactions: a `Deploy` t
## Deploy transaction

:::caution
The deploy transaction will be deprecated in future StarkNet versions. To deploy new constract instances, you can use the `deploy` syscall. For more information, see [contract classes](../Contracts/contract-classes).
The deploy transaction will be deprecated in future StarkNet versions. To deploy new constract instances, you can use the `deploy` syscall. For more information, see [contract classes](../Contracts/contract-classes.md).
:::

A deploy transaction is a transaction type used to deploy contracts to StarkNet.
Expand Down Expand Up @@ -42,9 +42,9 @@ Where:

- The placeholder zero is used to align the hash computation for the different types of transactions (here, it holds the place of the `max_fee` field which exsists in both `invoke` and `declare` transactions)
- “deploy” and “constructor” constant’s prefixes, encoded in bytes (ASCII), with big-endian.
- $h$ is the [Pedersen](../Hashing/hash-functions#pedersen-hash) hash and $sn\_keccak$ is [StarkNet Keccak](../Hashing/hash-functions#starknet-keccak)
- `chain_id` is a constant value that specifies the network to which this transaction is sent. See [Chain-Id](./transactions#chain-id).
- `contract_address` is calculated as described [here](../Contracts/contract-address).
- $h$ is the [Pedersen](../Hashing/hash-functions.md#pedersen-hash) hash and $sn\_keccak$ is [StarkNet Keccak](../Hashing/hash-functions.md#starknet-keccak)
- `chain_id` is a constant value that specifies the network to which this transaction is sent. See [Chain-Id](./transactions.md#chain-id).
- `contract_address` is calculated as described [here](../Contracts/contract-address.md).

## Invoke Transaction

Expand Down Expand Up @@ -86,12 +86,12 @@ $$
Where:

- “invoke” is a constant prefix, encoded in bytes (ASCII), with big-endian.
- `chain_id` is a constant value that specifies the network to which this transaction is sent. See [Chain-Id](./transactions#chain-id).
- $$h$$ is the [Pedersen](../Hashing/hash-functions#pedersen-hash) hash
- `chain_id` is a constant value that specifies the network to which this transaction is sent. See [Chain-Id](./transactions.md#chain-id).
- $$h$$ is the [Pedersen](../Hashing/hash-functions.md#pedersen-hash) hash

## Declare transaction

The declare transaction is used to introduce new classes into the state of StarkNet, enabling other contracts to deploy instances of those classes or using them in a library call. For more information, see [contract classes](../contracts/contract-classes).
The declare transaction is used to introduce new classes into the state of StarkNet, enabling other contracts to deploy instances of those classes or using them in a library call. For more information, see [contract classes](../Contracts/contract-classes.md).

A declare transaction has the following fields:

Expand Down Expand Up @@ -121,12 +121,12 @@ $$
Where:

- The placeholders zeros are used to align the hash computation for the different types of transactions (here, they stand for the empty call data and entry point selector)
- `chain_id` is a constant value that specifies the network to which this transaction is sent. See [Chain-Id](./transactions#chain-id).
- $$h$$ is the [Pedersen](../Hashing/hash-functions#pedersen-hash) hash
- `chain_id` is a constant value that specifies the network to which this transaction is sent. See [Chain-Id](./transactions.md#chain-id).
- $$h$$ is the [Pedersen](../Hashing/hash-functions.md#pedersen-hash) hash

## Signature

While StarkNet does not have a specific signature scheme built into the protocol, the Cairo language, in which smart contracts are written, does have an efficient implementation for ECDSA signature with respect to a [STARK-friendly curve](../Hashing/hash-functions#stark-curve).
While StarkNet does not have a specific signature scheme built into the protocol, the Cairo language, in which smart contracts are written, does have an efficient implementation for ECDSA signature with respect to a [STARK-friendly curve](../Hashing/hash-functions.md#stark-curve).

The generator used in the ECDSA algorithm is $G=\left(g_x, g_y\right)$ where:

Expand Down
14 changes: 7 additions & 7 deletions docs/CLI/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ Sends a transaction to the StarkNet sequencer, can take the following arguments:
- `contract_abi`\* - a path to a JSON file containing the called [contract’s abi](https://www.cairo-lang.org/docs/hello_starknet/intro.html#the-contract-s-abi)
- `function_name`\*- the name of the called function
- `arguments`\* - inputs to the called function, represented by a list of space-delimited values`
- `signature_information` - list of field elements as described [here](../Blocks/transactions#signature)
- `wallet_name` - the name of the desired wallet, use [deploy_account](./commands#starknet-deploy_account) to set-up new accounts in the CLI.
- `signature_information` - list of field elements as described [here](../Blocks/transactions.md#signature)
- `wallet_name` - the name of the desired wallet, use [deploy_account](./commands.md#starknet-deploy_account) to set-up new accounts in the CLI.
- `nonce` - account nonce, only relevant if the call is going through an account

:::tip
Expand Down Expand Up @@ -113,7 +113,7 @@ The possible statuses of a transaction are:
- `ACCEPTED_ON_L2`
- `ACCEPTED_ON_L1`

Refer to [this](../Blocks/transaction-life-cycle) section for more information about the transaction lifecycle.
Refer to [this](../Blocks/transaction-life-cycle.md) section for more information about the transaction lifecycle.

### starknet call

Expand All @@ -138,15 +138,15 @@ Calls a StarkNet contract without affecting the state, can take the following ar
- `arguments`\* - inputs to the called function, represented by a list of space-delimited values
- `block_hash` - the hash of the block used as the context for the call operation. If this argument is omitted, the latest block is used
- `block_number` - same as block_hash, but specifies the context block by number or [tag](#block_tag)
- `signature_information` - list of field elements as described [here](../Blocks/transactions#signature)
- `wallet_name` - the name of the desired wallet, use [deploy_account](./commands#starknet-deploy_account) to set-up new accounts in the CLI
- `signature_information` - list of field elements as described [here](../Blocks/transactions.md#signature)
- `wallet_name` - the name of the desired wallet, use [deploy_account](./commands.md#starknet-deploy_account) to set-up new accounts in the CLI
- `nonce` - account nonce, only relevant if the call is going through an account

<a name="block_tag"></a>

:::info Block Tag

A block context can be specified via the `latest` or `pending` tags, where the former refers to the latest accepted on L2 block and the latter refers to the [pending block](../Blocks/transaction-life-cycle#the-pending-block).
A block context can be specified via the `latest` or `pending` tags, where the former refers to the latest accepted on L2 block and the latter refers to the [pending block](../Blocks/transaction-life-cycle.md#the-pending-block).

:::

Expand Down Expand Up @@ -211,7 +211,7 @@ Returns the requested transaction, expects the following argument:
starknet get_transaction_receipt --hash <transaction_hash>
```

Returns the [receipt](../Blocks/transaction-life-cycle#transaction-receipt) associated with the transaction, expects the following argument:
Returns the [receipt](../Blocks/transaction-life-cycle.md#transaction-receipt) associated with the transaction, expects the following argument:

- `transaction_hash`\* - hash of the requested transaction

Expand Down
6 changes: 3 additions & 3 deletions docs/Contracts/contract-address.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ The contract address is a unique identifier of the contract on StarkNet. It is a

- `prefix` - the ASCII encoding of the constant string “STARKNET_CONTRACT_ADDRESS”
- `caller_address` - currently always zero
- `salt` - part of the [deploy transaction](../Blocks/transactions#deploy-transaction)
- `contract_hash` - see [the docs](./contract-hash)
- `calldata_hash` - [array hash](../Hashing/hash-functions#array-hashing) of the inputs to the constructor
- `salt` - part of the [deploy transaction](../Blocks/transactions.md#deploy-transaction)
- `contract_hash` - see [the docs](./contract-hash.md)
- `calldata_hash` - [array hash](../Hashing/hash-functions.md#array-hashing) of the inputs to the constructor

The computation is roughly the following:

Expand Down
2 changes: 1 addition & 1 deletion docs/Contracts/contract-classes.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ A contract class does not necessarily have a deployed instance in StarkNet.

## Using Classes

New classes can be added to the state of StarkNet with the [`declare`](../Blocks/transactions#declare-transaction) transaction. New instances of a previously declared class can be deployed via the `deploy` system call.
New classes can be added to the state of StarkNet with the [`declare`](../Blocks/transactions.md#declare-transaction) transaction. New instances of a previously declared class can be deployed via the `deploy` system call.

To use the functionality of a declared class, without deploying an instance of that class, you can use the `library_call` system call. This system call is an analogue of Ethereum's delegate call in the world of classes. You can use class code directly, instead of having a placeholder contract deployed, which is used only for its code.
8 changes: 4 additions & 4 deletions docs/Contracts/contract-hash.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ The contract's hash is a hash of its definition. The elements defining a contrac
The contract’s hash is the chain hash[^4] of the above, computed as follows:

- start with $h(0,api\_version)$
- for every line in the above (excluding the first), compute $h(h(previous\_line), new\_line)$, where the hash of an array is defined [here](../Hashing/hash-functions#array-hashing).
- for every line in the above (excluding the first), compute $h(h(previous\_line), new\_line)$, where the hash of an array is defined [here](../Hashing/hash-functions.md#array-hashing).
- let $c$ denote the cumulative hash resulting from applying the above process; the contract’s hash is then $h(c, \textrm{number\_of\_lines})$, where $\text{number\_of\_lines}$ is 7.
For more details, see the [Cairo implementation](https://github.com/starkware-libs/cairo-lang/blob/7712b21fc3b1cb02321a58d0c0579f5370147a8b/src/starkware/starknet/core/os/contracts.cairo#L47).

[^1]:
An entry point is a pair `(selector, offset)`, where offset is the offset of the instruction that should be called inside the contract’s bytecode
:::info Function selector
The selector is an identifier through which the function is callable in transactions or in other contracts. The selector is the [starknet_keccak](../Hashing/hash-functions#starknet-keccak) hash of the function name, encoded in ASCII.
The selector is an identifier through which the function is callable in transactions or in other contracts. The selector is the [starknet_keccak](../Hashing/hash-functions.md#starknet-keccak) hash of the function name, encoded in ASCII.
:::

[^2]: ASCII encoding of the builtin names
[^3]: Here we mean [starknet_keccak](../Hashing/hash-functions#starknet-keccak)
[^4]: [Pedersen hash](../Hashing/hash-functions#pedersen-hash)
[^3]: Here we mean [starknet_keccak](../Hashing/hash-functions.md#starknet-keccak)
[^4]: [Pedersen hash](../Hashing/hash-functions.md#pedersen-hash)
6 changes: 3 additions & 3 deletions docs/Data Availabilty/on-chain-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ The state diffs contain information on every contact whose storage was updated a

- Number of cells that encode contract deployments
- For each deployed contract, we have:
- `contract_address` - the [address](../Contracts/contract-address) of the deployed contract
- `contract_hash` - the [hash](../Contracts/contract-hash) of the contract
- `contract_address` - the [address](../Contracts/contract-address.md) of the deployed contract
- `contract_hash` - the [hash](../Contracts/contract-hash.md) of the contract
- `len(constructor_call_data)` - the number of arguments to the contract constructor
- `constructor_call_data` - the list of arguments to the constructor
- Number of contracts whose storage is updated
- For each such contract, we have:
- `contract_address` - the [address](../Contracts/contract-address) of the contract
- `contract_address` - the [address](../Contracts/contract-address.md) of the contract
- `num_of_storage_updates` - number of storage updates
- For each storage update:
- `key` - the address inside the contract's storage where the value is updated
Expand Down
10 changes: 5 additions & 5 deletions docs/Events/starknet-events.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ end
message_received.emit(1, 2);
```

The emit function emits an event with a single key, which is an identifier of the event, given by $\text{sn\_keccak(event\_name)}$, where $\text{event\_name}$ is the ASCII encoding of the event’s name and $\text{sn\_keccak}$ is defined [here](../Hashing/hash-functions#starknet-keccak). To emit custom keys, one should use the low level `emit_event` system call:
The emit function emits an event with a single key, which is an identifier of the event, given by $\text{sn\_keccak(event\_name)}$, where $\text{event\_name}$ is the ASCII encoding of the event’s name and $\text{sn\_keccak}$ is defined [here](../Hashing/hash-functions.md#starknet-keccak). To emit custom keys, one should use the low level `emit_event` system call:

```js
from starkware.starknet.common.syscalls import emit_event
Expand Down Expand Up @@ -65,7 +65,7 @@ message_received.emit(2, data, p)

:::

The emitted events are part of the [transaction receipt](../Blocks/transaction-life-cycle#transaction-receipt).
The emitted events are part of the [transaction receipt](../Blocks/transaction-life-cycle.md#transaction-receipt).

## Event ABI

Expand Down Expand Up @@ -99,7 +99,7 @@ $$

Where:

- $\text{keys\_hash}$, $\text{data\_hash}$ are the hashes of the keys list and data list correspondingly (see [array hashing](../Hashing/hash-functions#array-hashing)).
- $h$ is the [pedersen](../Hashing/hash-functions#pedersen-hash) hash function
- $\text{keys\_hash}$, $\text{data\_hash}$ are the hashes of the keys list and data list correspondingly (see [array hashing](../Hashing/hash-functions.md#array-hashing)).
- $h$ is the [pedersen](../Hashing/hash-functions.md#pedersen-hash) hash function

The event hashes are included in the [`event_commitment`](../Blocks/header#event_commitment) field of a block.
The event hashes are included in the [`event_commitment`](../Blocks/header.md#event_commitment) field of a block.
Loading

0 comments on commit 9264f15

Please sign in to comment.