# Prepare phase

The `prepare` phase is used when access to the private `AuthAccount` object of **signing accounts** is required for your transaction.

Direct access to signing accounts is **only possible inside the `prepare` phase**.

For each signer of the transaction the signing account is passed as an argument to the `prepare` phase. For example, if the transaction has three signers, the prepare **must** have three parameters of type `AuthAccount`.

```
 prepare(signer1: AuthAccount) {
      // ...
 }
```

As a best practice, only use the `prepare` phase to define and execute logic that requires access to the `AuthAccount` objects of signing accounts, and *move all other logic elsewhere*. Modifications to accounts can have significant implications, so keep this phase clear of unrelated logic to ensure users of your contract are able to easily read and understand logic related to their private account objects.

The prepare phase serves a similar purpose as the initializer of a contract/resource/structure.

For example, if a transaction performs a token transfer, put the withdrawal in the `prepare` phase, as it requires access to the account storage, but perform the deposit in the `execute` phase.

`AuthAccount` objects have the permissions to read from and write to the `/storage/` and `/private/` areas of the account, which cannot be directly accessed anywhere else. They also have the permission to create and delete capabilities that use these areas.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://max-daunarovich.gitbook.io/flow-network/introduction/events/transactions/prepare-phase.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
