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

docs: Updated content on deploying a new account. #1163

Merged
merged 4 commits into from
Mar 14, 2024

Conversation

stoobie
Copy link
Collaborator

@stoobie stoobie commented Mar 6, 2024

Description of the Changes

This PR addresses #935.

PR Preview URL

Deploying new accounts

Also moved Universal Deployer Contract to a different place in the TOC:
image

Check List

  • Changes have been done against main branch, and PR does not conflict
  • PR title follows the convention: <docs/feat/fix/chore>(optional scope): <description>, e.g: fix: minor typos in code

This change is Reviewable

@stoobie stoobie requested a review from odednaor March 6, 2024 09:34
Copy link

github-actions bot commented Mar 6, 2024

Your preview build is ready! ✨ Check the following link in 1-2 minutes: https://starknet-io.github.io/starknet-docs/pr-1163/documentation/ .

@stoobie stoobie changed the title Updated content on deploying a new account. docs: Updated content on deploying a new account. Mar 6, 2024

== Deploy account transaction
* Send a `DEPLOY_ACCOUNT` transaction. This method does not require a preexisting account.
* Include the `deploy` syscall in the account contract, such as by invoking the Universal Deployer Contract (UDC) with an `INVOKE` transaction. This method requires an existing account to send the `INVOKE` transaction.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Include the `deploy` syscall in the account contract, such as by invoking the Universal Deployer Contract (UDC) with an `INVOKE` transaction. This method requires an existing account to send the `INVOKE` transaction.
* Using the Universal Deployer Contract (UDC). This method requires an existing account to send the `INVOKE` transaction.

Also suggest referencing the UDC documentation

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

* Decide on the account contract that you want to deploy
* Compute your would-be account address off-chain
* Send funds to this address
. Verifies that the address has funds to pay for the deployment.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If deployed using the DEPLOY_ACCOUNT tx, then the fees are paid from the deployed account address. If by using the UDC, then from the sender account.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

* Compute your would-be account address off-chain
* Send funds to this address
. Verifies that the address has funds to pay for the deployment.
. Executes the constructor with the given arguments.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other way around, first the validate deploy or validate, only then the constructor.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

. Verifies that the address has funds to pay for the deployment.
. Executes the constructor with the given arguments.
. Runs the respective validation function in the contract, as follows:
** When deploying with the `DEPLOY_ACCOUNT` transaction type, the sequencer executes the `+__validate_deploy__+` function in the contract.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
** When deploying with the `DEPLOY_ACCOUNT` transaction type, the sequencer executes the `+__validate_deploy__+` function in the contract.
** When deploying with the `DEPLOY_ACCOUNT` transaction type, the sequencer executes the `+__validate_deploy__+` function in the deployed contract.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

. Executes the constructor with the given arguments.
. Runs the respective validation function in the contract, as follows:
** When deploying with the `DEPLOY_ACCOUNT` transaction type, the sequencer executes the `+__validate_deploy__+` function in the contract.
** When deploying with the `INVOKE` transaction type and a contract that includes the `deploy` syscall, such as the UDC, the sequencer executes the `+__validate__+` function in the contract.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
** When deploying with the `INVOKE` transaction type and a contract that includes the `deploy` syscall, such as the UDC, the sequencer executes the `+__validate__+` function in the contract.
** When deploying using the UDC, the sequencer executes the `+__validate__+` function in the contract of the sender address.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

** When deploying with the `DEPLOY_ACCOUNT` transaction type, the sequencer executes the `+__validate_deploy__+` function in the contract.
** When deploying with the `INVOKE` transaction type and a contract that includes the `deploy` syscall, such as the UDC, the sequencer executes the `+__validate__+` function in the contract.
. Charges fees from the new account address.
. Sets the account's nonce to `1`.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is only true in case the account is deployed with the DEPLOY_ACCOUNT tx. If by the UDC, the nonce of the deployed account is 0.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.


Once the address has enough funds to pay for the deployment, you can then send a `deploy_account` transaction.
== Deploying a new account with Starkli
Copy link
Collaborator

@odednaor odednaor Mar 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest just having a link to the Starkli book instead of having this full section.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got rid of the Prerequisites and the Procedure heading.

Copy link
Collaborator

@odednaor odednaor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some comments.

* Decide on the account contract that you want to deploy
* Compute your would-be account address off-chain
* Send funds to this address
. Verifies that the address has funds to pay for the deployment.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
. Verifies that the address has funds to pay for the deployment.
. Verifies that the address has funds to pay for the deployment.
+
If you use a `DEPLOY_ACCOUNT` transaction, the fees are paid from the address of the deployed account. If you use the UDC, the fees are paid from the sender's account.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove it from the numbered list and add as a note. For DEPLOY_ACCOUNT tx, the fees are charged from the deployed address and from an INVOKE tx using the UDC, the fees are charged from the sender's account (and add a link to the transactions types page to invoke tx v1 and v3).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

Copy link

github-actions bot commented Mar 6, 2024

Your preview build is ready! ✨ Check the following link in 1-2 minutes: https://starknet-io.github.io/starknet-docs/pr-1163/documentation/ .

@stoobie stoobie requested a review from odednaor March 10, 2024 14:04
Copy link
Collaborator

@odednaor odednaor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see inline comments

Copy link

Your preview build is ready! ✨ Check the following link in 1-2 minutes: https://starknet-io.github.io/starknet-docs/pr-1163/documentation/ .

1 similar comment
Copy link

Your preview build is ready! ✨ Check the following link in 1-2 minutes: https://starknet-io.github.io/starknet-docs/pr-1163/documentation/ .

Copy link
Collaborator

@odednaor odednaor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@stoobie stoobie merged commit b19927b into main Mar 14, 2024
3 checks passed
@stoobie stoobie deleted the steve/deploy_new_account branch March 14, 2024 09:36
xiaolou86 pushed a commit to xiaolou86/starknet-docs that referenced this pull request Apr 7, 2024
* Updated content on deploying a new account.

* SME comments.

* SME comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants