You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/contracts-cairo/1.0.0/accounts.mdx
+13-13Lines changed: 13 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -80,12 +80,12 @@ interoperability with the ecosystem.
80
80
The Starknet protocol uses a few entrypoints for abstracting the accounts. We already mentioned the first two
81
81
as part of the ISRC6 interface, and both are required for enabling accounts to be used for executing transactions. The rest are optional:
82
82
83
-
1.`\\__validate__` verifies the validity of the transaction to be executed. This is usually used to validate signatures,
83
+
1.`__validate__` verifies the validity of the transaction to be executed. This is usually used to validate signatures,
84
84
but the entrypoint implementation can be customized to feature any validation mechanism [with some limitations](https://docs.starknet.io/architecture-and-concepts/accounts/account-functions/#limitations_of_validation).
85
-
2.`\\__execute__` executes the transaction if the validation is successful.
86
-
3.`\\__validate_declare__` optional entrypoint similar to `\\__validate__` but for transactions
85
+
2.`__execute__` executes the transaction if the validation is successful.
86
+
3.`__validate_declare__` optional entrypoint similar to `__validate__` but for transactions
87
87
meant to declare other contracts.
88
-
4.`\\__validate_deploy__` optional entrypoint similar to `\\__validate__` but meant for [counterfactual deployments](/guides/deployment).
88
+
4.`__validate_deploy__` optional entrypoint similar to `__validate__` but meant for [counterfactual deployments](/guides/deployment).
89
89
90
90
<Callout>
91
91
Although these entrypoints are available to the protocol for its regular transaction flow, they can also be called like any other method.
@@ -275,7 +275,7 @@ wraps and exposes the `deploy_syscall` to provide arbitrary deployments through
275
275
But if you don’t have an account to invoke it, you will probably want to use the latter.
276
276
277
277
To do counterfactual deployments, you need to implement another protocol-level entrypoint named
278
-
`\\__validate_deploy__`. Check the [counterfactual deployments](/guides/deployment) guide to learn how.
278
+
`__validate_deploy__`. Check the [counterfactual deployments](/guides/deployment) guide to learn how.
279
279
280
280
## Sending transactions
281
281
@@ -285,7 +285,7 @@ Let’s now explore how to send transactions through these accounts.
285
285
286
286
First, let’s take the example account we created before and deploy it:
287
287
288
-
```[,cairo]
288
+
```rust
289
289
#[starknet::contract(account)]
290
290
modMyAccount {
291
291
useopenzeppelin_account::AccountComponent;
@@ -333,7 +333,7 @@ The flag enables custom account variants.
333
333
The following examples use `sncast`[v0.23.0](https://github.com/foundry-rs/starknet-foundry/releases/tag/v0.23.0).
334
334
</Callout>
335
335
336
-
```[,bash]
336
+
```bash
337
337
$ sncast \
338
338
--url http://127.0.0.1:5050 \
339
339
account create \
@@ -344,7 +344,7 @@ $ sncast \
344
344
This command will output the precomputed contract address and the recommended `max-fee`.
345
345
To counterfactually deploy the account, send funds to the address and then deploy the custom account.
346
346
347
-
```[,bash]
347
+
```bash
348
348
$ sncast \
349
349
--url http://127.0.0.1:5050 \
350
350
account deploy \
@@ -353,7 +353,7 @@ $ sncast \
353
353
354
354
Once the account is deployed, set the `--account` flag with the custom account name to send transactions from that account.
355
355
356
-
```[,bash]
356
+
```bash
357
357
$ sncast \
358
358
--account my-custom-account \
359
359
--url http://127.0.0.1:5050 \
@@ -367,7 +367,7 @@ $ sncast \
367
367
368
368
First, let’s take the example account we created before and deploy it:
369
369
370
-
```[,cairo]
370
+
```rust
371
371
#[starknet::contract(account)]
372
372
modMyEthAccount {
373
373
useopenzeppelin_account::EthAccountComponent;
@@ -417,7 +417,7 @@ Next, precompute the EthAccount contract address using the declared class hash.
417
417
The following examples use unreleased features from StarknetJS (`starknetjs@next`) at commit [d002baea0abc1de3ac6e87a671f3dec3757437b3](https://github.com/starknet-io/starknet.js/commit/d002baea0abc1de3ac6e87a671f3dec3757437b3).
Copy file name to clipboardExpand all lines: content/contracts-cairo/1.0.0/erc1155.mdx
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -79,7 +79,7 @@ mod MyERC1155 {
79
79
The following interface represents the full ABI of the Contracts for Cairo [ERC1155Component](/api/erc1155#ERC1155Component).
80
80
The interface includes the [IERC1155](/api/erc1155#IERC1155) standard interface and the optional [IERC1155MetadataURI](/api/erc1155#IERC1155MetadataURI) interface together with [ISRC5](/api/introspection#ISRC5).
81
81
82
-
To support older token deployments, as mentioned in [Dual interfaces](interfaces#dual_interfaces), the component also includes implementations of the interface written in camelCase.
82
+
To support older token deployments, as mentioned in [Dual interfaces](guides/interfaces-and-dispatchers#dual-interfaces), the component also includes implementations of the interface written in camelCase.
83
83
84
84
```cairo
85
85
#[starknet::interface]
@@ -156,7 +156,7 @@ In the spirit of the standard, we’ve also included batch operations in the non
156
156
<Callouttype='warn'>
157
157
While [safe_transfer_from](/api/erc1155#IERC1155-safe_transfer_from) and [safe_batch_transfer_from](/api/erc1155#IERC1155-safe_batch_transfer_from) prevent loss by checking the receiver can handle the
158
158
</Callout>
159
-
tokens, this yields execution to the receiver which can result in a [reentrant call](security#reentrancy_guard).
159
+
tokens, this yields execution to the receiver which can result in a [reentrant call](security#reentrancy-guard).
160
160
161
161
## Receiving tokens
162
162
@@ -190,7 +190,7 @@ When [safe_transfer_from](/api/erc1155#IERC1155-safe_transfer_from) and [safe_ba
190
190
Otherwise, the transaction will fail.
191
191
192
192
<Callout>
193
-
For information on how to calculate interface IDs, see [Computing the interface ID](introspection#computing_the_interface_id).
193
+
For information on how to calculate interface IDs, see [Computing the interface ID](introspection#computing-the-interface-id).
Copy file name to clipboardExpand all lines: content/contracts-cairo/1.0.0/erc20.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -71,7 +71,7 @@ For a more complete guide on ERC20 token mechanisms, see [Creating ERC20 Supply]
71
71
The following interface represents the full ABI of the Contracts for Cairo [ERC20Component](/api/erc20#ERC20Component).
72
72
The interface includes the [IERC20](/api/erc20#IERC20) standard interface as well as the optional [IERC20Metadata](/api/erc20#IERC20Metadata).
73
73
74
-
To support older token deployments, as mentioned in [Dual interfaces](/interfaces#dual_interfaces), the component also includes an implementation of the interface written in camelCase.
74
+
To support older token deployments, as mentioned in [Dual interfaces](/guides/interfaces-and-dispatchers#dual-interfaces), the component also includes an implementation of the interface written in camelCase.
75
75
76
76
```cairo
77
77
#[starknet::interface]
@@ -106,7 +106,7 @@ Although Starknet is not EVM compatible, this component aims to be as close as p
106
106
Some notable differences, however, can still be found, such as:
107
107
108
108
* The `ByteArray` type is used to represent strings in Cairo.
109
-
* The component offers a [dual interface](/interfaces#dual_interfaces) which supports both snake_case and camelCase methods, as opposed to just camelCase in Solidity.
109
+
* The component offers a [dual interface](/guides/interfaces-and-dispatchers#dual-interfaces) which supports both snake_case and camelCase methods, as opposed to just camelCase in Solidity.
110
110
*`transfer`, `transfer_from` and `approve` will never return anything different from `true` because they will revert on any error.
111
111
* Function selectors are calculated differently between [Cairo](https://github.com/starkware-libs/cairo/blob/7dd34f6c57b7baf5cd5a30c15e00af39cb26f7e1/crates/cairo-lang-starknet/src/contract.rs#L39-L48) and [Solidity](https://solidity-by-example.org/function-selector/).
Copy file name to clipboardExpand all lines: content/contracts-cairo/1.0.0/erc721.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -64,7 +64,7 @@ mod MyNFT {
64
64
The following interface represents the full ABI of the Contracts for Cairo [ERC721Component](/api/erc721#ERC721Component).
65
65
The interface includes the [IERC721](/api/erc721#IERC721) standard interface and the optional [IERC721Metadata](/api/erc721#IERC721Metadata) interface.
66
66
67
-
To support older token deployments, as mentioned in [Dual interfaces](interfaces#dual_interfaces), the component also includes implementations of the interface written in camelCase.
67
+
To support older token deployments, as mentioned in [Dual interfaces](guides/interfaces-and-dispatchers#dual-interfaces), the component also includes implementations of the interface written in camelCase.
68
68
69
69
```cairo
70
70
#[starknet::interface]
@@ -158,7 +158,7 @@ When safe methods such as [safe_transfer_from](api/erc721#IERC721-safe_transfer_
158
158
Otherwise, the transaction will fail.
159
159
160
160
<Callout>
161
-
For information on how to calculate interface IDs, see [Computing the interface ID](introspection#computing_the_interface_id).
161
+
For information on how to calculate interface IDs, see [Computing the interface ID](introspection#computing-the-interface-id).
Copy file name to clipboardExpand all lines: content/contracts-cairo/2.0.0/accounts.mdx
+13-13Lines changed: 13 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -80,12 +80,12 @@ interoperability with the ecosystem.
80
80
The Starknet protocol uses a few entrypoints for abstracting the accounts. We already mentioned the first two
81
81
as part of the ISRC6 interface, and both are required for enabling accounts to be used for executing transactions. The rest are optional:
82
82
83
-
1.`\\__validate__` verifies the validity of the transaction to be executed. This is usually used to validate signatures,
83
+
1.`__validate__` verifies the validity of the transaction to be executed. This is usually used to validate signatures,
84
84
but the entrypoint implementation can be customized to feature any validation mechanism [with some limitations](https://docs.starknet.io/architecture-and-concepts/accounts/account-functions/#limitations_of_validation).
85
-
2.`\\__execute__` executes the transaction if the validation is successful.
86
-
3.`\\__validate_declare__` optional entrypoint similar to `\\__validate__` but for transactions
85
+
2.`__execute__` executes the transaction if the validation is successful.
86
+
3.`__validate_declare__` optional entrypoint similar to `__validate__` but for transactions
87
87
meant to declare other contracts.
88
-
4.`\\__validate_deploy__` optional entrypoint similar to `\\__validate__` but meant for [counterfactual deployments](/guides/deployment).
88
+
4.`__validate_deploy__` optional entrypoint similar to `__validate__` but meant for [counterfactual deployments](/guides/deployment).
89
89
90
90
<Callout>
91
91
Although these entrypoints are available to the protocol for its regular transaction flow, they can also be called like any other method.
@@ -275,7 +275,7 @@ wraps and exposes the `deploy_syscall` to provide arbitrary deployments through
275
275
But if you don’t have an account to invoke it, you will probably want to use the latter.
276
276
277
277
To do counterfactual deployments, you need to implement another protocol-level entrypoint named
278
-
`\\__validate_deploy__`. Check the [counterfactual deployments](/guides/deployment) guide to learn how.
278
+
`__validate_deploy__`. Check the [counterfactual deployments](/guides/deployment) guide to learn how.
279
279
280
280
## Sending transactions
281
281
@@ -285,7 +285,7 @@ Let’s now explore how to send transactions through these accounts.
285
285
286
286
First, let’s take the example account we created before and deploy it:
287
287
288
-
```[,cairo]
288
+
```rust
289
289
#[starknet::contract(account)]
290
290
modMyAccount {
291
291
useopenzeppelin_account::AccountComponent;
@@ -333,7 +333,7 @@ The flag enables custom account variants.
333
333
The following examples use `sncast`[v0.23.0](https://github.com/foundry-rs/starknet-foundry/releases/tag/v0.23.0).
334
334
</Callout>
335
335
336
-
```[,bash]
336
+
```bash
337
337
$ sncast \
338
338
--url http://127.0.0.1:5050 \
339
339
account create \
@@ -344,7 +344,7 @@ $ sncast \
344
344
This command will output the precomputed contract address and the recommended `max-fee`.
345
345
To counterfactually deploy the account, send funds to the address and then deploy the custom account.
346
346
347
-
```[,bash]
347
+
```bash
348
348
$ sncast \
349
349
--url http://127.0.0.1:5050 \
350
350
account deploy \
@@ -353,7 +353,7 @@ $ sncast \
353
353
354
354
Once the account is deployed, set the `--account` flag with the custom account name to send transactions from that account.
355
355
356
-
```[,bash]
356
+
```bash
357
357
$ sncast \
358
358
--account my-custom-account \
359
359
--url http://127.0.0.1:5050 \
@@ -367,7 +367,7 @@ $ sncast \
367
367
368
368
First, let’s take the example account we created before and deploy it:
369
369
370
-
```[,cairo]
370
+
```rust
371
371
#[starknet::contract(account)]
372
372
modMyEthAccount {
373
373
useopenzeppelin_account::EthAccountComponent;
@@ -417,7 +417,7 @@ Next, precompute the EthAccount contract address using the declared class hash.
417
417
The following examples use unreleased features from StarknetJS (`starknetjs@next`) at commit [d002baea0abc1de3ac6e87a671f3dec3757437b3](https://github.com/starknet-io/starknet.js/commit/d002baea0abc1de3ac6e87a671f3dec3757437b3).
0 commit comments