Skip to content

Commit

Permalink
Removed details about functions from approach.adoc. These details app…
Browse files Browse the repository at this point in the history
…ear in account_functions.adoc.
  • Loading branch information
stoobie committed Mar 3, 2024
1 parent 8b7dbbb commit c7c492c
Showing 1 changed file with 2 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,7 @@ While not mandatory at the protocol level, you can use a richer standard interfa
[#account_functions]
== Account functions

The following functions are part of account contracts. The logic of these functions can be mostly arbitrary. For more information, see

[#starknet_account_interface_functions]
.Starknet account interface functions
[cols="1,2"]
|===
| Function name | Description

| `+__validate__+` | (Required) Initiates the validation stage in the sequencer. Runs when the sequencer receives an `INVOKE` transaction. Validates the sender's address.

In most implementations, `+__validate__+` ensures that only the account owner can initiate transactions.
| `+__execute__+` | (Required) Runs when the sequencer receives an `INVOKE` transaction.

In most implementations, `+__execute__+` initiates a sequence of calls from the account.
| `+__validate_declare__+` | (Optional) Runs when the sequencer receives an `DECLARE` transaction. Validates the sender's address.

If the contract declares other contracts and handles the corresponding gas fees, this function authenticates the contract declaration.
| `+__validate_deploy__+`
| (Optional) Runs when the sequencer receives a `DEPLOY` transaction. Validate the deployment of the class referred to by the `class_hash` parameter in the transaction.

You can use this function to set up an account contract without linking it to the address that deploys it or depending on another account contract for gas fees.
|===
A valid account contract includes specific functions, depending on the type of the contract. For more information, see xref:architecture_and_concepts:Accounts/account_functions.adoc[].

[#replay_protection]
== Replay protection
Expand All @@ -38,7 +17,7 @@ In Starknet, similar to Ethereum, every contract has a nonce, including an accou

[NOTE]
====
In Starknet, only the nonce of account contracts, that is, those adhering to the above structure, can be non-zero.
In Starknet, only the nonce of account contracts, that is, those adhering to the above structure, can be non-zero.
In contrast, in Ethereum, regular smart contracts, known as _Contract Accounts_, as opposed to _Externally Owned Accounts_ can increment their nonce by deploying smart contracts, that is, executing the `CREATE` and `CREATE2` opcodes.
Expand Down

0 comments on commit c7c492c

Please sign in to comment.