Skip to content

Commit dbb1340

Browse files
authored
Smart contracts cleanup #1642
1 parent b6f9010 commit dbb1340

23 files changed

+34
-2435
lines changed

.htaccess

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,3 +411,10 @@ RewriteRule ^architecture-and-concepts/network-architecture/fee-mechanism$ /arch
411411
RewriteRule ^architecture-and-concepts/network-architecture/messaging-mechanism$ /architecture-and-concepts/messaging? [R=301,L]
412412
RewriteRule ^architecture-and-concepts/network-architecture/starknet-state$ /architecture-and-concepts/state? [R=301,L]
413413
RewriteRule ^architecture-and-concepts/network-architecture/messaging-reference$ /resources/messaging-reference? [R=301,L]
414+
RewriteRule ^architecture-and-concepts/smart-contracts/starknet-events/$ https://book.cairo-lang.org/ch101-03-contract-events.html [R=301,L]
415+
RewriteRule ^architecture-and-concepts/smart-contracts/execution-info/$ / [R=301,L]
416+
RewriteRule ^architecture-and-concepts/smart-contracts/compiled-class-hash/$ / [R=301,L]
417+
RewriteRule ^architecture-and-concepts/smart-contracts/contract-address/$ https://book.cairo-lang.org/ch100-01-contracts-classes-and-instances.html [R=301,L]
418+
RewriteRule ^architecture-and-concepts/smart-contracts/class-hash/$ https://book.cairo-lang.org/ch100-01-contracts-classes-and-instances.html [R=301,L]
419+
RewriteRule ^architecture-and-concepts/smart-contracts/contract-classes/$ https://book.cairo-lang.org/ch100-01-contracts-classes-and-instances.html [R=301,L]
420+
RewriteRule ^architecture-and-concepts/smart-contracts/cairo-and-sierra/$ https://book.cairo-lang.org/appendix-09-sierra.html [R=301,L]

components/Starknet/modules/architecture-and-concepts/nav.adoc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
** xref:economics-of-starknet.adoc[Tokenomics]
1313
* Stack
1414
** https://book.cairo-lang.org/[Cairo ↗^]
15-
** xref:smart-contracts/cairo-and-sierra.adoc[]
1615
** xref:sharp.adoc[SHARP]
1716
** xref:os.adoc[SNOS]
1817
** xref:starkgate.adoc[]

components/Starknet/modules/architecture-and-concepts/pages/blocks.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ Note that the signature is itself a (possibly empty) array of field elements.
135135
[discrete]
136136
=== Event hash
137137

138-
The hash of an xref:../smart-contracts/starknet-events.adoc[event] emitted by a contract whose address is `emitter_address` and a transaction whose hash is `tx_hash` is defined by:
138+
The hash of an https://book.cairo-lang.org/ch101-03-contract-events.html[event^] emitted by a contract whose address is `emitter_address` and a transaction whose hash is `tx_hash` is defined by:
139139

140140
[,,subs="quotes"]
141141
----

components/Starknet/modules/architecture-and-concepts/pages/messaging.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,6 @@ Since L1 handler transactions are not initiated by an account, invoking link:htt
248248

249249
== Additional resources
250250

251-
* xref:architecture-and-concepts:smart-contracts/system-calls-cairo1.adoc#send_message_to_L1[`send_message_to_L1`] syscall
251+
* https://book.cairo-lang.org/appendix-08-system-calls.html#send_message_to_l1[`send_message_to_L1`^] syscall
252252
* link:https://github.com/starkware-libs/cairo-lang/blob/54d7e92a703b3b5a1e07e9389608178129946efc/src/starkware/starknet/solidity/IStarknetMessaging.sol#L13[`sendMessageToL2`] function on the Starknet Core Contract
253253
* For more information on how messaging works within the Starknet Core Contract, including details on coding, see link:https://book.cairo-lang.org/ch16-04-L1-L2-messaging.html[L1-L2 Messaging] in _The Cairo Book: The Cairo Programming Language_

components/Starknet/modules/architecture-and-concepts/pages/os.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ Contract calls are in fact done non-deterministically, i.e. the contract's respo
4343
[id="syscall-mechanism"]
4444
=== Syscall mechanism
4545

46-
A contract can invoke xref:smart-contracts/system-calls-cairo1.adoc[system calls] throughout its execution, which pass the control from the currently executing contract to SNOS itself. Such operations are required when a contract needs information that does not exist within its code, e.g. accessing the Starknet state to read a storage value or to call another contract.
46+
A contract can invoke https://book.cairo-lang.org/appendix-08-system-calls.html[system calls^] throughout its execution, which pass the control from the currently executing contract to SNOS itself. Such operations are required when a contract needs information that does not exist within its code, e.g. accessing the Starknet state to read a storage value or to call another contract.
4747

4848
SNOS's code heavily relies on non-determinism to handle system calls. Whenever a contract invokes some syscall, the request, alongside the guessed response, is recorded in a syscalls array.
4949
At the end of every entry point execution, we go over the syscalls array and verify that the responses were correct (for more details, see the https://github.com/starkware-libs/cairo-lang/blob/8e11b8cc65ae1d0959328b1b4a40b92df8b58595/src/starkware/starknet/core/os/execution/execute_entry_point.cairo#L286[`execute_entry_point` function in `execute_transactions.cairo`^]).
5050

51-
For syscalls such as xref:architecture-and-concepts:smart-contracts/system-calls-cairo1.adoc#get_execution_info[`get_execution_info`],
51+
For syscalls such as https://book.cairo-lang.org/appendix-08-system-calls.html#get_execution_info[`get_execution_info`^],
5252
which returns the block hash and number, correctness means consistency with the value given to SNOS as input. For contract calls, however, one needs to execute the called contract and verify that the actual response and the guessed response are identical. But how can we guess the responses to all the contract calls before executing them? For that, it is important to distinguish two different styles-of-execution that a Starknet block goes through:
5353

5454
* The first one is done by a sequencer, when constructing the block from incoming transactions

components/Starknet/modules/architecture-and-concepts/pages/smart-contracts/cairo-and-sierra.adoc

Lines changed: 0 additions & 82 deletions
This file was deleted.

components/Starknet/modules/architecture-and-concepts/pages/smart-contracts/cairo-builtins.adoc

Lines changed: 0 additions & 37 deletions
This file was deleted.

components/Starknet/modules/architecture-and-concepts/pages/smart-contracts/class-hash.adoc

Lines changed: 0 additions & 75 deletions
This file was deleted.

0 commit comments

Comments
 (0)